Add more dex entries

This commit is contained in:
zontreck 2025-06-01 14:16:16 -07:00
parent ec46c62a24
commit d33cdfb275
9 changed files with 379 additions and 6 deletions

View file

@ -1,8 +1,35 @@
import 'dart:math';
import 'dart:nativewrappers/_internal/vm/lib/ffi_allocation_patch.dart';
import 'package:pokedex/pokemon.dart';
import 'package:shared_preferences/shared_preferences.dart';
class Callbacks {
Function()? mainPage;
Function()? filtersPage;
Function()? dexDisplay;
Function()? updateCheckPage;
Future<void> dispatch() async {
if (mainPage != null) mainPage.call();
if (filtersPage != null) filtersPage.call();
if (dexDisplay != null) dexDisplay.call();
if (updateCheckPage != null) updateCheckPage.call();
}
}
class SessionData {
static Future<void> initialize() async {
SharedPreferencesAsync spa = SharedPreferencesAsync();
darkMode = await spa.getBool("dark") ?? false;
}
static Future<void> finalize() async {
SharedPreferencesAsync spa = SharedPreferencesAsync();
await spa.setBool("dark", darkMode);
}
static Callbacks callbacks = Callbacks();
static bool isUpdateAvailable = false;
static bool enableDescription = true;
static bool darkMode = false;