Commit efb45ea7 authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

Trivial nit fixes (#12285)

parent 4389f070
...@@ -23,7 +23,7 @@ DeviceOperatingSystem deviceOperatingSystem = DeviceOperatingSystem.android; ...@@ -23,7 +23,7 @@ DeviceOperatingSystem deviceOperatingSystem = DeviceOperatingSystem.android;
/// Discovers available devices and chooses one to work with. /// Discovers available devices and chooses one to work with.
abstract class DeviceDiscovery { abstract class DeviceDiscovery {
factory DeviceDiscovery() { factory DeviceDiscovery() {
switch(deviceOperatingSystem) { switch (deviceOperatingSystem) {
case DeviceOperatingSystem.android: case DeviceOperatingSystem.android:
return new AndroidDeviceDiscovery(); return new AndroidDeviceDiscovery();
case DeviceOperatingSystem.ios: case DeviceOperatingSystem.ios:
......
...@@ -101,7 +101,7 @@ Future<Null> saveScreenshots(List<String> fromPaths, List<String> largeNames, Li ...@@ -101,7 +101,7 @@ Future<Null> saveScreenshots(List<String> fromPaths, List<String> largeNames, Li
for (int index = 0; index < uploads.length; index += 1) for (int index = 0; index < uploads.length; index += 1)
uploads[index] = new Upload(fromPaths[index], largeNames[index], smallNames[index]); uploads[index] = new Upload(fromPaths[index], largeNames[index], smallNames[index]);
while(uploads.any(Upload.isNotComplete)) { while (uploads.any(Upload.isNotComplete)) {
final HttpClient client = new HttpClient(); final HttpClient client = new HttpClient();
uploads = uploads.where(Upload.isNotComplete).toList(); uploads = uploads.where(Upload.isNotComplete).toList();
await Future.wait(uploads.map((Upload upload) => upload.run(client))); await Future.wait(uploads.map((Upload upload) => upload.run(client)));
......
...@@ -265,7 +265,7 @@ class CardCollectionState extends State<CardCollection> { ...@@ -265,7 +265,7 @@ class CardCollectionState extends State<CardCollection> {
); );
String backgroundMessage; String backgroundMessage;
switch(_dismissDirection) { switch (_dismissDirection) {
case DismissDirection.horizontal: case DismissDirection.horizontal:
backgroundMessage = "Swipe in either direction"; backgroundMessage = "Swipe in either direction";
break; break;
......
...@@ -199,7 +199,7 @@ class GridDemoPhotoItem extends StatelessWidget { ...@@ -199,7 +199,7 @@ class GridDemoPhotoItem extends StatelessWidget {
final IconData icon = photo.isFavorite ? Icons.star : Icons.star_border; final IconData icon = photo.isFavorite ? Icons.star : Icons.star_border;
switch(tileStyle) { switch (tileStyle) {
case GridDemoTileStyle.imageOnly: case GridDemoTileStyle.imageOnly:
return image; return image;
......
...@@ -60,7 +60,7 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> { ...@@ -60,7 +60,7 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
} }
void handleDemoAction(LeaveBehindDemoAction action) { void handleDemoAction(LeaveBehindDemoAction action) {
switch(action) { switch (action) {
case LeaveBehindDemoAction.reset: case LeaveBehindDemoAction.reset:
initListItems(); initListItems();
break; break;
......
...@@ -83,7 +83,7 @@ class ScrollableTabsDemoState extends State<ScrollableTabsDemo> with SingleTicke ...@@ -83,7 +83,7 @@ class ScrollableTabsDemoState extends State<ScrollableTabsDemo> with SingleTicke
controller: _controller, controller: _controller,
isScrollable: true, isScrollable: true,
tabs: _allPages.map((_Page page) { tabs: _allPages.map((_Page page) {
switch(_demoStyle) { switch (_demoStyle) {
case TabsDemoStyle.iconsAndText: case TabsDemoStyle.iconsAndText:
return new Tab(text: page.text, icon: new Icon(page.icon)); return new Tab(text: page.text, icon: new Icon(page.icon));
case TabsDemoStyle.iconsOnly: case TabsDemoStyle.iconsOnly:
......
...@@ -116,7 +116,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter { ...@@ -116,7 +116,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
bool _generateSpans() { bool _generateSpans() {
int lastLoopPosition = _scanner.position; int lastLoopPosition = _scanner.position;
while(!_scanner.isDone) { while (!_scanner.isDone) {
// Skip White space // Skip White space
_scanner.scan(new RegExp(r"\s+")); _scanner.scan(new RegExp(r"\s+"));
...@@ -294,7 +294,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter { ...@@ -294,7 +294,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
} }
void _simplify() { void _simplify() {
for(int i = _spans.length - 2; i >= 0; i -= 1) { for (int i = _spans.length - 2; i >= 0; i -= 1) {
if (_spans[i].type == _spans[i + 1].type && _spans[i].end == _spans[i + 1].start) { if (_spans[i].type == _spans[i + 1].type && _spans[i].end == _spans[i + 1].start) {
_spans[i] = new _HighlightSpan( _spans[i] = new _HighlightSpan(
_spans[i].type, _spans[i].type,
......
...@@ -121,7 +121,7 @@ Future<Null> saveDurationsHistogram(List<Map<String, dynamic>> events, String ou ...@@ -121,7 +121,7 @@ Future<Null> saveDurationsHistogram(List<Map<String, dynamic>> events, String ou
final Iterator<Map<String, dynamic>> eventIter = events.iterator; final Iterator<Map<String, dynamic>> eventIter = events.iterator;
String lastEventName = ''; String lastEventName = '';
String lastRouteName = ''; String lastRouteName = '';
while(eventIter.moveNext()) { while (eventIter.moveNext()) {
final String eventName = eventIter.current['name']; final String eventName = eventIter.current['name'];
if (!<String>['Start Transition', 'Frame'].contains(eventName)) if (!<String>['Start Transition', 'Frame'].contains(eventName))
......
...@@ -282,7 +282,7 @@ class IsolateExampleState extends State<StatefulWidget> with SingleTickerProvide ...@@ -282,7 +282,7 @@ class IsolateExampleState extends State<StatefulWidget> with SingleTickerProvide
} }
String _getStatus(CalculationState state) { String _getStatus(CalculationState state) {
switch(state) { switch (state) {
case CalculationState.loading: case CalculationState.loading:
return 'Loading...'; return 'Loading...';
case CalculationState.calculating: case CalculationState.calculating:
......
...@@ -27,7 +27,7 @@ void main() { ...@@ -27,7 +27,7 @@ void main() {
await driver.tap(button); await driver.tap(button);
String batteryLevel; String batteryLevel;
while(batteryLevel == null || batteryLevel.isEmpty) { while (batteryLevel == null || batteryLevel.isEmpty) {
batteryLevel = await driver.getText(batteryLevelLabel); batteryLevel = await driver.getText(batteryLevelLabel);
} }
expect(batteryLevel, isNotEmpty); expect(batteryLevel, isNotEmpty);
......
...@@ -86,7 +86,7 @@ class StockHomeState extends State<StockHome> { ...@@ -86,7 +86,7 @@ class StockHomeState extends State<StockHome> {
} }
void _handleStockMenu(BuildContext context, _StockMenuItem value) { void _handleStockMenu(BuildContext context, _StockMenuItem value) {
switch(value) { switch (value) {
case _StockMenuItem.autorefresh: case _StockMenuItem.autorefresh:
setState(() { setState(() {
_autorefresh = !_autorefresh; _autorefresh = !_autorefresh;
......
...@@ -1386,7 +1386,7 @@ class IterableProperty<T> extends DiagnosticsProperty<Iterable<T>> { ...@@ -1386,7 +1386,7 @@ class IterableProperty<T> extends DiagnosticsProperty<Iterable<T>> {
/// Create a diagnostics property for iterables (e.g. lists). /// Create a diagnostics property for iterables (e.g. lists).
/// ///
/// The [ifEmpty] argument is used to indicate how an iterable [value] with 0 /// The [ifEmpty] argument is used to indicate how an iterable [value] with 0
/// elements is displayed. If [ifEmpty] equals `null` that indicates that an /// elements is displayed. If [ifEmpty] equals null that indicates that an
/// empty iterable [value] is not interesting to display similar to how /// empty iterable [value] is not interesting to display similar to how
/// [defaultValue] is used to indicate that a specific concrete value is not /// [defaultValue] is used to indicate that a specific concrete value is not
/// interesting to display. /// interesting to display.
...@@ -1433,10 +1433,10 @@ class IterableProperty<T> extends DiagnosticsProperty<Iterable<T>> { ...@@ -1433,10 +1433,10 @@ class IterableProperty<T> extends DiagnosticsProperty<Iterable<T>> {
/// Priority level of the diagnostic used to control which diagnostics should /// Priority level of the diagnostic used to control which diagnostics should
/// be shown and filtered. /// be shown and filtered.
/// ///
/// If [ifEmpty] is `null` and the [value] is an empty [Iterable] then level /// If [ifEmpty] is null and the [value] is an empty [Iterable] then level
/// [DiagnosticLevel.fine] is returned in a similar way to how an /// [DiagnosticLevel.fine] is returned in a similar way to how an
/// [ObjectFlagProperty] handles when [ifNull] is `null` and the [value] is /// [ObjectFlagProperty] handles when [ifNull] is null and the [value] is
/// `null`. /// null.
@override @override
DiagnosticLevel get level { DiagnosticLevel get level {
if (ifEmpty == null && value != null && value.isEmpty && super.level != DiagnosticLevel.hidden) if (ifEmpty == null && value != null && value.isEmpty && super.level != DiagnosticLevel.hidden)
...@@ -1605,8 +1605,8 @@ class DiagnosticsProperty<T> extends DiagnosticsNode { ...@@ -1605,8 +1605,8 @@ class DiagnosticsProperty<T> extends DiagnosticsNode {
/// ///
/// The [level] argument is just a suggestion and can be overridden if /// The [level] argument is just a suggestion and can be overridden if
/// something else about the property causes it to have a lower or higher /// something else about the property causes it to have a lower or higher
/// level. For example, if the property value is `null` and [missingIfNull] is /// level. For example, if the property value is null and [missingIfNull] is
/// `true`, [level] is raised to [DiagnosticLevel.warning]. /// true, [level] is raised to [DiagnosticLevel.warning].
DiagnosticsProperty( DiagnosticsProperty(
String name, String name,
T value, { T value, {
...@@ -2056,7 +2056,7 @@ abstract class Diagnosticable { ...@@ -2056,7 +2056,7 @@ abstract class Diagnosticable {
/// Returns a debug representation of the object that is used by debugging /// Returns a debug representation of the object that is used by debugging
/// tools and by [toStringDeep]. /// tools and by [toStringDeep].
/// ///
/// Leave [name] as `null` if there is not a meaningful description of the /// Leave [name] as null if there is not a meaningful description of the
/// relationship between the this node and its parent. /// relationship between the this node and its parent.
/// ///
/// Typically the [style] argument is only specified to indicate an atypical /// Typically the [style] argument is only specified to indicate an atypical
......
...@@ -254,7 +254,7 @@ class ScaleGestureRecognizer extends OneSequenceGestureRecognizer { ...@@ -254,7 +254,7 @@ class ScaleGestureRecognizer extends OneSequenceGestureRecognizer {
@override @override
void didStopTrackingLastPointer(int pointer) { void didStopTrackingLastPointer(int pointer) {
switch(_state) { switch (_state) {
case _ScaleState.possible: case _ScaleState.possible:
resolve(GestureDisposition.rejected); resolve(GestureDisposition.rejected);
break; break;
......
...@@ -87,7 +87,7 @@ class _DatePickerHeader extends StatelessWidget { ...@@ -87,7 +87,7 @@ class _DatePickerHeader extends StatelessWidget {
final TextTheme headerTextTheme = themeData.primaryTextTheme; final TextTheme headerTextTheme = themeData.primaryTextTheme;
Color dayColor; Color dayColor;
Color yearColor; Color yearColor;
switch(themeData.primaryColorBrightness) { switch (themeData.primaryColorBrightness) {
case Brightness.light: case Brightness.light:
dayColor = mode == DatePickerMode.day ? Colors.black87 : Colors.black54; dayColor = mode == DatePickerMode.day ? Colors.black87 : Colors.black54;
yearColor = mode == DatePickerMode.year ? Colors.black87 : Colors.black54; yearColor = mode == DatePickerMode.year ? Colors.black87 : Colors.black54;
......
...@@ -54,7 +54,7 @@ class ExpansionTile extends StatefulWidget { ...@@ -54,7 +54,7 @@ class ExpansionTile extends StatefulWidget {
/// Called when the tile expands or collapses. /// Called when the tile expands or collapses.
/// ///
/// When the tile starts expanding, this function is called with the value /// When the tile starts expanding, this function is called with the value
/// `true`. When the tile starts collapsing, this function is called with /// true. When the tile starts collapsing, this function is called with
/// the value false. /// the value false.
final ValueChanged<bool> onExpansionChanged; final ValueChanged<bool> onExpansionChanged;
......
...@@ -71,7 +71,7 @@ import 'theme.dart'; ...@@ -71,7 +71,7 @@ import 'theme.dart';
/// ```dart /// ```dart
/// assert(debugCheckHasMaterial(context)); /// assert(debugCheckHasMaterial(context));
/// ``` /// ```
/// The parameter [enableFeedback] must not be `null`. /// The parameter [enableFeedback] must not be null.
/// ///
/// See also: /// See also:
/// ///
......
...@@ -102,7 +102,7 @@ abstract class MaterialLocalizations { ...@@ -102,7 +102,7 @@ abstract class MaterialLocalizations {
/// This text theme is incomplete. For example, it lacks text color /// This text theme is incomplete. For example, it lacks text color
/// information. This theme must be merged with another text theme that /// information. This theme must be merged with another text theme that
/// provides the missing values. The text styles provided by this theme have /// provides the missing values. The text styles provided by this theme have
/// their [TextStyle.inherit] property set to `true`. /// their [TextStyle.inherit] property set to true.
/// ///
/// Typically a complete theme is obtained via [Theme.of], which can be /// Typically a complete theme is obtained via [Theme.of], which can be
/// localized using the [Localizations] widget. /// localized using the [Localizations] widget.
......
...@@ -303,7 +303,7 @@ class _IndicatorPainter extends CustomPainter { ...@@ -303,7 +303,7 @@ class _IndicatorPainter extends CustomPainter {
static bool _tabOffsetsNotEqual(List<double> a, List<double> b) { static bool _tabOffsetsNotEqual(List<double> a, List<double> b) {
assert(a != null && b != null && a.length == b.length); assert(a != null && b != null && a.length == b.length);
for(int i = 0; i < a.length; i++) { for (int i = 0; i < a.length; i += 1) {
if (a[i] != b[i]) if (a[i] != b[i])
return true; return true;
} }
......
...@@ -457,7 +457,7 @@ class ThemeData { ...@@ -457,7 +457,7 @@ class ThemeData {
/// provided by the [localTextGeometry]. /// provided by the [localTextGeometry].
/// ///
/// The [TextStyle.inherit] field in the text styles provided by /// The [TextStyle.inherit] field in the text styles provided by
/// [localTextGeometry] must be set to `true`. /// [localTextGeometry] must be set to true.
static ThemeData localize(ThemeData baseTheme, TextTheme localTextGeometry) { static ThemeData localize(ThemeData baseTheme, TextTheme localTextGeometry) {
assert(baseTheme != null); assert(baseTheme != null);
assert(localTextGeometry != null); assert(localTextGeometry != null);
......
...@@ -287,7 +287,7 @@ class _MinuteControl extends StatelessWidget { ...@@ -287,7 +287,7 @@ class _MinuteControl extends StatelessWidget {
/// Provides time picker header layout configuration for the given /// Provides time picker header layout configuration for the given
/// [timeOfDayFormat] passing [context] to each widget in the configuration. /// [timeOfDayFormat] passing [context] to each widget in the configuration.
/// ///
/// [timeOfDayFormat] and [context] must not be `null`. /// The [timeOfDayFormat] and [context] arguments must not be null.
_TimePickerHeaderFormat _buildHeaderFormat(TimeOfDayFormat timeOfDayFormat, _TimePickerFragmentContext context) { _TimePickerHeaderFormat _buildHeaderFormat(TimeOfDayFormat timeOfDayFormat, _TimePickerFragmentContext context) {
// Creates an hour fragment. // Creates an hour fragment.
_TimePickerHeaderFragment hour(HourFormat hourFormat) { _TimePickerHeaderFragment hour(HourFormat hourFormat) {
......
...@@ -130,7 +130,7 @@ class TwoLevelSublist extends StatefulWidget { ...@@ -130,7 +130,7 @@ class TwoLevelSublist extends StatefulWidget {
/// Called when the sublist expands or collapses. /// Called when the sublist expands or collapses.
/// ///
/// When the sublist starts expanding, this function is called with the value /// When the sublist starts expanding, this function is called with the value
/// `true`. When the sublist starts collapsing, this function is called with /// true. When the sublist starts collapsing, this function is called with
/// the value false. /// the value false.
final ValueChanged<bool> onOpenChanged; final ValueChanged<bool> onOpenChanged;
......
...@@ -778,7 +778,7 @@ class _RootSemanticsFragment extends _InterestingSemanticsFragment { ...@@ -778,7 +778,7 @@ class _RootSemanticsFragment extends _InterestingSemanticsFragment {
} }
} }
/// Represents a RenderObject that has [isSemanticBoundary] set to `true`. /// Represents a RenderObject that has [isSemanticBoundary] set to true.
/// ///
/// It returns the SemanticsNode for that [RenderObject]. /// It returns the SemanticsNode for that [RenderObject].
class _ConcreteSemanticsFragment extends _InterestingSemanticsFragment { class _ConcreteSemanticsFragment extends _InterestingSemanticsFragment {
...@@ -818,7 +818,7 @@ class _ConcreteSemanticsFragment extends _InterestingSemanticsFragment { ...@@ -818,7 +818,7 @@ class _ConcreteSemanticsFragment extends _InterestingSemanticsFragment {
} }
/// Represents a RenderObject that does not have [isSemanticBoundary] set to /// Represents a RenderObject that does not have [isSemanticBoundary] set to
/// `true`, but which does have some semantic annotators. /// true, but which does have some semantic annotators.
/// ///
/// When it is compiled, if the nearest ancestor [_SemanticsFragment] that isn't /// When it is compiled, if the nearest ancestor [_SemanticsFragment] that isn't
/// also an [_ImplicitSemanticsFragment] is a [_RootSemanticsFragment] or a /// also an [_ImplicitSemanticsFragment] is a [_RootSemanticsFragment] or a
...@@ -2500,7 +2500,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -2500,7 +2500,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
/// Whether this [RenderObject] makes other [RenderObject]s previously painted /// Whether this [RenderObject] makes other [RenderObject]s previously painted
/// within the same semantic boundary unreachable for accessibility purposes. /// within the same semantic boundary unreachable for accessibility purposes.
/// ///
/// If `true` is returned, the [SemanticsNode]s for all siblings and cousins /// If true is returned, the [SemanticsNode]s for all siblings and cousins
/// of this node, that are earlier in a depth-first pre-order traversal, are /// of this node, that are earlier in a depth-first pre-order traversal, are
/// dropped from the semantics tree up until a semantic boundary (as defined /// dropped from the semantics tree up until a semantic boundary (as defined
/// by [isSemanticBoundary]) is reached. /// by [isSemanticBoundary]) is reached.
...@@ -2562,9 +2562,9 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -2562,9 +2562,9 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
/// ///
/// The parameters [onlyLocalUpdates] and [noGeometry] tell the framework /// The parameters [onlyLocalUpdates] and [noGeometry] tell the framework
/// how much of the semantics have changed. Bigger changes (indicated by /// how much of the semantics have changed. Bigger changes (indicated by
/// setting one or both parameters to `false`) are more expansive to compute. /// setting one or both parameters to false) are more expansive to compute.
/// ///
/// [onlyLocalUpdates] should be set to `true` to reduce cost if the semantics /// [onlyLocalUpdates] should be set to true to reduce cost if the semantics
/// update does not in any way change the shape of the semantics tree (e.g. /// update does not in any way change the shape of the semantics tree (e.g.
/// [SemanticsNode]s will neither be added/removed from the tree nor be moved /// [SemanticsNode]s will neither be added/removed from the tree nor be moved
/// within the tree). In other words, with [onlyLocalChanges] the /// within the tree). In other words, with [onlyLocalChanges] the
...@@ -2572,14 +2572,14 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -2572,14 +2572,14 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
/// local [SemanticsNode] (e.g. changing a label or flag) without affecting /// local [SemanticsNode] (e.g. changing a label or flag) without affecting
/// other nodes in the tree. /// other nodes in the tree.
/// ///
/// [onlyLocalUpdates] has to be set to `false` in the following cases as they /// [onlyLocalUpdates] has to be set to false in the following cases as they
/// will change the shape of the tree: /// will change the shape of the tree:
/// ///
/// 1. [isSemanticBoundary] changed its value. /// 1. [isSemanticBoundary] changed its value.
/// 2. [semanticsAnnotator] changed from or to returning `null` and /// 2. [semanticsAnnotator] changed from or to returning null and
/// [isSemanticBoundary] isn't `true`. /// [isSemanticBoundary] isn't true.
/// ///
/// [noGeometry] should be set to `true` to reduce cost if the geometry (e.g. /// [noGeometry] should be set to true to reduce cost if the geometry (e.g.
/// size and position) of the corresponding [SemanticsNode] has not /// size and position) of the corresponding [SemanticsNode] has not
/// changed. Examples for such semantic updates that don't require a geometry /// changed. Examples for such semantic updates that don't require a geometry
/// update are changes to flags, labels, or actions. /// update are changes to flags, labels, or actions.
...@@ -2766,7 +2766,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im ...@@ -2766,7 +2766,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
/// [markNeedsSemanticsUpdate] must not have `onlyLocalUpdates` set, as it is /// [markNeedsSemanticsUpdate] must not have `onlyLocalUpdates` set, as it is
/// possible that the node should be entirely removed. /// possible that the node should be entirely removed.
/// ///
/// If the annotation should only happen under certain conditions, `null` /// If the annotation should only happen under certain conditions, null
/// should be returned if those conditions are currently not met to avoid /// should be returned if those conditions are currently not met to avoid
/// the creation of an empty [SemanticsNode]. /// the creation of an empty [SemanticsNode].
SemanticsAnnotator get semanticsAnnotator => null; SemanticsAnnotator get semanticsAnnotator => null;
......
...@@ -830,7 +830,7 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin { ...@@ -830,7 +830,7 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin {
if (_children == null) if (_children == null)
return const <SemanticsNode>[]; return const <SemanticsNode>[];
switch(childOrder) { switch (childOrder) {
case DebugSemanticsDumpOrder.traversal: case DebugSemanticsDumpOrder.traversal:
return new List<SemanticsNode>.from(_children)..sort(_geometryComparator); return new List<SemanticsNode>.from(_children)..sort(_geometryComparator);
case DebugSemanticsDumpOrder.inverseHitTest: case DebugSemanticsDumpOrder.inverseHitTest:
......
...@@ -209,7 +209,7 @@ abstract class RenderSliverPersistentHeader extends RenderSliver with RenderObje ...@@ -209,7 +209,7 @@ abstract class RenderSliverPersistentHeader extends RenderSliver with RenderObje
/// be excluded from the semantic scrolling area. /// be excluded from the semantic scrolling area.
/// ///
/// [RenderSliver]s that stay on the screen even though the user has scrolled /// [RenderSliver]s that stay on the screen even though the user has scrolled
/// past them (e.g. a pinned app bar) should set this to `true`. /// past them (e.g. a pinned app bar) should set this to true.
@protected @protected
bool get excludeFromSemanticsScrolling => _excludeFromSemanticsScrolling; bool get excludeFromSemanticsScrolling => _excludeFromSemanticsScrolling;
bool _excludeFromSemanticsScrolling = false; bool _excludeFromSemanticsScrolling = false;
......
...@@ -330,7 +330,7 @@ class _WidgetsAppState extends State<WidgetsApp> implements WidgetsBindingObserv ...@@ -330,7 +330,7 @@ class _WidgetsAppState extends State<WidgetsApp> implements WidgetsBindingObserv
// Android devices (Java really) report 3 deprecated language codes, see // Android devices (Java really) report 3 deprecated language codes, see
// http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4140555 // http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4140555
// and https://developer.android.com/reference/java/util/Locale.html // and https://developer.android.com/reference/java/util/Locale.html
switch(newLocale.languageCode) { switch (newLocale.languageCode) {
case 'iw': case 'iw':
newLocale = new Locale('he', newLocale.countryCode); // Hebrew newLocale = new Locale('he', newLocale.countryCode); // Hebrew
break; break;
......
...@@ -285,7 +285,7 @@ class _DismissibleState extends State<Dismissible> with TickerProviderStateMixin ...@@ -285,7 +285,7 @@ class _DismissibleState extends State<Dismissible> with TickerProviderStateMixin
if (_directionIsXAxis) { if (_directionIsXAxis) {
if (vx.abs() - vy.abs() < _kMinFlingVelocityDelta) if (vx.abs() - vy.abs() < _kMinFlingVelocityDelta)
return false; return false;
switch(widget.direction) { switch (widget.direction) {
case DismissDirection.horizontal: case DismissDirection.horizontal:
return vx.abs() > _kMinFlingVelocity; return vx.abs() > _kMinFlingVelocity;
case DismissDirection.endToStart: case DismissDirection.endToStart:
...@@ -296,7 +296,7 @@ class _DismissibleState extends State<Dismissible> with TickerProviderStateMixin ...@@ -296,7 +296,7 @@ class _DismissibleState extends State<Dismissible> with TickerProviderStateMixin
} else { } else {
if (vy.abs() - vx.abs() < _kMinFlingVelocityDelta) if (vy.abs() - vx.abs() < _kMinFlingVelocityDelta)
return false; return false;
switch(widget.direction) { switch (widget.direction) {
case DismissDirection.vertical: case DismissDirection.vertical:
return vy.abs() > _kMinFlingVelocity; return vy.abs() > _kMinFlingVelocity;
case DismissDirection.up: case DismissDirection.up:
......
...@@ -406,7 +406,7 @@ class _FadeInImageState extends State<FadeInImage> with TickerProviderStateMixin ...@@ -406,7 +406,7 @@ class _FadeInImageState extends State<FadeInImage> with TickerProviderStateMixin
void _updatePhase() { void _updatePhase() {
setState(() { setState(() {
switch(_phase) { switch (_phase) {
case FadeInImagePhase.start: case FadeInImagePhase.start:
if (_imageResolver._imageInfo != null) if (_imageResolver._imageInfo != null)
_phase = FadeInImagePhase.completed; _phase = FadeInImagePhase.completed;
......
...@@ -567,7 +567,7 @@ class RawGestureDetectorState extends State<RawGestureDetector> { ...@@ -567,7 +567,7 @@ class RawGestureDetectorState extends State<RawGestureDetector> {
/// The event can be interpreted by assistive technologies to provide /// The event can be interpreted by assistive technologies to provide
/// additional feedback to the user about the state of the UI. /// additional feedback to the user about the state of the UI.
/// ///
/// The event will not be sent if [excludeFromSemantics] is set to `true`. /// The event will not be sent if [excludeFromSemantics] is set to true.
void sendSemanticsEvent(SemanticsEvent event) { void sendSemanticsEvent(SemanticsEvent event) {
if (!widget.excludeFromSemantics) { if (!widget.excludeFromSemantics) {
final RenderSemanticsGestureHandler semanticsGestureHandler = context.findRenderObject(); final RenderSemanticsGestureHandler semanticsGestureHandler = context.findRenderObject();
......
...@@ -411,7 +411,7 @@ class Localizations extends StatefulWidget { ...@@ -411,7 +411,7 @@ class Localizations extends StatefulWidget {
/// Returns the localized resources object of the given `type` for the widget /// Returns the localized resources object of the given `type` for the widget
/// tree that corresponds to the given `context`. /// tree that corresponds to the given `context`.
/// ///
/// Returns `null` if no resources object of the given `type` exists within /// Returns null if no resources object of the given `type` exists within
/// the given `context`. /// the given `context`.
/// ///
/// This method is typically used by a static factory method on the `type` /// This method is typically used by a static factory method on the `type`
......
...@@ -274,7 +274,7 @@ void main() { ...@@ -274,7 +274,7 @@ void main() {
// have the same origin and height as the dropdown button. // have the same origin and height as the dropdown button.
final List<RenderObject> itemBoxes = tester.renderObjectList(find.byKey(const ValueKey<String>('two'))).toList(); final List<RenderObject> itemBoxes = tester.renderObjectList(find.byKey(const ValueKey<String>('two'))).toList();
expect(itemBoxes.length, equals(2)); expect(itemBoxes.length, equals(2));
for(RenderBox itemBox in itemBoxes) { for (RenderBox itemBox in itemBoxes) {
assert(itemBox.attached); assert(itemBox.attached);
expect(buttonBox.localToGlobal(Offset.zero), equals(itemBox.localToGlobal(Offset.zero))); expect(buttonBox.localToGlobal(Offset.zero), equals(itemBox.localToGlobal(Offset.zero)));
expect(buttonBox.size.height, equals(itemBox.size.height)); expect(buttonBox.size.height, equals(itemBox.size.height));
...@@ -310,7 +310,7 @@ void main() { ...@@ -310,7 +310,7 @@ void main() {
final double menuItemHeight = itemBoxes.map((RenderBox box) => box.size.height).reduce(math.max); final double menuItemHeight = itemBoxes.map((RenderBox box) => box.size.height).reduce(math.max);
expect(menuItemHeight, greaterThan(buttonBox.size.height)); expect(menuItemHeight, greaterThan(buttonBox.size.height));
for(RenderBox itemBox in itemBoxes) { for (RenderBox itemBox in itemBoxes) {
assert(itemBox.attached); assert(itemBox.attached);
final Offset buttonBoxCenter = buttonBox.size.center(buttonBox.localToGlobal(Offset.zero)); final Offset buttonBoxCenter = buttonBox.size.center(buttonBox.localToGlobal(Offset.zero));
final Offset itemBoxCenter = itemBox.size.center(itemBox.localToGlobal(Offset.zero)); final Offset itemBoxCenter = itemBox.size.center(itemBox.localToGlobal(Offset.zero));
......
...@@ -82,7 +82,7 @@ void main() { ...@@ -82,7 +82,7 @@ void main() {
headerBuilder: (BuildContext context, bool isExpanded) { headerBuilder: (BuildContext context, bool isExpanded) {
return new Text(isExpanded ? 'B' : 'A'); return new Text(isExpanded ? 'B' : 'A');
}, },
body: const SizedBox(height:100.0), body: const SizedBox(height: 100.0),
isExpanded: true, isExpanded: true,
), ),
], ],
...@@ -93,7 +93,7 @@ void main() { ...@@ -93,7 +93,7 @@ void main() {
headerBuilder: (BuildContext context, bool isExpanded){ headerBuilder: (BuildContext context, bool isExpanded){
return new Text(isExpanded ? 'D' : 'C'); return new Text(isExpanded ? 'D' : 'C');
}, },
body: const SizedBox(height:100.0), body: const SizedBox(height: 100.0),
isExpanded: true, isExpanded: true,
), ),
], ],
......
...@@ -160,29 +160,31 @@ void main() { ...@@ -160,29 +160,31 @@ void main() {
); );
expect( expect(
Material.of(tester.element(find.byType(Switch))), Material.of(tester.element(find.byType(Switch))),
paints paints
..rrect( ..rrect(
color: Colors.blue[500], color: Colors.blue[500],
rrect: new RRect.fromLTRBR( rrect: new RRect.fromLTRBR(
383.5, 293.0, 416.5, 307.0, const Radius.circular(7.0))) 383.5, 293.0, 416.5, 307.0, const Radius.circular(7.0)))
..circle(color: const Color(0x33000000)) ..circle(color: const Color(0x33000000))
..circle(color: const Color(0x24000000)) ..circle(color: const Color(0x24000000))
..circle(color: const Color(0x1f000000)) ..circle(color: const Color(0x1f000000))
..circle(color: Colors.yellow[500])); ..circle(color: Colors.yellow[500])
);
await tester.drag(find.byType(Switch), const Offset(-30.0, 0.0)); await tester.drag(find.byType(Switch), const Offset(-30.0, 0.0));
await tester.pump(); await tester.pump();
expect( expect(
Material.of(tester.element(find.byType(Switch))), Material.of(tester.element(find.byType(Switch))),
paints paints
..rrect( ..rrect(
color: Colors.green[500], color: Colors.green[500],
rrect: new RRect.fromLTRBR( rrect: new RRect.fromLTRBR(
383.5, 293.0, 416.5, 307.0, const Radius.circular(7.0))) 383.5, 293.0, 416.5, 307.0, const Radius.circular(7.0)))
..circle(color: const Color(0x33000000)) ..circle(color: const Color(0x33000000))
..circle(color: const Color(0x24000000)) ..circle(color: const Color(0x24000000))
..circle(color: const Color(0x1f000000)) ..circle(color: const Color(0x1f000000))
..circle(color: Colors.red[500])); ..circle(color: Colors.red[500])
);
}); });
} }
...@@ -122,7 +122,7 @@ void main() { ...@@ -122,7 +122,7 @@ void main() {
await tester.tap(find.byKey(dropdownMenuButtonKey)); await tester.tap(find.byKey(dropdownMenuButtonKey));
await tester.pump(const Duration(seconds: 1)); await tester.pump(const Duration(seconds: 1));
for(Element item in tester.elementList(find.text('menuItem'))) for (Element item in tester.elementList(find.text('menuItem')))
expect(Theme.of(item).brightness, equals(Brightness.light)); expect(Theme.of(item).brightness, equals(Brightness.light));
}); });
......
...@@ -75,7 +75,7 @@ final Duration _kPauseBetweenReconnectAttempts = _kShortTimeout ~/ 5; ...@@ -75,7 +75,7 @@ final Duration _kPauseBetweenReconnectAttempts = _kShortTimeout ~/ 5;
// See https://github.com/dart-lang/sdk/blob/master/runtime/vm/timeline.cc#L32 // See https://github.com/dart-lang/sdk/blob/master/runtime/vm/timeline.cc#L32
String _timelineStreamsToString(List<TimelineStream> streams) { String _timelineStreamsToString(List<TimelineStream> streams) {
final String contents = streams.map((TimelineStream stream) { final String contents = streams.map((TimelineStream stream) {
switch(stream) { switch (stream) {
case TimelineStream.all: return 'all'; case TimelineStream.all: return 'all';
case TimelineStream.api: return 'API'; case TimelineStream.api: return 'API';
case TimelineStream.compiler: return 'Compiler'; case TimelineStream.compiler: return 'Compiler';
...@@ -425,7 +425,7 @@ class FlutterDriver { ...@@ -425,7 +425,7 @@ class FlutterDriver {
/// Turns semantics on or off in the Flutter app under test. /// Turns semantics on or off in the Flutter app under test.
/// ///
/// Returns `true` when the call actually changed the state from on to off or /// Returns true when the call actually changed the state from on to off or
/// vice versa. /// vice versa.
Future<bool> setSemantics(bool enabled, { Duration timeout: _kShortTimeout }) async { Future<bool> setSemantics(bool enabled, { Duration timeout: _kShortTimeout }) async {
final SetSemanticsResult result = SetSemanticsResult.fromJson(await _sendCommand(new SetSemantics(enabled, timeout: timeout))); final SetSemanticsResult result = SetSemanticsResult.fromJson(await _sendCommand(new SetSemantics(enabled, timeout: timeout)));
......
...@@ -131,7 +131,7 @@ abstract class SerializableFinder { ...@@ -131,7 +131,7 @@ abstract class SerializableFinder {
/// Deserializes a finder from JSON generated by [serialize]. /// Deserializes a finder from JSON generated by [serialize].
static SerializableFinder deserialize(Map<String, String> json) { static SerializableFinder deserialize(Map<String, String> json) {
final String finderType = json['finderType']; final String finderType = json['finderType'];
switch(finderType) { switch (finderType) {
case 'ByType': return ByType.deserialize(json); case 'ByType': return ByType.deserialize(json);
case 'ByValueKey': return ByValueKey.deserialize(json); case 'ByValueKey': return ByValueKey.deserialize(json);
case 'ByTooltipMessage': return ByTooltipMessage.deserialize(json); case 'ByTooltipMessage': return ByTooltipMessage.deserialize(json);
...@@ -219,7 +219,7 @@ class ByValueKey extends SerializableFinder { ...@@ -219,7 +219,7 @@ class ByValueKey extends SerializableFinder {
static ByValueKey deserialize(Map<String, String> json) { static ByValueKey deserialize(Map<String, String> json) {
final String keyValueString = json['keyValueString']; final String keyValueString = json['keyValueString'];
final String keyValueType = json['keyValueType']; final String keyValueType = json['keyValueType'];
switch(keyValueType) { switch (keyValueType) {
case 'int': case 'int':
return new ByValueKey(int.parse(keyValueString)); return new ByValueKey(int.parse(keyValueString));
case 'String': case 'String':
......
...@@ -138,7 +138,7 @@ class TimelineSummary { ...@@ -138,7 +138,7 @@ class TimelineSummary {
// Timeline does not guarantee that the first event is the "begin" event. // Timeline does not guarantee that the first event is the "begin" event.
final Iterator<TimelineEvent> events = _extractNamedEvents(name) final Iterator<TimelineEvent> events = _extractNamedEvents(name)
.skipWhile((TimelineEvent evt) => evt.phase != 'B').iterator; .skipWhile((TimelineEvent evt) => evt.phase != 'B').iterator;
while(events.moveNext()) { while (events.moveNext()) {
final TimelineEvent beginEvent = events.current; final TimelineEvent beginEvent = events.current;
if (events.moveNext()) { if (events.moveNext()) {
final TimelineEvent endEvent = events.current; final TimelineEvent endEvent = events.current;
......
...@@ -434,10 +434,10 @@ class _EqualsIgnoringHashCodes extends Matcher { ...@@ -434,10 +434,10 @@ class _EqualsIgnoringHashCodes extends Matcher {
} }
} }
/// Returns `true` if [c] represents a whitespace code unit. /// Returns true if [c] represents a whitespace code unit.
bool _isWhitespace(int c) => (c <= 0x000D && c >= 0x0009) || c == 0x0020; bool _isWhitespace(int c) => (c <= 0x000D && c >= 0x0009) || c == 0x0020;
/// Returns `true` if [c] represents a vertical line unicode line art code unit. /// Returns true if [c] represents a vertical line unicode line art code unit.
/// ///
/// See [https://en.wikipedia.org/wiki/Box-drawing_character]. This method only /// See [https://en.wikipedia.org/wiki/Box-drawing_character]. This method only
/// specifies vertical line art code units currently used by Flutter line art. /// specifies vertical line art code units currently used by Flutter line art.
......
...@@ -118,11 +118,7 @@ class AnsiTerminal { ...@@ -118,11 +118,7 @@ class AnsiTerminal {
} }
String choice; String choice;
singleCharMode = true; singleCharMode = true;
while( while (isEmpty(choice) || choice.length != 1 || !acceptedCharacters.contains(choice)) {
isEmpty(choice)
|| choice.length != 1
|| !acceptedCharacters.contains(choice)
) {
if (isNotEmpty(prompt)) { if (isNotEmpty(prompt)) {
printStatus(prompt, emphasis: true, newline: false); printStatus(prompt, emphasis: true, newline: false);
if (displayAcceptedCharacters) if (displayAcceptedCharacters)
......
...@@ -53,8 +53,8 @@ abstract class AnalyzeBase { ...@@ -53,8 +53,8 @@ abstract class AnalyzeBase {
bool get isBenchmarking => argResults['benchmark']; bool get isBenchmarking => argResults['benchmark'];
} }
/// Return `true` if [fileList] contains a path that resides inside the Flutter repository. /// Return true if [fileList] contains a path that resides inside the Flutter repository.
/// If [fileList] is empty, then return `true` if the current directory resides inside the Flutter repository. /// If [fileList] is empty, then return true if the current directory resides inside the Flutter repository.
bool inRepo(List<String> fileList) { bool inRepo(List<String> fileList) {
if (fileList == null || fileList.isEmpty) if (fileList == null || fileList.isEmpty)
fileList = <String>[fs.path.current]; fileList = <String>[fs.path.current];
......
...@@ -383,7 +383,7 @@ String _validateProjectDir(String dirPath, { String flutterRoot }) { ...@@ -383,7 +383,7 @@ String _validateProjectDir(String dirPath, { String flutterRoot }) {
final FileSystemEntityType type = fs.typeSync(dirPath); final FileSystemEntityType type = fs.typeSync(dirPath);
if (type != FileSystemEntityType.NOT_FOUND) { if (type != FileSystemEntityType.NOT_FOUND) {
switch(type) { switch (type) {
case FileSystemEntityType.FILE: case FileSystemEntityType.FILE:
// Do not overwrite files. // Do not overwrite files.
return "Invalid project name: '$dirPath' - file exists."; return "Invalid project name: '$dirPath' - file exists.";
......
...@@ -109,7 +109,7 @@ class ResidentCompiler { ...@@ -109,7 +109,7 @@ class ResidentCompiler {
/// Otherwise, [mainPath] is ignored, but [invalidatedFiles] is recompiled /// Otherwise, [mainPath] is ignored, but [invalidatedFiles] is recompiled
/// into new binary. /// into new binary.
/// Binary file name is returned if compilation was successful, otherwise /// Binary file name is returned if compilation was successful, otherwise
/// `null` is returned. /// null is returned.
Future<String> recompile(String mainPath, List<String> invalidatedFiles) async { Future<String> recompile(String mainPath, List<String> invalidatedFiles) async {
stdoutHandler.reset(); stdoutHandler.reset();
......
...@@ -30,7 +30,7 @@ DevFSConfig get devFSConfig => context[DevFSConfig]; ...@@ -30,7 +30,7 @@ DevFSConfig get devFSConfig => context[DevFSConfig];
abstract class DevFSContent { abstract class DevFSContent {
bool _exists = true; bool _exists = true;
/// Return `true` if this is the first time this method is called /// Return true if this is the first time this method is called
/// or if the entry has been modified since this method was last called. /// or if the entry has been modified since this method was last called.
bool get isModified; bool get isModified;
...@@ -125,7 +125,7 @@ class DevFSByteContent extends DevFSContent { ...@@ -125,7 +125,7 @@ class DevFSByteContent extends DevFSContent {
_isModified = true; _isModified = true;
} }
/// Return `true` only once so that the content is written to the device only once. /// Return true only once so that the content is written to the device only once.
@override @override
bool get isModified { bool get isModified {
final bool modified = _isModified; final bool modified = _isModified;
......
...@@ -668,12 +668,12 @@ int compareIosVersions(String v1, String v2) { ...@@ -668,12 +668,12 @@ int compareIosVersions(String v1, String v2) {
final List<int> v2Fragments = v2.split('.').map(int.parse).toList(); final List<int> v2Fragments = v2.split('.').map(int.parse).toList();
int i = 0; int i = 0;
while(i < v1Fragments.length && i < v2Fragments.length) { while (i < v1Fragments.length && i < v2Fragments.length) {
final int v1Fragment = v1Fragments[i]; final int v1Fragment = v1Fragments[i];
final int v2Fragment = v2Fragments[i]; final int v2Fragment = v2Fragments[i];
if (v1Fragment != v2Fragment) if (v1Fragment != v2Fragment)
return v1Fragment.compareTo(v2Fragment); return v1Fragment.compareTo(v2Fragment);
i++; i += 1;
} }
return v1Fragments.length.compareTo(v2Fragments.length); return v1Fragments.length.compareTo(v2Fragments.length);
} }
......
...@@ -395,7 +395,7 @@ class VersionCheckError implements Exception { ...@@ -395,7 +395,7 @@ class VersionCheckError implements Exception {
/// Runs [command] and returns the standard output as a string. /// Runs [command] and returns the standard output as a string.
/// ///
/// If [lenient] is `true` and the command fails, returns an empty string. /// If [lenient] is true and the command fails, returns an empty string.
/// Otherwise, throws a [ToolExit] exception. /// Otherwise, throws a [ToolExit] exception.
String _runSync(List<String> command, {bool lenient: true}) { String _runSync(List<String> command, {bool lenient: true}) {
final ProcessResult results = processManager.runSync(command, workingDirectory: Cache.flutterRoot); final ProcessResult results = processManager.runSync(command, workingDirectory: Cache.flutterRoot);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment