Skip to content

Commit

Permalink
ui: add about page
Browse files Browse the repository at this point in the history
  • Loading branch information
jjanku committed May 17, 2024
1 parent c7fcf05 commit a9b2845
Show file tree
Hide file tree
Showing 5 changed files with 140 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'package:provider/provider.dart';
import 'app_container.dart';
import 'routes.dart';
import 'theme.dart';
import 'ui/about_page.dart';
import 'ui/home_page.dart';
import 'ui/init_page.dart';
import 'ui/new_group_page.dart';
Expand Down Expand Up @@ -127,6 +128,7 @@ class MyApp extends StatelessWidget {
prefillHost: prefillHost ?? 'meesign.crocs.fi.muni.cz',
prefillName: prefillName ?? '',
),
Routes.about: (_) => const AboutPage(),
},
);
}
Expand Down
1 change: 1 addition & 0 deletions lib/routes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ class Routes {
static const String newGroupSearch = '$newGroup/search';
static const String newGroupQr = '$newGroup/qr_reader';
static const String init = '/init';
static const String about = '/about';
}
131 changes: 131 additions & 0 deletions lib/ui/about_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:material_symbols_icons/symbols.dart';
import 'package:url_launcher/url_launcher.dart';

class AboutPage extends StatelessWidget {
static const version = '0.4.0';

static const crocsAuth = 'crocs.fi.muni.cz';
static const meesignAuth = 'meesign.$crocsAuth';

// sorted alphabetically by last name
static const authors = [
(name: 'Antonín Dufka', github: 'dufkan'),
(name: 'Jiří Gavenda', github: 'jirigav'),
(name: 'Jakub Janků', github: 'jjanku'),
(name: 'Kristián Mika', github: 'KristianMika'),
(name: 'Petr Švenda', github: 'petrs'),
];

const AboutPage({super.key});

@override
Widget build(BuildContext context) {
final theme = Theme.of(context);

final linkStyle = theme.textTheme.titleMedium?.copyWith(
decoration: TextDecoration.underline,
color: theme.colorScheme.tertiary,
);

final sectionStyle = theme.textTheme.titleLarge;

const sectionGap = 32.0;
const itemGap = 16.0;

return Scaffold(
appBar: AppBar(
title: const Text('About'),
),
body: SizedBox.expand(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SvgPicture.asset(
'assets/icon_logo.svg',
colorFilter: ColorFilter.mode(
theme.colorScheme.primaryContainer,
BlendMode.srcIn,
),
width: 72,
),
const SizedBox(height: itemGap),
Text(
'MeeSign',
textAlign: TextAlign.center,
style: theme.textTheme.displayLarge,
),
const SizedBox(height: itemGap),
Text(
version,
style: theme.textTheme.titleLarge,
),
const SizedBox(height: itemGap),
InkWell(
onTap: () => launchUrl(Uri.https(meesignAuth)),
borderRadius: const BorderRadius.all(Radius.circular(4)),
child: Text(
meesignAuth,
style: linkStyle,
),
),
const SizedBox(height: sectionGap),
Text(
'Developed by',
style: sectionStyle,
),
const SizedBox(height: itemGap),
SvgPicture.asset(
'assets/crocs_logo.svg',
colorFilter: theme.brightness == Brightness.dark
? ColorFilter.mode(
theme.colorScheme.onSurface,
BlendMode.srcIn,
)
: null,
height: 72,
),
const SizedBox(height: itemGap),
InkWell(
onTap: () => launchUrl(Uri.https(crocsAuth)),
borderRadius: const BorderRadius.all(Radius.circular(4)),
child: Text(
crocsAuth,
style: linkStyle,
),
),
const SizedBox(height: sectionGap),
Text(
'Authors',
style: sectionStyle,
),
const SizedBox(height: itemGap),
for (final author in authors)
Row(
mainAxisSize: MainAxisSize.min,
children: [
SizedBox.square(
dimension: 24,
child: IconButton(
padding: const EdgeInsets.all(0),
iconSize: 20,
icon: const Icon(Symbols.link, opticalSize: 20),
onPressed: () => launchUrl(
Uri.https('github.com', author.github),
),
),
),
const SizedBox(width: 4),
Text(author.name),
],
),
const SizedBox(height: sectionGap),
],
),
),
),
);
}
}
4 changes: 4 additions & 0 deletions lib/ui/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1144,6 +1144,10 @@ class _HomePageViewState extends State<HomePageView> {
onTap: () => model.showArchived = !model.showArchived,
child: const Text('Archived'),
),
PopupMenuItem(
onTap: () => Navigator.pushNamed(context, Routes.about),
child: const Text('About'),
),
],
);
}),
Expand Down
2 changes: 2 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html

# Do not forget to update lib/ui/about_page.dart as well!
version: 0.4.0

environment:
Expand Down

0 comments on commit a9b2845

Please sign in to comment.