feat(accessibility): add reduceMotion scaling and minimize animations; apply RepaintBoundary to heavy widgets
This commit is contained in:
@@ -4,6 +4,7 @@ import '../theme/app_colors.dart';
|
||||
import 'glassmorphism_card.dart';
|
||||
import '../l10n/app_localizations.dart';
|
||||
import '../utils/platform_helper.dart';
|
||||
import '../utils/reduce_motion.dart';
|
||||
|
||||
class FloatingNavigationBar extends StatefulWidget {
|
||||
final int selectedIndex;
|
||||
@@ -30,7 +31,9 @@ class _FloatingNavigationBarState extends State<FloatingNavigationBar>
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller = AnimationController(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
duration: ReduceMotion.platform()
|
||||
? const Duration(milliseconds: 0)
|
||||
: const Duration(milliseconds: 300),
|
||||
vsync: this,
|
||||
);
|
||||
_animation = CurvedAnimation(
|
||||
@@ -72,9 +75,13 @@ class _FloatingNavigationBarState extends State<FloatingNavigationBar>
|
||||
right: 16,
|
||||
height: 88,
|
||||
child: Transform.translate(
|
||||
offset: Offset(0, 100 * (1 - _animation.value)),
|
||||
offset: Offset(
|
||||
0,
|
||||
ReduceMotion.isEnabled(context)
|
||||
? 0
|
||||
: 100 * (1 - _animation.value)),
|
||||
child: Opacity(
|
||||
opacity: _animation.value,
|
||||
opacity: ReduceMotion.isEnabled(context) ? 1 : _animation.value,
|
||||
child: Container(
|
||||
margin: const EdgeInsets.all(4), // 그림자 공간 확보
|
||||
decoration: BoxDecoration(
|
||||
@@ -220,12 +227,14 @@ class _AddButtonState extends State<_AddButton>
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller = AnimationController(
|
||||
duration: const Duration(milliseconds: 150),
|
||||
duration: ReduceMotion.platform()
|
||||
? const Duration(milliseconds: 0)
|
||||
: const Duration(milliseconds: 150),
|
||||
vsync: this,
|
||||
);
|
||||
_scaleAnimation = Tween<double>(
|
||||
begin: 1.0,
|
||||
end: 0.9,
|
||||
end: ReduceMotion.platform() ? 1.0 : 0.9,
|
||||
).animate(CurvedAnimation(
|
||||
parent: _controller,
|
||||
curve: Curves.easeInOut,
|
||||
|
||||
Reference in New Issue
Block a user