diff --git a/lib/main.dart b/lib/main.dart index 806f6fd..bffd4a7 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -13,6 +13,7 @@ import 'package:openhiit/utils/functions.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:share_plus/share_plus.dart'; import 'package:sqflite/sqflite.dart'; +import 'package:url_launcher/url_launcher.dart'; import 'constants/snackbars.dart'; import 'create_workout/select_timer.dart'; import 'helper_widgets/export_bottom_sheet.dart'; @@ -438,6 +439,43 @@ class _MyHomePageState extends State { color: Theme.of(context).scaffoldBackgroundColor, child: SafeArea( child: Scaffold( + appBar: AppBar( + toolbarHeight: 30, + actions: [ + IconButton( + icon: const Icon(Icons.info_outline), + onPressed: () { + showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: const Text("About OpenHIIT"), + content: const Text( + "OpenHIIT is a free and open-source interval timer."), + actions: [ + TextButton( + onPressed: () async { + final Uri url = Uri.parse( + 'https://a-mabe.github.io/OpenHIIT/'); + if (!await launchUrl(url)) { + throw Exception('Could not launch $url'); + } + }, + child: const Text("View privacy policy"), + ), + TextButton( + onPressed: () { + Navigator.pop(context); + }, + child: const Text("Close"), + ), + ], + ); + }); + }, + ), + ], + ), /// Pushes to [SelectTimer()] floatingActionButton: Visibility( diff --git a/pubspec.lock b/pubspec.lock index 772b75b..f6d7c60 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -965,6 +965,30 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.2" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + sha256: "21b704ce5fa560ea9f3b525b43601c678728ba46725bab9b01187b4831377ed3" + url: "https://pub.dev" + source: hosted + version: "6.3.0" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + sha256: e35a698ac302dd68e41f73250bd9517fe3ab5fa4f18fe4647a0872db61bacbab + url: "https://pub.dev" + source: hosted + version: "6.3.10" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + sha256: e43b677296fadce447e987a2f519dcf5f6d1e527dc35d01ffab4fff5b8a7063e + url: "https://pub.dev" + source: hosted + version: "6.3.1" url_launcher_linux: dependency: transitive description: @@ -973,6 +997,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.2.0" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + sha256: "9a1a42d5d2d95400c795b2914c36fdcb525870c752569438e4ebb09a2b5d90de" + url: "https://pub.dev" + source: hosted + version: "3.2.0" url_launcher_platform_interface: dependency: transitive description: @@ -1086,5 +1118,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.4.0 <4.0.0" - flutter: ">=3.22.0" + dart: ">=3.5.0 <4.0.0" + flutter: ">=3.24.0" diff --git a/pubspec.yaml b/pubspec.yaml index 719cbf4..4a1a3a7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -62,6 +62,7 @@ dependencies: file_saver: ^0.2.13 permission_handler: ^11.3.1 shared_preferences: ^2.2.3 + url_launcher: ^6.3.0 flutter_launcher_icons: android: "launcher_icon"