feat: add game graphic

This commit is contained in:
2026-07-08 09:06:32 +03:30
parent ffd2646eea
commit 46a649166b
15 changed files with 521 additions and 57 deletions
+24
View File
@@ -0,0 +1,24 @@
import 'package:flutter/foundation.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
/// تنظیماتِ سراسریِ اپ (فعلاً کیفیتِ گرافیک). با ذخیره‌ی محلی پایدار می‌ماند.
class AppSettings {
AppSettings._();
static final AppSettings I = AppSettings._();
final _storage = const FlutterSecureStorage();
static const _kLowGfx = 'low_graphics';
/// حالتِ کم‌مصرف: افکت‌های اتمسفری (ذرات، شوک‌ویوِ بریدن، پس‌زمینه‌ی تصویری)
/// خاموش می‌شوند تا روی گوشی‌های ضعیف روان بماند. با ValueNotifier تا UI واکنش دهد.
final ValueNotifier<bool> lowGraphics = ValueNotifier(false);
Future<void> load() async {
lowGraphics.value = (await _storage.read(key: _kLowGfx)) == '1';
}
Future<void> setLowGraphics(bool v) async {
lowGraphics.value = v;
await _storage.write(key: _kLowGfx, value: v ? '1' : '0');
}
}