Skip to content

Commit

Permalink
Add info dialog with privacy policy
Browse files Browse the repository at this point in the history
  • Loading branch information
a-mabe committed Sep 7, 2024
1 parent f96a23e commit 524ffa7
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 2 deletions.
38 changes: 38 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -438,6 +439,43 @@ class _MyHomePageState extends State<MyHomePage> {
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(
Expand Down
36 changes: 34 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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"
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 524ffa7

Please sign in to comment.