From 0cc210cf2b12f988eee8d1e8d8fc50b98265c014 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sun, 5 Apr 2020 22:19:40 +1000 Subject: [PATCH] Add more buttons to the main screen - Currently just display an "unsupported" dialog --- lib/main.dart | 55 +++++++++++++++++++++++++++++++++++++++++++---- lib/settings.dart | 7 ++++++ 2 files changed, 58 insertions(+), 4 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index f738531c..41c32206 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -194,8 +194,19 @@ class _MyHomePageState extends State { Navigator.push(context, MaterialPageRoute(builder: (context) => LocationDisplayWidget(null))); } - void _suppliers() { - // TODO + void _unsupported() { + showDialog( + context: context, + child: new SimpleDialog( + title: new Text("Unsupported"), + children: [ + ListTile( + title: Text("This feature is not yet supported"), + subtitle: Text("It will be supported in an upcoming release"), + ) + ], + ) + ); } @override @@ -259,7 +270,7 @@ class _MyHomePageState extends State { Column( children: [ IconButton( - icon: new Icon(Icons.category), + icon: new FaIcon(FontAwesomeIcons.shapes), tooltip: 'Parts', onPressed: _parts, ), @@ -281,7 +292,7 @@ class _MyHomePageState extends State { IconButton( icon: new FaIcon(FontAwesomeIcons.industry), tooltip: 'Suppliers', - onPressed: _suppliers, + onPressed: _unsupported, ), Text("Suppliers"), ] @@ -289,6 +300,42 @@ class _MyHomePageState extends State { ], ), Spacer(), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Column( + children: [ + IconButton( + icon: new FaIcon(FontAwesomeIcons.tools), + tooltip: "Build", + onPressed: _unsupported, + ), + Text("Build"), + ], + ), + Column( + children: [ + IconButton( + icon: new FaIcon(FontAwesomeIcons.shoppingCart), + tooltip: "Order", + onPressed: _unsupported, + ), + Text("Order"), + ] + ), + Column( + children: [ + IconButton( + icon: new FaIcon(FontAwesomeIcons.shippingFast), + tooltip: "Sell", + onPressed: _unsupported, + ), + Text("Sell"), + ] + ) + ], + ), + Spacer(), Row( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/settings.dart b/lib/settings.dart index 55b28ace..48d8d363 100644 --- a/lib/settings.dart +++ b/lib/settings.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import 'package:InvenTree/api.dart'; import 'login_settings.dart'; import 'package:package_info/package_info.dart'; @@ -56,6 +57,11 @@ class _InvenTreeSettingsState extends State { child: new SimpleDialog( title: new Text("About InvenTree"), children: [ + ListTile( + title: Text("Server Version"), + subtitle: Text(InvenTreeAPI().version.isNotEmpty ? InvenTreeAPI().version : "Not connected"), + ), + Divider(), ListTile( title: Text("App Name"), subtitle: Text("${info.appName}"), @@ -72,6 +78,7 @@ class _InvenTreeSettingsState extends State { title: Text("Build Number"), subtitle: Text("${info.buildNumber}") ), + Divider(), ListTile( title: Text("Submit Bug Report"), subtitle: Text("Submit a bug report or feature request at:\n https://github.com/inventree/inventree-app/issues/"),