Skip to content

Commit 61b5c99

Browse files
committed
Improve visibility of onboarding forward/back buttons
1 parent d854d2a commit 61b5c99

File tree

5 files changed

+127
-111
lines changed

5 files changed

+127
-111
lines changed

lib/Frontend/Widgets/scan_for_new_device.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,8 @@ class _ScanGearListState extends ConsumerState<ScanGearList> {
253253
Padding(
254254
padding: const EdgeInsets.all(16.0),
255255
child: Text(
256-
convertToUwU(scanDevicesScanMessage()),
256+
//Show a different message during onboarding
257+
convertToUwU(widget.popOnConnect ? scanDevicesScanMessage() : scanDevicesOnboardingScanMessage()),
257258
textAlign: TextAlign.center,
258259
),
259260
),

lib/Frontend/pages/intro.dart

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'package:flutter/foundation.dart';
12
import 'package:flutter/material.dart';
23
import 'package:flutter/services.dart';
34
import 'package:flutter_riverpod/flutter_riverpod.dart';
@@ -57,7 +58,6 @@ class OnBoardingPageState extends ConsumerState<OnBoardingPage> {
5758
);
5859
}
5960

60-
int page = 0;
6161
@override
6262
Widget build(BuildContext context) {
6363
setupSystemColor(context);
@@ -78,7 +78,6 @@ class OnBoardingPageState extends ConsumerState<OnBoardingPage> {
7878
return IntroductionScreen(
7979
key: introKey,
8080
canProgress: (page) {
81-
this.page = page;
8281
if (page == 2 && !bluetoothAccepted) {
8382
return false;
8483
} else if (page == 1 && !privacyAccepted) {
@@ -88,6 +87,8 @@ class OnBoardingPageState extends ConsumerState<OnBoardingPage> {
8887
},
8988
globalBackgroundColor: Theme.of(context).canvasColor,
9089
allowImplicitScrolling: true,
90+
showBackButton: true,
91+
showSkipButton: kDebugMode,
9192
globalHeader: Align(
9293
alignment: Alignment.topRight,
9394
child: SafeArea(
@@ -253,20 +254,32 @@ class OnBoardingPageState extends ConsumerState<OnBoardingPage> {
253254
onSkip: () => _onIntroEnd(context),
254255
// You can override onSkip callback
255256
//rtl: true, // Display as right-to-left
256-
back: const Icon(Icons.arrow_back),
257-
overrideNext: page == 3
258-
? FilledButton(
259-
onPressed: () {
260-
_onIntroEnd(context);
261-
},
262-
child: Text(convertToUwU(onboardingContinueLabel()), style: const TextStyle(fontWeight: FontWeight.w600)),
263-
)
264-
: null,
265-
next: Icon(
266-
Icons.arrow_forward,
267-
size: 24,
268-
key: Key('nextPage'),
257+
overrideNext: Row(
258+
mainAxisSize: MainAxisSize.min,
259+
mainAxisAlignment: MainAxisAlignment.center,
260+
children: [
261+
FilledButton(
262+
onPressed: () {
263+
introKey.currentState?.next();
264+
},
265+
child: Row(
266+
mainAxisSize: MainAxisSize.min,
267+
children: [
268+
Text(convertToUwU(onboardingContinueLabel()), style: const TextStyle(fontWeight: FontWeight.w600)),
269+
const Icon(
270+
Icons.arrow_forward,
271+
key: Key('nextPage'),
272+
),
273+
],
274+
),
275+
)
276+
],
277+
),
278+
279+
skip: const Icon(
280+
Icons.skip_next,
269281
),
282+
back: const Icon(Icons.arrow_back),
270283
done: FilledButton(
271284
onPressed: () {
272285
_onIntroEnd(context);
@@ -276,7 +289,7 @@ class OnBoardingPageState extends ConsumerState<OnBoardingPage> {
276289
dotsFlex: 1,
277290
controlsPadding: const EdgeInsets.symmetric(vertical: 32),
278291
dotsDecorator: DotsDecorator(
279-
size: const Size.square(10.0),
292+
size: const Size.square(12.0),
280293
activeSize: const Size(40.0, 10.0),
281294
activeColor: Theme.of(context).colorScheme.primary,
282295
color: Theme.of(context).colorScheme.tertiary,

lib/Frontend/translation_string_definitions.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ String aboutPage() => Intl.message('About', name: 'aboutPage', desc: 'The label
2929
String settingsPage() => Intl.message('Settings', name: 'settingsPage', desc: 'The label and title of the settings page');
3030
String moreExperimentalTitle() => Intl.message('Experimental', name: 'moreExperimentalTitle', desc: 'The label for the experimental features on the More page');
3131
String moreCoshubPromoTitle() => Intl.message('CosHub', name: 'moreCoshubPromoTitle', desc: 'The title for the coshub link on the More page');
32-
String moreCoshubPromoDescription() => Intl.message('Our latest app to help you plan, share and create your cosplay is here', name: 'moreCoshubPromoDescription', desc: 'The description for the coshub link on the More page');
32+
String moreCoshubPromoDescription() =>
33+
Intl.message('Our latest app to help you plan, share and create your cosplay is here', name: 'moreCoshubPromoDescription', desc: 'The description for the coshub link on the More page');
3334

3435
String settingsDescription() => Intl.message('Change app color, configure Haptics, and more', name: 'settingsDescription', desc: 'The description of the settings page on the more page');
3536

@@ -219,6 +220,8 @@ String scanDevicesFoundTitle() => Intl.message('Found Gear. Tap the gear name to
219220

220221
String scanDevicesScanMessage() => Intl.message('Scanning for gear. Please make sure your gear is powered on and nearby',
221222
name: 'scanDevicesScanMessage', desc: 'scan for devices scan in progress message when scanning for a device');
223+
String scanDevicesOnboardingScanMessage() => Intl.message('Scanning for gear. Please make sure your gear is powered on and nearby. You can always connect your gear later.',
224+
name: 'scanDevicesOnboardingScanMessage', desc: 'additional scan for devices scan in progress message when scanning for a device during onboarding');
222225

223226
//Triggers
224227
String triggerWalkingTitle() => Intl.message('Walking', name: 'triggerWalkingTitle', desc: 'Walking/Step trigger title');
@@ -383,6 +386,7 @@ String onboardingBluetoothEnableButtonLabel() =>
383386

384387
String onboardingDoneButtonLabel() => Intl.message("Done", name: 'onboardingDoneButtonLabel', desc: 'Label for the button to close the onboarding screen');
385388
String onboardingContinueLabel() => Intl.message("Continue", name: 'onboardingContinueLabel', desc: 'Label for the button to continue past the scan for gear screen');
389+
String onboardingBackButtonLabel() => Intl.message("Back", name: 'onboardingBackButtonLabel', desc: 'Label for the button to go back on the onboarding screen');
386390

387391
String onboardingCompletedTitle() => Intl.message("Happy Wagging!", name: 'onboardingCompletedTitle', desc: 'Title of the final page of the onboarding screen');
388392

lib/main.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,6 @@ class TailApp extends ConsumerWidget {
243243
HiveProxy
244244
..put(settings, showDebugging, true)
245245
..put(settings, allowAnalytics, false)
246-
..put(settings, allowErrorReporting, true)
247-
..put(settings, hasCompletedOnboarding, hasCompletedOnboardingVersionToAgree)
248246
..put(settings, showDemoGear, true);
249247
}
250248

0 commit comments

Comments
 (0)