Skip to content

Commit b70b34e

Browse files
authored
Add back buttons in auth flow screens (#639)
* feat: add back buttons and update header styling in auth flow screens * feat: add back navigation buttons to auth flow screens
1 parent f1cce74 commit b70b34e

File tree

4 files changed

+69
-28
lines changed

4 files changed

+69
-28
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- Global No relay indicator
1313
- [Android] Sensitive clipboard copy for private key (nsec).
1414
- Group info update functionality (name and description).
15+
- Add back buttons in auth flow screens for easier navigation.
1516

1617
### Changed
1718

lib/ui/auth_flow/create_profile_screen.dart

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
22
import 'package:flutter_riverpod/flutter_riverpod.dart';
33
import 'package:flutter_screenutil/flutter_screenutil.dart';
44
import 'package:gap/gap.dart';
5+
import 'package:go_router/go_router.dart';
56
import 'package:whitenoise/config/providers/active_account_provider.dart';
67
import 'package:whitenoise/config/providers/create_profile_screen_provider.dart';
78
import 'package:whitenoise/ui/core/themes/assets.dart';
@@ -69,14 +70,27 @@ class _CreateProfileScreenState extends ConsumerState<CreateProfileScreen> {
6970
padding: EdgeInsets.fromLTRB(24.w, 32.h, 24.w, 0),
7071
child: Column(
7172
children: [
72-
Text(
73-
'Setup Profile',
74-
textAlign: TextAlign.center,
75-
style: TextStyle(
76-
fontSize: 32.sp,
77-
fontWeight: FontWeight.w700,
78-
color: context.colors.mutedForeground,
79-
),
73+
Row(
74+
children: [
75+
IconButton(
76+
onPressed: () => context.pop(),
77+
icon: WnImage(
78+
AssetsPaths.icChevronLeft,
79+
size: 18.w,
80+
color: context.colors.primary,
81+
),
82+
),
83+
Gap(8.w),
84+
Text(
85+
'Set Up Profile',
86+
textAlign: TextAlign.center,
87+
style: TextStyle(
88+
fontSize: 18.sp,
89+
fontWeight: FontWeight.w600,
90+
color: context.colors.mutedForeground,
91+
),
92+
),
93+
],
8094
),
8195
Gap(48.h),
8296
Stack(

lib/ui/auth_flow/info_screen.dart

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,27 @@ class _InfoScreenState extends ConsumerState<InfoScreen> {
7676
padding: const EdgeInsets.fromLTRB(24, 32, 24, 0).w,
7777
child: Column(
7878
children: [
79-
Text(
80-
'Security Without\nCompromise',
81-
textAlign: TextAlign.center,
82-
style: TextStyle(
83-
fontSize: 32.sp,
84-
fontWeight: FontWeight.w700,
85-
color: context.colors.mutedForeground,
86-
),
79+
Row(
80+
children: [
81+
IconButton(
82+
onPressed: () => context.pop(),
83+
icon: WnImage(
84+
AssetsPaths.icChevronLeft,
85+
size: 18.w,
86+
color: context.colors.primary,
87+
),
88+
),
89+
Gap(8.w),
90+
Text(
91+
'Beyond the Noise',
92+
textAlign: TextAlign.center,
93+
style: TextStyle(
94+
fontSize: 18.sp,
95+
fontWeight: FontWeight.w600,
96+
color: context.colors.mutedForeground,
97+
),
98+
),
99+
],
87100
),
88101
Gap(48.h),
89102
FeatureItem(

lib/ui/auth_flow/login_screen.dart

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -137,18 +137,31 @@ class _LoginScreenState extends ConsumerState<LoginScreen> with WidgetsBindingOb
137137
children: [
138138
Padding(
139139
padding: EdgeInsets.only(top: 24.h),
140-
child: Text(
141-
'Login to White Noise',
142-
textAlign: TextAlign.center,
143-
style: TextStyle(
144-
fontSize: 32.sp,
145-
fontWeight: FontWeight.w700,
146-
color: context.colors.mutedForeground,
147-
),
148-
textHeightBehavior: const TextHeightBehavior(
149-
applyHeightToFirstAscent: false,
150-
applyHeightToLastDescent: false,
151-
),
140+
child: Row(
141+
children: [
142+
IconButton(
143+
onPressed: () => context.pop(),
144+
icon: WnImage(
145+
AssetsPaths.icChevronLeft,
146+
size: 18.w,
147+
color: context.colors.primary,
148+
),
149+
),
150+
Gap(8.w),
151+
Text(
152+
'Login to White Noise',
153+
textAlign: TextAlign.center,
154+
style: TextStyle(
155+
fontSize: 18.sp,
156+
fontWeight: FontWeight.w600,
157+
color: context.colors.mutedForeground,
158+
),
159+
textHeightBehavior: const TextHeightBehavior(
160+
applyHeightToFirstAscent: false,
161+
applyHeightToLastDescent: false,
162+
),
163+
),
164+
],
152165
),
153166
),
154167
Gap(79.5.h),

0 commit comments

Comments
 (0)