2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-12 02:05:29 +00:00

Add web link to InvenTree documentation

This commit is contained in:
Oliver Walters
2021-02-14 20:23:29 +11:00
parent 57eae6f065
commit 822d1be2e2
4 changed files with 26 additions and 3 deletions

View File

@ -10,6 +10,7 @@ import 'package:flutter/services.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:url_launcher/url_launcher.dart';
import 'login.dart';
@ -29,6 +30,8 @@ class _InvenTreeSettingsState extends State<InvenTreeSettingsWidget> {
final _scaffoldKey = GlobalKey<ScaffoldState>();
final _bugKey = GlobalKey<FormState>();
final String docsUrl = "https://inventree.rtfd.io";
@override
Widget build(BuildContext context) {
return Scaffold(
@ -54,6 +57,15 @@ class _InvenTreeSettingsState extends State<InvenTreeSettingsWidget> {
onTap: _about,
),
ListTile(
title: Text(I18N.of(context).documentation),
subtitle: Text(docsUrl),
leading: FaIcon(FontAwesomeIcons.book),
onTap: () {
_openDocs();
},
),
ListTile(
title: Text(I18N.of(context).reportBug),
subtitle: Text("Report bug or suggest new feature"),
@ -67,6 +79,13 @@ class _InvenTreeSettingsState extends State<InvenTreeSettingsWidget> {
);
}
void _openDocs() async {
if (await canLaunch(docsUrl)) {
await launch(docsUrl);
}
}
void _editServerSettings() async {
List<UserProfile> profiles = await UserProfileDBManager().getAllProfiles();