Skip to content

Commit c654b0c

Browse files
committed
refactor(settings): update imports and error handling in settings page
- Replace shared constants and widgets imports with ht_shared and ht_ui_kit packages - Use AppLocalizationsX for localization - Update error handling in FailureStateWidget to use HtHttpException and UnknownException
1 parent f5d0769 commit c654b0c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/settings/view/settings_page.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import 'package:ht_main/app/bloc/app_bloc.dart';
55
import 'package:ht_main/l10n/l10n.dart';
66
import 'package:ht_main/router/routes.dart';
77
import 'package:ht_main/settings/bloc/settings_bloc.dart';
8-
import 'package:ht_main/shared/constants/constants.dart';
9-
import 'package:ht_main/shared/widgets/widgets.dart';
8+
import 'package:ht_shared/ht_shared.dart';
9+
import 'package:ht_ui_kit/ht_ui_kit.dart';
1010

1111
/// {@template settings_page}
1212
/// The main page for accessing different application settings categories.
@@ -20,7 +20,7 @@ class SettingsPage extends StatelessWidget {
2020

2121
@override
2222
Widget build(BuildContext context) {
23-
final l10n = context.l10n;
23+
final l10n = AppLocalizationsX(context).l10n;
2424

2525
return Scaffold(
2626
appBar: AppBar(
@@ -54,7 +54,8 @@ class SettingsPage extends StatelessWidget {
5454
// Handle error state
5555
if (state.status == SettingsStatus.failure) {
5656
return FailureStateWidget(
57-
message: state.error?.toString() ?? l10n.settingsErrorDefault,
57+
exception: state.error as HtHttpException? ??
58+
const UnknownException('An unknown error occurred'),
5859
onRetry: () {
5960
// Access AppBloc to get the current user ID for retry
6061
final appBloc = context.read<AppBloc>();

0 commit comments

Comments
 (0)