mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-12 10:15:32 +00:00
Part detail view is now refreshabel
- lso add a progress dialog when reloading a model object
This commit is contained in:
@ -6,6 +6,7 @@ import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:InvenTree/api.dart';
|
||||
import 'package:InvenTree/widget/refreshable_state.dart';
|
||||
import 'package:InvenTree/widget/drawer.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
|
||||
@ -21,7 +22,10 @@ class PartDetailWidget extends StatefulWidget {
|
||||
}
|
||||
|
||||
|
||||
class _PartDisplayState extends State<PartDetailWidget> {
|
||||
class _PartDisplayState extends RefreshableState<PartDetailWidget> {
|
||||
|
||||
@override
|
||||
String app_bar_title = "Part";
|
||||
|
||||
_PartDisplayState(this.part) {
|
||||
// TODO
|
||||
@ -29,6 +33,11 @@ class _PartDisplayState extends State<PartDetailWidget> {
|
||||
|
||||
InvenTreePart part;
|
||||
|
||||
@override
|
||||
Future<void> request(BuildContext context) async {
|
||||
await part.reload(context);
|
||||
}
|
||||
|
||||
/*
|
||||
* Build a list of tiles to display under the part description
|
||||
*/
|
||||
@ -154,22 +163,11 @@ class _PartDisplayState extends State<PartDetailWidget> {
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("Part Details"),
|
||||
Widget getBody(BuildContext context) {
|
||||
return Center(
|
||||
child: ListView(
|
||||
children: partTiles(),
|
||||
),
|
||||
drawer: new InvenTreeDrawer(context),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
child: FaIcon(FontAwesomeIcons.ellipsisH),
|
||||
// TODO - Add pop-up icons
|
||||
// Ref: https://stackoverflow.com/questions/46480221/flutter-floating-action-button-with-speed-dial#46480722
|
||||
),
|
||||
body: Center(
|
||||
child: ListView(
|
||||
children: partTiles(),
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user