Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
felangel committed Nov 21, 2023
1 parent 1dea1a8 commit eb104ef
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 35 deletions.
6 changes: 3 additions & 3 deletions example/lib/authentication_flow/authentication_flow.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand All @@ -159,7 +159,7 @@ class OnboardingStep extends StatelessWidget {
onPressed: () {
context.flow<int>().update((s) => s + 1);
},
)
),
],
),
],
Expand All @@ -183,7 +183,7 @@ class HomePage extends StatelessWidget {
onPressed: () {
context.read<AuthenticationCubit>().logout();
},
)
),
],
),
body: const Center(child: Text('Home')),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion example/lib/location_flow/widgets/widgets.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export 'drop_down_menu.dart';
export 'drop_down.dart';
export 'loading_indicator.dart';
export 'location_error.dart';
6 changes: 3 additions & 3 deletions example/lib/onboarding_flow/onboarding_flow.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class OnboardingWelcome extends StatelessWidget {
children: [
Text(
'Welcome Text',
style: theme.textTheme.headline3,
style: theme.textTheme.displaySmall,
),
],
),
Expand Down Expand Up @@ -139,7 +139,7 @@ class OnboardingUsage extends StatelessWidget {
children: [
Text(
'Usage Text',
style: theme.textTheme.headline3,
style: theme.textTheme.displaySmall,
),
],
),
Expand Down Expand Up @@ -207,7 +207,7 @@ class OnboardingComplete extends StatelessWidget {
children: [
Text(
'All Done!',
style: theme.textTheme.headline3,
style: theme.textTheme.displaySmall,
textAlign: TextAlign.center,
),
],
Expand Down
6 changes: 3 additions & 3 deletions example/lib/profile_flow/profile_flow.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class _ProfileNameFormState extends State<ProfileNameForm> {
ElevatedButton(
onPressed: _name.isNotEmpty ? _continuePressed : null,
child: const Text('Continue'),
)
),
],
),
),
Expand Down Expand Up @@ -111,7 +111,7 @@ class _ProfileAgeFormState extends State<ProfileAgeForm> {
ElevatedButton(
onPressed: _age != null ? _continuePressed : null,
child: const Text('Continue'),
)
),
],
),
),
Expand Down Expand Up @@ -158,7 +158,7 @@ class _ProfileWeightFormState extends State<ProfileWeightForm> {
ElevatedButton(
onPressed: _weight != null ? _continuePressed : null,
child: const Text('Continue'),
)
),
],
),
),
Expand Down
49 changes: 29 additions & 20 deletions test/flow_builder_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -1406,7 +1415,7 @@ void main() {
),
),
),
)
),
];
},
);
Expand Down Expand Up @@ -1462,7 +1471,7 @@ void main() {
),
),
),
)
),
];
},
);
Expand Down

0 comments on commit eb104ef

Please sign in to comment.