@@ -5,6 +5,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
55import 'package:gap/gap.dart' ;
66import 'package:go_router/go_router.dart' ;
77import 'package:logging/logging.dart' ;
8+ import 'package:whitenoise/config/extensions/toast_extension.dart' ;
89import 'package:whitenoise/config/providers/active_account_provider.dart' ;
910import 'package:whitenoise/config/providers/active_pubkey_provider.dart' ;
1011import 'package:whitenoise/config/providers/auth_provider.dart' ;
@@ -17,6 +18,7 @@ import 'package:whitenoise/routing/routes.dart';
1718import 'package:whitenoise/src/rust/api.dart' as wn_api;
1819import 'package:whitenoise/ui/core/themes/assets.dart' ;
1920import 'package:whitenoise/ui/core/themes/src/extensions.dart' ;
21+ import 'package:whitenoise/ui/core/ui/wn_app_bar.dart' ;
2022import 'package:whitenoise/ui/core/ui/wn_button.dart' ;
2123import 'package:whitenoise/ui/core/ui/wn_dialog.dart' ;
2224import 'package:whitenoise/ui/core/ui/wn_image.dart' ;
@@ -161,12 +163,7 @@ class AppSettingsScreen extends ConsumerWidget {
161163 if (! context.mounted) return ;
162164
163165 Navigator .of (context).pop (); // Close loading dialog
164- ScaffoldMessenger .of (context).showSnackBar (
165- SnackBar (
166- content: Text ('Failed to delete data: $e ' ),
167- duration: const Duration (seconds: 5 ),
168- ),
169- );
166+ ref.showErrorToast ('Failed to delete data: $e ' , durationMs: 5000 );
170167 }
171168 }
172169
@@ -181,81 +178,85 @@ class AppSettingsScreen extends ConsumerWidget {
181178 statusBarBrightness: Brightness .dark,
182179 ),
183180 child: Scaffold (
184- backgroundColor: context.colors.appBarBackground,
181+ backgroundColor: context.colors.neutral,
182+ appBar: WnAppBar (
183+ automaticallyImplyLeading: false ,
184+ leading: RepaintBoundary (
185+ child: IconButton (
186+ onPressed: () => context.pop (),
187+ icon: WnImage (
188+ AssetsPaths .icChevronLeft,
189+ width: 24. w,
190+ height: 24. w,
191+ color: context.colors.solidPrimary,
192+ ),
193+ ),
194+ ),
195+ title: RepaintBoundary (
196+ child: Text (
197+ 'App Settings' ,
198+ style: TextStyle (
199+ fontSize: 18. sp,
200+ fontWeight: FontWeight .w600,
201+ color: context.colors.solidPrimary,
202+ ),
203+ ),
204+ ),
205+ ),
185206 body: SafeArea (
186207 bottom: false ,
187208 child: ColoredBox (
188209 color: context.colors.neutral,
189210 child: Column (
190211 children: [
191- Gap (24. h),
192- Row (
193- children: [
194- IconButton (
195- onPressed: () => context.pop (),
196- icon: WnImage (
197- AssetsPaths .icChevronLeft,
198- width: 24. w,
199- height: 24. w,
200- color: context.colors.primary,
201- ),
202- ),
203- Text (
204- 'App Settings' ,
205- style: TextStyle (
206- fontSize: 18. sp,
207- fontWeight: FontWeight .w600,
208- color: context.colors.mutedForeground,
209- ),
210- ),
211- ],
212- ),
213- Gap (29. h),
214212 Expanded (
215- child: SingleChildScrollView (
216- child: Padding (
217- padding: EdgeInsets .only (
218- left: 16. w,
219- right: 16. w,
220- bottom: 24. w,
221- ),
222- child: Column (
223- crossAxisAlignment: CrossAxisAlignment .start,
224- children: [
225- Text (
226- 'Theme' ,
227- style: TextStyle (
228- fontSize: 14. sp,
229- fontWeight: FontWeight .w600,
230- color: context.colors.primary,
213+ child: Padding (
214+ padding: EdgeInsets .symmetric (vertical: 24. h),
215+ child: SingleChildScrollView (
216+ child: Padding (
217+ padding: EdgeInsets .only (
218+ left: 16. w,
219+ right: 16. w,
220+ bottom: 24. w,
221+ ),
222+ child: Column (
223+ crossAxisAlignment: CrossAxisAlignment .start,
224+ children: [
225+ Text (
226+ 'Theme' ,
227+ style: TextStyle (
228+ fontSize: 14. sp,
229+ fontWeight: FontWeight .w600,
230+ color: context.colors.primary,
231+ ),
232+ ),
233+ Gap (10. h),
234+ _ThemeDropdown (
235+ currentTheme: themeMode,
236+ onThemeChanged: (newMode) {
237+ ref.read (themeProvider.notifier).setThemeMode (newMode);
238+ },
231239 ),
232- ),
233- Gap (10. h),
234- _ThemeDropdown (
235- currentTheme: themeMode,
236- onThemeChanged: (newMode) {
237- ref.read (themeProvider.notifier).setThemeMode (newMode);
238- },
239- ),
240- Gap (16. h),
241- Text (
242- 'Danger Zone' ,
243- style: TextStyle (
244- fontSize: 14. sp,
245- fontWeight: FontWeight .w600,
246- color: context.colors.primary,
240+ Gap (16. h),
241+ Text (
242+ 'Danger Zone' ,
243+ style: TextStyle (
244+ fontSize: 14. sp,
245+ fontWeight: FontWeight .w600,
246+ color: context.colors.primary,
247+ ),
247248 ),
248- ),
249- Gap (10. h),
250- WnFilledButton (
251- label: 'Delete All Data' ,
252- labelTextStyle: WnButtonSize .large.textStyle ().copyWith (
253- color: context.colors.solidNeutralWhite,
249+ Gap (10. h),
250+ WnFilledButton (
251+ label: 'Delete All Data' ,
252+ labelTextStyle: WnButtonSize .large.textStyle ().copyWith (
253+ color: context.colors.solidNeutralWhite,
254+ ),
255+ visualState: WnButtonVisualState .destructive,
256+ onPressed: () => _deleteAllData (context, ref),
254257 ),
255- visualState: WnButtonVisualState .destructive,
256- onPressed: () => _deleteAllData (context, ref),
257- ),
258- ],
258+ ],
259+ ),
259260 ),
260261 ),
261262 ),
0 commit comments