From 4357a7fc1748ea4080d3a30fcd6108274e7f2123 Mon Sep 17 00:00:00 2001 From: flofriday Date: Sun, 15 Aug 2021 13:28:45 +0200 Subject: [PATCH] =?UTF-8?q?Hide=20an=20easteregg=20=F0=9F=90=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/screens/settings_screen.dart | 57 ++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 14 deletions(-) diff --git a/lib/screens/settings_screen.dart b/lib/screens/settings_screen.dart index a412cdd..176c15a 100644 --- a/lib/screens/settings_screen.dart +++ b/lib/screens/settings_screen.dart @@ -144,24 +144,53 @@ class _SettingsScreenState extends State { ], ), ), - Padding( - padding: EdgeInsets.all(12), - child: Center( - child: FutureBuilder( - future: PackageInfo.fromPlatform(), - builder: (BuildContext context, - AsyncSnapshot snapshot) { - if (!snapshot.hasData) return Text("zz"); + Center( + child: FutureBuilder( + future: PackageInfo.fromPlatform(), + builder: (BuildContext context, + AsyncSnapshot snapshot) { + if (!snapshot.hasData) return Text("zz"); - String build = "debug"; - if (kReleaseMode) build = "release"; + String build = "debug"; + if (kReleaseMode) build = "release"; - return Text( + return TextButton( + child: Text( "Version ${snapshot.data!.version} $build build", style: Theme.of(context).textTheme.caption, - ); - }), - ), + ), + onPressed: () { + // This is just for the animation to hint that there + // is something + }, + onLongPress: () { + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + title: const Text('🐮 Mooooooo!'), + content: SingleChildScrollView( + child: ListBody( + children: const [ + Text( + 'Oh no!\nYou found on of my eastereggs, how emberassing. 🙈\n\nOk you can keep it, but please don\'t tell the other about this.'), + ], + ), + ), + actions: [ + TextButton( + child: const Text('I will be quiet.'), + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ], + ); + }, + ); + }, + ); + }), ), ], ),