diff --git a/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_navigation_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_navigation_demo.dart index 23227dfc2cc..e98b1b89af1 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_navigation_demo.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_navigation_demo.dart @@ -302,21 +302,15 @@ class Tab1ItemPage extends StatefulWidget { } class Tab1ItemPageState extends State { - @override - void initState() { - super.initState(); - relatedColors = List.generate(10, (int index) { - final math.Random random = math.Random(widget.randomSeed); - return Color.fromARGB( - 255, - (widget.color!.red + random.nextInt(100) - 50).clamp(0, 255), - (widget.color!.green + random.nextInt(100) - 50).clamp(0, 255), - (widget.color!.blue + random.nextInt(100) - 50).clamp(0, 255), - ); - }); - } - - late List relatedColors; + late final List relatedColors = List.generate(10, (int index) { + final math.Random random = math.Random(widget.randomSeed); + return Color.fromARGB( + 255, + (widget.color!.red + random.nextInt(100) - 50).clamp(0, 255), + (widget.color!.green + random.nextInt(100) - 50).clamp(0, 255), + (widget.color!.blue + random.nextInt(100) - 50).clamp(0, 255), + ); + }); @override Widget build(BuildContext context) { diff --git a/dev/integration_tests/flutter_gallery/lib/gallery/app.dart b/dev/integration_tests/flutter_gallery/lib/gallery/app.dart index df4f2c1934e..d639fb1956e 100644 --- a/dev/integration_tests/flutter_gallery/lib/gallery/app.dart +++ b/dev/integration_tests/flutter_gallery/lib/gallery/app.dart @@ -45,7 +45,7 @@ class GalleryApp extends StatefulWidget { class _GalleryAppState extends State { GalleryOptions? _options; Timer? _timeDilationTimer; - late AppStateModel model; + late final AppStateModel model = AppStateModel()..loadProducts(); Map _buildRoutes() { // For a different example of how to set up an application routing table @@ -66,7 +66,6 @@ class _GalleryAppState extends State { timeDilation: timeDilation, platform: defaultTargetPlatform, ); - model = AppStateModel()..loadProducts(); } @override