From b96066bf1735be2cc62718d245b9a28f0dfa49aa Mon Sep 17 00:00:00 2001 From: Felix Angelov Date: Tue, 21 Nov 2023 12:58:55 -0600 Subject: [PATCH] ci: use latest stable flutter (#114) --- .github/workflows/main.yaml | 2 +- .../authentication_flow.dart | 6 +-- .../pages/city_selection/city_selection.dart | 2 +- .../country_selection/country_selection.dart | 2 +- .../state_selection/state_selection.dart | 2 +- .../{drop_down_menu.dart => drop_down.dart} | 4 +- .../lib/location_flow/widgets/widgets.dart | 2 +- .../lib/onboarding_flow/onboarding_flow.dart | 6 +-- example/lib/profile_flow/profile_flow.dart | 6 +-- test/flow_builder_test.dart | 49 +++++++++++-------- 10 files changed, 45 insertions(+), 36 deletions(-) rename example/lib/location_flow/widgets/{drop_down_menu.dart => drop_down.dart} (90%) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index f8322b5..02126ab 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -17,7 +17,7 @@ jobs: uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1 with: flutter_channel: stable - flutter_version: 3.0.5 + flutter_version: 3.13.9 pana: runs-on: ubuntu-latest diff --git a/example/lib/authentication_flow/authentication_flow.dart b/example/lib/authentication_flow/authentication_flow.dart index 5ccdb91..178b87b 100644 --- a/example/lib/authentication_flow/authentication_flow.dart +++ b/example/lib/authentication_flow/authentication_flow.dart @@ -144,7 +144,7 @@ class OnboardingStep extends StatelessWidget { child: Column( mainAxisSize: MainAxisSize.min, children: [ - Text('Step $step', style: theme.textTheme.headline1), + Text('Step $step', style: theme.textTheme.displayLarge), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -159,7 +159,7 @@ class OnboardingStep extends StatelessWidget { onPressed: () { context.flow().update((s) => s + 1); }, - ) + ), ], ), ], @@ -183,7 +183,7 @@ class HomePage extends StatelessWidget { onPressed: () { context.read().logout(); }, - ) + ), ], ), body: const Center(child: Text('Home')), diff --git a/example/lib/location_flow/pages/city_selection/city_selection.dart b/example/lib/location_flow/pages/city_selection/city_selection.dart index 3f54e8d..6c865ab 100644 --- a/example/lib/location_flow/pages/city_selection/city_selection.dart +++ b/example/lib/location_flow/pages/city_selection/city_selection.dart @@ -43,7 +43,7 @@ class CitySelectionForm extends StatelessWidget { case LocationStatus.loading: return const LoadingIndicator(); case LocationStatus.success: - return DropdownMenu( + return Dropdown( hint: const Text('Select a City'), items: state.locations, value: state.selectedLocation, diff --git a/example/lib/location_flow/pages/country_selection/country_selection.dart b/example/lib/location_flow/pages/country_selection/country_selection.dart index 1ce40f1..e19d305 100644 --- a/example/lib/location_flow/pages/country_selection/country_selection.dart +++ b/example/lib/location_flow/pages/country_selection/country_selection.dart @@ -47,7 +47,7 @@ class CountrySelectionForm extends StatelessWidget { case LocationStatus.loading: return const LoadingIndicator(); case LocationStatus.success: - return DropdownMenu( + return Dropdown( hint: const Text('Select a Country'), items: state.locations, value: state.selectedLocation, diff --git a/example/lib/location_flow/pages/state_selection/state_selection.dart b/example/lib/location_flow/pages/state_selection/state_selection.dart index 7ad8e7c..4cb09f9 100644 --- a/example/lib/location_flow/pages/state_selection/state_selection.dart +++ b/example/lib/location_flow/pages/state_selection/state_selection.dart @@ -43,7 +43,7 @@ class StateSelectionForm extends StatelessWidget { case LocationStatus.loading: return const LoadingIndicator(); case LocationStatus.success: - return DropdownMenu( + return Dropdown( hint: const Text('Select a State'), items: state.locations, value: state.selectedLocation, diff --git a/example/lib/location_flow/widgets/drop_down_menu.dart b/example/lib/location_flow/widgets/drop_down.dart similarity index 90% rename from example/lib/location_flow/widgets/drop_down_menu.dart rename to example/lib/location_flow/widgets/drop_down.dart index f81c211..e29254e 100644 --- a/example/lib/location_flow/widgets/drop_down_menu.dart +++ b/example/lib/location_flow/widgets/drop_down.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; -class DropdownMenu extends StatelessWidget { - const DropdownMenu({ +class Dropdown extends StatelessWidget { + const Dropdown({ super.key, required this.items, required this.onChanged, diff --git a/example/lib/location_flow/widgets/widgets.dart b/example/lib/location_flow/widgets/widgets.dart index d888f0e..de7ab38 100644 --- a/example/lib/location_flow/widgets/widgets.dart +++ b/example/lib/location_flow/widgets/widgets.dart @@ -1,3 +1,3 @@ -export 'drop_down_menu.dart'; +export 'drop_down.dart'; export 'loading_indicator.dart'; export 'location_error.dart'; diff --git a/example/lib/onboarding_flow/onboarding_flow.dart b/example/lib/onboarding_flow/onboarding_flow.dart index 295c25a..cf519f2 100644 --- a/example/lib/onboarding_flow/onboarding_flow.dart +++ b/example/lib/onboarding_flow/onboarding_flow.dart @@ -75,7 +75,7 @@ class OnboardingWelcome extends StatelessWidget { children: [ Text( 'Welcome Text', - style: theme.textTheme.headline3, + style: theme.textTheme.displaySmall, ), ], ), @@ -139,7 +139,7 @@ class OnboardingUsage extends StatelessWidget { children: [ Text( 'Usage Text', - style: theme.textTheme.headline3, + style: theme.textTheme.displaySmall, ), ], ), @@ -207,7 +207,7 @@ class OnboardingComplete extends StatelessWidget { children: [ Text( 'All Done!', - style: theme.textTheme.headline3, + style: theme.textTheme.displaySmall, textAlign: TextAlign.center, ), ], diff --git a/example/lib/profile_flow/profile_flow.dart b/example/lib/profile_flow/profile_flow.dart index ae66cac..394638c 100644 --- a/example/lib/profile_flow/profile_flow.dart +++ b/example/lib/profile_flow/profile_flow.dart @@ -68,7 +68,7 @@ class _ProfileNameFormState extends State { ElevatedButton( onPressed: _name.isNotEmpty ? _continuePressed : null, child: const Text('Continue'), - ) + ), ], ), ), @@ -111,7 +111,7 @@ class _ProfileAgeFormState extends State { ElevatedButton( onPressed: _age != null ? _continuePressed : null, child: const Text('Continue'), - ) + ), ], ), ), @@ -158,7 +158,7 @@ class _ProfileWeightFormState extends State { ElevatedButton( onPressed: _weight != null ? _continuePressed : null, child: const Text('Continue'), - ) + ), ], ), ), diff --git a/test/flow_builder_test.dart b/test/flow_builder_test.dart index ce4f51c..093a97b 100644 --- a/test/flow_builder_test.dart +++ b/test/flow_builder_test.dart @@ -531,12 +531,15 @@ void main() { testWidgets('system back button pops entire flow', (tester) async { var systemPopCallCount = 0; - SystemChannels.platform.setMockMethodCallHandler((call) { - if (call.method == 'SystemNavigator.pop') { - systemPopCallCount++; - } - return null; - }); + tester.binding.defaultBinaryMessenger.setMockMethodCallHandler( + SystemChannels.platform, + (call) { + if (call.method == 'SystemNavigator.pop') { + systemPopCallCount++; + } + return null; + }, + ); const buttonKey = Key('__button__'); const scaffoldKey = Key('__scaffold__'); await tester.pumpWidget( @@ -579,12 +582,15 @@ void main() { testWidgets('system back button pops routes that have been pushed', (tester) async { var systemPopCallCount = 0; - SystemChannels.platform.setMockMethodCallHandler((call) { - if (call.method == 'SystemNavigator.pop') { - systemPopCallCount++; - } - return null; - }); + tester.binding.defaultBinaryMessenger.setMockMethodCallHandler( + SystemChannels.platform, + (call) { + if (call.method == 'SystemNavigator.pop') { + systemPopCallCount++; + } + return null; + }, + ); const buttonKey = Key('__button__'); const scaffoldKey = Key('__scaffold__'); await tester.pumpWidget( @@ -641,12 +647,15 @@ void main() { testWidgets('system back button pops typed routes that have been pushed', (tester) async { var systemPopCallCount = 0; - SystemChannels.platform.setMockMethodCallHandler((call) { - if (call.method == 'SystemNavigator.pop') { - systemPopCallCount++; - } - return null; - }); + tester.binding.defaultBinaryMessenger.setMockMethodCallHandler( + SystemChannels.platform, + (call) { + if (call.method == 'SystemNavigator.pop') { + systemPopCallCount++; + } + return null; + }, + ); const buttonKey = Key('__button__'); const scaffoldKey = Key('__scaffold__'); await tester.pumpWidget( @@ -1406,7 +1415,7 @@ void main() { ), ), ), - ) + ), ]; }, ); @@ -1462,7 +1471,7 @@ void main() { ), ), ), - ) + ), ]; }, );