- Design-System: MeloDesignTokens ThemeExtension, Outfit-Font, Farben #0B0B10/#14141C/#1C1C26 - Akzentfarbe-User-Einstellung behalten (MeloTheme.akzentNotifier), Gradient aus Akzent - Startseite: Hero-Weiterhören-Karte mit Cover, Titel, Glow-Play-Button - 2-stufige Einstellungen: Standard + Expertenmodus (SharedPreferences Key 'experten_modus') - Komponenten: Pill-Buttons (radius 999), Card-Radius 20, Glow-Shadow, PressScale-Widget - Login: Gradient-Button mit Akzent-Glow - 199 Tests grün (194 bestehend + 5 neu): ThemeExtension, Expertenmodus, Akzent, PressScale, Hero - flutter analyze lib/ + test/ = 0 Issues - KEIN APK
36 lines
951 B
Dart
36 lines
951 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
/// Press-Scale Mikro-Interaktion: Button skaliert beim Drücken auf 0.97.
|
|
/// Verwendet AnimatedScale mit 120ms Curves.easeOut.
|
|
class PressScale extends StatefulWidget {
|
|
final Widget child;
|
|
final VoidCallback? onTap;
|
|
|
|
const PressScale({super.key, required this.child, this.onTap});
|
|
|
|
@override
|
|
State<PressScale> createState() => _PressScaleState();
|
|
}
|
|
|
|
class _PressScaleState extends State<PressScale> {
|
|
double _scale = 1.0;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GestureDetector(
|
|
onTapDown: (_) => setState(() => _scale = 0.97),
|
|
onTapUp: (_) {
|
|
setState(() => _scale = 1.0);
|
|
widget.onTap?.call();
|
|
},
|
|
onTapCancel: () => setState(() => _scale = 1.0),
|
|
child: AnimatedScale(
|
|
scale: _scale,
|
|
duration: const Duration(milliseconds: 120),
|
|
curve: Curves.easeOut,
|
|
child: widget.child,
|
|
),
|
|
);
|
|
}
|
|
}
|