match_magic/lib/models/app_state_manager.dart

17 lines
495 B
Dart

import 'package:shared_preferences/shared_preferences.dart';
class AppStateManager {
static const String _modeKey = 'mode';
// Installing the bubbles or balloons mod
static Future<bool> getMode() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
return prefs.getBool(_modeKey) ?? true;
}
static Future<void> setMode(bool mode) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.setBool(_modeKey, mode);
}
}