From ace3e8bfe6c3d90f2b1377387bb94ce55fc816bf Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Fri, 27 Nov 2020 22:16:19 +0100 Subject: [PATCH] Add about dialog placeholder --- lib/widgets/app_drawer.dart | 52 +++++++++++++++++++++++++++++++++++-- pubspec.lock | 44 ++++++++++++++++++++++++++++++- pubspec.yaml | 1 + 3 files changed, 94 insertions(+), 3 deletions(-) diff --git a/lib/widgets/app_drawer.dart b/lib/widgets/app_drawer.dart index bd01c6d3..095ac3ed 100644 --- a/lib/widgets/app_drawer.dart +++ b/lib/widgets/app_drawer.dart @@ -1,5 +1,7 @@ +import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'package:url_launcher/url_launcher.dart'; import 'package:wger/locale/locales.dart'; import 'package:wger/providers/auth.dart'; import 'package:wger/screens/dashboard.dart'; @@ -58,8 +60,20 @@ class AppDrawer extends StatelessWidget { leading: Icon(Icons.edit), title: Text('Options'), onTap: () { - Navigator.of(context).pop(); - Navigator.of(context).pushReplacementNamed(WeightScreen.routeName); + showDialog( + context: context, + builder: (context) => AlertDialog( + content: Text("Would show options dialog"), + actions: [ + TextButton( + child: Text( + "Close", + ), + onPressed: () => Navigator.of(context).pop(), + ), + ], + ), + ); }, ), Divider(), @@ -72,6 +86,40 @@ class AppDrawer extends StatelessWidget { Navigator.of(context).pushReplacementNamed('/'); }, ), + Divider(), + AboutListTile( + icon: Icon(Icons.info), + applicationName: 'wger', + applicationVersion: '0.0.1 alpha', + applicationLegalese: '\u{a9} 2020 The wger team', + applicationIcon: Image.asset( + 'assets/images/logo.png', + width: 60, + ), + aboutBoxChildren: [ + RichText( + text: TextSpan( + style: TextStyle(fontSize: 16, color: Colors.black), + children: [ + TextSpan( + text: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, ' + 'sed diam nonumy eirmod tempor invidunt ut labore et dolore ' + 'magna aliquyam erat, sed diam voluptua. At vero eos et accusam ' + 'et justo duo dolores et ea rebum.\n', + ), + TextSpan( + text: 'https://github.com/wger-project/wger', + style: TextStyle(color: Colors.blue), + recognizer: TapGestureRecognizer() + ..onTap = () { + launch('https://github.com/wger-project/wger'); + }, + ) + ], + ), + ), + ], + ), ], ), ); diff --git a/pubspec.lock b/pubspec.lock index 0c722804..3f36107e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -621,6 +621,48 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.0-nullsafety.3" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + url: "https://pub.dartlang.org" + source: hosted + version: "5.7.10" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+4" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+9" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.9" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.5+1" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+3" vector_math: dependency: transitive description: @@ -672,4 +714,4 @@ packages: version: "2.2.1" sdks: dart: ">=2.10.0-110 <2.11.0" - flutter: ">=1.16.0 <2.0.0" + flutter: ">=1.22.0 <2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index d9753bdf..ad935729 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -33,6 +33,7 @@ dependencies: flutter_calendar_carousel: ^1.5.1 cupertino_icons: ^1.0.0 json_serializable: ^3.5.0 + url_launcher: ^5.7.10 dev_dependencies: flutter_test: