Add link to github in app drawer

This commit is contained in:
estevez
2018-09-24 22:12:56 +03:00
parent 2b622cff04
commit 60793dbf89
4 changed files with 28 additions and 0 deletions

View File

@ -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
View 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");
}
}
}