2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-13 10:45:29 +00:00

Reorganize settings:

- Add new setting to disable error uploading
- Move "about" info to a separate view
This commit is contained in:
Oliver
2022-01-09 22:22:08 +11:00
parent 27da8b2820
commit f1a46be417
8 changed files with 270 additions and 161 deletions

View File

@ -9,6 +9,7 @@ import "package:font_awesome_flutter/font_awesome_flutter.dart";
import "package:package_info_plus/package_info_plus.dart";
import "package:inventree/l10.dart";
import 'package:url_launcher/url_launcher.dart';
class InvenTreeAboutWidget extends StatelessWidget {
@ -37,6 +38,32 @@ class InvenTreeAboutWidget extends StatelessWidget {
);
}
Future <void> _openDocs() async {
const String docsUrl = "https://inventree.readthedocs.io/en/latest/app/app/";
if (await canLaunch(docsUrl)) {
await launch(docsUrl);
}
}
Future <void> _reportBug(BuildContext context) async {
const String url = "https://github.com/inventree/InvenTree/issues/new?assignees=&labels=app%2C+bug&title=%5BApp%5D+Enter+bug+description";
if (await canLaunch(url)) {
await launch(url);
}
}
Future <void> _translate() async {
const String url = "https://crowdin.com/project/inventree";
if (await canLaunch(url)) {
await launch(url);
}
}
@override
Widget build(BuildContext context) {
@ -135,6 +162,39 @@ class InvenTreeAboutWidget extends StatelessWidget {
)
);
tiles.add(
ListTile(
title: Text(L10().documentation),
subtitle: Text("https://inventree.readthedocs.io"),
leading: FaIcon(FontAwesomeIcons.book, color: COLOR_CLICK),
onTap: () {
_openDocs();
},
)
);
tiles.add(
ListTile(
title: Text(L10().translate),
subtitle: Text(L10().translateHelp),
leading: FaIcon(FontAwesomeIcons.language, color: COLOR_CLICK),
onTap: () {
_translate();
}
)
);
tiles.add(
ListTile(
title: Text(L10().reportBug),
subtitle: Text(L10().reportBugDescription),
leading: FaIcon(FontAwesomeIcons.bug, color: COLOR_CLICK),
onTap: () {
_reportBug(context);
},
)
);
return Scaffold(
appBar: AppBar(
title: Text(L10().appAbout),