@@ -28,6 +28,7 @@ class AppState extends Equatable {
28
28
this .status = AppStatus .initial,
29
29
this .user, // User is now nullable and defaults to null
30
30
this .locale, // Added locale
31
+ this .appConfig, // Added AppConfig
31
32
});
32
33
33
34
/// The index of the currently selected item in the bottom navigation bar.
@@ -58,6 +59,9 @@ class AppState extends Equatable {
58
59
/// The current application locale.
59
60
final Locale ? locale; // Added locale
60
61
62
+ /// The global application configuration (remote config).
63
+ final AppConfig ? appConfig; // Added AppConfig
64
+
61
65
/// Creates a copy of the current state with updated values.
62
66
AppState copyWith ({
63
67
int ? selectedBottomNavigationIndex,
@@ -69,8 +73,10 @@ class AppState extends Equatable {
69
73
User ? user,
70
74
UserAppSettings ? settings, // Add settings to copyWith
71
75
Locale ? locale, // Added locale
76
+ AppConfig ? appConfig, // Added AppConfig
72
77
bool clearFontFamily = false ,
73
78
bool clearLocale = false , // Added to allow clearing locale
79
+ bool clearAppConfig = false , // Added to allow clearing appConfig
74
80
}) {
75
81
return AppState (
76
82
selectedBottomNavigationIndex:
@@ -83,6 +89,7 @@ class AppState extends Equatable {
83
89
user: user ?? this .user,
84
90
settings: settings ?? this .settings, // Copy settings
85
91
locale: clearLocale ? null : locale ?? this .locale, // Added locale
92
+ appConfig: clearAppConfig ? null : appConfig ?? this .appConfig, // Added
86
93
);
87
94
}
88
95
@@ -97,5 +104,6 @@ class AppState extends Equatable {
97
104
user,
98
105
settings, // Include settings in props
99
106
locale, // Added locale to props
107
+ appConfig, // Added AppConfig to props
100
108
];
101
109
}
0 commit comments