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:event_bus/event_bus.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:url_launcher/url_launcher.dart';
part 'settingsPage.dart'; part 'settingsPage.dart';
part 'data_model.dart'; part 'data_model.dart';
part 'logPage.dart'; part 'logPage.dart';
part 'utils.dart';
EventBus eventBus = new EventBus(); EventBus eventBus = new EventBus();
const String appName = "HA Client"; const String appName = "HA Client";
@ -539,6 +541,13 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver {
Navigator.pushNamed(context, '/log-view'); 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( new AboutListTile(
applicationName: appName, applicationName: appName,
applicationVersion: appVersion, 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");
}
}
}

View File

@ -424,6 +424,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.6" 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: utf:
dependency: transitive dependency: transitive
description: description:

View File

@ -15,6 +15,7 @@ dependencies:
package_info: ^0.3.2 package_info: ^0.3.2
flutter_launcher_icons: ^0.6.1 flutter_launcher_icons: ^0.6.1
cached_network_image: ^0.4.1 cached_network_image: ^0.4.1
url_launcher: ^3.0.3
# The following adds the Cupertino Icons font to your application. # The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons. # Use with the CupertinoIcons class for iOS style icons.