This commit is contained in:
Phuoc Nguyen
2025-10-23 17:03:58 +07:00
parent 30c245b401
commit 9189b65ebf
22 changed files with 589 additions and 195 deletions

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';
import '../providers/settings_provider.dart';
import '../../../auth/presentation/providers/auth_provider.dart';
import '../../../../core/constants/app_constants.dart';
@@ -105,11 +106,11 @@ class SettingsPage extends ConsumerWidget {
content: const Text('Are you sure you want to logout?'),
actions: [
TextButton(
onPressed: () => Navigator.pop(context, false),
onPressed: () => context.pop(false),
child: const Text('Cancel'),
),
FilledButton(
onPressed: () => Navigator.pop(context, true),
onPressed: () => context.pop(true),
style: FilledButton.styleFrom(
backgroundColor: Theme.of(context).colorScheme.error,
),
@@ -294,7 +295,7 @@ class SettingsPage extends ConsumerWidget {
onChanged: (value) {
if (value != null) {
ref.read(settingsProvider.notifier).updateTheme(value);
Navigator.pop(context);
context.pop();
}
},
),
@@ -305,7 +306,7 @@ class SettingsPage extends ConsumerWidget {
onChanged: (value) {
if (value != null) {
ref.read(settingsProvider.notifier).updateTheme(value);
Navigator.pop(context);
context.pop();
}
},
),
@@ -316,7 +317,7 @@ class SettingsPage extends ConsumerWidget {
onChanged: (value) {
if (value != null) {
ref.read(settingsProvider.notifier).updateTheme(value);
Navigator.pop(context);
context.pop();
}
},
),
@@ -341,7 +342,7 @@ class SettingsPage extends ConsumerWidget {
onChanged: (value) {
if (value != null) {
ref.read(settingsProvider.notifier).updateLanguage(value);
Navigator.pop(context);
context.pop();
}
},
),
@@ -352,7 +353,7 @@ class SettingsPage extends ConsumerWidget {
onChanged: (value) {
if (value != null) {
ref.read(settingsProvider.notifier).updateLanguage(value);
Navigator.pop(context);
context.pop();
}
},
),
@@ -363,7 +364,7 @@ class SettingsPage extends ConsumerWidget {
onChanged: (value) {
if (value != null) {
ref.read(settingsProvider.notifier).updateLanguage(value);
Navigator.pop(context);
context.pop();
}
},
),
@@ -388,7 +389,7 @@ class SettingsPage extends ConsumerWidget {
onChanged: (value) {
if (value != null) {
// TODO: Implement currency update
Navigator.pop(context);
context.pop();
}
},
),
@@ -399,7 +400,7 @@ class SettingsPage extends ConsumerWidget {
onChanged: (value) {
if (value != null) {
// TODO: Implement currency update
Navigator.pop(context);
context.pop();
}
},
),
@@ -410,7 +411,7 @@ class SettingsPage extends ConsumerWidget {
onChanged: (value) {
if (value != null) {
// TODO: Implement currency update
Navigator.pop(context);
context.pop();
}
},
),
@@ -437,13 +438,13 @@ class SettingsPage extends ConsumerWidget {
),
actions: [
TextButton(
onPressed: () => Navigator.pop(context),
onPressed: () => context.pop(),
child: const Text('Cancel'),
),
FilledButton(
onPressed: () {
// TODO: Implement store name update
Navigator.pop(context);
context.pop();
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Store name updated')),
);
@@ -476,13 +477,13 @@ class SettingsPage extends ConsumerWidget {
),
actions: [
TextButton(
onPressed: () => Navigator.pop(context),
onPressed: () => context.pop(),
child: const Text('Cancel'),
),
FilledButton(
onPressed: () {
// TODO: Implement tax rate update
Navigator.pop(context);
context.pop();
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Tax rate updated')),
);
@@ -521,7 +522,7 @@ class SettingsPage extends ConsumerWidget {
// Close loading dialog
if (context.mounted) {
Navigator.pop(context);
context.pop();
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Data synced successfully')),
);
@@ -538,12 +539,12 @@ class SettingsPage extends ConsumerWidget {
),
actions: [
TextButton(
onPressed: () => Navigator.pop(context),
onPressed: () => context.pop(),
child: const Text('Cancel'),
),
FilledButton(
onPressed: () {
Navigator.pop(context);
context.pop();
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Cache cleared')),
);