Skip to content

Commit

Permalink
feat: add About section with app metadata and source code link in You…
Browse files Browse the repository at this point in the history
…Page
  • Loading branch information
Dr-Blank committed Oct 3, 2024
1 parent fd10791 commit d7f90fb
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 19 deletions.
Binary file added assets/images/vaani_logo_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
80 changes: 61 additions & 19 deletions lib/features/you/view/you_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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);
},
),
Expand All @@ -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(),
),
),
],
),
),
Expand Down Expand Up @@ -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'),
);
}
}
5 changes: 5 additions & 0 deletions lib/settings/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(' ', '_');
}
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d7f90fb

Please sign in to comment.