Prefer void to null (#22977)

* Future<void> main

* Future<void>.delayed

* prefer_void_to_Null

* address review comments
diff --git a/examples/catalog/bin/screenshot_test.dart.template b/examples/catalog/bin/screenshot_test.dart.template
index 6492439..63fb285 100644
--- a/examples/catalog/bin/screenshot_test.dart.template
+++ b/examples/catalog/bin/screenshot_test.dart.template
@@ -26,7 +26,7 @@
       for (String path in paths) {
         await driver.waitUntilNoTransientCallbacks();
         // TBD: when #11021 has been resolved, this shouldn't be necessary.
-        await new Future<Null>.delayed(const Duration(milliseconds: 500));
+        await new Future<void>.delayed(const Duration(milliseconds: 500));
         final List<int> pixels = await driver.screenshot();
         final File file = new File(path);
         await file.writeAsBytes(pixels);
diff --git a/examples/catalog/test/expansion_tile_sample_test.dart b/examples/catalog/test/expansion_tile_sample_test.dart
index 2a6bcde..619a0ba 100644
--- a/examples/catalog/test/expansion_tile_sample_test.dart
+++ b/examples/catalog/test/expansion_tile_sample_test.dart
@@ -22,12 +22,12 @@
       }
     }
 
-    Future<Null> scrollUpOneEntry() async {
+    Future<void> scrollUpOneEntry() async {
       await tester.dragFrom(const Offset(200.0, 200.0), const Offset(0.0, -88.00));
       await tester.pumpAndSettle();
     }
 
-    Future<Null> tapEntry(String title) async {
+    Future<void> tapEntry(String title) async {
       await tester.tap(find.text(title));
       await tester.pumpAndSettle();
     }
diff --git a/examples/flutter_gallery/lib/demo/material/bottom_app_bar_demo.dart b/examples/flutter_gallery/lib/demo/material/bottom_app_bar_demo.dart
index bf327f0..0b1a272 100644
--- a/examples/flutter_gallery/lib/demo/material/bottom_app_bar_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/bottom_app_bar_demo.dart
@@ -351,7 +351,7 @@
       IconButton(
         icon: const Icon(Icons.menu),
         onPressed: () {
-          showModalBottomSheet<Null>(
+          showModalBottomSheet<void>(
             context: context,
             builder: (BuildContext context) => const _DemoDrawer(),
           );
diff --git a/examples/flutter_gallery/lib/demo/material/date_and_time_picker_demo.dart b/examples/flutter_gallery/lib/demo/material/date_and_time_picker_demo.dart
index 64701fe..ab9763e 100644
--- a/examples/flutter_gallery/lib/demo/material/date_and_time_picker_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/date_and_time_picker_demo.dart
@@ -64,7 +64,7 @@
   final ValueChanged<DateTime> selectDate;
   final ValueChanged<TimeOfDay> selectTime;
 
-  Future<Null> _selectDate(BuildContext context) async {
+  Future<void> _selectDate(BuildContext context) async {
     final DateTime picked = await showDatePicker(
       context: context,
       initialDate: selectedDate,
@@ -75,7 +75,7 @@
       selectDate(picked);
   }
 
-  Future<Null> _selectTime(BuildContext context) async {
+  Future<void> _selectTime(BuildContext context) async {
     final TimeOfDay picked = await showTimePicker(
       context: context,
       initialTime: selectedTime
diff --git a/examples/flutter_gallery/lib/demo/material/dialog_demo.dart b/examples/flutter_gallery/lib/demo/material/dialog_demo.dart
index 27c7bff..73c5e83 100644
--- a/examples/flutter_gallery/lib/demo/material/dialog_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/dialog_demo.dart
@@ -180,7 +180,7 @@
                 context: context,
                 initialTime: _selectedTime
               )
-              .then<Null>((TimeOfDay value) {
+              .then<void>((TimeOfDay value) {
                 if (value != null && value != _selectedTime) {
                   _selectedTime = value;
                   _scaffoldKey.currentState.showSnackBar(SnackBar(
diff --git a/examples/flutter_gallery/lib/demo/material/full_screen_dialog_demo.dart b/examples/flutter_gallery/lib/demo/material/full_screen_dialog_demo.dart
index 9d268fe..9c5fc2c 100644
--- a/examples/flutter_gallery/lib/demo/material/full_screen_dialog_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/full_screen_dialog_demo.dart
@@ -49,7 +49,7 @@
                     firstDate: date.subtract(const Duration(days: 30)),
                     lastDate: date.add(const Duration(days: 30))
                   )
-                  .then<Null>((DateTime value) {
+                  .then<void>((DateTime value) {
                     if (value != null)
                       onChanged(DateTime(value.year, value.month, value.day, time.hour, time.minute));
                   });
@@ -76,7 +76,7 @@
                   context: context,
                   initialTime: time
                 )
-                .then<Null>((TimeOfDay value) {
+                .then<void>((TimeOfDay value) {
                   if (value != null)
                     onChanged(DateTime(date.year, date.month, date.day, value.hour, value.minute));
                 });
diff --git a/examples/flutter_gallery/lib/demo/material/list_demo.dart b/examples/flutter_gallery/lib/demo/material/list_demo.dart
index 0f35f96..d47c226 100644
--- a/examples/flutter_gallery/lib/demo/material/list_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/list_demo.dart
@@ -32,7 +32,7 @@
 class _ListDemoState extends State<ListDemo> {
   static final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
 
-  PersistentBottomSheetController<Null> _bottomSheet;
+  PersistentBottomSheetController<void> _bottomSheet;
   _MaterialListType _itemType = _MaterialListType.threeLine;
   bool _dense = false;
   bool _showAvatars = true;
@@ -51,7 +51,7 @@
   }
 
   void _showConfigurationSheet() {
-    final PersistentBottomSheetController<Null> bottomSheet = scaffoldKey.currentState.showBottomSheet((BuildContext bottomSheetContext) {
+    final PersistentBottomSheetController<void> bottomSheet = scaffoldKey.currentState.showBottomSheet<void>((BuildContext bottomSheetContext) {
       return Container(
         decoration: const BoxDecoration(
           border: Border(top: BorderSide(color: Colors.black26)),
diff --git a/examples/flutter_gallery/lib/demo/material/overscroll_demo.dart b/examples/flutter_gallery/lib/demo/material/overscroll_demo.dart
index 5863444..028b1fc 100644
--- a/examples/flutter_gallery/lib/demo/material/overscroll_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/overscroll_demo.dart
@@ -26,10 +26,10 @@
     'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N'
   ];
 
-  Future<Null> _handleRefresh() {
-    final Completer<Null> completer = Completer<Null>();
-    Timer(const Duration(seconds: 3), () { completer.complete(null); });
-    return completer.future.then<Null>((_) {
+  Future<void> _handleRefresh() {
+    final Completer<void> completer = Completer<void>();
+    Timer(const Duration(seconds: 3), () { completer.complete(); });
+    return completer.future.then<void>((_) {
        _scaffoldKey.currentState?.showSnackBar(SnackBar(
          content: const Text('Refresh complete'),
          action: SnackBarAction(
diff --git a/examples/flutter_gallery/lib/demo/material/persistent_bottom_sheet_demo.dart b/examples/flutter_gallery/lib/demo/material/persistent_bottom_sheet_demo.dart
index b244989..40ac589 100644
--- a/examples/flutter_gallery/lib/demo/material/persistent_bottom_sheet_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/persistent_bottom_sheet_demo.dart
@@ -28,7 +28,7 @@
     setState(() { // disable the button
       _showBottomSheetCallback = null;
     });
-    _scaffoldKey.currentState.showBottomSheet<Null>((BuildContext context) {
+    _scaffoldKey.currentState.showBottomSheet<void>((BuildContext context) {
       final ThemeData themeData = Theme.of(context);
       return Container(
         decoration: BoxDecoration(
diff --git a/examples/flutter_gallery/lib/demo/material/reorderable_list_demo.dart b/examples/flutter_gallery/lib/demo/material/reorderable_list_demo.dart
index 4cda720..f296128 100644
--- a/examples/flutter_gallery/lib/demo/material/reorderable_list_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/reorderable_list_demo.dart
@@ -39,7 +39,7 @@
 class _ListDemoState extends State<ReorderableListDemo> {
   static final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
 
-  PersistentBottomSheetController<Null> _bottomSheet;
+  PersistentBottomSheetController<void> _bottomSheet;
   _ReorderableListType _itemType = _ReorderableListType.threeLine;
   bool _reverseSort = false;
   final List<_ListItem> _items = <String>[
@@ -58,7 +58,7 @@
 
   void _showConfigurationSheet() {
     setState(() {
-      _bottomSheet = scaffoldKey.currentState.showBottomSheet((BuildContext bottomSheetContext) {
+      _bottomSheet = scaffoldKey.currentState.showBottomSheet<void>((BuildContext bottomSheetContext) {
         return DecoratedBox(
           decoration: const BoxDecoration(
             border: Border(top: BorderSide(color: Colors.black26)),
diff --git a/examples/flutter_gallery/lib/demo/material/tabs_fab_demo.dart b/examples/flutter_gallery/lib/demo/material/tabs_fab_demo.dart
index 0ebb592..6f09cb8 100644
--- a/examples/flutter_gallery/lib/demo/material/tabs_fab_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/tabs_fab_demo.dart
@@ -69,7 +69,7 @@
   }
 
   void _showExplanatoryText() {
-    _scaffoldKey.currentState.showBottomSheet<Null>((BuildContext context) {
+    _scaffoldKey.currentState.showBottomSheet<void>((BuildContext context) {
       return Container(
         decoration: BoxDecoration(
           border: Border(top: BorderSide(color: Theme.of(context).dividerColor))
diff --git a/examples/flutter_gallery/lib/demo/shrine/shrine_home.dart b/examples/flutter_gallery/lib/demo/shrine/shrine_home.dart
index 9382df9..a7aa943 100644
--- a/examples/flutter_gallery/lib/demo/shrine/shrine_home.dart
+++ b/examples/flutter_gallery/lib/demo/shrine/shrine_home.dart
@@ -362,7 +362,7 @@
   static final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>(debugLabel: 'Shrine Home');
   static final _ShrineGridDelegate gridDelegate = _ShrineGridDelegate();
 
-  Future<Null> _showOrderPage(Product product) async {
+  Future<void> _showOrderPage(Product product) async {
     final Order order = _shoppingCart[product] ?? Order(product: product);
     final Order completedOrder = await Navigator.push(context, ShrineOrderRoute(
       order: order,
diff --git a/examples/flutter_gallery/lib/demo/video_demo.dart b/examples/flutter_gallery/lib/demo/video_demo.dart
index a100591..b4851bd 100644
--- a/examples/flutter_gallery/lib/demo/video_demo.dart
+++ b/examples/flutter_gallery/lib/demo/video_demo.dart
@@ -66,7 +66,7 @@
         pageBuilder: fullScreenRoutePageBuilder,
       );
 
-      route.completed.then((void result) {
+      route.completed.then((void value) {
         controller.setVolume(0.0);
       });
 
@@ -272,7 +272,7 @@
   });
 
   final Widget child;
-  final Completer<Null> connectedCompleter;
+  final Completer<void> connectedCompleter;
   final GlobalKey<ScaffoldState> scaffoldKey;
 
   @override
@@ -362,14 +362,14 @@
   );
 
   final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
-  final Completer<Null> connectedCompleter = Completer<Null>();
+  final Completer<void> connectedCompleter = Completer<void>();
   bool isSupported = true;
 
   @override
   void initState() {
     super.initState();
 
-    Future<Null> initController(VideoPlayerController controller) async {
+    Future<void> initController(VideoPlayerController controller) async {
       controller.setLooping(true);
       controller.setVolume(0.0);
       controller.play();
diff --git a/examples/flutter_gallery/lib/gallery/demo.dart b/examples/flutter_gallery/lib/gallery/demo.dart
index c6a5eda..12afd7d 100644
--- a/examples/flutter_gallery/lib/gallery/demo.dart
+++ b/examples/flutter_gallery/lib/gallery/demo.dart
@@ -138,7 +138,7 @@
 
   @override
   void didChangeDependencies() {
-    getExampleCode(widget.exampleCodeTag, DefaultAssetBundle.of(context)).then<Null>((String code) {
+    getExampleCode(widget.exampleCodeTag, DefaultAssetBundle.of(context)).then<void>((String code) {
       if (mounted) {
         setState(() {
           _exampleCode = code ?? 'Example code not found';
diff --git a/examples/flutter_gallery/lib/gallery/example_code_parser.dart b/examples/flutter_gallery/lib/gallery/example_code_parser.dart
index 6a834bc..7f50292 100644
--- a/examples/flutter_gallery/lib/gallery/example_code_parser.dart
+++ b/examples/flutter_gallery/lib/gallery/example_code_parser.dart
@@ -17,7 +17,7 @@
   return _exampleCode[tag];
 }
 
-Future<Null> _parseExampleCode(AssetBundle bundle) async {
+Future<void> _parseExampleCode(AssetBundle bundle) async {
   final String code = await bundle.loadString('lib/gallery/example_code.dart') ??
     '// lib/gallery/example_code.dart not found\n';
   _exampleCode = <String, String>{};
diff --git a/examples/flutter_gallery/test/live_smoketest.dart b/examples/flutter_gallery/test/live_smoketest.dart
index 8bab93d..c64be04 100644
--- a/examples/flutter_gallery/test/live_smoketest.dart
+++ b/examples/flutter_gallery/test/live_smoketest.dart
@@ -39,7 +39,7 @@
   'Video',
 ];
 
-Future<Null> main() async {
+Future<void> main() async {
   try {
     // Verify that _kUnsynchronizedDemos and _kSkippedDemos identify
     // demos that actually exist.
@@ -89,8 +89,8 @@
   bool frameSync = true;
 
   /// Waits until at the end of a frame the provided [condition] is [true].
-  Future<Null> _waitUntilFrame(bool condition(), [Completer<Null> completer]) {
-    completer ??= Completer<Null>();
+  Future<void> _waitUntilFrame(bool condition(), [Completer<void> completer]) {
+    completer ??= Completer<void>();
     if (!condition()) {
       SchedulerBinding.instance.addPostFrameCallback((Duration timestamp) {
         _waitUntilFrame(condition, completer);
@@ -112,11 +112,11 @@
   }
 
   @override
-  Future<Null> tap(Finder finder, { int pointer }) async {
+  Future<void> tap(Finder finder, { int pointer }) async {
     await super.tap(await _waitForElement(finder), pointer: pointer);
   }
 
-  Future<Null> scrollIntoView(Finder finder, {double alignment}) async {
+  Future<void> scrollIntoView(Finder finder, {double alignment}) async {
     final Finder target = await _waitForElement(finder);
     await Scrollable.ensureVisible(target.evaluate().single, duration: const Duration(milliseconds: 100), alignment: alignment);
   }
diff --git a/examples/flutter_gallery/test/smoke_test.dart b/examples/flutter_gallery/test/smoke_test.dart
index df480fc..9eb65f5 100644
--- a/examples/flutter_gallery/test/smoke_test.dart
+++ b/examples/flutter_gallery/test/smoke_test.dart
@@ -46,7 +46,7 @@
   }
 }
 
-Future<Null> smokeDemo(WidgetTester tester, GalleryDemo demo) async {
+Future<void> smokeDemo(WidgetTester tester, GalleryDemo demo) async {
   // Don't use pumpUntilNoTransientCallbacks in this function, because some of
   // the smoketests have infinitely-running animations (e.g. the progress
   // indicators demo).
@@ -94,7 +94,7 @@
   await tester.pump(const Duration(milliseconds: 400)); // Wait until it has finished.
 }
 
-Future<Null> smokeOptionsPage(WidgetTester tester) async {
+Future<void> smokeOptionsPage(WidgetTester tester) async {
   final Finder showOptionsPageButton = find.byTooltip('Toggle options page');
 
   // Show the options page
@@ -133,7 +133,7 @@
   await tester.pumpAndSettle();
 }
 
-Future<Null> smokeGallery(WidgetTester tester) async {
+Future<void> smokeGallery(WidgetTester tester) async {
   bool sendFeedbackButtonPressed = false;
 
   await tester.pumpWidget(
diff --git a/examples/flutter_gallery/test_driver/scroll_perf_test.dart b/examples/flutter_gallery/test_driver/scroll_perf_test.dart
index 07a0b7f..0f1f2cb 100644
--- a/examples/flutter_gallery/test_driver/scroll_perf_test.dart
+++ b/examples/flutter_gallery/test_driver/scroll_perf_test.dart
@@ -31,13 +31,13 @@
         // Scroll down
         for (int i = 0; i < 5; i++) {
           await driver.scroll(demoList, 0.0, -300.0, const Duration(milliseconds: 300));
-          await Future<Null>.delayed(const Duration(milliseconds: 500));
+          await Future<void>.delayed(const Duration(milliseconds: 500));
         }
 
         // Scroll up
         for (int i = 0; i < 5; i++) {
           await driver.scroll(demoList, 0.0, 300.0, const Duration(milliseconds: 300));
-          await Future<Null>.delayed(const Duration(milliseconds: 500));
+          await Future<void>.delayed(const Duration(milliseconds: 500));
         }
       });
 
diff --git a/examples/flutter_gallery/test_driver/transitions_perf_test.dart b/examples/flutter_gallery/test_driver/transitions_perf_test.dart
index 9e6da3b..440e332 100644
--- a/examples/flutter_gallery/test_driver/transitions_perf_test.dart
+++ b/examples/flutter_gallery/test_driver/transitions_perf_test.dart
@@ -55,7 +55,7 @@
 
 /// Extracts event data from [events] recorded by timeline, validates it, turns
 /// it into a histogram, and saves to a JSON file.
-Future<Null> saveDurationsHistogram(List<Map<String, dynamic>> events, String outputPath) async {
+Future<void> saveDurationsHistogram(List<Map<String, dynamic>> events, String outputPath) async {
   final Map<String, List<int>> durations = <String, List<int>>{};
   Map<String, dynamic> startEvent;
 
@@ -121,7 +121,7 @@
 
 /// Scrolls each demo menu item into view, launches it, then returns to the
 /// home screen twice.
-Future<Null> runDemos(List<String> demos, FlutterDriver driver) async {
+Future<void> runDemos(List<String> demos, FlutterDriver driver) async {
   final SerializableFinder demoList = find.byValueKey('GalleryDemoList');
   String currentDemoCategory;
 
diff --git a/examples/flutter_gallery/test_memory/back_button.dart b/examples/flutter_gallery/test_memory/back_button.dart
index c8f2e11..9efc776 100644
--- a/examples/flutter_gallery/test_memory/back_button.dart
+++ b/examples/flutter_gallery/test_memory/back_button.dart
@@ -30,7 +30,7 @@
 Future<void> main() async {
   runApp(const GalleryApp());
   await endOfAnimation();
-  await Future<Null>.delayed(const Duration(milliseconds: 50));
+  await Future<void>.delayed(const Duration(milliseconds: 50));
   debugPrint('==== MEMORY BENCHMARK ==== READY ====');
   WidgetsBinding.instance.addObserver(LifecycleObserver());
 }
diff --git a/examples/flutter_gallery/test_memory/memory_nav.dart b/examples/flutter_gallery/test_memory/memory_nav.dart
index fc64fda..b5aad66 100644
--- a/examples/flutter_gallery/test_memory/memory_nav.dart
+++ b/examples/flutter_gallery/test_memory/memory_nav.dart
@@ -36,7 +36,7 @@
     ),
   ));
   await SchedulerBinding.instance.endOfFrame;
-  await Future<Null>.delayed(const Duration(milliseconds: 50));
+  await Future<void>.delayed(const Duration(milliseconds: 50));
   debugPrint('==== MEMORY BENCHMARK ==== READY ====');
 
   await ready.future;
@@ -55,12 +55,12 @@
 
   debugPrint('Navigating...');
   await controller.tap(find.text('Material'));
-  await Future<Null>.delayed(const Duration(milliseconds: 150));
+  await Future<void>.delayed(const Duration(milliseconds: 150));
   final Finder demoList = find.byKey(const Key('GalleryDemoList'));
   final Finder demoItem = find.text('Text fields');
   do {
     await controller.drag(demoList, const Offset(0.0, -300.0));
-    await Future<Null>.delayed(const Duration(milliseconds: 20));
+    await Future<void>.delayed(const Duration(milliseconds: 20));
   } while (!demoItem.precache());
 
   // Ensure that the center of the "Text fields" item is visible
diff --git a/examples/layers/services/isolate.dart b/examples/layers/services/isolate.dart
index d7bfae7..5c689d6 100644
--- a/examples/layers/services/isolate.dart
+++ b/examples/layers/services/isolate.dart
@@ -136,12 +136,12 @@
     // isolates do not have access to the root bundle. However, the loading
     // process is asynchronous, so the UI will not block while the file is
     // loaded.
-    rootBundle.loadString('services/data.json').then<Null>((String data) {
+    rootBundle.loadString('services/data.json').then<void>((String data) {
       if (isRunning) {
         final CalculationMessage message = CalculationMessage(data, _receivePort.sendPort);
         // Spawn an isolate to JSON-parse the file contents. The JSON parsing
         // is synchronous, so if done in the main isolate, the UI would block.
-        Isolate.spawn<CalculationMessage>(_calculate, message).then<Null>((Isolate isolate) {
+        Isolate.spawn<CalculationMessage>(_calculate, message).then<void>((Isolate isolate) {
           if (!isRunning) {
             isolate.kill(priority: Isolate.immediate);
           } else {
diff --git a/examples/layers/test/gestures_test.dart b/examples/layers/test/gestures_test.dart
index c37b1d2..1b09663 100644
--- a/examples/layers/test/gestures_test.dart
+++ b/examples/layers/test/gestures_test.dart
@@ -16,7 +16,7 @@
     final Finder finder = find.byType(GestureDemo);
 
     MaterialColor getSwatch() => tester.state<GestureDemoState>(finder).swatch;
-    Future<Null> tap() async {
+    Future<void> tap() async {
       final Offset topLeft = tester.getTopLeft(finder);
       await tester.tapAt(tester.getSize(finder).center(topLeft));
       await tester.pump(const Duration(seconds: 1));
diff --git a/examples/platform_channel/lib/main.dart b/examples/platform_channel/lib/main.dart
index 8739a01..48eddc8 100644
--- a/examples/platform_channel/lib/main.dart
+++ b/examples/platform_channel/lib/main.dart
@@ -21,7 +21,7 @@
   String _batteryLevel = 'Battery level: unknown.';
   String _chargingStatus = 'Battery status: unknown.';
 
-  Future<Null> _getBatteryLevel() async {
+  Future<void> _getBatteryLevel() async {
     String batteryLevel;
     try {
       final int result = await methodChannel.invokeMethod('getBatteryLevel');
diff --git a/examples/platform_channel_swift/lib/main.dart b/examples/platform_channel_swift/lib/main.dart
index 8739a01..48eddc8 100644
--- a/examples/platform_channel_swift/lib/main.dart
+++ b/examples/platform_channel_swift/lib/main.dart
@@ -21,7 +21,7 @@
   String _batteryLevel = 'Battery level: unknown.';
   String _chargingStatus = 'Battery status: unknown.';
 
-  Future<Null> _getBatteryLevel() async {
+  Future<void> _getBatteryLevel() async {
     String batteryLevel;
     try {
       final int result = await methodChannel.invokeMethod('getBatteryLevel');
diff --git a/examples/platform_view/lib/main.dart b/examples/platform_view/lib/main.dart
index 9a66c01..4778d68 100644
--- a/examples/platform_view/lib/main.dart
+++ b/examples/platform_view/lib/main.dart
@@ -45,7 +45,7 @@
     });
   }
 
-  Future<Null> _launchPlatformCount() async {
+  Future<void> _launchPlatformCount() async {
     final int platformCounter =
         await _methodChannel.invokeMethod('switchView', _counter);
     setState(() {
diff --git a/examples/stocks/lib/stock_data.dart b/examples/stocks/lib/stock_data.dart
index e8d98db..3e08482 100644
--- a/examples/stocks/lib/stock_data.dart
+++ b/examples/stocks/lib/stock_data.dart
@@ -77,7 +77,7 @@
   static bool actuallyFetchData = true;
 
   void _fetchNextChunk() {
-    _httpClient.get(_urlToFetch(_nextChunk++)).then<Null>((http.Response response) {
+    _httpClient.get(_urlToFetch(_nextChunk++)).then<void>((http.Response response) {
       final String json = response.body;
       if (json == null) {
         debugPrint('Failed to load stock data chunk ${_nextChunk - 1}');
diff --git a/examples/stocks/lib/stock_home.dart b/examples/stocks/lib/stock_home.dart
index 323850d..c77134e 100644
--- a/examples/stocks/lib/stock_home.dart
+++ b/examples/stocks/lib/stock_home.dart
@@ -263,7 +263,7 @@
         Navigator.pushNamed(context, '/stock:${stock.symbol}');
       },
       onShow: (Stock stock) {
-        _scaffoldKey.currentState.showBottomSheet<Null>((BuildContext context) => StockSymbolBottomSheet(stock: stock));
+        _scaffoldKey.currentState.showBottomSheet<void>((BuildContext context) => StockSymbolBottomSheet(stock: stock));
       },
     );
   }
diff --git a/examples/stocks/test_driver/scroll_perf_test.dart b/examples/stocks/test_driver/scroll_perf_test.dart
index e8a8591..eb5a23c 100644
--- a/examples/stocks/test_driver/scroll_perf_test.dart
+++ b/examples/stocks/test_driver/scroll_perf_test.dart
@@ -29,13 +29,13 @@
         // Scroll down
         for (int i = 0; i < 5; i++) {
           await driver.scroll(stockList, 0.0, -300.0, const Duration(milliseconds: 300));
-          await Future<Null>.delayed(const Duration(milliseconds: 500));
+          await Future<void>.delayed(const Duration(milliseconds: 500));
         }
 
         // Scroll up
         for (int i = 0; i < 5; i++) {
           await driver.scroll(stockList, 0.0, 300.0, const Duration(milliseconds: 300));
-          await Future<Null>.delayed(const Duration(milliseconds: 500));
+          await Future<void>.delayed(const Duration(milliseconds: 500));
         }
       });