Unverified Commit 8c79f40d authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

Fixes resulting from audit of issues links (#20772)

* Fixes resulting from audit of issues links

I looked at every link to GitHub in our repo. For cases where we had a TODO that was waiting for a bug to be fixed, and the bug has now been fixed, I applied the pending change. For cases where the link was out of date, I updated the link.

* Update run_test.dart

skip this test again since it failed on linux and macos bots
parent 809721d0
...@@ -68,21 +68,21 @@ linter: ...@@ -68,21 +68,21 @@ linter:
- avoid_relative_lib_imports - avoid_relative_lib_imports
- avoid_renaming_method_parameters - avoid_renaming_method_parameters
- avoid_return_types_on_setters - avoid_return_types_on_setters
# - avoid_returning_null # we do this commonly # - avoid_returning_null # there are plenty of valid reasons to return null
# - avoid_returning_this # https://github.com/dart-lang/linter/issues/842 # - avoid_returning_this # there are plenty of valid reasons to return this
# - avoid_setters_without_getters # not yet tested # - avoid_setters_without_getters # not yet tested
# - avoid_single_cascade_in_expression_statements # not yet tested # - avoid_single_cascade_in_expression_statements # not yet tested
- avoid_slow_async_io - avoid_slow_async_io
# - avoid_types_as_parameter_names # https://github.com/dart-lang/linter/pull/954/files - avoid_types_as_parameter_names
# - avoid_types_on_closure_parameters # conflicts with always_specify_types # - avoid_types_on_closure_parameters # conflicts with always_specify_types
# - avoid_unused_constructor_parameters # https://github.com/dart-lang/linter/pull/847 - avoid_unused_constructor_parameters
- await_only_futures - await_only_futures
- camel_case_types - camel_case_types
- cancel_subscriptions - cancel_subscriptions
# - cascade_invocations # not yet tested # - cascade_invocations # not yet tested
# - close_sinks # https://github.com/flutter/flutter/issues/5789 # - close_sinks # not reliable enough
# - comment_references # blocked on https://github.com/dart-lang/dartdoc/issues/1153 # - comment_references # blocked on https://github.com/flutter/flutter/issues/20765
# - constant_identifier_names # https://github.com/dart-lang/linter/issues/204 # - constant_identifier_names # needs an opt-out https://github.com/dart-lang/linter/issues/204
- control_flow_in_finally - control_flow_in_finally
- directives_ordering - directives_ordering
- empty_catches - empty_catches
...@@ -90,13 +90,13 @@ linter: ...@@ -90,13 +90,13 @@ linter:
- empty_statements - empty_statements
- hash_and_equals - hash_and_equals
- implementation_imports - implementation_imports
# - invariant_booleans # https://github.com/flutter/flutter/issues/5790 # - invariant_booleans # too many false positives: https://github.com/dart-lang/linter/issues/811
- iterable_contains_unrelated_type - iterable_contains_unrelated_type
# - join_return_with_assignment # not yet tested # - join_return_with_assignment # not yet tested
- library_names - library_names
- library_prefixes - library_prefixes
- list_remove_unrelated_type - list_remove_unrelated_type
# - literal_only_boolean_expressions # https://github.com/flutter/flutter/issues/5791 # - literal_only_boolean_expressions # too many false positives: https://github.com/dart-lang/sdk/issues/34181
- no_adjacent_strings_in_list - no_adjacent_strings_in_list
- no_duplicate_case_values - no_duplicate_case_values
- non_constant_identifier_names - non_constant_identifier_names
...@@ -127,7 +127,7 @@ linter: ...@@ -127,7 +127,7 @@ linter:
# - prefer_function_declarations_over_variables # not yet tested # - prefer_function_declarations_over_variables # not yet tested
- prefer_initializing_formals - prefer_initializing_formals
# - prefer_interpolation_to_compose_strings # not yet tested # - prefer_interpolation_to_compose_strings # not yet tested
# - prefer_iterable_whereType # https://github.com/dart-lang/sdk/issues/32463 - prefer_iterable_whereType
- prefer_is_empty - prefer_is_empty
- prefer_is_not_empty - prefer_is_not_empty
- prefer_single_quotes - prefer_single_quotes
...@@ -141,11 +141,11 @@ linter: ...@@ -141,11 +141,11 @@ linter:
- throw_in_finally - throw_in_finally
# - type_annotate_public_apis # subset of always_specify_types # - type_annotate_public_apis # subset of always_specify_types
- type_init_formals - type_init_formals
# - unawaited_futures # https://github.com/flutter/flutter/issues/5793 # - unawaited_futures # too many false positives
- unnecessary_brace_in_string_interps - unnecessary_brace_in_string_interps
- unnecessary_const - unnecessary_const
- unnecessary_getters_setters - unnecessary_getters_setters
# - unnecessary_lambdas # https://github.com/dart-lang/linter/issues/498 # - unnecessary_lambdas # has false positives: https://github.com/dart-lang/linter/issues/498
- unnecessary_null_aware_assignments - unnecessary_null_aware_assignments
- unnecessary_null_in_if_null_operators - unnecessary_null_in_if_null_operators
- unnecessary_overrides - unnecessary_overrides
...@@ -155,7 +155,7 @@ linter: ...@@ -155,7 +155,7 @@ linter:
- unrelated_type_equality_checks - unrelated_type_equality_checks
- use_rethrow_when_possible - use_rethrow_when_possible
# - use_setters_to_change_properties # not yet tested # - use_setters_to_change_properties # not yet tested
# - use_string_buffers # https://github.com/dart-lang/linter/pull/664 # - use_string_buffers # has false positives: https://github.com/dart-lang/sdk/issues/34182
# - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review # - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review
- valid_regexps - valid_regexps
# - void_checks # not yet tested # - void_checks # not yet tested
...@@ -610,8 +610,8 @@ Future<Null> _verifyNoBadImportsInFlutter(String workingDirectory) async { ...@@ -610,8 +610,8 @@ Future<Null> _verifyNoBadImportsInFlutter(String workingDirectory) async {
.map<String>((FileSystemEntity entity) => path.basenameWithoutExtension(entity.path)) .map<String>((FileSystemEntity entity) => path.basenameWithoutExtension(entity.path))
.toList()..sort(); .toList()..sort();
final List<String> directories = new Directory(srcPath).listSync() final List<String> directories = new Directory(srcPath).listSync()
.where((FileSystemEntity entity) => entity is Directory) .whereType<Directory>()
.map<String>((FileSystemEntity entity) => path.basename(entity.path)) .map<String>((Directory entity) => path.basename(entity.path))
.toList()..sort(); .toList()..sort();
if (!_matches(packages, directories)) { if (!_matches(packages, directories)) {
errors.add( errors.add(
......
...@@ -147,7 +147,7 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> { ...@@ -147,7 +147,7 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
value: LeaveBehindDemoAction.reset, value: LeaveBehindDemoAction.reset,
child: Text('Reset the list') child: Text('Reset the list')
), ),
const PopupMenuDivider(), // ignore: list_element_type_not_assignable, https://github.com/flutter/flutter/issues/5771 const PopupMenuDivider(),
new CheckedPopupMenuItem<LeaveBehindDemoAction>( new CheckedPopupMenuItem<LeaveBehindDemoAction>(
value: LeaveBehindDemoAction.horizontalSwipe, value: LeaveBehindDemoAction.horizontalSwipe,
checked: _dismissDirection == DismissDirection.horizontal, checked: _dismissDirection == DismissDirection.horizontal,
......
...@@ -140,7 +140,7 @@ class MenuDemoState extends State<MenuDemo> { ...@@ -140,7 +140,7 @@ class MenuDemoState extends State<MenuDemo> {
title: Text('Get link') title: Text('Get link')
) )
), ),
const PopupMenuDivider(), // ignore: list_element_type_not_assignable, https://github.com/flutter/flutter/issues/5771 const PopupMenuDivider(),
const PopupMenuItem<String>( const PopupMenuItem<String>(
value: 'Remove', value: 'Remove',
child: ListTile( child: ListTile(
......
...@@ -67,11 +67,7 @@ class _TappableWhileStatusIsState extends State<_TappableWhileStatusIs> { ...@@ -67,11 +67,7 @@ class _TappableWhileStatusIsState extends State<_TappableWhileStatusIs> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new AbsorbPointer( return new AbsorbPointer(
absorbing: !_active, absorbing: !_active,
// Redundant. TODO(xster): remove after https://github.com/flutter/flutter/issues/17179. child: widget.child,
child: new IgnorePointer(
ignoring: !_active,
child: widget.child
),
); );
} }
} }
......
...@@ -11,7 +11,7 @@ import 'package:flutter/material.dart'; ...@@ -11,7 +11,7 @@ import 'package:flutter/material.dart';
import 'gallery/app.dart'; import 'gallery/app.dart';
void main() { void main() {
// Temporary debugging hook for https://github.com/flutter/flutter/issues/17956 // Temporary debugging hook for https://github.com/flutter/flutter/issues/17888
debugInstrumentationEnabled = true; debugInstrumentationEnabled = true;
// Overriding https://github.com/flutter/flutter/issues/13736 for better // Overriding https://github.com/flutter/flutter/issues/13736 for better
......
...@@ -132,11 +132,10 @@ class CalculationManager { ...@@ -132,11 +132,10 @@ class CalculationManager {
Isolate _isolate; Isolate _isolate;
void _runCalculation() { void _runCalculation() {
// Load the JSON string. Note that this is done in the main isolate; at the // Load the JSON string. This is done in the main isolate because spawned
// moment, spawned isolates do not have access to Mojo services, including // isolates do not have access to the root bundle. However, the loading
// the root bundle (see https://github.com/flutter/flutter/issues/3294). // process is asynchronous, so the UI will not block while the file is
// However, the loading process is asynchronous, so the UI will not block // loaded.
// while the file is loaded.
rootBundle.loadString('services/data.json').then<Null>((String data) { rootBundle.loadString('services/data.json').then<Null>((String data) {
if (isRunning) { if (isRunning) {
final CalculationMessage message = new CalculationMessage(data, _receivePort.sendPort); final CalculationMessage message = new CalculationMessage(data, _receivePort.sendPort);
......
...@@ -27,7 +27,7 @@ analyzer: ...@@ -27,7 +27,7 @@ analyzer:
# treat missing required parameters as a warning (not a hint) # treat missing required parameters as a warning (not a hint)
missing_required_param: warning missing_required_param: warning
# treat missing returns as a warning (not a hint) # treat missing returns as a warning (not a hint)
# TODO: https://github.com/flutter/flutter/issues/20114 # TODO(ianh): https://github.com/flutter/flutter/issues/20114
missing_return: ignore missing_return: ignore
# allow having TODOs in the code # allow having TODOs in the code
todo: ignore todo: ignore
...@@ -48,7 +48,7 @@ linter: ...@@ -48,7 +48,7 @@ linter:
- camel_case_types - camel_case_types
- cancel_subscriptions - cancel_subscriptions
- close_sinks - close_sinks
# - comment_references # blocked on https://github.com/dart-lang/dartdoc/issues/1153 # - comment_references # we do not presume as to what people want to reference in their dartdocs
# - constant_identifier_names # https://github.com/dart-lang/linter/issues/204 # - constant_identifier_names # https://github.com/dart-lang/linter/issues/204
- control_flow_in_finally - control_flow_in_finally
- empty_constructor_bodies - empty_constructor_bodies
......
...@@ -162,8 +162,7 @@ class CupertinoTabBar extends StatelessWidget implements PreferredSizeWidget { ...@@ -162,8 +162,7 @@ class CupertinoTabBar extends StatelessWidget implements PreferredSizeWidget {
new Expanded( new Expanded(
child: new Semantics( child: new Semantics(
selected: active, selected: active,
// TODO(https://github.com/flutter/flutter/issues/13452): // TODO(xster): This needs localization support. https://github.com/flutter/flutter/issues/13452
// This needs localization support.
hint: 'tab, ${index + 1} of ${items.length}', hint: 'tab, ${index + 1} of ${items.length}',
child: new GestureDetector( child: new GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
......
...@@ -95,7 +95,7 @@ class CupertinoPageRoute<T> extends PageRoute<T> { ...@@ -95,7 +95,7 @@ class CupertinoPageRoute<T> extends PageRoute<T> {
assert(maintainState != null), assert(maintainState != null),
assert(fullscreenDialog != null), assert(fullscreenDialog != null),
super(settings: settings, fullscreenDialog: fullscreenDialog) { super(settings: settings, fullscreenDialog: fullscreenDialog) {
// ignore: prefer_asserts_in_initializer_lists , https://github.com/dart-lang/sdk/issues/31223 // ignore: prefer_asserts_in_initializer_lists, https://github.com/dart-lang/sdk/issues/31223
assert(opaque); // PageRoute makes it return true. assert(opaque); // PageRoute makes it return true.
} }
......
...@@ -115,9 +115,9 @@ class _TextSelectionToolbar extends StatelessWidget { ...@@ -115,9 +115,9 @@ class _TextSelectionToolbar extends StatelessWidget {
child: new Row(mainAxisSize: MainAxisSize.min, children: items), child: new Row(mainAxisSize: MainAxisSize.min, children: items),
), ),
), ),
// TODO(https://github.com/flutter/flutter/issues/11274): // TODO(xster): Position the triangle based on the layout delegate, and
// Position the triangle based on the layout delegate. // avoid letting the triangle line up with any dividers.
// And avoid letting the triangle line up with any dividers. // https://github.com/flutter/flutter/issues/11274
triangle, triangle,
], ],
); );
......
...@@ -76,7 +76,7 @@ class ValueKey<T> extends LocalKey { ...@@ -76,7 +76,7 @@ class ValueKey<T> extends LocalKey {
String toString() { String toString() {
final String valueString = T == String ? '<\'$value\'>' : '<$value>'; final String valueString = T == String ? '<\'$value\'>' : '<$value>';
// The crazy on the next line is a workaround for // The crazy on the next line is a workaround for
// https://github.com/dart-lang/sdk/issues/28548 // https://github.com/dart-lang/sdk/issues/33297
if (runtimeType == new _TypeLiteral<ValueKey<T>>().type) if (runtimeType == new _TypeLiteral<ValueKey<T>>().type)
return '[$valueString]'; return '[$valueString]';
return '[$T $valueString]'; return '[$T $valueString]';
......
...@@ -41,7 +41,8 @@ class AnimatedIcon extends StatelessWidget { ...@@ -41,7 +41,8 @@ class AnimatedIcon extends StatelessWidget {
this.semanticLabel, this.semanticLabel,
this.textDirection, this.textDirection,
}) : assert(progress != null), }) : assert(progress != null),
assert(icon != null); assert(icon != null),
super(key: key);
/// The animation progress for the animated icon. /// The animation progress for the animated icon.
/// ///
......
...@@ -368,11 +368,4 @@ class _RenderCheckbox extends RenderToggleable { ...@@ -368,11 +368,4 @@ class _RenderCheckbox extends RenderToggleable {
} }
} }
} }
// TODO(hmuller): smooth segues for cases where the value changes
// in the middle of position's animation cycle.
// https://github.com/flutter/flutter/issues/14674
// TODO(hmuller): accessibility support for tristate checkboxes.
// https://github.com/flutter/flutter/issues/14677
} }
...@@ -15,6 +15,7 @@ import 'data_table_source.dart'; ...@@ -15,6 +15,7 @@ import 'data_table_source.dart';
import 'dropdown.dart'; import 'dropdown.dart';
import 'icon_button.dart'; import 'icon_button.dart';
import 'icons.dart'; import 'icons.dart';
import 'ink_decoration.dart';
import 'material_localizations.dart'; import 'material_localizations.dart';
import 'progress_indicator.dart'; import 'progress_indicator.dart';
import 'theme.dart'; import 'theme.dart';
...@@ -397,20 +398,19 @@ class PaginatedDataTableState extends State<PaginatedDataTable> { ...@@ -397,20 +398,19 @@ class PaginatedDataTableState extends State<PaginatedDataTable> {
opacity: 0.54 opacity: 0.54
), ),
child: new ButtonTheme.bar( child: new ButtonTheme.bar(
child: new Container( child: new Ink(
height: 64.0, height: 64.0,
padding: new EdgeInsetsDirectional.only(start: startPadding, end: 14.0),
// TODO(ianh): This decoration will prevent ink splashes from being visible.
// Instead, we should have a widget that prints the decoration on the material.
// See https://github.com/flutter/flutter/issues/3782
color: _selectedRowCount > 0 ? themeData.secondaryHeaderColor : null, color: _selectedRowCount > 0 ? themeData.secondaryHeaderColor : null,
child: new Row( child: new Padding(
mainAxisAlignment: MainAxisAlignment.end, padding: new EdgeInsetsDirectional.only(start: startPadding, end: 14.0),
children: headerWidgets child: new Row(
) mainAxisAlignment: MainAxisAlignment.end,
) children: headerWidgets
) ),
) ),
),
),
),
), ),
), ),
new SingleChildScrollView( new SingleChildScrollView(
......
...@@ -61,7 +61,7 @@ class Tab extends StatelessWidget { ...@@ -61,7 +61,7 @@ class Tab extends StatelessWidget {
this.icon, this.icon,
this.child, this.child,
}) : assert(text != null || child != null || icon != null), }) : assert(text != null || child != null || icon != null),
assert(!(text != null && null != child)), // TODO(goderbauer): https://github.com/dart-lang/sdk/issues/31140 assert(!(text != null && null != child)), // TODO(goderbauer): https://github.com/dart-lang/sdk/issues/34180
super(key: key); super(key: key);
/// The text to display as the tab's label. /// The text to display as the tab's label.
......
...@@ -83,7 +83,7 @@ class BoxDecoration extends Decoration { ...@@ -83,7 +83,7 @@ class BoxDecoration extends Decoration {
this.backgroundBlendMode, this.backgroundBlendMode,
this.shape = BoxShape.rectangle, this.shape = BoxShape.rectangle,
}) : assert(shape != null), }) : assert(shape != null),
// TODO(mattcarroll): Use "backgroundBlendMode == null" when https://github.com/dart-lang/sdk/issues/31140 is in. // TODO(mattcarroll): Use "backgroundBlendMode == null" when https://github.com/dart-lang/sdk/issues/34180 is in.
assert( assert(
identical(backgroundBlendMode, null) || color != null || gradient != null, identical(backgroundBlendMode, null) || color != null || gradient != null,
'backgroundBlendMode applies to BoxDecoration\'s background color or ' 'backgroundBlendMode applies to BoxDecoration\'s background color or '
......
...@@ -2059,9 +2059,8 @@ abstract class RenderBox extends RenderObject { ...@@ -2059,9 +2059,8 @@ abstract class RenderBox extends RenderObject {
/// // ... handle the event ... /// // ... handle the event ...
/// } /// }
/// ``` /// ```
// TODO(ianh): Fix the type of the argument here once https://github.com/dart-lang/sdk/issues/25232 is fixed
@override @override
void handleEvent(PointerEvent event, covariant HitTestEntry entry) { void handleEvent(PointerEvent event, BoxHitTestEntry entry) {
super.handleEvent(event, entry); super.handleEvent(event, entry);
} }
......
...@@ -53,7 +53,7 @@ class RenderProxyBox extends RenderBox with RenderObjectWithChildMixin<RenderBox ...@@ -53,7 +53,7 @@ class RenderProxyBox extends RenderBox with RenderObjectWithChildMixin<RenderBox
/// This class can be used as a mixin for situations where the proxying behavior /// This class can be used as a mixin for situations where the proxying behavior
/// of [RenderProxyBox] is desired but inheriting from [RenderProxyBox] is /// of [RenderProxyBox] is desired but inheriting from [RenderProxyBox] is
/// impractical (e.g. because you want to mix in other classes as well). /// impractical (e.g. because you want to mix in other classes as well).
// TODO(ianh): Remove this class once https://github.com/dart-lang/sdk/issues/15101 is fixed // TODO(ianh): Remove this class once https://github.com/dart-lang/sdk/issues/31543 is fixed
@optionalTypeArgs @optionalTypeArgs
abstract class RenderProxyBoxMixin<T extends RenderBox> extends RenderBox with RenderObjectWithChildMixin<T> { abstract class RenderProxyBoxMixin<T extends RenderBox> extends RenderBox with RenderObjectWithChildMixin<T> {
// This class is intended to be used as a mixin, and should not be // This class is intended to be used as a mixin, and should not be
...@@ -3243,7 +3243,6 @@ class RenderSemanticsAnnotations extends RenderProxyBox { ...@@ -3243,7 +3243,6 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
bool hidden, bool hidden,
bool image, bool image,
bool liveRegion, bool liveRegion,
bool isSwitch,
String label, String label,
String value, String value,
String increasedValue, String increasedValue,
......
...@@ -239,7 +239,7 @@ abstract class RenderAligningShiftedBox extends RenderShiftedBox { ...@@ -239,7 +239,7 @@ abstract class RenderAligningShiftedBox extends RenderShiftedBox {
super(child); super(child);
/// A constructor to be used only when the extending class also has a mixin. /// A constructor to be used only when the extending class also has a mixin.
// TODO(gspencer): Remove this constructor once https://github.com/dart-lang/sdk/issues/15101 is fixed. // TODO(gspencer): Remove this constructor once https://github.com/dart-lang/sdk/issues/31543 is fixed.
@protected @protected
RenderAligningShiftedBox.mixin(AlignmentGeometry alignment,TextDirection textDirection, RenderBox child) RenderAligningShiftedBox.mixin(AlignmentGeometry alignment,TextDirection textDirection, RenderBox child)
: this(alignment: alignment, textDirection: textDirection, child: child); : this(alignment: alignment, textDirection: textDirection, child: child);
......
...@@ -366,7 +366,6 @@ class RenderTable extends RenderBox { ...@@ -366,7 +366,6 @@ class RenderTable extends RenderBox {
TableBorder border, TableBorder border,
List<Decoration> rowDecorations, List<Decoration> rowDecorations,
ImageConfiguration configuration = ImageConfiguration.empty, ImageConfiguration configuration = ImageConfiguration.empty,
Decoration defaultRowDecoration,
TableCellVerticalAlignment defaultVerticalAlignment = TableCellVerticalAlignment.top, TableCellVerticalAlignment defaultVerticalAlignment = TableCellVerticalAlignment.top,
TextBaseline textBaseline, TextBaseline textBaseline,
List<List<RenderBox>> children List<List<RenderBox>> children
......
...@@ -694,10 +694,7 @@ abstract class WidgetsBinding extends BindingBase with SchedulerBinding, Gesture ...@@ -694,10 +694,7 @@ abstract class WidgetsBinding extends BindingBase with SchedulerBinding, Gesture
deferFirstFrameReport(); deferFirstFrameReport();
if (renderViewElement != null) if (renderViewElement != null)
buildOwner.reassemble(renderViewElement); buildOwner.reassemble(renderViewElement);
// TODO(hansmuller): eliminate the value variable after analyzer bug return super.performReassemble().then((Null value) {
// https://github.com/flutter/flutter/issues/11646 is fixed.
final Future<Null> value = super.performReassemble();
return value.then((Null _) {
allowFirstFrameReport(); allowFirstFrameReport();
}); });
} }
......
...@@ -1326,7 +1326,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin { ...@@ -1326,7 +1326,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin {
if (plannedInitialRoutes.contains(null)) { if (plannedInitialRoutes.contains(null)) {
assert(() { assert(() {
FlutterError.reportError( FlutterError.reportError(
new FlutterErrorDetails( // ignore: prefer_const_constructors, https://github.com/dart-lang/sdk/issues/29952 new FlutterErrorDetails(
exception: exception:
'Could not navigate to initial route.\n' 'Could not navigate to initial route.\n'
'The requested route name was: "/$initialRouteName"\n' 'The requested route name was: "/$initialRouteName"\n'
......
...@@ -1513,7 +1513,6 @@ class RenderSliverOverlapInjector extends RenderSliver { ...@@ -1513,7 +1513,6 @@ class RenderSliverOverlapInjector extends RenderSliver {
/// The [handle] must not be null. /// The [handle] must not be null.
RenderSliverOverlapInjector({ RenderSliverOverlapInjector({
@required SliverOverlapAbsorberHandle handle, @required SliverOverlapAbsorberHandle handle,
RenderSliver child,
}) : assert(handle != null), _handle = handle; }) : assert(handle != null), _handle = handle;
double _currentLayoutExtent; double _currentLayoutExtent;
......
...@@ -287,7 +287,7 @@ class _SliverScrollingPersistentHeader extends _SliverPersistentHeaderRenderObje ...@@ -287,7 +287,7 @@ class _SliverScrollingPersistentHeader extends _SliverPersistentHeaderRenderObje
} }
} }
// This class exists to work around https://github.com/dart-lang/sdk/issues/15101 // This class exists to work around https://github.com/dart-lang/sdk/issues/31543
abstract class _RenderSliverScrollingPersistentHeader extends RenderSliverScrollingPersistentHeader { } abstract class _RenderSliverScrollingPersistentHeader extends RenderSliverScrollingPersistentHeader { }
class _RenderSliverScrollingPersistentHeaderForWidgets extends _RenderSliverScrollingPersistentHeader class _RenderSliverScrollingPersistentHeaderForWidgets extends _RenderSliverScrollingPersistentHeader
...@@ -305,7 +305,7 @@ class _SliverPinnedPersistentHeader extends _SliverPersistentHeaderRenderObjectW ...@@ -305,7 +305,7 @@ class _SliverPinnedPersistentHeader extends _SliverPersistentHeaderRenderObjectW
} }
} }
// This class exists to work around https://github.com/dart-lang/sdk/issues/15101 // This class exists to work around https://github.com/dart-lang/sdk/issues/31543
abstract class _RenderSliverPinnedPersistentHeader extends RenderSliverPinnedPersistentHeader { } abstract class _RenderSliverPinnedPersistentHeader extends RenderSliverPinnedPersistentHeader { }
class _RenderSliverPinnedPersistentHeaderForWidgets extends _RenderSliverPinnedPersistentHeader with _RenderSliverPersistentHeaderForWidgetsMixin { } class _RenderSliverPinnedPersistentHeaderForWidgets extends _RenderSliverPinnedPersistentHeader with _RenderSliverPersistentHeaderForWidgetsMixin { }
...@@ -319,7 +319,7 @@ class _SliverFloatingPersistentHeader extends _SliverPersistentHeaderRenderObjec ...@@ -319,7 +319,7 @@ class _SliverFloatingPersistentHeader extends _SliverPersistentHeaderRenderObjec
@override @override
_RenderSliverPersistentHeaderForWidgetsMixin createRenderObject(BuildContext context) { _RenderSliverPersistentHeaderForWidgetsMixin createRenderObject(BuildContext context) {
// Not passing this snapConfiguration as a constructor parameter to avoid the // Not passing this snapConfiguration as a constructor parameter to avoid the
// additional layers added due to https://github.com/dart-lang/sdk/issues/15101 // additional layers added due to https://github.com/dart-lang/sdk/issues/31543
return new _RenderSliverFloatingPersistentHeaderForWidgets() return new _RenderSliverFloatingPersistentHeaderForWidgets()
..snapConfiguration = delegate.snapConfiguration; ..snapConfiguration = delegate.snapConfiguration;
} }
...@@ -330,7 +330,7 @@ class _SliverFloatingPersistentHeader extends _SliverPersistentHeaderRenderObjec ...@@ -330,7 +330,7 @@ class _SliverFloatingPersistentHeader extends _SliverPersistentHeaderRenderObjec
} }
} }
// This class exists to work around https://github.com/dart-lang/sdk/issues/15101 // This class exists to work around https://github.com/dart-lang/sdk/issues/31543
abstract class _RenderSliverFloatingPinnedPersistentHeader extends RenderSliverFloatingPinnedPersistentHeader { } abstract class _RenderSliverFloatingPinnedPersistentHeader extends RenderSliverFloatingPinnedPersistentHeader { }
class _RenderSliverFloatingPinnedPersistentHeaderForWidgets extends _RenderSliverFloatingPinnedPersistentHeader with _RenderSliverPersistentHeaderForWidgetsMixin { } class _RenderSliverFloatingPinnedPersistentHeaderForWidgets extends _RenderSliverFloatingPinnedPersistentHeader with _RenderSliverPersistentHeaderForWidgetsMixin { }
...@@ -344,7 +344,7 @@ class _SliverFloatingPinnedPersistentHeader extends _SliverPersistentHeaderRende ...@@ -344,7 +344,7 @@ class _SliverFloatingPinnedPersistentHeader extends _SliverPersistentHeaderRende
@override @override
_RenderSliverPersistentHeaderForWidgetsMixin createRenderObject(BuildContext context) { _RenderSliverPersistentHeaderForWidgetsMixin createRenderObject(BuildContext context) {
// Not passing this snapConfiguration as a constructor parameter to avoid the // Not passing this snapConfiguration as a constructor parameter to avoid the
// additional layers added due to https://github.com/dart-lang/sdk/issues/15101 // additional layers added due to https://github.com/dart-lang/sdk/issues/31543
return new _RenderSliverFloatingPinnedPersistentHeaderForWidgets() return new _RenderSliverFloatingPinnedPersistentHeaderForWidgets()
..snapConfiguration = delegate.snapConfiguration; ..snapConfiguration = delegate.snapConfiguration;
} }
...@@ -355,7 +355,7 @@ class _SliverFloatingPinnedPersistentHeader extends _SliverPersistentHeaderRende ...@@ -355,7 +355,7 @@ class _SliverFloatingPinnedPersistentHeader extends _SliverPersistentHeaderRende
} }
} }
// This class exists to work around https://github.com/dart-lang/sdk/issues/15101 // This class exists to work around https://github.com/dart-lang/sdk/issues/31543
abstract class _RenderSliverFloatingPersistentHeader extends RenderSliverFloatingPersistentHeader { } abstract class _RenderSliverFloatingPersistentHeader extends RenderSliverFloatingPersistentHeader { }
class _RenderSliverFloatingPersistentHeaderForWidgets extends _RenderSliverFloatingPersistentHeader with _RenderSliverPersistentHeaderForWidgetsMixin { } class _RenderSliverFloatingPersistentHeaderForWidgets extends _RenderSliverFloatingPersistentHeader with _RenderSliverPersistentHeaderForWidgetsMixin { }
...@@ -119,7 +119,6 @@ class _SerializeConfig { ...@@ -119,7 +119,6 @@ class _SerializeConfig {
_SerializeConfig.merge( _SerializeConfig.merge(
_SerializeConfig base, { _SerializeConfig base, {
int subtreeDepth, int subtreeDepth,
bool omitChildren,
Iterable<Diagnosticable> pathToInclude, Iterable<Diagnosticable> pathToInclude,
}) : }) :
groupName = base.groupName, groupName = base.groupName,
...@@ -837,7 +836,7 @@ class WidgetInspectorService { ...@@ -837,7 +836,7 @@ class WidgetInspectorService {
new _SerializeConfig.merge(config, pathToInclude: config.pathToInclude.skip(1)), new _SerializeConfig.merge(config, pathToInclude: config.pathToInclude.skip(1)),
); );
} else { } else {
return _nodeToJson(node, new _SerializeConfig.merge(config, omitChildren: true)); return _nodeToJson(node, new _SerializeConfig.merge(config));
} }
} }
// The tricky special case here is that when in the detailsTree, // The tricky special case here is that when in the detailsTree,
......
...@@ -52,7 +52,6 @@ void main() { ...@@ -52,7 +52,6 @@ void main() {
await expectLater( await expectLater(
find.byType(RichText), find.byType(RichText),
matchesGoldenFile('localized_fonts.rich_text.styled_text_span.png'), matchesGoldenFile('localized_fonts.rich_text.styled_text_span.png'),
skip: !Platform.isLinux,
); );
}, },
skip: !Platform.isLinux, skip: !Platform.isLinux,
...@@ -105,7 +104,6 @@ void main() { ...@@ -105,7 +104,6 @@ void main() {
await expectLater( await expectLater(
find.byType(Row), find.byType(Row),
matchesGoldenFile('localized_fonts.text_ambient_locale.chars.png'), matchesGoldenFile('localized_fonts.text_ambient_locale.chars.png'),
skip: !Platform.isLinux,
); );
}, },
skip: !Platform.isLinux, skip: !Platform.isLinux,
...@@ -150,7 +148,6 @@ void main() { ...@@ -150,7 +148,6 @@ void main() {
await expectLater( await expectLater(
find.byType(Row), find.byType(Row),
matchesGoldenFile('localized_fonts.text_explicit_locale.chars.png'), matchesGoldenFile('localized_fonts.text_explicit_locale.chars.png'),
skip: !Platform.isLinux,
); );
}, },
skip: !Platform.isLinux, skip: !Platform.isLinux,
......
...@@ -1029,9 +1029,8 @@ class LiveTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding { ...@@ -1029,9 +1029,8 @@ class LiveTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding {
@override @override
int get microtaskCount { int get microtaskCount {
// Unsupported until we have a wrapper around the real async API // The Dart SDK doesn't report this number.
// https://github.com/flutter/flutter/issues/4637 assert(false, 'microtaskCount cannot be reported when running in real time');
assert(false);
return -1; return -1;
} }
......
...@@ -136,12 +136,8 @@ abstract class WidgetController { ...@@ -136,12 +136,8 @@ abstract class WidgetController {
Iterable<State> get allStates { Iterable<State> get allStates {
TestAsyncUtils.guardSync(); TestAsyncUtils.guardSync();
return allElements return allElements
// TODO(vegorov) replace with Iterable.whereType, when it is available. https://github.com/dart-lang/sdk/issues/27827 .whereType<StatefulElement>()
.where((Element element) => element is StatefulElement) .map((StatefulElement element) => element.state);
.map((Element element) {
final StatefulElement statefulElement = element;
return statefulElement.state;
});
} }
/// The matching state in the widget tree. /// The matching state in the widget tree.
...@@ -151,7 +147,7 @@ abstract class WidgetController { ...@@ -151,7 +147,7 @@ abstract class WidgetController {
/// ///
/// * Use [firstState] if you expect to match several states but only want the first. /// * Use [firstState] if you expect to match several states but only want the first.
/// * Use [stateList] if you expect to match several states and want all of them. /// * Use [stateList] if you expect to match several states and want all of them.
T state<T extends State<StatefulWidget>>(Finder finder) { // TODO(leafp): remove '<StatefulWidget>' when https://github.com/dart-lang/sdk/issues/28580 is fixed T state<T extends State>(Finder finder) {
TestAsyncUtils.guardSync(); TestAsyncUtils.guardSync();
return _stateOf<T>(finder.evaluate().single, finder); return _stateOf<T>(finder.evaluate().single, finder);
} }
...@@ -163,7 +159,7 @@ abstract class WidgetController { ...@@ -163,7 +159,7 @@ abstract class WidgetController {
/// matching widget has no state. /// matching widget has no state.
/// ///
/// * Use [state] if you only expect to match one state. /// * Use [state] if you only expect to match one state.
T firstState<T extends State<StatefulWidget>>(Finder finder) { // TODO(leafp): remove '<StatefulWidget>' when https://github.com/dart-lang/sdk/issues/28580 is fixed T firstState<T extends State>(Finder finder) {
TestAsyncUtils.guardSync(); TestAsyncUtils.guardSync();
return _stateOf<T>(finder.evaluate().first, finder); return _stateOf<T>(finder.evaluate().first, finder);
} }
...@@ -175,12 +171,12 @@ abstract class WidgetController { ...@@ -175,12 +171,12 @@ abstract class WidgetController {
/// ///
/// * Use [state] if you only expect to match one state. /// * Use [state] if you only expect to match one state.
/// * Use [firstState] if you expect to match several but only want the first. /// * Use [firstState] if you expect to match several but only want the first.
Iterable<T> stateList<T extends State<StatefulWidget>>(Finder finder) { // TODO(leafp): remove '<StatefulWidget>' when https://github.com/dart-lang/sdk/issues/28580 is fixed Iterable<T> stateList<T extends State>(Finder finder) {
TestAsyncUtils.guardSync(); TestAsyncUtils.guardSync();
return finder.evaluate().map((Element element) => _stateOf<T>(element, finder)); return finder.evaluate().map((Element element) => _stateOf<T>(element, finder));
} }
T _stateOf<T extends State<StatefulWidget>>(Element element, Finder finder) { // TODO(leafp): remove '<StatefulWidget>' when https://github.com/dart-lang/sdk/issues/28580 is fixed T _stateOf<T extends State>(Element element, Finder finder) {
TestAsyncUtils.guardSync(); TestAsyncUtils.guardSync();
if (element is StatefulElement) if (element is StatefulElement)
return element.state; return element.state;
......
...@@ -45,7 +45,7 @@ void main() { ...@@ -45,7 +45,7 @@ void main() {
test_package.expect(completed, isFalse); test_package.expect(completed, isFalse);
await future; await future;
test_package.expect(completed, isTrue); test_package.expect(completed, isTrue);
}, skip: true /* Enable once https://github.com/dart-lang/test/pull/831 lands */); });
}); });
group('findsOneWidget', () { group('findsOneWidget', () {
......
...@@ -73,7 +73,7 @@ Future<Null> main(List<String> args) async { ...@@ -73,7 +73,7 @@ Future<Null> main(List<String> args) async {
new PrecacheCommand(), new PrecacheCommand(),
new RunCommand(verboseHelp: verboseHelp), new RunCommand(verboseHelp: verboseHelp),
new ScreenshotCommand(), new ScreenshotCommand(),
new ShellCompletionCommand(verboseHelp: verboseHelp), new ShellCompletionCommand(),
new StopCommand(), new StopCommand(),
new TestCommand(verboseHelp: verboseHelp), new TestCommand(verboseHelp: verboseHelp),
new TraceCommand(), new TraceCommand(),
......
...@@ -17,7 +17,6 @@ import '../base/io.dart'; ...@@ -17,7 +17,6 @@ import '../base/io.dart';
import '../base/logger.dart'; import '../base/logger.dart';
import '../base/process.dart'; import '../base/process.dart';
import '../base/process_manager.dart'; import '../base/process_manager.dart';
import '../base/utils.dart';
import '../build_info.dart'; import '../build_info.dart';
import '../device.dart'; import '../device.dart';
import '../globals.dart'; import '../globals.dart';
...@@ -519,32 +518,6 @@ class AndroidDevice extends Device { ...@@ -519,32 +518,6 @@ class AndroidDevice extends Device {
await runCheckedAsync(adbCommandForDevice(<String>['pull', remotePath, outputFile.path])); await runCheckedAsync(adbCommandForDevice(<String>['pull', remotePath, outputFile.path]));
await runCheckedAsync(adbCommandForDevice(<String>['shell', 'rm', remotePath])); await runCheckedAsync(adbCommandForDevice(<String>['shell', 'rm', remotePath]));
} }
// TODO(dantup): discoverApps is no longer used and can possibly be removed.
// Waiting for a response here:
// https://github.com/flutter/flutter/pull/18873#discussion_r198862179
@override
Future<List<DiscoveredApp>> discoverApps() async {
final RegExp discoverExp = new RegExp(r'DISCOVER: (.*)');
final List<DiscoveredApp> result = <DiscoveredApp>[];
final StreamSubscription<String> logs = getLogReader().logLines.listen((String line) {
final Match match = discoverExp.firstMatch(line);
if (match != null) {
final Map<String, dynamic> app = json.decode(match.group(1));
result.add(new DiscoveredApp(app['id'], app['observatoryPort']));
}
});
await runCheckedAsync(adbCommandForDevice(<String>[
'shell', 'am', 'broadcast', '-a', 'io.flutter.view.DISCOVER'
]));
await waitGroup<Null>(<Future<Null>>[
new Future<Null>.delayed(const Duration(seconds: 1)),
logs.cancel(),
]);
return result;
}
} }
Map<String, String> parseAdbDeviceProperties(String str) { Map<String, String> parseAdbDeviceProperties(String str) {
......
...@@ -361,11 +361,7 @@ class AndroidSdk { ...@@ -361,11 +361,7 @@ class AndroidSdk {
if (platformsDir.existsSync()) { if (platformsDir.existsSync()) {
platforms = platformsDir platforms = platformsDir
.listSync() .listSync()
.where((FileSystemEntity entity) => entity is Directory) .whereType<Directory>();
.map<Directory>((FileSystemEntity entity) {
final Directory dir = entity;
return dir;
});
} }
List<Version> buildTools = <Version>[]; // 19.1.0, 22.0.1, ... List<Version> buildTools = <Version>[]; // 19.1.0, 22.0.1, ...
......
...@@ -150,8 +150,7 @@ class AndroidStudio implements Comparable<AndroidStudio> { ...@@ -150,8 +150,7 @@ class AndroidStudio implements Comparable<AndroidStudio> {
final Iterable<Directory> directories = fs final Iterable<Directory> directories = fs
.directory(path) .directory(path)
.listSync() .listSync()
.where((FileSystemEntity e) => e is Directory) .whereType<Directory>();
.cast<Directory>();
for (Directory directory in directories) { for (Directory directory in directories) {
final String name = directory.basename; final String name = directory.basename;
// An exact match, or something like 'Android Studio 3.0 Preview.app'. // An exact match, or something like 'Android Studio 3.0 Preview.app'.
......
...@@ -46,14 +46,7 @@ Future<ReplayProcessManager> getReplayProcessManager(String location) async { ...@@ -46,14 +46,7 @@ Future<ReplayProcessManager> getReplayProcessManager(String location) async {
ProcessManager manager; ProcessManager manager;
try { try {
manager = await ReplayProcessManager.create(dir, manager = await ReplayProcessManager.create(dir);
// TODO(tvolkert): Once https://github.com/flutter/flutter/issues/7166 is
// resolved, we can use the default `streamDelay`. In the
// meantime, native file I/O operations cause our `tail` process
// streams to flush before our protocol discovery is listening on
// them, causing us to timeout waiting for the observatory port.
streamDelay: const Duration(milliseconds: 50),
);
} on ArgumentError catch (error) { } on ArgumentError catch (error) {
throwToolExit('Invalid replay-from: $error'); throwToolExit('Invalid replay-from: $error');
} }
......
...@@ -25,22 +25,6 @@ class AnsiTerminal { ...@@ -25,22 +25,6 @@ class AnsiTerminal {
static const String _reset = '\u001B[0m'; static const String _reset = '\u001B[0m';
static const String _clear = '\u001B[2J\u001B[H'; static const String _clear = '\u001B[2J\u001B[H';
static const int _EBADF = 9;
static const int _ENXIO = 6;
static const int _ENOTTY = 25;
static const int _ENETRESET = 102;
static const int _INVALID_HANDLE = 6;
/// Setting the line mode can throw for some terminals (with "Operation not
/// supported on socket"), but the error can be safely ignored.
static const List<int> _lineModeIgnorableErrors = <int>[
_EBADF,
_ENXIO,
_ENOTTY,
_ENETRESET,
_INVALID_HANDLE,
];
bool supportsColor = platform.stdoutSupportsAnsi; bool supportsColor = platform.stdoutSupportsAnsi;
String bolden(String message) { String bolden(String message) {
...@@ -59,24 +43,15 @@ class AnsiTerminal { ...@@ -59,24 +43,15 @@ class AnsiTerminal {
String clearScreen() => supportsColor ? _clear : '\n\n'; String clearScreen() => supportsColor ? _clear : '\n\n';
set singleCharMode(bool value) { set singleCharMode(bool value) {
// TODO(goderbauer): instead of trying to set lineMode and then catching
// [_ENOTTY] or [_INVALID_HANDLE], we should check beforehand if stdin is
// connected to a terminal or not.
// (Requires https://github.com/dart-lang/sdk/issues/29083 to be resolved.)
final Stream<List<int>> stdin = io.stdin; final Stream<List<int>> stdin = io.stdin;
if (stdin is io.Stdin) { if (stdin is io.Stdin && stdin.hasTerminal) {
try { // The order of setting lineMode and echoMode is important on Windows.
// The order of setting lineMode and echoMode is important on Windows. if (value) {
if (value) { stdin.echoMode = false;
stdin.echoMode = false; stdin.lineMode = false;
stdin.lineMode = false; } else {
} else { stdin.lineMode = true;
stdin.lineMode = true; stdin.echoMode = true;
stdin.echoMode = true;
}
} on io.StdinException catch (error) {
if (!_lineModeIgnorableErrors.contains(error.osError?.errorCode))
rethrow;
} }
} }
} }
......
...@@ -21,7 +21,7 @@ class BuildCommand extends FlutterCommand { ...@@ -21,7 +21,7 @@ class BuildCommand extends FlutterCommand {
addSubcommand(new BuildApkCommand(verboseHelp: verboseHelp)); addSubcommand(new BuildApkCommand(verboseHelp: verboseHelp));
addSubcommand(new BuildAotCommand(verboseHelp: verboseHelp)); addSubcommand(new BuildAotCommand(verboseHelp: verboseHelp));
addSubcommand(new BuildIOSCommand(verboseHelp: verboseHelp)); addSubcommand(new BuildIOSCommand(verboseHelp: verboseHelp));
addSubcommand(new BuildFlxCommand(verboseHelp: verboseHelp)); addSubcommand(new BuildFlxCommand());
addSubcommand(new BuildBundleCommand(verboseHelp: verboseHelp)); addSubcommand(new BuildBundleCommand(verboseHelp: verboseHelp));
} }
......
...@@ -8,8 +8,6 @@ import '../globals.dart'; ...@@ -8,8 +8,6 @@ import '../globals.dart';
import 'build.dart'; import 'build.dart';
class BuildFlxCommand extends BuildSubCommand { class BuildFlxCommand extends BuildSubCommand {
BuildFlxCommand({bool verboseHelp = false});
@override @override
final String name = 'flx'; final String name = 'flx';
......
...@@ -129,10 +129,7 @@ class CreateCommand extends FlutterCommand { ...@@ -129,10 +129,7 @@ class CreateCommand extends FlutterCommand {
final bool generatePackage = template == 'package'; final bool generatePackage = template == 'package';
final Directory projectDir = fs.directory(argResults.rest.first); final Directory projectDir = fs.directory(argResults.rest.first);
String dirPath = fs.path.normalize(projectDir.absolute.path); final String dirPath = fs.path.normalize(projectDir.absolute.path);
// TODO(goderbauer): Work-around for: https://github.com/dart-lang/path/issues/24
if (fs.path.basename(dirPath) == '.')
dirPath = fs.path.dirname(dirPath);
String organization = argResults['org']; String organization = argResults['org'];
if (!argResults.wasParsed('org')) { if (!argResults.wasParsed('org')) {
final FlutterProject project = await FlutterProject.fromDirectory(projectDir); final FlutterProject project = await FlutterProject.fromDirectory(projectDir);
......
...@@ -231,13 +231,9 @@ class IdeConfigCommand extends FlutterCommand { ...@@ -231,13 +231,9 @@ class IdeConfigCommand extends FlutterCommand {
} }
final String flutterRoot = fs.path.absolute(Cache.flutterRoot); final String flutterRoot = fs.path.absolute(Cache.flutterRoot);
String dirPath = fs.path.normalize( final String dirPath = fs.path.normalize(
fs.directory(fs.path.absolute(Cache.flutterRoot)).absolute.path, fs.directory(fs.path.absolute(Cache.flutterRoot)).absolute.path,
); );
// TODO(goderbauer): Work-around for: https://github.com/dart-lang/path/issues/24
if (fs.path.basename(dirPath) == '.') {
dirPath = fs.path.dirname(dirPath);
}
final String error = _validateFlutterDir(dirPath, flutterRoot: flutterRoot); final String error = _validateFlutterDir(dirPath, flutterRoot: flutterRoot);
if (error != null) { if (error != null) {
......
...@@ -12,7 +12,7 @@ import '../base/io.dart'; ...@@ -12,7 +12,7 @@ import '../base/io.dart';
import '../runner/flutter_command.dart'; import '../runner/flutter_command.dart';
class ShellCompletionCommand extends FlutterCommand { class ShellCompletionCommand extends FlutterCommand {
ShellCompletionCommand({bool verboseHelp = false}) { ShellCompletionCommand() {
argParser.addFlag( argParser.addFlag(
'overwrite', 'overwrite',
defaultsTo: false, defaultsTo: false,
......
...@@ -277,13 +277,6 @@ abstract class Device { ...@@ -277,13 +277,6 @@ abstract class Device {
Future<void> takeScreenshot(File outputFile) => new Future<Null>.error('unimplemented'); Future<void> takeScreenshot(File outputFile) => new Future<Null>.error('unimplemented');
// TODO(dantup): discoverApps is no longer used and can possibly be removed.
// Waiting for a response here:
// https://github.com/flutter/flutter/pull/18873#discussion_r198862179
/// Find the apps that are currently running on this device.
Future<List<DiscoveredApp>> discoverApps() =>
new Future<List<DiscoveredApp>>.value(<DiscoveredApp>[]);
@override @override
int get hashCode => id.hashCode; int get hashCode => id.hashCode;
......
...@@ -91,7 +91,7 @@ class Doctor { ...@@ -91,7 +91,7 @@ class Doctor {
} }
List<Workflow> get workflows { List<Workflow> get workflows {
return new List<Workflow>.from(validators.where((DoctorValidator validator) => validator is Workflow)); return validators.whereType<Workflow>().toList();
} }
/// Print a summary of the state of the tooling, as well as how to get more info. /// Print a summary of the state of the tooling, as well as how to get more info.
...@@ -479,19 +479,17 @@ class IntelliJValidatorOnMac extends IntelliJValidator { ...@@ -479,19 +479,17 @@ class IntelliJValidatorOnMac extends IntelliJValidator {
} }
try { try {
final Iterable<FileSystemEntity> installDirs = installPaths final Iterable<Directory> installDirs = installPaths
.map((String installPath) => fs.directory(installPath)) .map((String installPath) => fs.directory(installPath))
.map((Directory dir) => dir.existsSync() ? dir.listSync() : <FileSystemEntity>[]) .map((Directory dir) => dir.existsSync() ? dir.listSync() : <FileSystemEntity>[])
.expand((List<FileSystemEntity> mappedDirs) => mappedDirs) .expand((List<FileSystemEntity> mappedDirs) => mappedDirs)
.where((FileSystemEntity mappedDir) => mappedDir is Directory); .whereType<Directory>();
for (FileSystemEntity dir in installDirs) { for (Directory dir in installDirs) {
if (dir is Directory) { checkForIntelliJ(dir);
checkForIntelliJ(dir); if (!dir.path.endsWith('.app')) {
if (!dir.path.endsWith('.app')) { for (FileSystemEntity subdir in dir.listSync()) {
for (FileSystemEntity subdir in dir.listSync()) { if (subdir is Directory) {
if (subdir is Directory) { checkForIntelliJ(subdir);
checkForIntelliJ(subdir);
}
} }
} }
} }
......
...@@ -34,9 +34,8 @@ class VsCode { ...@@ -34,9 +34,8 @@ class VsCode {
final Iterable<FileSystemEntity> extensionDirs = fs final Iterable<FileSystemEntity> extensionDirs = fs
.directory(extensionDirectory) .directory(extensionDirectory)
.listSync() .listSync()
.where((FileSystemEntity d) => d is Directory) .whereType<Directory>()
.where( .where((Directory d) => d.basename.toLowerCase().startsWith(extensionIdentifierLower));
(FileSystemEntity d) => d.basename.toLowerCase().startsWith(extensionIdentifierLower));
if (extensionDirs.isNotEmpty) { if (extensionDirs.isNotEmpty) {
final FileSystemEntity extensionDir = extensionDirs.first; final FileSystemEntity extensionDir = extensionDirs.first;
......
...@@ -196,8 +196,8 @@ void main() { ...@@ -196,8 +196,8 @@ void main() {
} }
fileFilter.addAll(fs.directory(pkgUri) fileFilter.addAll(fs.directory(pkgUri)
.listSync(recursive: true) .listSync(recursive: true)
.where((FileSystemEntity file) => file is File) .whereType<File>()
.map((FileSystemEntity file) => canonicalizePath(file.path)) .map<String>((File file) => canonicalizePath(file.path))
.toList()); .toList());
} }
final int bytes = await devFS.update(fileFilter: fileFilter); final int bytes = await devFS.update(fileFilter: fileFilter);
......
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