feat: simplify easter egg to direct URL launch on triple-tap
This commit is contained in:
parent
e22a8d5958
commit
c8a2fd60d0
1 changed files with 41 additions and 90 deletions
|
|
@ -20,11 +20,10 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
|||
late int _accuracy;
|
||||
late bool _offlineBuffer;
|
||||
late bool _stopDetection;
|
||||
bool _showEasterEgg = false;
|
||||
int _tapCount = 0;
|
||||
DateTime? _lastTapTime;
|
||||
|
||||
void _handleAppBarTap() {
|
||||
Future<void> _handleAppBarTap() async {
|
||||
const tripleTapInterval = Duration(milliseconds: 500);
|
||||
final now = DateTime.now();
|
||||
|
||||
|
|
@ -38,18 +37,10 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
|||
|
||||
if (_tapCount == 3) {
|
||||
_tapCount = 0;
|
||||
setState(() => _showEasterEgg = true);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _triggerEasterEgg() async {
|
||||
await Future.delayed(const Duration(milliseconds: 1500));
|
||||
final uri = Uri.parse('https://fiatcode.dev');
|
||||
if (await canLaunchUrl(uri)) {
|
||||
await launchUrl(uri, mode: LaunchMode.externalApplication);
|
||||
}
|
||||
if (mounted) {
|
||||
setState(() => _showEasterEgg = false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -167,9 +158,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
|||
child: Container(height: 1, color: const Color(0xFF2a2a2a)),
|
||||
),
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
ListView(
|
||||
body: ListView(
|
||||
padding: const EdgeInsets.all(20),
|
||||
children: [
|
||||
_buildSectionHeader('SERVER'),
|
||||
|
|
@ -208,9 +197,6 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
|||
const SizedBox(height: 20),
|
||||
],
|
||||
),
|
||||
if (_showEasterEgg) _buildEasterEggOverlay(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -441,39 +427,4 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
|||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildEasterEggOverlay() {
|
||||
return AnimatedOpacity(
|
||||
opacity: _showEasterEgg ? 1.0 : 0.0,
|
||||
duration: const Duration(milliseconds: 300),
|
||||
onEnd: _triggerEasterEgg,
|
||||
child: AnimatedScale(
|
||||
scale: _showEasterEgg ? 1.0 : 0.5,
|
||||
duration: const Duration(milliseconds: 300),
|
||||
curve: Curves.easeOutBack,
|
||||
child: Container(
|
||||
color: Colors.black.withValues(alpha: 0.85),
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'🎉 FIAT CODE! 🎉',
|
||||
style: TextStyle(
|
||||
fontFamily: 'monospace',
|
||||
fontSize: 32,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: const Color(0xFF00e676),
|
||||
shadows: [
|
||||
Shadow(
|
||||
color: const Color(0xFF00e676).withValues(alpha: 0.5),
|
||||
blurRadius: 20,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue