diff --git a/analysis_options.yaml b/analysis_options.yaml index c258678294..747d8e24b4 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -223,7 +223,7 @@ linter: - unnecessary_string_interpolations - unnecessary_this - unnecessary_to_list_in_spreads - # - unreachable_from_main # Do not enable this rule until it is un-marked as "experimental" and carefully re-evaluated. + - unreachable_from_main - unrelated_type_equality_checks - unsafe_html - use_build_context_synchronously diff --git a/dev/benchmarks/microbenchmarks/lib/language/compute_bench.dart b/dev/benchmarks/microbenchmarks/lib/language/compute_bench.dart index aa9c43129a..36e8ef7527 100644 --- a/dev/benchmarks/microbenchmarks/lib/language/compute_bench.dart +++ b/dev/benchmarks/microbenchmarks/lib/language/compute_bench.dart @@ -12,9 +12,10 @@ const int _kNumWarmUp = 100; class Data { Data(this.value); - Map toJson() => { 'value': value }; - final int value; + + @override + String toString() => 'Data($value)'; } List test(int length) { diff --git a/dev/benchmarks/platform_views_layout/lib/main.dart b/dev/benchmarks/platform_views_layout/lib/main.dart index 9fd59bfb1a..4eb4f81c43 100644 --- a/dev/benchmarks/platform_views_layout/lib/main.dart +++ b/dev/benchmarks/platform_views_layout/lib/main.dart @@ -5,7 +5,6 @@ import 'dart:io'; import 'package:flutter/material.dart'; -import 'package:flutter/scheduler.dart' show timeDilation; void main() { runApp( @@ -31,12 +30,6 @@ class PlatformViewAppState extends State { home: const PlatformViewLayout(), ); } - - void toggleAnimationSpeed() { - setState(() { - timeDilation = (timeDilation != 1.0) ? 1.0 : 5.0; - }); - } } class PlatformViewLayout extends StatelessWidget { diff --git a/dev/benchmarks/platform_views_layout/lib/main_non_intersecting.dart b/dev/benchmarks/platform_views_layout/lib/main_non_intersecting.dart index 63156e8f99..9107e9a6b9 100644 --- a/dev/benchmarks/platform_views_layout/lib/main_non_intersecting.dart +++ b/dev/benchmarks/platform_views_layout/lib/main_non_intersecting.dart @@ -5,7 +5,6 @@ import 'dart:io'; import 'package:flutter/material.dart'; -import 'package:flutter/scheduler.dart' show timeDilation; void main() { runApp( @@ -31,12 +30,6 @@ class PlatformViewAppState extends State { home: const PlatformViewLayout(), ); } - - void toggleAnimationSpeed() { - setState(() { - timeDilation = (timeDilation != 1.0) ? 1.0 : 5.0; - }); - } } class PlatformViewLayout extends StatelessWidget { diff --git a/dev/benchmarks/platform_views_layout_hybrid_composition/lib/main.dart b/dev/benchmarks/platform_views_layout_hybrid_composition/lib/main.dart index 98cdb0c653..f56bc63cc1 100644 --- a/dev/benchmarks/platform_views_layout_hybrid_composition/lib/main.dart +++ b/dev/benchmarks/platform_views_layout_hybrid_composition/lib/main.dart @@ -5,7 +5,6 @@ import 'dart:io'; import 'package:flutter/material.dart'; -import 'package:flutter/scheduler.dart' show timeDilation; import 'package:flutter_driver/driver_extension.dart'; import 'android_platform_view.dart'; @@ -35,12 +34,6 @@ class PlatformViewAppState extends State { home: const PlatformViewLayout(), ); } - - void toggleAnimationSpeed() { - setState(() { - timeDilation = (timeDilation != 1.0) ? 1.0 : 5.0; - }); - } } class PlatformViewLayout extends StatelessWidget { diff --git a/dev/integration_tests/web_e2e_tests/test_driver/url_strategy_integration.dart b/dev/integration_tests/web_e2e_tests/test_driver/url_strategy_integration.dart index 6122172aa3..bba6a6de1e 100644 --- a/dev/integration_tests/web_e2e_tests/test_driver/url_strategy_integration.dart +++ b/dev/integration_tests/web_e2e_tests/test_driver/url_strategy_integration.dart @@ -46,11 +46,6 @@ void main() { /// It keeps a list of history entries and event listeners in memory and /// manipulates them in order to achieve the desired functionality. class TestUrlStrategy extends UrlStrategy { - /// Creates a instance of [TestUrlStrategy] with an empty string as the - /// path. - factory TestUrlStrategy() => - TestUrlStrategy.fromEntry(const TestHistoryEntry(null, null, '')); - /// Creates an instance of [TestUrlStrategy] and populates it with a list /// that has [initialEntry] as the only item. TestUrlStrategy.fromEntry(TestHistoryEntry initialEntry) @@ -64,8 +59,6 @@ class TestUrlStrategy extends UrlStrategy { dynamic getState() => currentEntry.state; int _currentEntryIndex; - int get currentEntryIndex => _currentEntryIndex; - final List history; TestHistoryEntry get currentEntry { @@ -105,16 +98,6 @@ class TestUrlStrategy extends UrlStrategy { currentEntry = TestHistoryEntry(state, title, url); } - /// This simulates the case where a user types in a url manually. It causes - /// a new state to be pushed, and all event listeners will be invoked. - Future simulateUserTypingUrl(String url) { - assert(withinAppHistory); - return _nextEventLoop(() { - pushState(null, '', url); - _firePopStateEvent(); - }); - } - @override Future go(int count) { assert(withinAppHistory); diff --git a/dev/manual_tests/lib/actions.dart b/dev/manual_tests/lib/actions.dart index ced46243e8..0e494d12b3 100644 --- a/dev/manual_tests/lib/actions.dart +++ b/dev/manual_tests/lib/actions.dart @@ -56,13 +56,6 @@ class Memento extends Object with Diagnosticable { /// An [ActionDispatcher] subclass that manages the invocation of undoable /// actions. class UndoableActionDispatcher extends ActionDispatcher implements Listenable { - /// Constructs a new [UndoableActionDispatcher]. - /// - /// The [maxUndoLevels] argument must not be null. - UndoableActionDispatcher({ - int maxUndoLevels = _defaultMaxUndoLevels, - }) : _maxUndoLevels = maxUndoLevels; - // A stack of actions that have been performed. The most recent action // performed is at the end of the list. final DoubleLinkedQueue _completedActions = DoubleLinkedQueue(); @@ -70,19 +63,12 @@ class UndoableActionDispatcher extends ActionDispatcher implements Listenable { // at the end of the list. final List _undoneActions = []; - static const int _defaultMaxUndoLevels = 1000; - /// The maximum number of undo levels allowed. /// /// If this value is set to a value smaller than the number of completed /// actions, then the stack of completed actions is truncated to only include /// the last [maxUndoLevels] actions. - int get maxUndoLevels => _maxUndoLevels; - int _maxUndoLevels; - set maxUndoLevels(int value) { - _maxUndoLevels = value; - _pruneActions(); - } + int get maxUndoLevels => 1000; final Set _listeners = {}; @@ -121,7 +107,7 @@ class UndoableActionDispatcher extends ActionDispatcher implements Listenable { // Enforces undo level limit. void _pruneActions() { - while (_completedActions.length > _maxUndoLevels) { + while (_completedActions.length > maxUndoLevels) { _completedActions.removeFirst(); } } @@ -237,26 +223,12 @@ class RedoAction extends Action { } /// An action that can be undone. -abstract class UndoableAction extends Action { - /// The [Intent] this action was originally invoked with. - Intent? get invocationIntent => _invocationTag; - Intent? _invocationTag; - - @protected - set invocationIntent(Intent? value) => _invocationTag = value; - - @override - @mustCallSuper - void invoke(T intent) { - invocationIntent = intent; - } -} +abstract class UndoableAction extends Action { } class UndoableFocusActionBase extends UndoableAction { @override @mustCallSuper Memento invoke(T intent) { - super.invoke(intent); final FocusNode? previousFocus = primaryFocus; return Memento(name: previousFocus!.debugLabel!, undo: () { previousFocus.requestFocus(); @@ -295,8 +267,6 @@ class UndoablePreviousFocusAction extends UndoableFocusActionBase { - TraversalDirection? direction; - @override Memento invoke(DirectionalFocusIntent intent) { final Memento memento = super.invoke(intent); diff --git a/dev/manual_tests/lib/density.dart b/dev/manual_tests/lib/density.dart index 696d987929..02e252e4da 100644 --- a/dev/manual_tests/lib/density.dart +++ b/dev/manual_tests/lib/density.dart @@ -30,15 +30,13 @@ class MyApp extends StatelessWidget { Widget build(BuildContext context) { return const MaterialApp( title: _title, - home: MyHomePage(title: _title), + home: MyHomePage(), ); } } class MyHomePage extends StatefulWidget { - const MyHomePage({super.key, required this.title}); - - final String title; + const MyHomePage({super.key}); @override State createState() => _MyHomePageState(); @@ -92,12 +90,6 @@ class OptionModel extends ChangeNotifier { bool get longText => _longText; bool _longText = false; - set longText(bool longText) { - if (longText != _longText) { - _longText = longText; - notifyListeners(); - } - } void reset() { final OptionModel defaultModel = OptionModel(); diff --git a/dev/manual_tests/lib/menu_anchor.dart b/dev/manual_tests/lib/menu_anchor.dart index 7b3e0dbc02..b6f98d34b7 100644 --- a/dev/manual_tests/lib/menu_anchor.dart +++ b/dev/manual_tests/lib/menu_anchor.dart @@ -778,9 +778,4 @@ enum TestMenu { final String acceleratorLabel; // Strip the accelerator markers. String get label => MenuAcceleratorLabel.stripAcceleratorMarkers(acceleratorLabel); - int get acceleratorIndex { - int index = -1; - MenuAcceleratorLabel.stripAcceleratorMarkers(acceleratorLabel, setIndex: (int i) => index = i); - return index; - } } diff --git a/dev/tools/examples_smoke_test.dart b/dev/tools/examples_smoke_test.dart index 732eb31c84..f4877ff11a 100644 --- a/dev/tools/examples_smoke_test.dart +++ b/dev/tools/examples_smoke_test.dart @@ -81,13 +81,12 @@ Future runSmokeTests({ // A class to hold information related to an example, used to generate names // from for the tests. class ExampleInfo { - ExampleInfo(this.file, Directory examplesLibDir) + ExampleInfo(File file, Directory examplesLibDir) : importPath = _getImportPath(file, examplesLibDir), importName = '' { importName = importPath.replaceAll(RegExp(r'\.dart$'), '').replaceAll(RegExp(r'\W'), '_'); } - final File file; final String importPath; String importName; diff --git a/examples/api/analysis_options.yaml b/examples/api/analysis_options.yaml index 76be938a6b..dec61f90ed 100644 --- a/examples/api/analysis_options.yaml +++ b/examples/api/analysis_options.yaml @@ -6,3 +6,5 @@ linter: rules: # Samples want to print things pretty often. avoid_print: false + # Samples are sometimes incomplete and don't show usage of everything. + unreachable_from_main: false diff --git a/packages/flutter/test/foundation/isolates_test.dart b/packages/flutter/test/foundation/isolates_test.dart index 571d9a1e6b..24b834bc0c 100644 --- a/packages/flutter/test/foundation/isolates_test.dart +++ b/packages/flutter/test/foundation/isolates_test.dart @@ -139,6 +139,7 @@ Future computeInstanceMethod(int square) { Future computeInvalidInstanceMethod(int square) { final ComputeTestSubject subject = ComputeTestSubject(square, ReceivePort()); + expect(subject.additional, isA()); return compute(subject.method, square); } diff --git a/packages/flutter/test/material/menu_anchor_test.dart b/packages/flutter/test/material/menu_anchor_test.dart index 6e3441ea87..e48e855ff1 100644 --- a/packages/flutter/test/material/menu_anchor_test.dart +++ b/packages/flutter/test/material/menu_anchor_test.dart @@ -3256,9 +3256,4 @@ enum TestMenu { final String acceleratorLabel; // Strip the accelerator markers. String get label => MenuAcceleratorLabel.stripAcceleratorMarkers(acceleratorLabel); - int get acceleratorIndex { - int index = -1; - MenuAcceleratorLabel.stripAcceleratorMarkers(acceleratorLabel, setIndex: (int i) => index = i); - return index; - } } diff --git a/packages/flutter/test/painting/image_stream_test.dart b/packages/flutter/test/painting/image_stream_test.dart index 0f376c63ea..0c9bc32f60 100644 --- a/packages/flutter/test/painting/image_stream_test.dart +++ b/packages/flutter/test/painting/image_stream_test.dart @@ -26,8 +26,6 @@ class FakeFrameInfo implements FrameInfo { @override Image get image => _image; - int get imageHandleCount => image.debugGetOpenHandleStackTraces()!.length; - FakeFrameInfo clone() { return FakeFrameInfo( _duration, diff --git a/packages/flutter/test/semantics/semantics_update_test.dart b/packages/flutter/test/semantics/semantics_update_test.dart index 8fffef80ca..e5a41228b1 100644 --- a/packages/flutter/test/semantics/semantics_update_test.dart +++ b/packages/flutter/test/semantics/semantics_update_test.dart @@ -218,37 +218,13 @@ class SemanticsUpdateBuilderSpy extends Fake implements ui.SemanticsUpdateBuilde // Makes sure we don't send the same id twice. assert(!observations.containsKey(id)); observations[id] = SemanticsNodeUpdateObservation( - id: id, - flags: flags, - actions: actions, - maxValueLength: maxValueLength, - currentValueLength: currentValueLength, - textSelectionBase: textSelectionBase, - textSelectionExtent: textSelectionExtent, - platformViewId: platformViewId, - scrollChildren: scrollChildren, - scrollIndex: scrollIndex, - scrollPosition: scrollPosition, - scrollExtentMax: scrollExtentMax, - scrollExtentMin: scrollExtentMin, - elevation: elevation, - thickness: thickness, - rect: rect, label: label, labelAttributes: labelAttributes, hint: hint, hintAttributes: hintAttributes, value: value, valueAttributes: valueAttributes, - increasedValue: increasedValue, - increasedValueAttributes: increasedValueAttributes, - decreasedValue: decreasedValue, - decreasedValueAttributes: decreasedValueAttributes, - textDirection: textDirection, - transform: transform, childrenInTraversalOrder: childrenInTraversalOrder, - childrenInHitTestOrder: childrenInHitTestOrder, - additionalActions: additionalActions, ); } @@ -262,68 +238,20 @@ class SemanticsUpdateBuilderSpy extends Fake implements ui.SemanticsUpdateBuilde class SemanticsNodeUpdateObservation { const SemanticsNodeUpdateObservation({ - required this.id, - required this.flags, - required this.actions, - required this.maxValueLength, - required this.currentValueLength, - required this.textSelectionBase, - required this.textSelectionExtent, - required this.platformViewId, - required this.scrollChildren, - required this.scrollIndex, - required this.scrollPosition, - required this.scrollExtentMax, - required this.scrollExtentMin, - required this.elevation, - required this.thickness, - required this.rect, required this.label, this.labelAttributes, required this.value, this.valueAttributes, - required this.increasedValue, - this.increasedValueAttributes, - required this.decreasedValue, - this.decreasedValueAttributes, required this.hint, this.hintAttributes, - this.textDirection, - required this.transform, required this.childrenInTraversalOrder, - required this.childrenInHitTestOrder, - required this.additionalActions, }); - final int id; - final int flags; - final int actions; - final int maxValueLength; - final int currentValueLength; - final int textSelectionBase; - final int textSelectionExtent; - final int platformViewId; - final int scrollChildren; - final int scrollIndex; - final double scrollPosition; - final double scrollExtentMax; - final double scrollExtentMin; - final double elevation; - final double thickness; - final Rect rect; final String label; final List? labelAttributes; final String value; final List? valueAttributes; - final String increasedValue; - final List? increasedValueAttributes; - final String decreasedValue; - final List? decreasedValueAttributes; final String hint; final List? hintAttributes; - final TextDirection? textDirection; - final Float64List transform; final Int32List childrenInTraversalOrder; - final Int32List childrenInHitTestOrder; - final Int32List additionalActions; } diff --git a/packages/flutter/test/services/asset_manifest_test.dart b/packages/flutter/test/services/asset_manifest_test.dart index c0edd9136e..c06ffd0126 100644 --- a/packages/flutter/test/services/asset_manifest_test.dart +++ b/packages/flutter/test/services/asset_manifest_test.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:convert'; - import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -73,29 +71,3 @@ void main() { expect(manifest.getAssetVariants('invalid asset key'), isNull); }); } - -String createAssetManifestJson(Map> manifest) { - final Map jsonObject = manifest.map( - (String key, List value) { - final List variants = value.map((AssetMetadata e) => e.key).toList(); - return MapEntry>(key, variants); - } - ); - - return json.encode(jsonObject); -} - -ByteData createAssetManifestSmcBin(Map> manifest) { - final Map smcObject = manifest.map( - (String key, List value) { - final List variants = value.map((AssetMetadata variant) => { - 'asset': variant.key, - 'dpr': variant.targetDevicePixelRatio, - }).toList(); - - return MapEntry>(key, variants); - } - ); - - return const StandardMessageCodec().encodeMessage(smcObject)!; -} diff --git a/packages/flutter/test/widgets/async_lifecycle_test.dart b/packages/flutter/test/widgets/async_lifecycle_test.dart index 62f1e2f3f3..193152002b 100644 --- a/packages/flutter/test/widgets/async_lifecycle_test.dart +++ b/packages/flutter/test/widgets/async_lifecycle_test.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:flutter/widgets.dart'; +import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; class InvalidOnInitLifecycleWidget extends StatefulWidget { @@ -25,9 +25,9 @@ class InvalidOnInitLifecycleWidgetState extends State InvalidDidUpdateWidgetLifecycleWidgetState(); @@ -41,7 +41,7 @@ class InvalidDidUpdateWidgetLifecycleWidgetState extends State with AutomaticKeepAl } } -class RenderBoxKeepAlive extends RenderBox { - State createState() => AlwaysKeepAliveRenderBoxState(); -} - -class AlwaysKeepAliveRenderBoxState extends State<_AlwaysKeepAlive> with AutomaticKeepAliveClientMixin<_AlwaysKeepAlive> { - @override - bool get wantKeepAlive => true; - - @override - Widget build(BuildContext context) { - super.build(context); - return const SizedBox( - height: 48.0, - child: Text('keep me alive'), - ); - } -} +class RenderBoxKeepAlive extends RenderBox { } mixin KeepAliveParentDataMixinAlt implements KeepAliveParentDataMixin { @override @@ -631,14 +615,6 @@ class RenderSliverMultiBoxAdaptorAlt extends RenderSliver with RenderSliverHelpers, RenderSliverWithKeepAliveMixin { - RenderSliverMultiBoxAdaptorAlt({ - RenderSliverBoxChildManager? childManager, - }) : _childManager = childManager; - - @protected - RenderSliverBoxChildManager? get childManager => _childManager; - final RenderSliverBoxChildManager? _childManager; - final List children = []; void insert(RenderBox child, { RenderBox? after }) { diff --git a/packages/flutter/test/widgets/fade_in_image_test.dart b/packages/flutter/test/widgets/fade_in_image_test.dart index 94933c1193..a10a77bd24 100644 --- a/packages/flutter/test/widgets/fade_in_image_test.dart +++ b/packages/flutter/test/widgets/fade_in_image_test.dart @@ -30,16 +30,6 @@ class FadeInImageParts { expect(animatedFadeOutFadeInElement, isNotNull); return animatedFadeOutFadeInElement!.state; } - - Element? get semanticsElement { - Element? result; - fadeInImageElement.visitChildren((Element child) { - if (child.widget is Semantics) { - result = child; - } - }); - return result; - } } class FadeInImageElements { diff --git a/packages/flutter/test/widgets/mark_needs_build_test.dart b/packages/flutter/test/widgets/mark_needs_build_test.dart index dbe1d3c472..9fa2d008b3 100644 --- a/packages/flutter/test/widgets/mark_needs_build_test.dart +++ b/packages/flutter/test/widgets/mark_needs_build_test.dart @@ -106,7 +106,7 @@ class _TestWidgetState extends State { calledDuringBuild++; }); return SizedBox.expand( - child: Text(Directionality.of(context).toString()), + child: Text('${widget.value}: ${Directionality.of(context)}'), ); } } diff --git a/packages/flutter/test/widgets/render_object_element_test.dart b/packages/flutter/test/widgets/render_object_element_test.dart index b3accf97eb..a485d3fed6 100644 --- a/packages/flutter/test/widgets/render_object_element_test.dart +++ b/packages/flutter/test/widgets/render_object_element_test.dart @@ -137,8 +137,8 @@ class SwapperElementWithProperOverrides extends SwapperElement { } class RenderSwapper extends RenderBox { - RenderBox? _stable; RenderBox? get stable => _stable; + RenderBox? _stable; set stable(RenderBox? child) { if (child == _stable) { return; @@ -153,8 +153,8 @@ class RenderSwapper extends RenderBox { } bool? _swapperIsOnTop; - RenderBox? _swapper; RenderBox? get swapper => _swapper; + RenderBox? _swapper; void setSwapper(RenderBox? child, bool isOnTop) { if (isOnTop != _swapperIsOnTop) { _swapperIsOnTop = isOnTop; @@ -174,11 +174,11 @@ class RenderSwapper extends RenderBox { @override void visitChildren(RenderObjectVisitor visitor) { - if (_stable != null) { - visitor(_stable!); + if (stable != null) { + visitor(stable!); } - if (_swapper != null) { - visitor(_swapper!); + if (swapper != null) { + visitor(swapper!); } } @@ -210,14 +210,14 @@ class RenderSwapper extends RenderBox { minHeight: constraints.minHeight / 2, maxHeight: constraints.maxHeight / 2, ); - if (_stable != null) { - final BoxParentData stableParentData = _stable!.parentData! as BoxParentData; - _stable!.layout(childConstraints); + if (stable != null) { + final BoxParentData stableParentData = stable!.parentData! as BoxParentData; + stable!.layout(childConstraints); stableParentData.offset = _swapperIsOnTop! ? bottomOffset : topOffset; } - if (_swapper != null) { - final BoxParentData swapperParentData = _swapper!.parentData! as BoxParentData; - _swapper!.layout(childConstraints); + if (swapper != null) { + final BoxParentData swapperParentData = swapper!.parentData! as BoxParentData; + swapper!.layout(childConstraints); swapperParentData.offset = _swapperIsOnTop! ? topOffset : bottomOffset; } } diff --git a/packages/flutter/test/widgets/reparent_state_harder_test.dart b/packages/flutter/test/widgets/reparent_state_harder_test.dart index f022a820d7..d7029bb888 100644 --- a/packages/flutter/test/widgets/reparent_state_harder_test.dart +++ b/packages/flutter/test/widgets/reparent_state_harder_test.dart @@ -63,10 +63,8 @@ class DummyStatefulWidgetState extends State { class RekeyableDummyStatefulWidgetWrapper extends StatefulWidget { const RekeyableDummyStatefulWidgetWrapper({ super.key, - this.child, required this.initialKey, }); - final Widget? child; final GlobalKey initialKey; @override RekeyableDummyStatefulWidgetWrapperState createState() => RekeyableDummyStatefulWidgetWrapperState(); diff --git a/packages/flutter/test/widgets/router_test.dart b/packages/flutter/test/widgets/router_test.dart index be0b375185..f07d59245b 100644 --- a/packages/flutter/test/widgets/router_test.dart +++ b/packages/flutter/test/widgets/router_test.dart @@ -1610,10 +1610,6 @@ class SimpleNavigatorRouterDelegate extends RouterDelegate wit RouteInformation get routeInformation => _routeInformation; late RouteInformation _routeInformation; - set routeInformation(RouteInformation newValue) { - _routeInformation = newValue; - notifyListeners(); - } SimpleRouterDelegateBuilder builder; SimpleNavigatorRouterDelegatePopPage onPopPage; @@ -1711,10 +1707,6 @@ class SimpleAsyncRouterDelegate extends RouterDelegate with Ch RouteInformation? get routeInformation => _routeInformation; RouteInformation? _routeInformation; - set routeInformation(RouteInformation? newValue) { - _routeInformation = newValue; - notifyListeners(); - } SimpleRouterDelegateBuilder builder; late Future setNewRouteFuture; diff --git a/packages/flutter/test/widgets/selectable_region_context_menu_test.dart b/packages/flutter/test/widgets/selectable_region_context_menu_test.dart index 128c63fc26..5ec1891246 100644 --- a/packages/flutter/test/widgets/selectable_region_context_menu_test.dart +++ b/packages/flutter/test/widgets/selectable_region_context_menu_test.dart @@ -18,7 +18,6 @@ extension on web.CSSRuleList { Iterable get iterable => _genIterable(this); } -typedef ItemGetter = T? Function(int index); Iterable _genIterable(dynamic jsCollection) { // ignore: avoid_dynamic_calls return Iterable.generate(jsCollection.length as int, (int index) => jsCollection.item(index) as T,); @@ -159,8 +158,7 @@ class RenderSelectionSpy extends RenderProxyBox } @override - SelectionGeometry get value => _value; - SelectionGeometry _value = const SelectionGeometry( + final SelectionGeometry value = const SelectionGeometry( hasContent: true, status: SelectionStatus.uncollapsed, startSelectionPoint: SelectionPoint( @@ -174,15 +172,6 @@ class RenderSelectionSpy extends RenderProxyBox handleType: TextSelectionHandleType.left, ), ); - set value(SelectionGeometry other) { - if (other == _value) { - return; - } - _value = other; - for (final VoidCallback callback in listeners) { - callback(); - } - } @override void pushHandleLayers(LayerLink? startHandle, LayerLink? endHandle) { } diff --git a/packages/flutter/test/widgets/selectable_region_test.dart b/packages/flutter/test/widgets/selectable_region_test.dart index e96dea2f26..e2903ab778 100644 --- a/packages/flutter/test/widgets/selectable_region_test.dart +++ b/packages/flutter/test/widgets/selectable_region_test.dart @@ -2526,8 +2526,7 @@ class RenderSelectionSpy extends RenderProxyBox } @override - SelectionGeometry get value => _value; - SelectionGeometry _value = const SelectionGeometry( + final SelectionGeometry value = const SelectionGeometry( hasContent: true, status: SelectionStatus.uncollapsed, startSelectionPoint: SelectionPoint( @@ -2541,15 +2540,6 @@ class RenderSelectionSpy extends RenderProxyBox handleType: TextSelectionHandleType.left, ), ); - set value(SelectionGeometry other) { - if (other == _value) { - return; - } - _value = other; - for (final VoidCallback callback in listeners) { - callback(); - } - } @override void pushHandleLayers(LayerLink? startHandle, LayerLink? endHandle) { } diff --git a/packages/flutter/test/widgets/semantics_10_test.dart b/packages/flutter/test/widgets/semantics_10_test.dart index 4b452b14be..0ef416efd6 100644 --- a/packages/flutter/test/widgets/semantics_10_test.dart +++ b/packages/flutter/test/widgets/semantics_10_test.dart @@ -96,13 +96,13 @@ class RenderTest extends RenderProxyBox { void describeSemanticsConfiguration(SemanticsConfiguration config) { super.describeSemanticsConfiguration(config); - if (!_isSemanticBoundary) { + if (!isSemanticBoundary) { return; } config - ..isSemanticBoundary = _isSemanticBoundary - ..label = _label + ..isSemanticBoundary = isSemanticBoundary + ..label = label ..textDirection = TextDirection.ltr; } diff --git a/packages/flutter/test/widgets/semantics_child_configs_delegate_test.dart b/packages/flutter/test/widgets/semantics_child_configs_delegate_test.dart index 33f3b28278..a562a53891 100644 --- a/packages/flutter/test/widgets/semantics_child_configs_delegate_test.dart +++ b/packages/flutter/test/widgets/semantics_child_configs_delegate_test.dart @@ -357,6 +357,6 @@ class RenderTestConfigDelegate extends RenderProxyBox { @override void describeSemanticsConfiguration(SemanticsConfiguration config) { - config.childConfigurationsDelegate = _delegate; + config.childConfigurationsDelegate = delegate; } } diff --git a/packages/flutter/test/widgets/shortcuts_test.dart b/packages/flutter/test/widgets/shortcuts_test.dart index 74d1d5931e..0481f8cd6b 100644 --- a/packages/flutter/test/widgets/shortcuts_test.dart +++ b/packages/flutter/test/widgets/shortcuts_test.dart @@ -601,18 +601,12 @@ void main() { testWidgets('Shortcuts.manager lets manager handle shortcuts', (WidgetTester tester) async { final GlobalKey containerKey = GlobalKey(); final List pressedKeys = []; - bool shortcutsSet = false; - void onShortcutsSet() { - shortcutsSet = true; - } final TestShortcutManager testManager = TestShortcutManager( pressedKeys, - onShortcutsSet: onShortcutsSet, shortcuts: { LogicalKeySet(LogicalKeyboardKey.shift): const TestIntent(), }, ); - shortcutsSet = false; bool invoked = false; await tester.pumpWidget( Actions( @@ -636,7 +630,6 @@ void main() { await tester.pump(); await tester.sendKeyDownEvent(LogicalKeyboardKey.shiftLeft); expect(invoked, isTrue); - expect(shortcutsSet, isFalse); expect(pressedKeys, equals([LogicalKeyboardKey.shiftLeft])); }); @@ -1953,10 +1946,9 @@ class TestIntent2 extends Intent { } class TestShortcutManager extends ShortcutManager { - TestShortcutManager(this.keys, { super.shortcuts, this.onShortcutsSet }); + TestShortcutManager(this.keys, { super.shortcuts }); List keys; - VoidCallback? onShortcutsSet; @override KeyEventResult handleKeypress(BuildContext context, RawKeyEvent event) { diff --git a/packages/flutter/test/widgets/slivers_keepalive_test.dart b/packages/flutter/test/widgets/slivers_keepalive_test.dart index 5065232cbe..ae7dc37c4c 100644 --- a/packages/flutter/test/widgets/slivers_keepalive_test.dart +++ b/packages/flutter/test/widgets/slivers_keepalive_test.dart @@ -319,7 +319,7 @@ void main() { WidgetTest2(text: 'child 2', key: UniqueKey()), ]; await tester.pumpWidget( - SwitchingSliverListTest(viewportFraction: 0.1, children: childList), + SwitchingSliverListTest(children: childList), ); final _WidgetTest0State state0 = tester.state(find.byType(WidgetTest0)); final _WidgetTest1State state1 = tester.state(find.byType(WidgetTest1)); @@ -330,32 +330,32 @@ void main() { childList = createSwitchedChildList(childList, 0, 2); await tester.pumpWidget( - SwitchingSliverListTest(viewportFraction: 0.1, children: childList), + SwitchingSliverListTest(children: childList), ); childList = createSwitchedChildList(childList, 1, 2); await tester.pumpWidget( - SwitchingSliverListTest(viewportFraction: 0.1, children: childList), + SwitchingSliverListTest(children: childList), ); childList = createSwitchedChildList(childList, 1, 2); await tester.pumpWidget( - SwitchingSliverListTest(viewportFraction: 0.1, children: childList), + SwitchingSliverListTest(children: childList), ); childList = createSwitchedChildList(childList, 0, 1); await tester.pumpWidget( - SwitchingSliverListTest(viewportFraction: 0.1, children: childList), + SwitchingSliverListTest(children: childList), ); childList = createSwitchedChildList(childList, 0, 2); await tester.pumpWidget( - SwitchingSliverListTest(viewportFraction: 0.1, children: childList), + SwitchingSliverListTest(children: childList), ); childList = createSwitchedChildList(childList, 0, 1); await tester.pumpWidget( - SwitchingSliverListTest(viewportFraction: 0.1, children: childList), + SwitchingSliverListTest(children: childList), ); expect(state0.hasBeenDisposed, false); expect(state1.hasBeenDisposed, true); @@ -369,7 +369,7 @@ void main() { WidgetTest2(text: 'child 2', key: UniqueKey()), ]; await tester.pumpWidget( - SwitchingSliverListTest(viewportFraction: 0.1, children: childList), + SwitchingSliverListTest(children: childList), ); final _WidgetTest0State state0 = tester.state(find.byType(WidgetTest0)); final _WidgetTest1State state1 = tester.state(find.byType(WidgetTest1)); @@ -381,7 +381,7 @@ void main() { childList = createSwitchedChildList(childList, 0, 1); childList.removeAt(2); await tester.pumpWidget( - SwitchingSliverListTest(viewportFraction: 0.1, children: childList), + SwitchingSliverListTest(children: childList), ); expect(find.text('child 0'), findsOneWidget); expect(find.text('child 1'), findsOneWidget); @@ -505,12 +505,10 @@ class SwitchingChildListTest extends StatelessWidget { class SwitchingSliverListTest extends StatelessWidget { const SwitchingSliverListTest({ required this.children, - this.viewportFraction = 1.0, super.key, }); final List children; - final double viewportFraction; @override Widget build(BuildContext context) { diff --git a/packages/flutter/test/widgets/snapshot_widget_test.dart b/packages/flutter/test/widgets/snapshot_widget_test.dart index 751a610e15..05512bae82 100644 --- a/packages/flutter/test/widgets/snapshot_widget_test.dart +++ b/packages/flutter/test/widgets/snapshot_widget_test.dart @@ -335,10 +335,6 @@ class TestPainter extends SnapshotPainter { super.removeListener(listener); } - void notify() { - notifyListeners(); - } - @override void paintSnapshot(PaintingContext context, Offset offset, Size size, ui.Image image, Size sourceSize, double pixelRatio) { count += 1; diff --git a/packages/flutter/test_private/bin/test_private.dart b/packages/flutter/test_private/bin/test_private.dart index 25b89f3c38..372ddb6a39 100644 --- a/packages/flutter/test_private/bin/test_private.dart +++ b/packages/flutter/test_private/bin/test_private.dart @@ -195,7 +195,13 @@ class TestCase { // Use Flutter's analysis_options.yaml file from packages/flutter. File(path.join(tmpdir.absolute.path, 'analysis_options.yaml')) - .writeAsStringSync('include: ${path.toUri(path.join(flutterRoot.path, 'packages', 'flutter', 'analysis_options.yaml'))}'); + .writeAsStringSync( + 'include: ${path.toUri(path.join(flutterRoot.path, 'packages', 'flutter', 'analysis_options.yaml'))}\n' + 'linter:\n' + ' rules:\n' + // The code does wonky things with the part-of directive that cause false positives. + ' unreachable_from_main: false' + ); return true; } diff --git a/packages/flutter_test/test/window_test.dart b/packages/flutter_test/test/window_test.dart index 495004da0d..144890c744 100644 --- a/packages/flutter_test/test/window_test.dart +++ b/packages/flutter_test/test/window_test.dart @@ -243,7 +243,6 @@ void main() { class TestObserver with WidgetsBindingObserver { List? locales; - Locale? locale; @override void didChangeLocales(List? locales) { diff --git a/packages/flutter_tools/bin/xcode_backend.dart b/packages/flutter_tools/bin/xcode_backend.dart index 9d4e46e398..0486a8741c 100644 --- a/packages/flutter_tools/bin/xcode_backend.dart +++ b/packages/flutter_tools/bin/xcode_backend.dart @@ -63,11 +63,6 @@ class Context { } } - bool existsDir(String path) { - final Directory dir = Directory(path); - return dir.existsSync(); - } - bool existsFile(String path) { final File file = File(path); return file.existsSync(); diff --git a/packages/flutter_tools/test/commands.shard/hermetic/attach_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/attach_test.dart index 1b3b9611a0..dd2de79fcb 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/attach_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/attach_test.dart @@ -105,7 +105,6 @@ void main() { testUsingContext('succeeds with iOS device with protocol discovery', () async { final FakeIOSDevice device = FakeIOSDevice( - logReader: fakeLogReader, portForwarder: portForwarder, majorSdkVersion: 12, onGetLogReader: () { @@ -167,7 +166,6 @@ void main() { testUsingContext('succeeds with iOS device with mDNS', () async { final FakeIOSDevice device = FakeIOSDevice( - logReader: fakeLogReader, portForwarder: portForwarder, majorSdkVersion: 16, onGetLogReader: () { @@ -237,7 +235,6 @@ void main() { testUsingContext('succeeds with iOS device with mDNS wireless device', () async { final FakeIOSDevice device = FakeIOSDevice( - logReader: fakeLogReader, portForwarder: portForwarder, majorSdkVersion: 16, connectionInterface: DeviceConnectionInterface.wireless, @@ -309,7 +306,6 @@ void main() { testUsingContext('succeeds with iOS device with mDNS wireless device with debug-port', () async { final FakeIOSDevice device = FakeIOSDevice( - logReader: fakeLogReader, portForwarder: portForwarder, majorSdkVersion: 16, connectionInterface: DeviceConnectionInterface.wireless, @@ -385,7 +381,6 @@ void main() { testUsingContext('succeeds with iOS device with mDNS wireless device with debug-url', () async { final FakeIOSDevice device = FakeIOSDevice( - logReader: fakeLogReader, portForwarder: portForwarder, majorSdkVersion: 16, connectionInterface: DeviceConnectionInterface.wireless, @@ -619,7 +614,6 @@ void main() { testUsingContext('succeeds when ipv6 is specified and debug-port is not on iOS device', () async { final FakeIOSDevice device = FakeIOSDevice( - logReader: fakeLogReader, portForwarder: portForwarder, majorSdkVersion: 12, onGetLogReader: () { @@ -1350,11 +1344,10 @@ class FakeAndroidDevice extends Fake implements AndroidDevice { class FakeIOSDevice extends Fake implements IOSDevice { FakeIOSDevice({ DevicePortForwarder? portForwarder, - DeviceLogReader? logReader, this.onGetLogReader, this.connectionInterface = DeviceConnectionInterface.attached, this.majorSdkVersion = 0, - }) : _portForwarder = portForwarder, _logReader = logReader; + }) : _portForwarder = portForwarder; final DevicePortForwarder? _portForwarder; @override @@ -1373,9 +1366,6 @@ class FakeIOSDevice extends Fake implements IOSDevice { @override DartDevelopmentService get dds => throw UnimplementedError('getter dds not implemented'); - final DeviceLogReader? _logReader; - DeviceLogReader get logReader => _logReader!; - final DeviceLogReader Function()? onGetLogReader; @override @@ -1470,11 +1460,9 @@ class FakeMDnsClient extends Fake implements MDnsClient { } class TestDeviceManager extends DeviceManager { - TestDeviceManager({required this.logger}) : super(logger: logger); + TestDeviceManager({required super.logger}); List devices = []; - final BufferLogger logger; - @override List get deviceDiscoverers { final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery(); diff --git a/packages/flutter_tools/test/commands.shard/hermetic/create_usage_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/create_usage_test.dart index 82491edf81..088caf9e75 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/create_usage_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/create_usage_test.dart @@ -19,9 +19,7 @@ import '../../src/test_flutter_command_runner.dart'; import '../../src/testbed.dart'; class FakePub extends Fake implements Pub { - FakePub(this.fs); - final FileSystem fs; int calledGetOffline = 0; int calledOnline = 0; @@ -59,7 +57,7 @@ void main() { setUp(() { testbed = Testbed(setup: () { - fakePub = FakePub(globals.fs); + fakePub = FakePub(); Cache.flutterRoot = 'flutter'; final List filePaths = [ globals.fs.path.join('flutter', 'packages', 'flutter', 'pubspec.yaml'), diff --git a/packages/flutter_tools/test/commands.shard/hermetic/doctor_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/doctor_test.dart index 0927707d72..9d42023235 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/doctor_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/doctor_test.dart @@ -831,41 +831,6 @@ class FakeAndroidWorkflow extends Fake implements AndroidWorkflow { final bool appliesToHostPlatform; } -class NoOpDoctor implements Doctor { - @override - bool get canLaunchAnything => true; - - @override - bool get canListAnything => true; - - @override - Future checkRemoteArtifacts(String engineRevision) async => true; - - @override - Future diagnose({ - bool androidLicenses = false, - bool verbose = true, - bool showColor = true, - AndroidLicenseValidator? androidLicenseValidator, - bool showPii = true, - List? startedValidatorTasks, - bool sendEvent = true, - FlutterVersion? version, - }) async => true; - - @override - List startValidatorTasks() => []; - - @override - Future summary() async { } - - @override - List get validators => []; - - @override - List get workflows => []; -} - class PassingValidator extends DoctorValidator { PassingValidator(super.title); diff --git a/packages/flutter_tools/test/commands.shard/hermetic/run_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/run_test.dart index 5ccba77dcc..ca7564e59e 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/run_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/run_test.dart @@ -1148,11 +1148,9 @@ void main() { } class TestDeviceManager extends DeviceManager { - TestDeviceManager({required this.logger}) : super(logger: logger); + TestDeviceManager({required super.logger}); List devices = []; - final Logger logger; - @override List get deviceDiscoverers { final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery(); diff --git a/packages/flutter_tools/test/general.shard/android/android_project_migration_test.dart b/packages/flutter_tools/test/general.shard/android/android_project_migration_test.dart index a6b9cfbe62..8722774497 100644 --- a/packages/flutter_tools/test/general.shard/android/android_project_migration_test.dart +++ b/packages/flutter_tools/test/general.shard/android/android_project_migration_test.dart @@ -9,9 +9,6 @@ import 'package:flutter_tools/src/android/gradle_utils.dart'; import 'package:flutter_tools/src/android/migrations/android_studio_java_gradle_conflict_migration.dart'; import 'package:flutter_tools/src/android/migrations/top_level_gradle_build_file_migration.dart'; import 'package:flutter_tools/src/base/logger.dart'; -import 'package:flutter_tools/src/base/os.dart'; -import 'package:flutter_tools/src/base/platform.dart'; -import 'package:flutter_tools/src/base/process.dart'; import 'package:flutter_tools/src/base/version.dart'; import 'package:flutter_tools/src/project.dart'; import 'package:test/fake.dart'; @@ -287,8 +284,3 @@ class FakeErroringJava extends FakeJava { throw Exception('How did this happen?'); } } - -class FakeFileSystem extends Fake implements FileSystem {} -class FakeProcessUtils extends Fake implements ProcessUtils {} -class FakePlatform extends Fake implements Platform {} -class FakeOperatingSystemUtils extends Fake implements OperatingSystemUtils {} diff --git a/packages/flutter_tools/test/general.shard/android/android_sdk_test.dart b/packages/flutter_tools/test/general.shard/android/android_sdk_test.dart index b70b3435cc..9e7ed95ea2 100644 --- a/packages/flutter_tools/test/general.shard/android/android_sdk_test.dart +++ b/packages/flutter_tools/test/general.shard/android/android_sdk_test.dart @@ -4,12 +4,10 @@ import 'package:file/memory.dart'; import 'package:flutter_tools/src/android/android_sdk.dart'; -import 'package:flutter_tools/src/android/android_studio.dart'; import 'package:flutter_tools/src/base/config.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/platform.dart'; import 'package:flutter_tools/src/globals.dart' as globals; -import 'package:test/fake.dart'; import '../../src/common.dart'; import '../../src/context.dart'; @@ -424,13 +422,3 @@ ro.build.version.incremental=1624448 ro.build.version.sdk=24 ro.build.version.codename=REL '''; - -class FakeAndroidStudioWithJdk extends Fake implements AndroidStudio { - @override - String? get javaPath => '/fake/android_studio/java/path/'; -} - -class FakeAndroidStudioWithoutJdk extends Fake implements AndroidStudio { - @override - String? get javaPath => null; -} diff --git a/packages/flutter_tools/test/general.shard/artifact_updater_test.dart b/packages/flutter_tools/test/general.shard/artifact_updater_test.dart index 2fc87d47ef..96780ec396 100644 --- a/packages/flutter_tools/test/general.shard/artifact_updater_test.dart +++ b/packages/flutter_tools/test/general.shard/artifact_updater_test.dart @@ -371,7 +371,7 @@ void main() { }); testWithoutContext('ArtifactUpdater will de-download a file if unzipping fails on windows', () async { - final FakeOperatingSystemUtils operatingSystemUtils = FakeOperatingSystemUtils(windows: true); + final FakeOperatingSystemUtils operatingSystemUtils = FakeOperatingSystemUtils(); final MemoryFileSystem fileSystem = MemoryFileSystem.test(); final BufferLogger logger = BufferLogger.test(); final ArtifactUpdater artifactUpdater = ArtifactUpdater( @@ -421,7 +421,7 @@ void main() { }); testWithoutContext('ArtifactUpdater will bail if unzipping fails more than twice on Windows', () async { - final FakeOperatingSystemUtils operatingSystemUtils = FakeOperatingSystemUtils(windows: true); + final FakeOperatingSystemUtils operatingSystemUtils = FakeOperatingSystemUtils(); final MemoryFileSystem fileSystem = MemoryFileSystem.test(); final BufferLogger logger = BufferLogger.test(); final ArtifactUpdater artifactUpdater = ArtifactUpdater( @@ -529,10 +529,7 @@ void main() { } class FakeOperatingSystemUtils extends Fake implements OperatingSystemUtils { - FakeOperatingSystemUtils({this.windows = false}); - int failures = 0; - final bool windows; /// A mapping of zip [file] paths to callbacks that receive the [targetDirectory]. /// diff --git a/packages/flutter_tools/test/general.shard/ios/simulators_test.dart b/packages/flutter_tools/test/general.shard/ios/simulators_test.dart index cefad2011d..e28578305e 100644 --- a/packages/flutter_tools/test/general.shard/ios/simulators_test.dart +++ b/packages/flutter_tools/test/general.shard/ios/simulators_test.dart @@ -1204,7 +1204,7 @@ class FakeSimControl extends Fake implements SimControl { @override Future launch(String deviceId, String appIdentifier, [ List? launchArgs ]) async { - requests.add(LaunchRequest(deviceId, appIdentifier, launchArgs)); + requests.add(LaunchRequest(appIdentifier, launchArgs)); return RunResult(ProcessResult(0, 0, '', ''), ['test']); } @@ -1215,9 +1215,8 @@ class FakeSimControl extends Fake implements SimControl { } class LaunchRequest { - const LaunchRequest(this.deviceId, this.appIdentifier, this.launchArgs); + const LaunchRequest(this.appIdentifier, this.launchArgs); - final String deviceId; final String appIdentifier; final List? launchArgs; } diff --git a/packages/flutter_tools/test/general.shard/terminal_handler_test.dart b/packages/flutter_tools/test/general.shard/terminal_handler_test.dart index 5992956b69..e234825ede 100644 --- a/packages/flutter_tools/test/general.shard/terminal_handler_test.dart +++ b/packages/flutter_tools/test/general.shard/terminal_handler_test.dart @@ -1496,7 +1496,6 @@ class FakeResidentCompiler extends Fake implements ResidentCompiler { } class TestRunner extends Fake implements ResidentRunner { bool hasHelpBeenPrinted = false; - String? receivedCommand; @override Future cleanupAfterSignal() async { } diff --git a/packages/flutter_tools/test/general.shard/web/devfs_web_test.dart b/packages/flutter_tools/test/general.shard/web/devfs_web_test.dart index f65db99ee4..e457408c05 100644 --- a/packages/flutter_tools/test/general.shard/web/devfs_web_test.dart +++ b/packages/flutter_tools/test/general.shard/web/devfs_web_test.dart @@ -1211,11 +1211,9 @@ class FakeShaderCompiler implements DevelopmentShaderCompiler { } class FakeDwds extends Fake implements Dwds { - FakeDwds(this.connectedAppsIterable) : + FakeDwds(Iterable connectedAppsIterable) : connectedApps = Stream.fromIterable(connectedAppsIterable); - final Iterable connectedAppsIterable; - @override final Stream connectedApps; diff --git a/packages/flutter_tools/test/general.shard/web/devices_test.dart b/packages/flutter_tools/test/general.shard/web/devices_test.dart index c5c9b9d4c8..06f4d0cfc7 100644 --- a/packages/flutter_tools/test/general.shard/web/devices_test.dart +++ b/packages/flutter_tools/test/general.shard/web/devices_test.dart @@ -394,12 +394,6 @@ void main() { class TestChromiumLauncher implements ChromiumLauncher { TestChromiumLauncher(); - bool _hasInstance = false; - void setInstance(Chromium chromium) { - _hasInstance = true; - currentCompleter.complete(chromium); - } - @override Completer currentCompleter = Completer(); @@ -417,7 +411,7 @@ class TestChromiumLauncher implements ChromiumLauncher { } @override - bool get hasChromeInstance => _hasInstance; + bool get hasChromeInstance => false; @override Future launch( diff --git a/packages/flutter_tools/test/general.shard/xcode_backend_test.dart b/packages/flutter_tools/test/general.shard/xcode_backend_test.dart index fe7bb29234..482e4ede33 100644 --- a/packages/flutter_tools/test/general.shard/xcode_backend_test.dart +++ b/packages/flutter_tools/test/general.shard/xcode_backend_test.dart @@ -234,11 +234,6 @@ class TestContext extends Context { String stdout = ''; String stderr = ''; - @override - bool existsDir(String path) { - return fileSystem.directory(path).existsSync(); - } - @override bool existsFile(String path) { return fileSystem.file(path).existsSync();