mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 19:46:25 +00:00
Implementing a generic "ordering" option configuration for paginated list widget
This commit is contained in:
parent
9c4f6710ff
commit
c878f37ec2
3 changed files with 144 additions and 9 deletions
|
|
@ -1,8 +1,9 @@
|
|||
|
||||
|
||||
import "package:flutter/material.dart";
|
||||
import "package:font_awesome_flutter/font_awesome_flutter.dart";
|
||||
|
||||
import "package:inventree/api.dart";
|
||||
import "package:inventree/api_form.dart";
|
||||
import "package:inventree/helpers.dart";
|
||||
import "package:inventree/inventree/bom.dart";
|
||||
import "package:inventree/l10.dart";
|
||||
|
|
@ -15,6 +16,7 @@ import "package:inventree/widget/part_detail.dart";
|
|||
import "package:inventree/widget/refreshable_state.dart";
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Widget for displaying a list of BomItems for the specified 'parent' Part instance
|
||||
*/
|
||||
|
|
@ -30,7 +32,7 @@ class BomList extends StatefulWidget {
|
|||
}
|
||||
|
||||
|
||||
class _BomListState extends RefreshableState<BomList> {
|
||||
class _BomListState extends PaginatedState<BomList> {
|
||||
|
||||
_BomListState(this.parent);
|
||||
|
||||
|
|
@ -39,6 +41,15 @@ class _BomListState extends RefreshableState<BomList> {
|
|||
@override
|
||||
String getAppBarTitle(BuildContext context) => L10().billOfMaterials;
|
||||
|
||||
@override
|
||||
String get prefix => "bom_";
|
||||
|
||||
@override
|
||||
Map<String, String> get orderingOptions => {
|
||||
"quantity": L10().quantity,
|
||||
"part": L10().part,
|
||||
};
|
||||
|
||||
@override
|
||||
Widget getBody(BuildContext context) {
|
||||
return PaginatedBomList({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue