mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-28 13:36:50 +00:00
Add separator divider elements in lists
This commit is contained in:
parent
18b4783c11
commit
1c0b469020
@ -15,48 +15,96 @@ class InvenTreeAboutWidget extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
||||||
|
List<Widget> tiles = [];
|
||||||
|
|
||||||
|
tiles.add(
|
||||||
|
ListTile(
|
||||||
|
title: Text(
|
||||||
|
I18N.of(context).serverDetails,
|
||||||
|
style: TextStyle(fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (InvenTreeAPI().isConnected()) {
|
||||||
|
tiles.add(
|
||||||
|
ListTile(
|
||||||
|
title: Text(I18N.of(context).address),
|
||||||
|
subtitle: Text(InvenTreeAPI().baseUrl.isNotEmpty ? InvenTreeAPI().baseUrl : "Not connected"),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
tiles.add(
|
||||||
|
ListTile(
|
||||||
|
title: Text(I18N.of(context).version),
|
||||||
|
subtitle: Text(InvenTreeAPI().version.isNotEmpty ? InvenTreeAPI().version : "Not connected"),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
tiles.add(
|
||||||
|
ListTile(
|
||||||
|
title: Text("Server Instance"),
|
||||||
|
subtitle: Text(InvenTreeAPI().instance.isNotEmpty ? InvenTreeAPI().instance : "Not connected"),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
tiles.add(
|
||||||
|
ListTile(
|
||||||
|
title: Text("Not Connected"),
|
||||||
|
subtitle: Text(
|
||||||
|
"InvenTree server not connected",
|
||||||
|
style: TextStyle(fontStyle: FontStyle.italic),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
tiles.add(
|
||||||
|
ListTile(
|
||||||
|
title: Text(
|
||||||
|
I18N.of(context).appDetails,
|
||||||
|
style: TextStyle(fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
tiles.add(
|
||||||
|
ListTile(
|
||||||
|
title: Text(I18N.of(context).name),
|
||||||
|
subtitle: Text("${info.appName}"),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
tiles.add(
|
||||||
|
ListTile(
|
||||||
|
title: Text("Package Name"),
|
||||||
|
subtitle: Text("${info.packageName}"),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
tiles.add(
|
||||||
|
ListTile(
|
||||||
|
title: Text(I18N.of(context).version),
|
||||||
|
subtitle: Text("${info.version}"),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
tiles.add(
|
||||||
|
ListTile(
|
||||||
|
title: Text(I18N.of(context).build),
|
||||||
|
subtitle: Text("${info.buildNumber}"),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text("About InvenTree"),
|
title: Text("About InvenTree"),
|
||||||
),
|
),
|
||||||
body: ListView(
|
body: ListView(
|
||||||
children: <Widget>[
|
children: ListTile.divideTiles(
|
||||||
ListTile(
|
context: context,
|
||||||
title: Text(I18N.of(context).serverDetails),
|
tiles: tiles,
|
||||||
),
|
).toList(),
|
||||||
ListTile(
|
|
||||||
title: Text(I18N.of(context).address),
|
|
||||||
subtitle: Text(InvenTreeAPI().baseUrl.isNotEmpty ? InvenTreeAPI().baseUrl : "Not connected"),
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
title: Text(I18N.of(context).version),
|
|
||||||
subtitle: Text(InvenTreeAPI().version.isNotEmpty ? InvenTreeAPI().version : "Not connected"),
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
title: Text("Server Instance"),
|
|
||||||
subtitle: Text(InvenTreeAPI().instance.isNotEmpty ? InvenTreeAPI().instance : "Not connected"),
|
|
||||||
),
|
|
||||||
Divider(),
|
|
||||||
ListTile(
|
|
||||||
title: Text(I18N.of(context).appDetails),
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
title: Text(I18N.of(context).name),
|
|
||||||
subtitle: Text("${info.appName}"),
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
title: Text("Package Name"),
|
|
||||||
subtitle: Text("${info.packageName}"),
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
title: Text(I18N.of(context).version),
|
|
||||||
subtitle: Text("${info.version}"),
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
title: Text(I18N.of(context).build),
|
|
||||||
subtitle: Text("${info.buildNumber}"),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -300,7 +300,10 @@ class _InvenTreeLoginSettingsState extends State<InvenTreeLoginSettingsWidget> {
|
|||||||
),
|
),
|
||||||
body: Container(
|
body: Container(
|
||||||
child: ListView(
|
child: ListView(
|
||||||
children: children,
|
children: ListTile.divideTiles(
|
||||||
|
context: context,
|
||||||
|
tiles: children
|
||||||
|
).toList(),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton(
|
||||||
|
@ -34,33 +34,35 @@ class _InvenTreeSettingsState extends State<InvenTreeSettingsWidget> {
|
|||||||
),
|
),
|
||||||
body: Center(
|
body: Center(
|
||||||
child: ListView(
|
child: ListView(
|
||||||
children: <Widget>[
|
children: ListTile.divideTiles(
|
||||||
ListTile(
|
context: context,
|
||||||
title: Text(I18N.of(context).profile),
|
tiles: <Widget>[
|
||||||
subtitle: Text("Configure user profile settings"),
|
ListTile(
|
||||||
leading: FaIcon(FontAwesomeIcons.user),
|
title: Text(I18N.of(context).profile),
|
||||||
onTap: _editServerSettings,
|
subtitle: Text("Configure user profile settings"),
|
||||||
),
|
leading: FaIcon(FontAwesomeIcons.user),
|
||||||
Divider(),
|
onTap: _editServerSettings,
|
||||||
ListTile(
|
),
|
||||||
title: Text(I18N.of(context).about),
|
ListTile(
|
||||||
subtitle: Text(I18N.of(context).appDetails),
|
title: Text(I18N.of(context).about),
|
||||||
leading: FaIcon(FontAwesomeIcons.infoCircle),
|
subtitle: Text(I18N.of(context).appDetails),
|
||||||
onTap: _about,
|
leading: FaIcon(FontAwesomeIcons.infoCircle),
|
||||||
),
|
onTap: _about,
|
||||||
ListTile(
|
),
|
||||||
title: Text(I18N.of(context).releaseNotes),
|
ListTile(
|
||||||
subtitle: Text("Display app release notes"),
|
title: Text(I18N.of(context).releaseNotes),
|
||||||
leading: FaIcon(FontAwesomeIcons.fileAlt),
|
subtitle: Text("Display app release notes"),
|
||||||
onTap: _releaseNotes,
|
leading: FaIcon(FontAwesomeIcons.fileAlt),
|
||||||
),
|
onTap: _releaseNotes,
|
||||||
ListTile(
|
),
|
||||||
title: Text(I18N.of(context).reportBug),
|
ListTile(
|
||||||
subtitle: Text("Report bug or suggest new feature"),
|
title: Text(I18N.of(context).reportBug),
|
||||||
leading: FaIcon(FontAwesomeIcons.bug),
|
subtitle: Text("Report bug or suggest new feature"),
|
||||||
onTap: null,
|
leading: FaIcon(FontAwesomeIcons.bug),
|
||||||
),
|
onTap: null,
|
||||||
],
|
),
|
||||||
|
]
|
||||||
|
).toList()
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -231,9 +231,10 @@ class SubcategoryList extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ListView.builder(
|
return ListView.separated(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
physics: ClampingScrollPhysics(),
|
physics: ClampingScrollPhysics(),
|
||||||
|
separatorBuilder: (_, __) => const Divider(),
|
||||||
itemBuilder: _build, itemCount: _categories.length);
|
itemBuilder: _build, itemCount: _categories.length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -282,9 +283,10 @@ class PartList extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ListView.builder(
|
return ListView.separated(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
physics: ClampingScrollPhysics(),
|
physics: ClampingScrollPhysics(),
|
||||||
|
separatorBuilder: (_, __) => const Divider(height: 1),
|
||||||
itemBuilder: _build, itemCount: _parts.length);
|
itemBuilder: _build, itemCount: _parts.length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,65 +102,65 @@ class InvenTreeDrawer extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Drawer(
|
return Drawer(
|
||||||
child: new ListView(
|
child: new ListView(
|
||||||
children: <Widget>[
|
children: ListTile.divideTiles(
|
||||||
new ListTile(
|
context: context,
|
||||||
leading: new Image.asset(
|
tiles: <Widget>[
|
||||||
"assets/image/icon.png",
|
new ListTile(
|
||||||
fit: BoxFit.scaleDown,
|
leading: new Image.asset(
|
||||||
width: 40,
|
"assets/image/icon.png",
|
||||||
|
fit: BoxFit.scaleDown,
|
||||||
|
width: 40,
|
||||||
|
),
|
||||||
|
title: new Text("InvenTree"),
|
||||||
|
onTap: _home,
|
||||||
),
|
),
|
||||||
title: new Text("InvenTree"),
|
/*
|
||||||
onTap: _home,
|
// TODO - Add search functionality!
|
||||||
),
|
new ListTile(
|
||||||
new Divider(),
|
title: new Text("Search"),
|
||||||
/*
|
leading: new FaIcon(FontAwesomeIcons.search),
|
||||||
// TODO - Add search functionality!
|
onTap: _search,
|
||||||
new ListTile(
|
),
|
||||||
title: new Text("Search"),
|
*/
|
||||||
leading: new FaIcon(FontAwesomeIcons.search),
|
new ListTile(
|
||||||
onTap: _search,
|
title: new Text(I18N.of(context).scanBarcode),
|
||||||
),
|
onTap: _scan,
|
||||||
*/
|
leading: new FaIcon(FontAwesomeIcons.barcode),
|
||||||
new ListTile(
|
),
|
||||||
title: new Text("Scan Barcode"),
|
new ListTile(
|
||||||
onTap: _scan,
|
title: new Text(I18N.of(context).parts),
|
||||||
leading: new FaIcon(FontAwesomeIcons.barcode),
|
leading: new Icon(Icons.category),
|
||||||
),
|
onTap: _showParts,
|
||||||
new Divider(),
|
),
|
||||||
new ListTile(
|
new ListTile(
|
||||||
title: new Text("Parts"),
|
title: new Text(I18N.of(context).stock),
|
||||||
leading: new Icon(Icons.category),
|
leading: new FaIcon(FontAwesomeIcons.boxes),
|
||||||
onTap: _showParts,
|
onTap: _showStock,
|
||||||
),
|
),
|
||||||
new ListTile(
|
/*
|
||||||
title: new Text("Stock"),
|
new ListTile(
|
||||||
leading: new FaIcon(FontAwesomeIcons.boxes),
|
title: new Text("Suppliers"),
|
||||||
onTap: _showStock,
|
leading: new FaIcon(FontAwesomeIcons.building),
|
||||||
),
|
onTap: _showSuppliers,
|
||||||
/*
|
),
|
||||||
new ListTile(
|
new ListTile(
|
||||||
title: new Text("Suppliers"),
|
title: Text("Manufacturers"),
|
||||||
leading: new FaIcon(FontAwesomeIcons.building),
|
leading: new FaIcon(FontAwesomeIcons.industry),
|
||||||
onTap: _showSuppliers,
|
onTap: _showManufacturers,
|
||||||
),
|
),
|
||||||
new ListTile(
|
new ListTile(
|
||||||
title: Text("Manufacturers"),
|
title: new Text("Customers"),
|
||||||
leading: new FaIcon(FontAwesomeIcons.industry),
|
leading: new FaIcon(FontAwesomeIcons.users),
|
||||||
onTap: _showManufacturers,
|
onTap: _showCustomers,
|
||||||
),
|
),
|
||||||
new ListTile(
|
*/
|
||||||
title: new Text("Customers"),
|
new ListTile(
|
||||||
leading: new FaIcon(FontAwesomeIcons.users),
|
title: new Text(I18N.of(context).settings),
|
||||||
onTap: _showCustomers,
|
leading: new Icon(Icons.settings),
|
||||||
),
|
onTap: _settings,
|
||||||
*/
|
),
|
||||||
new Divider(),
|
]
|
||||||
new ListTile(
|
).toList(),
|
||||||
title: new Text(I18N.of(context).settings),
|
|
||||||
leading: new Icon(Icons.settings),
|
|
||||||
onTap: _settings,
|
|
||||||
),
|
|
||||||
]
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -156,7 +156,10 @@ class _LocationDisplayState extends RefreshableState<LocationDisplayWidget> {
|
|||||||
);
|
);
|
||||||
case 1:
|
case 1:
|
||||||
return ListView(
|
return ListView(
|
||||||
children: actionTiles(),
|
children: ListTile.divideTiles(
|
||||||
|
context: context,
|
||||||
|
tiles: actionTiles()
|
||||||
|
).toList()
|
||||||
);
|
);
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
@ -298,10 +301,11 @@ class SublocationList extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ListView.builder(
|
return ListView.separated(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
physics: ClampingScrollPhysics(),
|
physics: ClampingScrollPhysics(),
|
||||||
itemBuilder: _build,
|
itemBuilder: _build,
|
||||||
|
separatorBuilder: (_, __) => const Divider(),
|
||||||
itemCount: _locations.length
|
itemCount: _locations.length
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -342,9 +346,10 @@ class StockList extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ListView.builder(
|
return ListView.separated(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
physics: ClampingScrollPhysics(),
|
physics: ClampingScrollPhysics(),
|
||||||
|
separatorBuilder: (_, __) => const Divider(),
|
||||||
itemBuilder: _build, itemCount: _items.length);
|
itemBuilder: _build, itemCount: _items.length);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -82,6 +82,7 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
|
|||||||
|
|
||||||
void _showStock(BuildContext context) async {
|
void _showStock(BuildContext context) async {
|
||||||
await part.getStockItems(context);
|
await part.getStockItems(context);
|
||||||
|
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(builder: (context) => PartStockDetailWidget(part))
|
MaterialPageRoute(builder: (context) => PartStockDetailWidget(part))
|
||||||
@ -349,13 +350,19 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
|
|||||||
case 0:
|
case 0:
|
||||||
return Center(
|
return Center(
|
||||||
child: ListView(
|
child: ListView(
|
||||||
children: partTiles(),
|
children: ListTile.divideTiles(
|
||||||
|
context: context,
|
||||||
|
tiles: partTiles()
|
||||||
|
).toList()
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
case 1:
|
case 1:
|
||||||
return Center(
|
return Center(
|
||||||
child: ListView(
|
child: ListView(
|
||||||
children: actionTiles(),
|
children: ListTile.divideTiles(
|
||||||
|
context: context,
|
||||||
|
tiles: actionTiles()
|
||||||
|
).toList()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
default:
|
default:
|
||||||
|
@ -100,10 +100,11 @@ class PartStockList extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ListView.builder(
|
return ListView.separated(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
physics: ClampingScrollPhysics(),
|
physics: ClampingScrollPhysics(),
|
||||||
itemBuilder: _build,
|
itemBuilder: _build,
|
||||||
|
separatorBuilder: (_, __) => const Divider(height: 1),
|
||||||
itemCount: _items.length
|
itemCount: _items.length
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -579,11 +579,17 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
|||||||
switch (index) {
|
switch (index) {
|
||||||
case 0:
|
case 0:
|
||||||
return ListView(
|
return ListView(
|
||||||
children: detailTiles(),
|
children: ListTile.divideTiles(
|
||||||
|
context: context,
|
||||||
|
tiles: detailTiles()
|
||||||
|
).toList(),
|
||||||
);
|
);
|
||||||
case 1:
|
case 1:
|
||||||
return ListView(
|
return ListView(
|
||||||
children: actionTiles(),
|
children: ListTile.divideTiles(
|
||||||
|
context: context,
|
||||||
|
tiles: actionTiles()
|
||||||
|
).toList()
|
||||||
);
|
);
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
|
@ -250,7 +250,10 @@ class _StockItemTestResultDisplayState extends RefreshableState<StockItemTestRes
|
|||||||
@override
|
@override
|
||||||
Widget getBody(BuildContext context) {
|
Widget getBody(BuildContext context) {
|
||||||
return ListView(
|
return ListView(
|
||||||
children: resultsList(),
|
children: ListTile.divideTiles(
|
||||||
|
context: context,
|
||||||
|
tiles: resultsList()
|
||||||
|
).toList()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user