diff options
| author | Mica White <botahamec@outlook.com> | 2026-01-13 22:51:59 -0500 |
|---|---|---|
| committer | Mica White <botahamec@outlook.com> | 2026-01-13 22:51:59 -0500 |
| commit | 359d8e07ef5cb585fff13031d075d7c949135317 (patch) | |
| tree | 0b317599d7cbbb9e5f8b4fce8e99559ad45bfd8c /lib/about.dart | |
| parent | d44654698cc3c65a5a458f4c2cdc3b2d868890f5 (diff) | |
Complete settings page
Diffstat (limited to 'lib/about.dart')
| -rw-r--r-- | lib/about.dart | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/lib/about.dart b/lib/about.dart deleted file mode 100644 index 7dbaaf4..0000000 --- a/lib/about.dart +++ /dev/null @@ -1,85 +0,0 @@ -import 'package:build_info/build_info.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:package_info_plus/package_info_plus.dart'; -import 'package:url_launcher/url_launcher_string.dart'; - -class AboutPage extends StatefulWidget { - const AboutPage({super.key}); - - @override - State<AboutPage> createState() => _AboutPageState(); -} - -class _AboutPageState extends State<AboutPage> { - Future<(PackageInfo, String, BuildInfoData?)>? _loadedData; - - @override - void initState() { - super.initState(); - _loadedData = Future(() async { - var packageInfo = await PackageInfo.fromPlatform(); - var license = await rootBundle.loadString('LICENSE'); - var buildInfo = await BuildInfo.fromPlatform(); - return (packageInfo, license, buildInfo); - }); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar(title: Text('About')), - body: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Icon( - Icons.speed, - size: Theme.of(context).textTheme.displayLarge?.fontSize ?? 72, - ), - Text( - 'Simple Speedometer', - style: Theme.of(context).textTheme.titleLarge, - ), - Text('© 2025 Mica White'), - Text(''), - TextButton.icon( - icon: Icon(Icons.code), - label: Text('View source code'), - onPressed: () => - launchUrlString("https://www.botahamec.dev/cgit/speedometer"), - ), - FutureBuilder( - future: _loadedData, - builder: (context, snapshot) { - final appName = snapshot.data?.$1.appName; - final version = snapshot.data?.$1.version; - final legalese = snapshot.data?.$2; - final buildDate = snapshot.data?.$3?.buildDate; - - return TextButton.icon( - icon: Icon(Icons.copyright), - label: Text('View licenses'), - onPressed: () => Navigator.push( - context, - MaterialPageRoute( - builder: (context) => LicensePage( - applicationIcon: Icon(Icons.speed), - applicationName: appName, - applicationVersion: snapshot.hasData - ? '$version (${buildDate?.year}-${buildDate?.month}-${buildDate?.day})' - : null, - applicationLegalese: legalese, - ), - ), - ), - ); - }, - ), - ], - ), - ), - ); - } -} |
