From d7f90fb7fff40203e03dacbf5d97f119c9c21715 Mon Sep 17 00:00:00 2001 From: Dr-Blank <64108942+Dr-Blank@users.noreply.github.com> Date: Thu, 3 Oct 2024 05:44:30 -0400 Subject: [PATCH] feat: add About section with app metadata and source code link in YouPage --- assets/images/vaani_logo_foreground.png | Bin 0 -> 3869 bytes lib/features/you/view/you_page.dart | 80 ++++++++++++++++++------ lib/settings/constants.dart | 5 ++ pubspec.yaml | 1 + 4 files changed, 67 insertions(+), 19 deletions(-) create mode 100644 assets/images/vaani_logo_foreground.png diff --git a/assets/images/vaani_logo_foreground.png b/assets/images/vaani_logo_foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..cb8014fdd92400fcd32a8791e6d07d7bbdd4d448 GIT binary patch literal 3869 zcmV+&5908NP)e>+ZGAdY^mmdCu8q|Ie_`-us+)YTks# zDuJo7);_6x-UNU#cY+B369DohFg-m@$5}z?zNx9H2l7kszoEL8QSRlHmX4yX+D3pH zvXUCHx6-4Ou2y4y?H9vCIfFos(KpXm`lZq-qYw-=s;(#N&(TV&Dt%k&qN?kv1%M#5 z&#M93Dbb^7%f46y?WkXjrnX2v*fK20H(^1EA44`JV!hqo6B>*{B;4ax|q1rF!FCb zAEL(4!?LJG09fSVZ%zP!7J<+s;Q!O}5dz?YS<;`3fLw7sm_MkE|Is50C&c0j03XOL z(K`Z^Z)KIeqUx|~kGnd(Kc}W3dVXyHNO+s6J{If8D4nBpf`GW+E&T^O%>;lVfq6!N z@-W>YKnPWLZvn7)0zgeukN{wci|Y-~?+^g&9o+PA7y)mTP~PvBNXY0M0TzI1y}D3! zotjgZ>X}noP~B@l6#z`ufFag^S^)@J-aL&mMq3uuwGo>uBj9Wa8QV~YB>WfX!?{Y& zR(hY(dCK!oFA5U?dPvH%2nQqM_f^D(p%_$cG_I>B06e4x4Y~-It^oqz(Gv7;l`yqK z?C{?#0Nzt80Al3vst|+Q-AZ?*b77C2a8E5LdlQ%8$)3L5_i5Tl0& z03H#9bc-6p!qlN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ZeZg`F(d*x+C8kn%o9AJF@)qXl~s|Ffo6ubZc-jUNHA5fbdidS(i- z<^-Y@RSfpf47sPSe3tC4k z&ivwA2S5M;^8&%LmH@#{J#4)85&*x-7fXF_v=soHHe6B6k)a~O%E{%dTp-&RvqKT1 ztpp&90s^^+Y%3z1EbB}7Kd!GY4^~r~0oYzm#?M=HaF9^=<(sJYr!ch{0C>mQVlViM z?ZfEC)yR#f)&dZwA(e2>@Er)q5~G0btDNO#qkx fFlGsix%&SD%zK8)*C8QD00000NkvXXu0mjf$1xqm literal 0 HcmV?d00001 diff --git a/lib/features/you/view/you_page.dart b/lib/features/you/view/you_page.dart index b5af9e3..2a7bee2 100644 --- a/lib/features/you/view/you_page.dart +++ b/lib/features/you/view/you_page.dart @@ -3,6 +3,7 @@ import 'package:go_router/go_router.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:vaani/api/api_provider.dart'; import 'package:vaani/router/router.dart'; +import 'package:vaani/settings/constants.dart'; import 'package:vaani/shared/utils.dart'; import 'package:vaani/shared/widgets/not_implemented.dart'; @@ -83,21 +84,6 @@ class YouPage extends HookConsumerWidget { title: const Text('My Playlists'), onTap: () { // Handle navigation to playlists - }, - ), - ListTile( - leading: const Icon(Icons.help), - title: const Text('Help'), - onTap: () { - // Handle navigation to help website - showNotImplementedToast(context); - }, - ), - ListTile( - leading: const Icon(Icons.info), - title: const Text('About'), - onTap: () { - // Handle navigation to about showNotImplementedToast(context); }, ), @@ -111,10 +97,40 @@ class YouPage extends HookConsumerWidget { ); }, ), - // const SizedBox(height: 16), - // const Text('App Version: 1.0.0'), - // const Text('Server Version: 1.0.0'), - // const Text('Author: Your Name'), + ListTile( + leading: const Icon(Icons.help), + title: const Text('Help'), + onTap: () { + // Handle navigation to help website + showNotImplementedToast(context); + }, + ), + + AboutListTile( + icon: const Icon(Icons.info), + applicationName: AppMetadata.appName, + applicationVersion: AppMetadata.version, + applicationLegalese: + 'Made with ❤️ by ${AppMetadata.author}', + aboutBoxChildren: [ + // link to github repo + ListTile( + leading: Icon(Icons.code), + title: Text('Source Code'), + onTap: () { + handleLaunchUrl(AppMetadata.githubRepo); + }, + ), + ], + // apply blend mode to the icon to match the primary color + applicationIcon: ColorFiltered( + colorFilter: ColorFilter.mode( + Theme.of(context).colorScheme.primary, + BlendMode.srcIn, + ), + child: const VaaniLogo(), + ), + ), ], ), ), @@ -166,3 +182,29 @@ class UserBar extends HookConsumerWidget { ); } } + +class VaaniLogo extends StatelessWidget { + const VaaniLogo({ + super.key, + this.size, + this.duration = const Duration(milliseconds: 750), + this.curve = Curves.fastOutSlowIn, + }); + + final double? size; + final Duration duration; + final Curve curve; + + @override + Widget build(BuildContext context) { + final IconThemeData iconTheme = IconTheme.of(context); + final double? iconSize = size ?? iconTheme.size; + return AnimatedContainer( + width: iconSize, + height: iconSize, + duration: duration, + curve: curve, + child: Image.asset('assets/images/vaani_logo_foreground.png'), + ); + } +} diff --git a/lib/settings/constants.dart b/lib/settings/constants.dart index 2429545..9ab7b55 100644 --- a/lib/settings/constants.dart +++ b/lib/settings/constants.dart @@ -10,5 +10,10 @@ class AppMetadata { // for deeplinking static const String appScheme = 'vaani'; + static const version = '1.0.0'; + static const author = 'Dr.Blank'; + + static Uri githubRepo = Uri.parse('https://github.com/Dr-Blank/Vaani'); + static get appNameLowerCase => appName.toLowerCase().replaceAll(' ', '_'); } diff --git a/pubspec.yaml b/pubspec.yaml index 8a632f4..0a4ac94 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -118,6 +118,7 @@ flutter: - assets/ - assets/animations/ - assets/sounds/ + - assets/images/ # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg # An image asset can refer to one or more resolution-specific "variants", see