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.
This commit is contained in:
Hixie
2015-10-26 14:51:05 -07:00
parent 8e10a20bda
commit b8388a7c94

View File

@@ -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'),