Add link to github in app drawer
This commit is contained in:
parent
2b622cff04
commit
60793dbf89
@ -8,10 +8,12 @@ import 'package:progress_indicators/progress_indicators.dart';
|
||||
import 'package:event_bus/event_bus.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
part 'settingsPage.dart';
|
||||
part 'data_model.dart';
|
||||
part 'logPage.dart';
|
||||
part 'utils.dart';
|
||||
|
||||
EventBus eventBus = new EventBus();
|
||||
const String appName = "HA Client";
|
||||
@ -539,6 +541,13 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver {
|
||||
Navigator.pushNamed(context, '/log-view');
|
||||
},
|
||||
),
|
||||
new ListTile(
|
||||
leading: Icon(MaterialDesignIcons.createIconDataFromIconName("mdi:github-circle")),
|
||||
title: Text("Reprot issue"),
|
||||
onTap: () {
|
||||
haUtils.launchURL("https://github.com/estevez-dev/ha_client_pub/issues/new");
|
||||
},
|
||||
),
|
||||
new AboutListTile(
|
||||
applicationName: appName,
|
||||
applicationVersion: appVersion,
|
||||
|
11
lib/utils.dart
Normal file
11
lib/utils.dart
Normal file
@ -0,0 +1,11 @@
|
||||
part of 'main.dart';
|
||||
|
||||
class haUtils {
|
||||
static void launchURL(String url) async {
|
||||
if (await canLaunch(url)) {
|
||||
await launch(url);
|
||||
} else {
|
||||
TheLogger.log("Error", "Could not launch $url");
|
||||
}
|
||||
}
|
||||
}
|
@ -424,6 +424,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.6"
|
||||
url_launcher:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: url_launcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.3"
|
||||
utf:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -15,6 +15,7 @@ dependencies:
|
||||
package_info: ^0.3.2
|
||||
flutter_launcher_icons: ^0.6.1
|
||||
cached_network_image: ^0.4.1
|
||||
url_launcher: ^3.0.3
|
||||
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
|
Reference in New Issue
Block a user