feat: add sounds

This commit is contained in:
2026-06-18 21:57:28 +03:30
parent 519752b478
commit f4d99043c4
18 changed files with 312 additions and 55 deletions
+7 -1
View File
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import '../service/app_sounds.dart';
import '../theme/app_theme.dart';
/// مجموعه‌ی ویجت‌های گرافیکیِ مشترک برای ظاهرِ بازیِ (Unity-style):
@@ -111,7 +112,12 @@ class _GameButtonState extends State<GameButton> {
onTapDown: enabled ? (_) => setState(() => _down = true) : null,
onTapUp: enabled ? (_) => setState(() => _down = false) : null,
onTapCancel: enabled ? () => setState(() => _down = false) : null,
onTap: widget.onTap,
onTap: enabled
? () {
AppSounds.button();
widget.onTap!();
}
: null,
child: AnimatedScale(
scale: _down ? 0.96 : 1.0,
duration: const Duration(milliseconds: 90),