feat: add game graphic
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:random_avatar/random_avatar.dart';
|
||||
|
||||
import '../../../../core/settings/app_settings.dart';
|
||||
import '../../../../core/theme/app_theme.dart';
|
||||
import '../../../../core/widgets/game_ui.dart';
|
||||
import '../../../../core/widgets/rank_badge.dart';
|
||||
@@ -198,6 +199,8 @@ class ProfileScreen extends StatelessWidget {
|
||||
const SizedBox(height: 8),
|
||||
_statsSection(context, d),
|
||||
const SizedBox(height: 16),
|
||||
const _GraphicsToggle(),
|
||||
const SizedBox(height: 8),
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
child: TextButton.icon(
|
||||
@@ -490,3 +493,40 @@ class _EditProfileSheetState extends State<_EditProfileSheet> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// سوئیچِ «گرافیک کممصرف»: افکتهای اتمسفری را برای گوشیهای ضعیف خاموش میکند.
|
||||
class _GraphicsToggle extends StatelessWidget {
|
||||
const _GraphicsToggle();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ValueListenableBuilder<bool>(
|
||||
valueListenable: AppSettings.I.lowGraphics,
|
||||
builder: (context, low, _) => Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 6),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.panel.withValues(alpha: 0.5),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(color: AppColors.goldFaint),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(Icons.bolt, color: AppColors.gold, size: 20),
|
||||
const SizedBox(width: 10),
|
||||
const Expanded(
|
||||
child: Text(
|
||||
'گرافیک کممصرف',
|
||||
style: TextStyle(color: Colors.white, fontSize: 14),
|
||||
),
|
||||
),
|
||||
Switch(
|
||||
value: low,
|
||||
activeThumbColor: AppColors.gold,
|
||||
onChanged: (v) => AppSettings.I.setLowGraphics(v),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user