feat(onboarding): add theme-aware 5.0 upgrade introduction

This commit is contained in:
zarzet committed 2026-09-22 00:15:29 +07:00
1 parent 4283126381
commit 3eea711ed3
7 files changed
+976

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
import 'package:shared_preferences/shared_preferences.dart';
/// Separate from settings migrations: migrating preferences must not consume
/// the upgrade introduction before the user has actually seen it.
class UpgradeIntroService {
static const _seenKey = 'upgrade_intro_5_0_seen';
static bool shouldShow(
SharedPreferences preferences, {
required String version,
required bool existingInstallation,
}) =>
version.split('.').first == '5' &&
existingInstallation &&
!(preferences.getBool(_seenKey) ?? false);
static Future<void> markSeen(SharedPreferences preferences) async {
await preferences.setBool(_seenKey, true);
}
}