Some NNBD Test Conversion (#67558)

Just converting some test files to NNBD
diff --git a/packages/flutter/test/material/flat_button_test.dart b/packages/flutter/test/material/flat_button_test.dart
index 3e7bbc8..fb2457d 100644
--- a/packages/flutter/test/material/flat_button_test.dart
+++ b/packages/flutter/test/material/flat_button_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.
 
-// @dart = 2.8
-
 import 'package:flutter/material.dart';
 import 'package:flutter_test/flutter_test.dart';
 import 'package:flutter/gestures.dart';
@@ -38,10 +36,10 @@
     expect(material.elevation, 0.0);
     expect(material.shadowColor, null);
     expect(material.shape, RoundedRectangleBorder(borderRadius: BorderRadius.circular(2.0)));
-    expect(material.textStyle.color, const Color(0xdd000000));
-    expect(material.textStyle.fontFamily, 'Roboto');
-    expect(material.textStyle.fontSize, 14);
-    expect(material.textStyle.fontWeight, FontWeight.w500);
+    expect(material.textStyle?.color, const Color(0xdd000000));
+    expect(material.textStyle?.fontFamily, 'Roboto');
+    expect(material.textStyle?.fontSize, 14);
+    expect(material.textStyle?.fontWeight, FontWeight.w500);
     expect(material.type, MaterialType.transparency);
 
     final Offset center = tester.getCenter(find.byType(FlatButton));
@@ -58,10 +56,10 @@
     expect(material.elevation, 0.0);
     expect(material.shadowColor, null);
     expect(material.shape, RoundedRectangleBorder(borderRadius: BorderRadius.circular(2.0)));
-    expect(material.textStyle.color, const Color(0xdd000000));
-    expect(material.textStyle.fontFamily, 'Roboto');
-    expect(material.textStyle.fontSize, 14);
-    expect(material.textStyle.fontWeight, FontWeight.w500);
+    expect(material.textStyle?.color, const Color(0xdd000000));
+    expect(material.textStyle?.fontFamily, 'Roboto');
+    expect(material.textStyle?.fontSize, 14);
+    expect(material.textStyle?.fontWeight, FontWeight.w500);
     expect(material.type, MaterialType.transparency);
 
     // Disabled FlatButton
@@ -83,10 +81,10 @@
     expect(material.elevation, 0.0);
     expect(material.shadowColor, null);
     expect(material.shape, RoundedRectangleBorder(borderRadius: BorderRadius.circular(2.0)));
-    expect(material.textStyle.color, const Color(0x61000000));
-    expect(material.textStyle.fontFamily, 'Roboto');
-    expect(material.textStyle.fontSize, 14);
-    expect(material.textStyle.fontWeight, FontWeight.w500);
+    expect(material.textStyle?.color, const Color(0x61000000));
+    expect(material.textStyle?.fontFamily, 'Roboto');
+    expect(material.textStyle?.fontSize, 14);
+    expect(material.textStyle?.fontWeight, FontWeight.w500);
     expect(material.type, MaterialType.transparency);
   });
 
@@ -171,9 +169,9 @@
         MaterialState.focused,
       };
       if (states.any(interactiveStates.contains)) {
-        return Colors.blue[900];
+        return Colors.blue[900]!;
       }
-      return Colors.blue[800];
+      return Colors.blue[800]!;
     }
 
     await tester.pumpWidget(
@@ -260,8 +258,8 @@
       ),
     );
 
-    Color textColor() {
-      return tester.renderObject<RenderParagraph>(find.text('FlatButton')).text.style.color;
+    Color? textColor() {
+      return tester.renderObject<RenderParagraph>(find.text('FlatButton')).text.style?.color;
     }
 
     // Default, not disabled.
@@ -329,7 +327,7 @@
       ),
     );
 
-    Color iconColor() => _iconStyle(tester, Icons.add).color;
+    Color? iconColor() => _iconStyle(tester, Icons.add)?.color;
     // Default, not disabled.
     expect(iconColor(), equals(defaultColor));
 
@@ -386,8 +384,8 @@
       ),
     );
 
-    Color textColor() {
-      return tester.renderObject<RenderParagraph>(find.text('FlatButton')).text.style.color;
+    Color? textColor() {
+      return tester.renderObject<RenderParagraph>(find.text('FlatButton')).text.style?.color;
     }
 
     // Disabled.
@@ -460,7 +458,7 @@
     addTearDown(gesture.removePointer);
 
     await tester.pump();
-    expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.text);
+    expect(RendererBinding.instance?.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.text);
 
     await tester.pumpWidget(
       Directionality(
@@ -476,7 +474,7 @@
       ),
     );
 
-    expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.text);
+    expect(RendererBinding.instance?.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.text);
 
     // Test default cursor
     await tester.pumpWidget(
@@ -492,7 +490,7 @@
       ),
     );
 
-    expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.click);
+    expect(RendererBinding.instance?.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.click);
 
     // Test default cursor when disabled
     await tester.pumpWidget(
@@ -508,7 +506,7 @@
       ),
     );
 
-    expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic);
+    expect(RendererBinding.instance?.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic);
   });
 
   testWidgets('Does FlatButton work with focus', (WidgetTester tester) async {
@@ -527,7 +525,7 @@
       ),
     );
 
-    WidgetsBinding.instance.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional;
+    WidgetsBinding.instance?.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional;
     focusNode.requestFocus();
     await tester.pumpAndSettle();
 
@@ -695,7 +693,7 @@
     bool wasPressed;
     Finder flatButton;
 
-    Widget buildFrame({ VoidCallback onPressed, VoidCallback onLongPress }) {
+    Widget buildFrame({ VoidCallback? onPressed, VoidCallback? onLongPress }) {
       return Directionality(
         textDirection: TextDirection.ltr,
         child: FlatButton(
@@ -829,7 +827,7 @@
       const double buttonHeight = 100;
       const double buttonDefaultMinHeight = 36.0;
 
-      Future<void> buildWidget({double buttonHeight}) {
+      Future<void> buildWidget({double? buttonHeight}) {
         return tester.pumpWidget(
           Directionality(
             textDirection: TextDirection.ltr,
@@ -859,7 +857,7 @@
       const double buttonMinWidth = 100;
       const double buttonDefaultMinWidth = 88.0;
 
-      Future<void> buildWidget({double buttonMinWidth}) {
+      Future<void> buildWidget({double? buttonMinWidth}) {
         return tester.pumpWidget(
           Directionality(
             textDirection: TextDirection.ltr,
@@ -886,7 +884,7 @@
     });
 }
 
-TextStyle _iconStyle(WidgetTester tester, IconData icon) {
+TextStyle? _iconStyle(WidgetTester tester, IconData icon) {
   final RichText iconRichText = tester.widget<RichText>(
     find.descendant(of: find.byIcon(icon), matching: find.byType(RichText)),
   );
diff --git a/packages/flutter/test/material/flexible_space_bar_collapse_mode_test.dart b/packages/flutter/test/material/flexible_space_bar_collapse_mode_test.dart
index d51542a..40f3759 100644
--- a/packages/flutter/test/material/flexible_space_bar_collapse_mode_test.dart
+++ b/packages/flutter/test/material/flexible_space_bar_collapse_mode_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.
 
-// @dart = 2.8
-
 import 'package:flutter/foundation.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter_test/flutter_test.dart';
diff --git a/packages/flutter/test/material/flexible_space_bar_stretch_mode_test.dart b/packages/flutter/test/material/flexible_space_bar_stretch_mode_test.dart
index 694d676..09077fe 100644
--- a/packages/flutter/test/material/flexible_space_bar_stretch_mode_test.dart
+++ b/packages/flutter/test/material/flexible_space_bar_stretch_mode_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.
 
-// @dart = 2.8
-
 import 'package:flutter/material.dart';
 import 'package:flutter/rendering.dart';
 import 'package:flutter_test/flutter_test.dart';
diff --git a/packages/flutter/test/material/flexible_space_bar_test.dart b/packages/flutter/test/material/flexible_space_bar_test.dart
index 879c2dd..398b083 100644
--- a/packages/flutter/test/material/flexible_space_bar_test.dart
+++ b/packages/flutter/test/material/flexible_space_bar_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.
 
-// @dart = 2.8
-
 import 'package:flutter/material.dart';
 import 'package:flutter_test/flutter_test.dart';
 
@@ -110,9 +108,8 @@
     final Text textWidget = actionTextBox.widget as Text;
     final DefaultTextStyle defaultTextStyle = DefaultTextStyle.of(actionTextBox);
 
-    TextStyle effectiveStyle = textWidget.style;
-    effectiveStyle = defaultTextStyle.style.merge(textWidget.style);
-    expect(effectiveStyle.color.alpha, 128); // Which is alpha of .5
+    final TextStyle effectiveStyle = defaultTextStyle.style.merge(textWidget.style);
+    expect(effectiveStyle.color?.alpha, 128); // Which is alpha of .5
 
     // We drag up to fully collapse the space bar.
     await tester.drag(find.byType(Container).first, const Offset(0, -400.0));
@@ -391,13 +388,13 @@
   testWidgets('FlexibleSpaceBar sets width constraints for the title', (WidgetTester tester) async {
     const double titleFontSize = 20.0;
     const double height = 300.0;
-    double width;
+    late double width;
     await tester.pumpWidget(
       MaterialApp(
         home: Scaffold(
           body: Builder(
             builder: (BuildContext context) {
-              width = MediaQuery.of(context).size.width;
+              width = MediaQuery.of(context)!.size.width;
               return CustomScrollView(
                 slivers: <Widget>[
                   SliverAppBar(
@@ -439,7 +436,7 @@
   });
 
   testWidgets('FlexibleSpaceBar test titlePadding defaults', (WidgetTester tester) async {
-    Widget buildFrame(TargetPlatform platform, bool centerTitle) {
+    Widget buildFrame(TargetPlatform platform, bool? centerTitle) {
       return MaterialApp(
         theme: ThemeData(platform: platform),
         home: Scaffold(
@@ -489,7 +486,7 @@
   });
 
   testWidgets('FlexibleSpaceBar test titlePadding override', (WidgetTester tester) async {
-    Widget buildFrame(TargetPlatform platform, bool centerTitle) {
+    Widget buildFrame(TargetPlatform platform, bool? centerTitle) {
       return MaterialApp(
         theme: ThemeData(platform: platform),
         home: Scaffold(
@@ -560,7 +557,7 @@
 class TestDelegate extends SliverPersistentHeaderDelegate {
 
   const TestDelegate({
-    this.settings,
+    required this.settings,
   });
 
   final FlexibleSpaceBarSettings settings;
diff --git a/packages/flutter/test/material/floating_action_button_location_test.dart b/packages/flutter/test/material/floating_action_button_location_test.dart
index f240d10..ac61ca6 100644
--- a/packages/flutter/test/material/floating_action_button_location_test.dart
+++ b/packages/flutter/test/material/floating_action_button_location_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.
 
-// @dart = 2.8
-
 import 'dart:math';
 
 import 'package:flutter/foundation.dart';
@@ -79,11 +77,11 @@
     });
 
     group('interrupts in-progress animations without jumps', () {
-      _GeometryListener geometryListener;
-      ScaffoldGeometry geometry;
-      _GeometryListenerState listenerState;
-      Size previousRect;
-      Iterable<double> previousRotations;
+      _GeometryListener? geometryListener;
+      ScaffoldGeometry? geometry;
+      _GeometryListenerState? listenerState;
+      Size? previousRect;
+      Iterable<double>? previousRotations;
 
       // The maximum amounts we expect the fab width and height to change
       // during one step of a transition.
@@ -100,13 +98,13 @@
         // Measure the delta in width and height of the fab, and check that it never grows
         // by more than the expected maximum deltas.
         void check() {
-          geometry = listenerState.cache.value;
-          final Size currentRect = geometry.floatingActionButtonArea?.size;
+          geometry = listenerState?.cache.value;
+          final Size? currentRect = geometry?.floatingActionButtonArea?.size;
           // Measure the delta in width and height of the rect, and check that
           // it never grows by more than a safe amount.
           if (previousRect != null && currentRect != null) {
-            final double deltaWidth = currentRect.width - previousRect.width;
-            final double deltaHeight = currentRect.height - previousRect.height;
+            final double deltaWidth = currentRect.width - previousRect!.width;
+            final double deltaHeight = currentRect.height - previousRect!.height;
             expect(
               deltaWidth.abs(),
               lessThanOrEqualTo(maxDeltaWidth),
@@ -135,15 +133,15 @@
           final Iterable<double> currentRotations = rotationTransitions.map(
               (RotationTransition t) => t.turns.value);
 
-          if (previousRotations != null && previousRotations.isNotEmpty
+          if (previousRotations != null && previousRotations!.isNotEmpty
               && currentRotations != null && currentRotations.isNotEmpty
               && previousRect != null && currentRect != null) {
             final List<double> deltas = <double>[];
             for (final double currentRotation in currentRotations) {
-              double minDelta;
-              for (final double previousRotation in previousRotations) {
+              late double minDelta;
+              for (final double previousRotation in previousRotations!) {
                 final double delta = (previousRotation - currentRotation).abs();
-                minDelta ??= delta;
+                minDelta = delta;
                 minDelta = min(delta, minDelta);
               }
               deltas.add(minDelta);
@@ -161,7 +159,7 @@
         }
 
         listenerState = tester.state(find.byType(_GeometryListener));
-        listenerState.geometryListenable.addListener(check);
+        listenerState!.geometryListenable!.addListener(check);
       }
 
       setUp(() {
@@ -649,7 +647,7 @@
               builder: (BuildContext context) {
                 return FloatingActionButton(
                   onPressed: () {
-                    ScaffoldMessenger.of(context).showSnackBar(
+                    ScaffoldMessenger.of(context)!.showSnackBar(
                       const SnackBar(content: Text('Snacky!')),
                     );
                   },
@@ -677,10 +675,10 @@
     Future<void> _runFloatTests(
       WidgetTester tester,
       FloatingActionButtonLocation location, {
-      Rect defaultRect,
-      Rect bottomNavigationBarRect,
-      Rect bottomSheetRect,
-      Rect snackBarRect,
+      required Rect defaultRect,
+      required Rect bottomNavigationBarRect,
+      required Rect bottomSheetRect,
+      required Rect snackBarRect,
       bool mini = false,
     }) async  {
       const double keyboardHeight = 200.0;
@@ -1050,10 +1048,10 @@
     Future<void> _runDockedTests(
       WidgetTester tester,
       FloatingActionButtonLocation location, {
-      Rect defaultRect,
-      Rect bottomNavigationBarRect,
-      Rect bottomSheetRect,
-      Rect snackBarRect,
+      required Rect defaultRect,
+      required Rect bottomNavigationBarRect,
+      required Rect bottomSheetRect,
+      required Rect snackBarRect,
       bool mini = false,
     }) async  {
       const double keyboardHeight = 200.0;
@@ -1385,8 +1383,8 @@
     Future<void> _runTopTests(
       WidgetTester tester,
       FloatingActionButtonLocation location, {
-      Rect defaultRect,
-      Rect appBarRect,
+      required Rect defaultRect,
+      required Rect appBarRect,
       bool mini = false,
     }) async  {
       const double viewPadding = 50.0;
@@ -1508,8 +1506,8 @@
   }
 
   int numNotifications = 0;
-  ValueListenable<ScaffoldGeometry> geometryListenable;
-  _GeometryCachePainter cache;
+  ValueListenable<ScaffoldGeometry>? geometryListenable;
+  late _GeometryCachePainter cache;
 
   @override
   void didChangeDependencies() {
@@ -1519,11 +1517,11 @@
       return;
 
     if (geometryListenable != null)
-      geometryListenable.removeListener(onGeometryChanged);
+      geometryListenable!.removeListener(onGeometryChanged);
 
     geometryListenable = newListenable;
-    geometryListenable.addListener(onGeometryChanged);
-    cache = _GeometryCachePainter(geometryListenable);
+    geometryListenable!.addListener(onGeometryChanged);
+    cache = _GeometryCachePainter(geometryListenable!);
   }
 
   void onGeometryChanged() {
@@ -1545,7 +1543,7 @@
 Widget _singleFabScaffold(
   FloatingActionButtonLocation location,
   {
-    FloatingActionButtonAnimator animator,
+    FloatingActionButtonAnimator? animator,
     bool mini = false,
     TextDirection textDirection = TextDirection.ltr,
   }
@@ -1589,7 +1587,7 @@
 
   final ValueListenable<ScaffoldGeometry> geometryListenable;
 
-  ScaffoldGeometry value;
+  late ScaffoldGeometry value;
   @override
   void paint(Canvas canvas, Size size) {
     value = geometryListenable.value;
@@ -1602,15 +1600,15 @@
 }
 
 Widget buildFrame({
-  FloatingActionButton fab = const FloatingActionButton(
+  FloatingActionButton? fab = const FloatingActionButton(
     onPressed: null,
     child: Text('1'),
   ),
-  FloatingActionButtonLocation location,
-  _GeometryListener listener,
+  FloatingActionButtonLocation? location,
+  _GeometryListener? listener,
   TextDirection textDirection = TextDirection.ltr,
   EdgeInsets viewInsets = const EdgeInsets.only(bottom: 200.0),
-  Widget bab,
+  Widget? bab,
 }) {
   return Localizations(
     locale: const Locale('en', 'us'),
@@ -1677,17 +1675,17 @@
 
 class _LinearMovementFabAnimator extends FloatingActionButtonAnimator {
   @override
-  Offset getOffset({@required Offset begin, @required Offset end, @required double progress}) {
-    return Offset.lerp(begin, end, progress);
+  Offset getOffset({required Offset begin, required Offset end, required double progress}) {
+    return Offset.lerp(begin, end, progress)!;
   }
 
   @override
-  Animation<double> getScaleAnimation({@required Animation<double> parent}) {
+  Animation<double> getScaleAnimation({required Animation<double> parent}) {
     return const AlwaysStoppedAnimation<double>(1.0);
   }
 
   @override
-  Animation<double> getRotationAnimation({@required Animation<double> parent}) {
+  Animation<double> getRotationAnimation({required Animation<double> parent}) {
     return const AlwaysStoppedAnimation<double>(1.0);
   }
 }
diff --git a/packages/flutter/test/material/floating_action_button_test.dart b/packages/flutter/test/material/floating_action_button_test.dart
index 02da70d..91c0396 100644
--- a/packages/flutter/test/material/floating_action_button_test.dart
+++ b/packages/flutter/test/material/floating_action_button_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.
 
-// @dart = 2.8
-
 @TestOn('!chrome') // whole file needs triage.
 import 'dart:ui';
 
@@ -109,8 +107,8 @@
     expect(find.text('Add'), findsNothing);
 
     // Test hover for tooltip.
-    TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse);
-    await gesture.addPointer();
+    TestGesture? gesture = await tester.createGesture(kind: PointerDeviceKind.mouse);
+    await gesture!.addPointer();
     addTearDown(() => gesture?.removePointer());
     await gesture.moveTo(tester.getCenter(find.byType(FloatingActionButton)));
     await tester.pumpAndSettle();
@@ -146,8 +144,8 @@
     expect(find.text('Add'), findsNothing);
 
     // Test hover for tooltip.
-    TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse);
-    await gesture.addPointer();
+    TestGesture? gesture = await tester.createGesture(kind: PointerDeviceKind.mouse);
+    await gesture!.addPointer();
     addTearDown(() => gesture?.removePointer());
     await tester.pumpAndSettle();
     await gesture.moveTo(tester.getCenter(find.byType(FloatingActionButton)));
@@ -472,7 +470,7 @@
   });
 
   testWidgets('Floating Action Button heroTag', (WidgetTester tester) async {
-    BuildContext theContext;
+    late BuildContext theContext;
     await tester.pumpWidget(
       MaterialApp(
         home: Scaffold(
@@ -495,7 +493,7 @@
   });
 
   testWidgets('Floating Action Button heroTag - with duplicate', (WidgetTester tester) async {
-    BuildContext theContext;
+    late BuildContext theContext;
     await tester.pumpWidget(
       MaterialApp(
         home: Scaffold(
@@ -519,7 +517,7 @@
   });
 
   testWidgets('Floating Action Button heroTag - with duplicate', (WidgetTester tester) async {
-    BuildContext theContext;
+    late BuildContext theContext;
     await tester.pumpWidget(
       MaterialApp(
         home: Scaffold(
@@ -773,7 +771,7 @@
 
     await tester.pump();
 
-    expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.text);
+    expect(RendererBinding.instance!.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.text);
 
     await tester.pumpWidget(
       MaterialApp(
@@ -791,7 +789,7 @@
     );
 
     await gesture.moveTo(tester.getCenter(find.byType(FloatingActionButton)));
-    expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.text);
+    expect(RendererBinding.instance!.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.text);
 
     // Test default cursor
     await tester.pumpWidget(
@@ -808,7 +806,7 @@
       ),
     );
 
-    expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.click);
+    expect(RendererBinding.instance!.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.click);
 
     // Test default cursor when disabled
     await tester.pumpWidget(
@@ -825,7 +823,7 @@
       ),
     );
 
-    expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic);
+    expect(RendererBinding.instance!.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic);
   });
 
   testWidgets('Floating Action Button has no clip by default', (WidgetTester tester) async {
@@ -882,7 +880,7 @@
     final RichText iconRichText = tester.widget<RichText>(
       find.descendant(of: find.byIcon(Icons.access_alarm), matching: find.byType(RichText)),
     );
-    expect(iconRichText.text.style.color, foregroundColor);
+    expect(iconRichText.text.style!.color, foregroundColor);
   });
 
   testWidgets('FloatingActionButton uses custom splash color', (WidgetTester tester) async {
diff --git a/packages/flutter/test/material/floating_action_button_theme_test.dart b/packages/flutter/test/material/floating_action_button_theme_test.dart
index 1feafb4..85af985 100644
--- a/packages/flutter/test/material/floating_action_button_theme_test.dart
+++ b/packages/flutter/test/material/floating_action_button_theme_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.
 
-// @dart = 2.8
-
 import 'package:flutter/foundation.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/rendering.dart';
@@ -28,7 +26,7 @@
     // The color scheme values are guaranteed to be non null since the default
     // [ThemeData] creates it with [ColorScheme.fromSwatch].
     expect(_getRawMaterialButton(tester).fillColor, ThemeData().colorScheme.secondary);
-    expect(_getRichText(tester).text.style.color, ThemeData().colorScheme.onSecondary);
+    expect(_getRichText(tester).text.style!.color, ThemeData().colorScheme.onSecondary);
 
     // These defaults come directly from the [FloatingActionButton].
     expect(_getRawMaterialButton(tester).elevation, 6);
@@ -67,7 +65,7 @@
     ));
 
     expect(_getRawMaterialButton(tester).fillColor, backgroundColor);
-    expect(_getRichText(tester).text.style.color, foregroundColor);
+    expect(_getRichText(tester).text.style!.color, foregroundColor);
     expect(_getRawMaterialButton(tester).elevation, elevation);
     expect(_getRawMaterialButton(tester).disabledElevation, disabledElevation);
     expect(_getRawMaterialButton(tester).highlightElevation, highlightElevation);
@@ -112,7 +110,7 @@
     ));
 
     expect(_getRawMaterialButton(tester).fillColor, backgroundColor);
-    expect(_getRichText(tester).text.style.color, foregroundColor);
+    expect(_getRichText(tester).text.style!.color, foregroundColor);
     expect(_getRawMaterialButton(tester).elevation, elevation);
     expect(_getRawMaterialButton(tester).disabledElevation, disabledElevation);
     expect(_getRawMaterialButton(tester).highlightElevation, highlightElevation);
diff --git a/packages/flutter/test/material/grid_title_test.dart b/packages/flutter/test/material/grid_title_test.dart
index d1bd664..0e90d90 100644
--- a/packages/flutter/test/material/grid_title_test.dart
+++ b/packages/flutter/test/material/grid_title_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.
 
-// @dart = 2.8
-
 import 'package:flutter_test/flutter_test.dart';
 import 'package:flutter/material.dart';
 
diff --git a/packages/flutter/test/material/icon_button_test.dart b/packages/flutter/test/material/icon_button_test.dart
index ac65041..754842e 100644
--- a/packages/flutter/test/material/icon_button_test.dart
+++ b/packages/flutter/test/material/icon_button_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.
 
-// @dart = 2.8
-
 import 'dart:ui';
 
 import 'package:flutter/material.dart';
@@ -23,7 +21,7 @@
 }
 
 void main() {
-  MockOnPressedFunction mockOnPressedFunction;
+  late MockOnPressedFunction mockOnPressedFunction;
 
   setUp(() {
     mockOnPressedFunction = MockOnPressedFunction();
@@ -537,14 +535,14 @@
   });
 
   group('feedback', () {
-    FeedbackTester feedback;
+    late FeedbackTester feedback;
 
     setUp(() {
       feedback = FeedbackTester();
     });
 
     tearDown(() {
-      feedback?.dispose();
+      feedback.dispose();
     });
 
     testWidgets('IconButton with disabled feedback', (WidgetTester tester) async {
@@ -664,7 +662,7 @@
 
     await tester.pump();
 
-    expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.forbidden);
+    expect(RendererBinding.instance!.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.forbidden);
 
     // Test default is click
     await tester.pumpWidget(
@@ -681,11 +679,11 @@
       ),
     );
 
-    expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.click);
+    expect(RendererBinding.instance!.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.click);
   });
 }
 
-Widget wrap({ Widget child }) {
+Widget wrap({ required Widget child }) {
   return FocusTraversalGroup(
     policy: ReadingOrderTraversalPolicy(),
     child: Directionality(
diff --git a/packages/flutter/test/material/icons_test.dart b/packages/flutter/test/material/icons_test.dart
index 2a1be8d..06a30a7 100644
--- a/packages/flutter/test/material/icons_test.dart
+++ b/packages/flutter/test/material/icons_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.
 
-// @dart = 2.8
-
 import 'package:flutter/material.dart';
 import 'package:flutter_test/flutter_test.dart';
 
diff --git a/packages/flutter/test/material/inherited_theme_test.dart b/packages/flutter/test/material/inherited_theme_test.dart
index d1f0c1d..83e7953 100644
--- a/packages/flutter/test/material/inherited_theme_test.dart
+++ b/packages/flutter/test/material/inherited_theme_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.
 
-// @dart = 2.8
-
 import 'package:flutter/material.dart';
 import 'package:flutter_test/flutter_test.dart';
 
@@ -19,12 +17,12 @@
       builder: (BuildContext context) {
         return Container(
           key: primaryContainerKey,
-          color: Theme.of(context).primaryColor,
+          color: Theme.of(context)!.primaryColor,
         );
       },
     );
 
-    BuildContext navigatorContext;
+    late BuildContext navigatorContext;
 
     Widget buildFrame() {
       return MaterialApp(
@@ -33,7 +31,7 @@
             builder: (BuildContext context) {
               navigatorContext = context;
               return Theme(
-                data: Theme.of(context).copyWith(primaryColor: primaryColor),
+                data: Theme.of(context)!.copyWith(primaryColor: primaryColor),
                 child: Builder( // Introduce a context so the shadow Theme is visible to captureAll().
                   builder: (BuildContext context) {
                     return Center(
@@ -43,7 +41,7 @@
                           ElevatedButton(
                             child: const Text('push unwrapped'),
                             onPressed: () {
-                              Navigator.of(context).push<void>(
+                              Navigator.of(context)!.push<void>(
                                 MaterialPageRoute<void>(
                                   // The primaryBox will see the default Theme when built.
                                   builder: (BuildContext _) => primaryBox,
@@ -54,7 +52,7 @@
                           ElevatedButton(
                             child: const Text('push wrapped'),
                             onPressed: () {
-                              Navigator.of(context).push<void>(
+                              Navigator.of(context)!.push<void>(
                                 MaterialPageRoute<void>(
                                   // Capture the shadow Theme.
                                   builder: (BuildContext _) => InheritedTheme.captureAll(context, primaryBox),
@@ -75,7 +73,7 @@
     }
 
     Color containerColor() {
-      return tester.widget<Container>(find.byKey(primaryContainerKey)).color;
+      return tester.widget<Container>(find.byKey(primaryContainerKey)).color!;
     }
 
     await tester.pumpWidget(buildFrame());
@@ -86,7 +84,7 @@
     await tester.pumpAndSettle(); // route animation
     expect(containerColor(), primaryColor);
 
-    Navigator.of(navigatorContext).pop();
+    Navigator.of(navigatorContext)!.pop();
     await tester.pumpAndSettle(); // route animation
 
     // Show the route which contains primaryBox
@@ -133,7 +131,7 @@
     TextStyle itemTextStyle(String text) {
       return tester.widget<RichText>(
         find.descendant(of: find.text(text), matching: find.byType(RichText)),
-      ).text.style;
+      ).text.style!;
     }
 
     await tester.pumpWidget(buildFrame());
@@ -176,7 +174,7 @@
       ],
     );
 
-    BuildContext navigatorContext;
+    late BuildContext navigatorContext;
 
     Widget buildFrame() {
       return MaterialApp(
@@ -196,7 +194,7 @@
                       ElevatedButton(
                         child: const Text('push unwrapped'),
                         onPressed: () {
-                          Navigator.of(context).push<void>(
+                          Navigator.of(context)!.push<void>(
                             MaterialPageRoute<void>(
                               // The Banner will see the default BannerTheme when built.
                               builder: (BuildContext _) => banner,
@@ -207,7 +205,7 @@
                       ElevatedButton(
                         child: const Text('push wrapped'),
                         onPressed: () {
-                          Navigator.of(context).push<void>(
+                          Navigator.of(context)!.push<void>(
                             MaterialPageRoute<void>(
                               // Capture the shadow BannerTheme.
                               builder: (BuildContext _) => InheritedTheme.captureAll(context, banner),
@@ -228,7 +226,7 @@
     Color bannerColor() {
       return tester.widget<Container>(
         find.descendant(of: find.byType(MaterialBanner), matching: find.byType(Container)).first,
-      ).color;
+      ).color!;
     }
 
     TextStyle getTextStyle(String text) {
@@ -237,7 +235,7 @@
           of: find.text(text),
           matching: find.byType(RichText),
         ),
-      ).text.style;
+      ).text.style!;
     }
 
     await tester.pumpWidget(buildFrame());
@@ -249,7 +247,7 @@
     expect(getTextStyle('hello').fontSize, bannerFontSize);
     expect(getTextStyle('hello').color, bannerTextColor);
 
-    Navigator.of(navigatorContext).pop();
+    Navigator.of(navigatorContext)!.pop();
     await tester.pumpAndSettle(); // route animation
 
     await tester.tap(find.text('push unwrapped'));
@@ -265,7 +263,7 @@
     const double dividerThickness = 7;
     const Widget divider = Center(child: Divider());
 
-    BuildContext navigatorContext;
+    late BuildContext navigatorContext;
 
     Widget buildFrame() {
       return MaterialApp(
@@ -286,7 +284,7 @@
                       ElevatedButton(
                         child: const Text('push unwrapped'),
                         onPressed: () {
-                          Navigator.of(context).push<void>(
+                          Navigator.of(context)!.push<void>(
                             MaterialPageRoute<void>(
                               // The Banner will see the default BannerTheme when built.
                               builder: (BuildContext _) => divider,
@@ -297,7 +295,7 @@
                       ElevatedButton(
                         child: const Text('push wrapped'),
                         onPressed: () {
-                          Navigator.of(context).push<void>(
+                          Navigator.of(context)!.push<void>(
                             MaterialPageRoute<void>(
                               // Capture the shadow BannerTheme.
                               builder: (BuildContext _) => InheritedTheme.captureAll(context, divider),
@@ -319,7 +317,7 @@
       final BoxDecoration decoration = tester.widget<Container>(
         find.descendant(of: find.byType(Divider), matching: find.byType(Container)).first,
       ).decoration as BoxDecoration;
-      return decoration.border.bottom;
+      return decoration.border!.bottom;
     }
 
     await tester.pumpWidget(buildFrame());
@@ -331,7 +329,7 @@
     expect(dividerBorder().color, dividerColor);
     expect(dividerBorder().width, dividerThickness);
 
-    Navigator.of(navigatorContext).pop();
+    Navigator.of(navigatorContext)!.pop();
     await tester.pumpAndSettle(); // route animation
 
     await tester.tap(find.text('push unwrapped'));
@@ -371,7 +369,7 @@
       ),
     );
 
-    BuildContext navigatorContext;
+    late BuildContext navigatorContext;
 
     Widget buildFrame() {
       return MaterialApp(
@@ -390,7 +388,7 @@
                       ElevatedButton(
                         child: const Text('push unwrapped'),
                         onPressed: () {
-                          Navigator.of(context).push<void>(
+                          Navigator.of(context)!.push<void>(
                             MaterialPageRoute<void>(
                               // The Banner will see the default BannerTheme when built.
                               builder: (BuildContext _) => listTiles,
@@ -401,7 +399,7 @@
                       ElevatedButton(
                         child: const Text('push wrapped'),
                         onPressed: () {
-                          Navigator.of(context).push<void>(
+                          Navigator.of(context)!.push<void>(
                             MaterialPageRoute<void>(
                               // Capture the shadow BannerTheme.
                               builder: (BuildContext _) => InheritedTheme.captureAll(context, listTiles),
@@ -422,7 +420,7 @@
     TextStyle getTextStyle(String text) {
       return tester.widget<RichText>(
         find.descendant(of: find.text(text), matching: find.byType(RichText)),
-      ).text.style;
+      ).text.style!;
     }
 
     TextStyle getIconStyle(Key key) {
@@ -431,7 +429,7 @@
           of: find.byKey(key),
           matching: find.byType(RichText),
         ),
-      ).text.style;
+      ).text.style!;
     }
 
     await tester.pumpWidget(buildFrame());
@@ -444,7 +442,7 @@
     expect(getIconStyle(selectedIconKey).color, tileSelectedColor);
     expect(getIconStyle(unselectedIconKey).color, tileIconColor);
 
-    Navigator.of(navigatorContext).pop();
+    Navigator.of(navigatorContext)!.pop();
     await tester.pumpAndSettle(); // route animation
 
     await tester.tap(find.text('push unwrapped'));
@@ -469,7 +467,7 @@
       ),
     );
 
-    BuildContext navigatorContext;
+    late BuildContext navigatorContext;
 
     Widget buildFrame() {
       return MaterialApp(
@@ -490,7 +488,7 @@
                       ElevatedButton(
                         child: const Text('push unwrapped'),
                         onPressed: () {
-                          Navigator.of(context).push<void>(
+                          Navigator.of(context)!.push<void>(
                             MaterialPageRoute<void>(
                               // The slider will see the default SliderTheme when built.
                               builder: (BuildContext _) => slider,
@@ -501,7 +499,7 @@
                       ElevatedButton(
                         child: const Text('push wrapped'),
                         onPressed: () {
-                          Navigator.of(context).push<void>(
+                          Navigator.of(context)!.push<void>(
                             MaterialPageRoute<void>(
                               // Capture the shadow SliderTheme.
                               builder: (BuildContext _) => InheritedTheme.captureAll(context, slider),
@@ -528,7 +526,7 @@
     expect(sliderBox, paints..rrect(color: activeTrackColor)..rrect(color: inactiveTrackColor));
     expect(sliderBox, paints..circle(color: thumbColor));
 
-    Navigator.of(navigatorContext).pop();
+    Navigator.of(navigatorContext)!.pop();
     await tester.pumpAndSettle(); // route animation
 
     await tester.tap(find.text('push unwrapped'));
@@ -555,7 +553,7 @@
       ),
     );
 
-    BuildContext navigatorContext;
+    late BuildContext navigatorContext;
 
     Widget buildFrame() {
       return MaterialApp(
@@ -575,7 +573,7 @@
                       ElevatedButton(
                         child: const Text('push unwrapped'),
                         onPressed: () {
-                          Navigator.of(context).push<void>(
+                          Navigator.of(context)!.push<void>(
                             MaterialPageRoute<void>(
                               // The slider will see the default ToggleButtonsTheme when built.
                               builder: (BuildContext _) => toggleButtons,
@@ -586,7 +584,7 @@
                       ElevatedButton(
                         child: const Text('push wrapped'),
                         onPressed: () {
-                          Navigator.of(context).push<void>(
+                          Navigator.of(context)!.push<void>(
                             MaterialPageRoute<void>(
                               // Capture the shadow toggleButtons.
                               builder: (BuildContext _) => InheritedTheme.captureAll(context, toggleButtons),
@@ -607,7 +605,7 @@
     Color getTextColor(String text) {
       return tester.widget<RichText>(
         find.descendant(of: find.text(text), matching: find.byType(RichText)),
-      ).text.style.color;
+      ).text.style!.color!;
     }
 
     await tester.pumpWidget(buildFrame());
@@ -618,7 +616,7 @@
     expect(getTextColor('selected'), selectedButtonColor);
     expect(getTextColor('unselected'), buttonColor);
 
-    Navigator.of(navigatorContext).pop();
+    Navigator.of(navigatorContext)!.pop();
     await tester.pumpAndSettle(); // route animation
 
     await tester.tap(find.text('push unwrapped'));
@@ -644,7 +642,7 @@
       ),
     );
 
-    BuildContext navigatorContext;
+    late BuildContext navigatorContext;
 
     Widget buildFrame() {
       return MaterialApp(
@@ -664,7 +662,7 @@
                       RaisedButton(
                         child: const Text('push unwrapped'),
                         onPressed: () {
-                          Navigator.of(context).push<void>(
+                          Navigator.of(context)!.push<void>(
                             MaterialPageRoute<void>(
                               // The slider will see the default ButtonTheme when built.
                               builder: (BuildContext _) => buttons,
@@ -675,7 +673,7 @@
                       RaisedButton(
                         child: const Text('push wrapped'),
                         onPressed: () {
-                          Navigator.of(context).push<void>(
+                          Navigator.of(context)!.push<void>(
                             MaterialPageRoute<void>(
                               // Capture the shadow toggleButtons.
                               builder: (BuildContext _) => InheritedTheme.captureAll(context, buttons),
@@ -699,7 +697,7 @@
           of: find.widgetWithText(RawMaterialButton, text),
           matching: find.byType(Material),
         ),
-      ).color;
+      ).color!;
     }
 
     await tester.pumpWidget(buildFrame());
@@ -710,7 +708,7 @@
     expect(getButtonColor('disabled'), disabledButtonColor);
     expect(getButtonColor('enabled'), buttonColor);
 
-    Navigator.of(navigatorContext).pop();
+    Navigator.of(navigatorContext)!.pop();
     await tester.pumpAndSettle(); // route animation
 
     await tester.tap(find.text('push unwrapped'));
diff --git a/packages/flutter/test/material/ink_paint_test.dart b/packages/flutter/test/material/ink_paint_test.dart
index 127be46..01689c1 100644
--- a/packages/flutter/test/material/ink_paint_test.dart
+++ b/packages/flutter/test/material/ink_paint_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.
 
-// @dart = 2.8
-
 import 'package:flutter/material.dart';
 import 'package:flutter/rendering.dart';
 import 'package:flutter/services.dart';
diff --git a/packages/flutter/test/material/ink_splash_test.dart b/packages/flutter/test/material/ink_splash_test.dart
index bbece80..32a8681 100644
--- a/packages/flutter/test/material/ink_splash_test.dart
+++ b/packages/flutter/test/material/ink_splash_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.
 
-// @dart = 2.8
-
 import 'package:flutter/material.dart';
 import 'package:flutter_test/flutter_test.dart';
 
diff --git a/packages/flutter/test/material/ink_well_test.dart b/packages/flutter/test/material/ink_well_test.dart
index 24800e0..29b1b10 100644
--- a/packages/flutter/test/material/ink_well_test.dart
+++ b/packages/flutter/test/material/ink_well_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.
 
-// @dart = 2.8
-
 import 'package:flutter/material.dart';
 import 'package:flutter/rendering.dart';
 import 'package:flutter_test/flutter_test.dart';
@@ -400,7 +398,7 @@
       ),
     );
 
-    expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.click);
+    expect(RendererBinding.instance!.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.click);
 
     // Test default of InkWell()
     await tester.pumpWidget(
@@ -417,7 +415,7 @@
       ),
     );
 
-    expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.click);
+    expect(RendererBinding.instance!.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.click);
 
     // Test disabled
     await tester.pumpWidget(
@@ -432,7 +430,7 @@
       ),
     );
 
-    expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic);
+    expect(RendererBinding.instance!.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic);
 
     // Test default of InkResponse()
     await tester.pumpWidget(
@@ -449,7 +447,7 @@
       ),
     );
 
-    expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.click);
+    expect(RendererBinding.instance!.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.click);
 
     // Test disabled
     await tester.pumpWidget(
@@ -464,18 +462,18 @@
       ),
     );
 
-    expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic);
+    expect(RendererBinding.instance!.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic);
   });
 
   group('feedback', () {
-    FeedbackTester feedback;
+    late FeedbackTester feedback;
 
     setUp(() {
       feedback = FeedbackTester();
     });
 
     tearDown(() {
-      feedback?.dispose();
+      feedback.dispose();
     });
 
     testWidgets('enabled (default)', (WidgetTester tester) async {
@@ -740,7 +738,7 @@
   testWidgets('When ink wells are nested, only the inner one is triggered by tap splash', (WidgetTester tester) async {
     final GlobalKey middleKey = GlobalKey();
     final GlobalKey innerKey = GlobalKey();
-    Widget paddedInkWell({Key key, Widget child}) {
+    Widget paddedInkWell({Key? key, Widget? child}) {
       return InkWell(
         key: key,
         onTap: () {},
@@ -769,7 +767,7 @@
         ),
       ),
     );
-    final MaterialInkController material = Material.of(tester.element(find.byKey(innerKey)));
+    final MaterialInkController material = Material.of(tester.element(find.byKey(innerKey)))!;
 
     // Press
     final TestGesture gesture = await tester.startGesture(tester.getCenter(find.byKey(innerKey)), pointer: 1);
@@ -806,7 +804,7 @@
   testWidgets('Reparenting parent should allow both inkwells to show splash afterwards', (WidgetTester tester) async {
     final GlobalKey middleKey = GlobalKey();
     final GlobalKey innerKey = GlobalKey();
-    Widget paddedInkWell({Key key, Widget child}) {
+    Widget paddedInkWell({Key? key, Widget? child}) {
       return InkWell(
         key: key,
         onTap: () {},
@@ -842,7 +840,7 @@
         ),
       ),
     );
-    final MaterialInkController material = Material.of(tester.element(find.byKey(innerKey)));
+    final MaterialInkController material = Material.of(tester.element(find.byKey(innerKey)))!;
 
     // Press
     final TestGesture gesture = await tester.startGesture(tester.getCenter(find.byKey(innerKey)), pointer: 1);
@@ -894,7 +892,7 @@
   testWidgets('Parent inkwell does not block child inkwells from splashes', (WidgetTester tester) async {
     final GlobalKey middleKey = GlobalKey();
     final GlobalKey innerKey = GlobalKey();
-    Widget paddedInkWell({Key key, Widget child}) {
+    Widget paddedInkWell({Key? key, Widget? child}) {
       return InkWell(
         key: key,
         onTap: () {},
@@ -923,7 +921,7 @@
         ),
       ),
     );
-    final MaterialInkController material = Material.of(tester.element(find.byKey(innerKey)));
+    final MaterialInkController material = Material.of(tester.element(find.byKey(innerKey)))!;
 
     // Press middle
     await tester.startGesture(tester.getTopLeft(find.byKey(middleKey)) + const Offset(1, 1), pointer: 1);
@@ -983,7 +981,7 @@
         ),
       ),
     );
-    final MaterialInkController material = Material.of(tester.element(find.byKey(leftKey)));
+    final MaterialInkController material = Material.of(tester.element(find.byKey(leftKey)))!;
 
     final Offset parentPosition = tester.getTopLeft(find.byKey(parentKey)) + const Offset(1, 1);
 
@@ -1032,10 +1030,10 @@
     final GlobalKey rightKey = GlobalKey();
 
     Widget doubleInkWellRow({
-      double leftWidth,
-      double rightWidth,
-      Widget leftChild,
-      Widget rightChild,
+      required double leftWidth,
+      required double rightWidth,
+      Widget? leftChild,
+      Widget? rightChild,
     }) {
       return Material(
         child: Directionality(
@@ -1095,7 +1093,7 @@
         ),
       ),
     );
-    final MaterialInkController material = Material.of(tester.element(find.byKey(innerKey)));
+    final MaterialInkController material = Material.of(tester.element(find.byKey(innerKey)))!;
 
     // Press inner
     final TestGesture gesture = await tester.startGesture(const Offset(100, 50), pointer: 1);
@@ -1169,7 +1167,7 @@
         ),
       ),
     );
-    final MaterialInkController material = Material.of(tester.element(find.byKey(innerKey)));
+    final MaterialInkController material = Material.of(tester.element(find.byKey(innerKey)))!;
 
     // Press
     final TestGesture gesture = await tester.startGesture(tester.getCenter(find.byKey(innerKey)), pointer: 1);
@@ -1194,9 +1192,9 @@
 
   testWidgets('disabled and hovered inkwell responds to mouse-exit', (WidgetTester tester) async {
     int onHoverCount = 0;
-    bool hover;
+    late bool hover;
 
-    Widget buildFrame({ bool enabled }) {
+    Widget buildFrame({ required bool enabled }) {
       return Material(
         child: Directionality(
           textDirection: TextDirection.ltr,
@@ -1257,7 +1255,7 @@
   });
 
   testWidgets('Changing InkWell.enabled should not trigger TextButton setState()', (WidgetTester tester) async {
-    Widget buildFrame({ bool enabled }) {
+    Widget buildFrame({ required bool enabled }) {
       return Material(
         child: Directionality(
           textDirection: TextDirection.ltr,