feat: add sounds
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user