diff --git a/assets/release_notes.md b/assets/release_notes.md index 1841054c..9329ce1c 100644 --- a/assets/release_notes.md +++ b/assets/release_notes.md @@ -1,6 +1,7 @@ ### 0.17.0 - November 2024 --- +- Enhanced home-screen display using grid-view - Improvements for image uploading - Provide "upload image" shortcut on Purchase Order detail view - Provide "upload image" shortcut on Sales Order detail view diff --git a/lib/settings/settings.dart b/lib/settings/settings.dart index 715d9634..30f4f2b4 100644 --- a/lib/settings/settings.dart +++ b/lib/settings/settings.dart @@ -56,6 +56,7 @@ class _InvenTreeSettingsState extends State { Navigator.push(context, MaterialPageRoute(builder: (context) => InvenTreeSelectServerWidget())); }, ), + Divider(), ListTile( title: Text(L10().appSettings), subtitle: Text(L10().appSettingsDetails), diff --git a/lib/widget/home.dart b/lib/widget/home.dart index ac1f44c4..748a4247 100644 --- a/lib/widget/home.dart +++ b/lib/widget/home.dart @@ -1,4 +1,5 @@ import "dart:async"; +import "dart:math"; import "package:flutter/material.dart"; import "package:flutter_tabler_icons/flutter_tabler_icons.dart"; @@ -187,15 +188,24 @@ class _InvenTreeHomePageState extends State with BaseWidgetPr return GestureDetector( child: Card( - margin: EdgeInsets.symmetric( - vertical: 5, - horizontal: 12 - ), - child: ListTile( - leading: Icon(icon, color: connected && allowed ? COLOR_ACTION : Colors.grey), - title: Text(label), - trailing: trailing, - ), + margin: EdgeInsets.all(5), + child: Align( + child: ListTile( + leading: Icon( + icon, + size: 32, + color: connected && allowed ? COLOR_ACTION : Colors.grey + ), + title: Text( + label, + style: TextStyle( + fontSize: 20 + ), + ), + trailing: trailing, + ), + alignment: Alignment.center, + ) ), onTap: () { if (!allowed) { @@ -219,9 +229,7 @@ class _InvenTreeHomePageState extends State with BaseWidgetPr */ List getListTiles(BuildContext context) { - List tiles = [ - Divider(height: 5) - ]; + List tiles = []; // Parts if (InvenTreePart().canView) { @@ -381,10 +389,26 @@ class _InvenTreeHomePageState extends State with BaseWidgetPr return _connectionStatusWidget(context); } - return ListView( - scrollDirection: Axis.vertical, - children: getListTiles(context), + double w = MediaQuery.of(context).size.width; + double h = MediaQuery.of(context).size.height; + + bool smallScreen = max(w, h) < 1000; + + int vTiles = smallScreen ? 2 : 3; + int hTiles = smallScreen ? 1 : 2; + double aspect = smallScreen ? 5 : 3; + double padding = smallScreen ? 2 : 10; + + return GridView.count( + crossAxisCount: w > h ? vTiles : hTiles, + children: getListTiles(context), + childAspectRatio: aspect, + primary: false, + crossAxisSpacing: padding, + mainAxisSpacing: padding, + padding: EdgeInsets.all(padding), ); + } @override