mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-14 19:25:27 +00:00
List refactor (#179)
* Catch paginator bug if widget is disposed before request returns * Refactoring paginated query widget - Add option to enable / disable search filters * Major refactor of paginated search widget - Learned something new.. a state can access widget.<attribute> - THIS CHANGES EVERTHING * Preferences: Add code for tri-state values - Also improve unit testing for preferences code * Allow boolean form fields to be optionally tristate * paginator: Allow custom boolean filters * Remove outdated filtering preferences * Refactor filter options - Allow specification of more detailed options * Add custom filters for "part" list * filter tweaks * Remove legacy "SublocationList" widget * Add filtering option for locationlist * Updates for stock location widget * Refactor category display widget * More widget refactoring * Update main search widget * Fix unit tests * Improve filtering on BOM display page
This commit is contained in:
@ -35,29 +35,22 @@ class _CompanyListWidgetState extends RefreshableState<CompanyListWidget> {
|
||||
|
||||
@override
|
||||
Widget getBody(BuildContext context) {
|
||||
|
||||
return PaginatedCompanyList(filters);
|
||||
|
||||
return PaginatedCompanyList(filters, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class PaginatedCompanyList extends PaginatedSearchWidget {
|
||||
|
||||
class PaginatedCompanyList extends StatefulWidget {
|
||||
|
||||
const PaginatedCompanyList(this.filters, {this.onTotalChanged});
|
||||
|
||||
final Map<String, String> filters;
|
||||
|
||||
final Function(int)? onTotalChanged;
|
||||
const PaginatedCompanyList(Map<String, String> filters, bool showSearch) : super(filters: filters, showSearch: showSearch);
|
||||
|
||||
@override
|
||||
_CompanyListState createState() => _CompanyListState(filters);
|
||||
_CompanyListState createState() => _CompanyListState();
|
||||
}
|
||||
|
||||
class _CompanyListState extends PaginatedSearchState<PaginatedCompanyList> {
|
||||
|
||||
_CompanyListState(Map<String, String> filters) : super(filters);
|
||||
_CompanyListState() : super();
|
||||
|
||||
@override
|
||||
Future<InvenTreePageResponse?> requestPage(int limit, int offset, Map<String, String> params) async {
|
||||
|
Reference in New Issue
Block a user