♻️ Add splash screen for loading data

This commit is contained in:
2024-12-14 01:32:13 +08:00
parent c7d5cb48ac
commit f763c7515a
13 changed files with 163 additions and 54 deletions

View File

@ -19,16 +19,17 @@ class UserProvider extends ChangeNotifier {
UserProvider(BuildContext context) {
_sn = context.read<SnNetworkProvider>();
}
SharedPreferences.getInstance().then((prefs) {
final value = prefs.getString(kAtkStoreKey);
isAuthorized = value != null;
notifyListeners();
refreshUser().then((value) {
if (value != null) {
log('Logged in as @${value.name}');
}
});
Future<void> initialize() async {
final prefs = await SharedPreferences.getInstance();
final value = prefs.getString(kAtkStoreKey);
isAuthorized = value != null;
notifyListeners();
refreshUser().then((value) {
if (value != null) {
log('Logged in as @${value.name}');
}
});
}