mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55: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();
|
||||
KVStoreService.doneGettingStarted = false;
|
||||
|
||||
final hiveCacheDir =
|
||||
kIsWeb ? null : (await getApplicationSupportDirectory()).path;
|
||||
|
@ -101,9 +101,11 @@ class GettingStartedScreenSupportSection extends HookConsumerWidget {
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: Colors.white,
|
||||
),
|
||||
onPressed: () {
|
||||
KVStoreService.doneGettingStarted = true;
|
||||
context.go("/");
|
||||
onPressed: () async {
|
||||
await KVStoreService.setDoneGettingStarted(true);
|
||||
if (context.mounted) {
|
||||
context.go("/");
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
@ -115,9 +117,11 @@ class GettingStartedScreenSupportSection extends HookConsumerWidget {
|
||||
backgroundColor: const Color(0xff1db954),
|
||||
foregroundColor: Colors.white,
|
||||
),
|
||||
onPressed: () {
|
||||
KVStoreService.doneGettingStarted = true;
|
||||
context.push("/login");
|
||||
onPressed: () async {
|
||||
await KVStoreService.setDoneGettingStarted(true);
|
||||
if (context.mounted) {
|
||||
context.push("/login");
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
|
@ -10,6 +10,6 @@ abstract class KVStoreService {
|
||||
|
||||
static bool get doneGettingStarted =>
|
||||
sharedPreferences.getBool('doneGettingStarted') ?? false;
|
||||
static set doneGettingStarted(bool value) =>
|
||||
sharedPreferences.setBool('doneGettingStarted', value);
|
||||
static Future<void> setDoneGettingStarted(bool value) async =>
|
||||
await sharedPreferences.setBool('doneGettingStarted', value);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user