From b8388a7c948e463043c1f52d0fbe656f9ccedb43 Mon Sep 17 00:00:00 2001 From: Hixie Date: Mon, 26 Oct 2015 14:51:05 -0700 Subject: [PATCH] Use the presence of handler to determine 'enabled' Instread of an explicit 'enabled' bool, this uses the presence of the event handler to determine if a widget is enabled or not. This means that if you've not passed a handler, your widget will be disabled, which makes sense, since it wouldn't work anyway. Adds this feature to checkbox, and ports raised button, flat button, and radio buttons to this new model. Adds a checkbox to card_collection that can be disabled. Hide a (basically bogus) hint from the (soon to be disabled) strong hint mode in the analyzer that this reveals. --- engine/src/flutter/sky/tools/skyanalyzer | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/src/flutter/sky/tools/skyanalyzer b/engine/src/flutter/sky/tools/skyanalyzer index 62ef48adf2..57048edcd3 100755 --- a/engine/src/flutter/sky/tools/skyanalyzer +++ b/engine/src/flutter/sky/tools/skyanalyzer @@ -41,8 +41,9 @@ _IGNORED_PATTERNS = [ re.compile(r'^\[hint\] Runtime check on non-ground type .+ may throw StrongModeError'), # https://github.com/dart-lang/sdk/issues/24565 re.compile(r'^\[hint] \([_, ]+\) .+ has inferred type '), # ignore underscore-only arguments - # Bogus hint - re.compile(r'^\[hint\] \(toText == toPlainText\) \? toStyledText : toPlainText has inferred type \(String, String\) → Widget \(.+styled_text.dart,.+\)'), # https://github.com/dart-lang/sdk/issues/24710 + # Bogus hint - https://github.com/dart-lang/sdk/issues/24710 + re.compile(r'^\[hint\] \(toText == toPlainText\) \? toStyledText : toPlainText has inferred type \(String, String\) → Widget \(.+styled_text.dart,.+\)'), + re.compile(r'^\[hint\] .+ \? \([_, ]+\) {.+} : null has inferred type .+'), # # Disable the lint checks that will be caught by code review re.compile(r'^\[lint\] Avoid defining a one-member abstract class when a simple function will do'),