mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 16:05:18 +00:00
chore: fix getting started showing up everytime
This commit is contained in:
parent
4a044498a4
commit
a248a4b48c
@ -70,7 +70,6 @@ Future<void> main(List<String> rawArgs) async {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await KVStoreService.initialize();
|
await KVStoreService.initialize();
|
||||||
KVStoreService.doneGettingStarted = false;
|
|
||||||
|
|
||||||
final hiveCacheDir =
|
final hiveCacheDir =
|
||||||
kIsWeb ? null : (await getApplicationSupportDirectory()).path;
|
kIsWeb ? null : (await getApplicationSupportDirectory()).path;
|
||||||
|
@ -101,9 +101,11 @@ class GettingStartedScreenSupportSection extends HookConsumerWidget {
|
|||||||
style: TextButton.styleFrom(
|
style: TextButton.styleFrom(
|
||||||
foregroundColor: Colors.white,
|
foregroundColor: Colors.white,
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () async {
|
||||||
KVStoreService.doneGettingStarted = true;
|
await KVStoreService.setDoneGettingStarted(true);
|
||||||
context.go("/");
|
if (context.mounted) {
|
||||||
|
context.go("/");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -115,9 +117,11 @@ class GettingStartedScreenSupportSection extends HookConsumerWidget {
|
|||||||
backgroundColor: const Color(0xff1db954),
|
backgroundColor: const Color(0xff1db954),
|
||||||
foregroundColor: Colors.white,
|
foregroundColor: Colors.white,
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () async {
|
||||||
KVStoreService.doneGettingStarted = true;
|
await KVStoreService.setDoneGettingStarted(true);
|
||||||
context.push("/login");
|
if (context.mounted) {
|
||||||
|
context.push("/login");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -10,6 +10,6 @@ abstract class KVStoreService {
|
|||||||
|
|
||||||
static bool get doneGettingStarted =>
|
static bool get doneGettingStarted =>
|
||||||
sharedPreferences.getBool('doneGettingStarted') ?? false;
|
sharedPreferences.getBool('doneGettingStarted') ?? false;
|
||||||
static set doneGettingStarted(bool value) =>
|
static Future<void> setDoneGettingStarted(bool value) async =>
|
||||||
sharedPreferences.setBool('doneGettingStarted', value);
|
await sharedPreferences.setBool('doneGettingStarted', value);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user