mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-28 05:26:47 +00:00
Adds skeleton for "app settings" view
This commit is contained in:
parent
a5406734eb
commit
194be50337
@ -10,6 +10,7 @@
|
||||
- Any "unauthorized" actions are now not displayed
|
||||
- Uses server-side pagination, providing a significant increase in UI performance
|
||||
- Adds audio feedback for server errors and barcode scanning
|
||||
- Adds "app settings" view
|
||||
|
||||
### 0.1.2 - February 2021
|
||||
---
|
||||
|
73
lib/settings/app_settings.dart
Normal file
73
lib/settings/app_settings.dart
Normal file
@ -0,0 +1,73 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
|
||||
class InvenTreeAppSettingsWidget extends StatefulWidget {
|
||||
@override
|
||||
_InvenTreeAppSettingsState createState() => _InvenTreeAppSettingsState();
|
||||
}
|
||||
|
||||
class _InvenTreeAppSettingsState extends State<InvenTreeAppSettingsWidget> {
|
||||
|
||||
final GlobalKey<_InvenTreeAppSettingsState> _settingsKey = GlobalKey<_InvenTreeAppSettingsState>();
|
||||
|
||||
_InvenTreeAppSettingsState() {
|
||||
|
||||
}
|
||||
|
||||
bool a = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
return Scaffold(
|
||||
key: _settingsKey,
|
||||
appBar: AppBar(
|
||||
title: Text(I18N.of(context).appSettings),
|
||||
),
|
||||
body: Container(
|
||||
child: ListView(
|
||||
children: [
|
||||
ListTile(
|
||||
title: Text(
|
||||
"Sounds",
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
leading: FaIcon(FontAwesomeIcons.volumeUp),
|
||||
),
|
||||
ListTile(
|
||||
title: Text("Server Error"),
|
||||
subtitle: Text("Play audible tone on server error"),
|
||||
leading: FaIcon(FontAwesomeIcons.server),
|
||||
trailing: Switch(
|
||||
value: false,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
// TODO
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
title: Text("Barcode Tones"),
|
||||
subtitle: Text("Play audible tones for barcode actions"),
|
||||
leading: FaIcon(FontAwesomeIcons.qrcode),
|
||||
trailing: Switch(
|
||||
value: a,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
a = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
Divider(height: 1),
|
||||
]
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
@ -53,7 +53,7 @@ class _InvenTreeLoginSettingsState extends State<InvenTreeLoginSettingsWidget> {
|
||||
}
|
||||
|
||||
showFormDialog(
|
||||
I18N.of(context).profileAdd,
|
||||
createNew ? I18N.of(context).profileAdd : I18N.of(context).profileEdit,
|
||||
key: _addProfileKey,
|
||||
callback: () {
|
||||
if (createNew) {
|
||||
@ -237,8 +237,6 @@ class _InvenTreeLoginSettingsState extends State<InvenTreeLoginSettingsWidget> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
final Size screenSize = MediaQuery.of(context).size;
|
||||
|
||||
List<Widget> children = [];
|
||||
|
||||
if (profiles != null && profiles.length > 0) {
|
||||
@ -268,7 +266,7 @@ class _InvenTreeLoginSettingsState extends State<InvenTreeLoginSettingsWidget> {
|
||||
Navigator.of(context).pop();
|
||||
_selectProfile(context, profile);
|
||||
},
|
||||
child: Text(I18N.of(context).profileSelect),
|
||||
child: Text(I18N.of(context).profileConnect),
|
||||
),
|
||||
SimpleDialogOption(
|
||||
onPressed: () {
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'package:InvenTree/settings/about.dart';
|
||||
import 'package:InvenTree/settings/app_settings.dart';
|
||||
import 'package:InvenTree/settings/login.dart';
|
||||
import 'package:InvenTree/user_profile.dart';
|
||||
|
||||
@ -39,11 +40,17 @@ class _InvenTreeSettingsState extends State<InvenTreeSettingsWidget> {
|
||||
context: context,
|
||||
tiles: <Widget>[
|
||||
ListTile(
|
||||
title: Text(I18N.of(context).profile),
|
||||
subtitle: Text("Configure user profile settings"),
|
||||
leading: FaIcon(FontAwesomeIcons.user),
|
||||
title: Text(I18N.of(context).server),
|
||||
subtitle: Text("Configure server settings"),
|
||||
leading: FaIcon(FontAwesomeIcons.server),
|
||||
onTap: _editServerSettings,
|
||||
),
|
||||
ListTile(
|
||||
leading: FaIcon(FontAwesomeIcons.cogs),
|
||||
title: Text(I18N.of(context).appSettings),
|
||||
subtitle: Text(I18N.of(context).appSettingsDetails),
|
||||
onTap: _editAppSettings,
|
||||
),
|
||||
ListTile(
|
||||
title: Text(I18N.of(context).about),
|
||||
subtitle: Text(I18N.of(context).appDetails),
|
||||
@ -76,11 +83,13 @@ class _InvenTreeSettingsState extends State<InvenTreeSettingsWidget> {
|
||||
|
||||
void _editServerSettings() async {
|
||||
|
||||
List<UserProfile> profiles = await UserProfileDBManager().getAllProfiles();
|
||||
|
||||
Navigator.push(context, MaterialPageRoute(builder: (context) => InvenTreeLoginSettingsWidget()));
|
||||
}
|
||||
|
||||
void _editAppSettings() async {
|
||||
Navigator.push(context, MaterialPageRoute(builder: (context) => InvenTreeAppSettingsWidget()));
|
||||
}
|
||||
|
||||
void _about() async {
|
||||
|
||||
PackageInfo.fromPlatform().then((PackageInfo info) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user