mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-13 10:45:29 +00:00
Yet more linting
This commit is contained in:
@ -32,6 +32,7 @@ class CategoryDisplayWidget extends StatefulWidget {
|
||||
|
||||
class _CategoryDisplayState extends RefreshableState<CategoryDisplayWidget> {
|
||||
|
||||
_CategoryDisplayState(this.category);
|
||||
|
||||
@override
|
||||
String getAppBarTitle(BuildContext context) => L10().partCategory;
|
||||
@ -74,8 +75,6 @@ class _CategoryDisplayState extends RefreshableState<CategoryDisplayWidget> {
|
||||
);
|
||||
}
|
||||
|
||||
_CategoryDisplayState(this.category);
|
||||
|
||||
// The local InvenTreePartCategory object
|
||||
final InvenTreePartCategory? category;
|
||||
|
||||
@ -350,10 +349,11 @@ class _CategoryDisplayState extends RefreshableState<CategoryDisplayWidget> {
|
||||
* Builder for displaying a list of PartCategory objects
|
||||
*/
|
||||
class SubcategoryList extends StatelessWidget {
|
||||
final List<InvenTreePartCategory> _categories;
|
||||
|
||||
const SubcategoryList(this._categories);
|
||||
|
||||
final List<InvenTreePartCategory> _categories;
|
||||
|
||||
void _openCategory(BuildContext context, int pk) {
|
||||
|
||||
// Attempt to load the sub-category.
|
||||
@ -397,12 +397,12 @@ class SubcategoryList extends StatelessWidget {
|
||||
|
||||
class PaginatedPartList extends StatefulWidget {
|
||||
|
||||
PaginatedPartList(this.filters, {this.onTotalChanged});
|
||||
|
||||
final Map<String, String> filters;
|
||||
|
||||
Function(int)? onTotalChanged;
|
||||
|
||||
PaginatedPartList(this.filters, {this.onTotalChanged});
|
||||
|
||||
@override
|
||||
_PaginatedPartListState createState() => _PaginatedPartListState(filters, onTotalChanged);
|
||||
}
|
||||
@ -410,6 +410,8 @@ class PaginatedPartList extends StatefulWidget {
|
||||
|
||||
class _PaginatedPartListState extends State<PaginatedPartList> {
|
||||
|
||||
_PaginatedPartListState(this.filters, this.onTotalChanged);
|
||||
|
||||
static const _pageSize = 25;
|
||||
|
||||
String _searchTerm = "";
|
||||
@ -418,8 +420,6 @@ class _PaginatedPartListState extends State<PaginatedPartList> {
|
||||
|
||||
final Map<String, String> filters;
|
||||
|
||||
_PaginatedPartListState(this.filters, this.onTotalChanged);
|
||||
|
||||
final PagingController<int, InvenTreePart> _pagingController = PagingController(firstPageKey: 0);
|
||||
|
||||
@override
|
||||
|
@ -10,10 +10,10 @@ import "package:inventree/l10.dart";
|
||||
|
||||
class CompanyDetailWidget extends StatefulWidget {
|
||||
|
||||
final InvenTreeCompany company;
|
||||
|
||||
const CompanyDetailWidget(this.company, {Key? key}) : super(key: key);
|
||||
|
||||
final InvenTreeCompany company;
|
||||
|
||||
@override
|
||||
_CompanyDetailState createState() => _CompanyDetailState(company);
|
||||
|
||||
|
@ -13,10 +13,10 @@ import "package:font_awesome_flutter/font_awesome_flutter.dart";
|
||||
|
||||
class InvenTreeDrawer extends StatelessWidget {
|
||||
|
||||
final BuildContext context;
|
||||
|
||||
const InvenTreeDrawer(this.context);
|
||||
|
||||
final BuildContext context;
|
||||
|
||||
void _closeDrawer() {
|
||||
// Close the drawer
|
||||
Navigator.of(context).pop();
|
||||
|
@ -31,14 +31,14 @@ class InvenTreeHomePage extends StatefulWidget {
|
||||
|
||||
class _InvenTreeHomePageState extends State<InvenTreeHomePage> {
|
||||
|
||||
final GlobalKey<_InvenTreeHomePageState> _homeKey = GlobalKey<_InvenTreeHomePageState>();
|
||||
|
||||
_InvenTreeHomePageState() : super() {
|
||||
|
||||
// Initially load the profile and attempt server connection
|
||||
_loadProfile();
|
||||
}
|
||||
|
||||
final GlobalKey<_InvenTreeHomePageState> _homeKey = GlobalKey<_InvenTreeHomePageState>();
|
||||
|
||||
// Selected user profile
|
||||
UserProfile? _profile;
|
||||
|
||||
@ -266,7 +266,7 @@ class _InvenTreeHomePageState extends State<InvenTreeHomePage> {
|
||||
appBar: AppBar(
|
||||
title: Text(L10().appTitle),
|
||||
),
|
||||
drawer: new InvenTreeDrawer(context),
|
||||
drawer: InvenTreeDrawer(context),
|
||||
body: ListView(
|
||||
physics: ClampingScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
|
@ -31,6 +31,8 @@ class LocationDisplayWidget extends StatefulWidget {
|
||||
|
||||
class _LocationDisplayState extends RefreshableState<LocationDisplayWidget> {
|
||||
|
||||
_LocationDisplayState(this.location);
|
||||
|
||||
final InvenTreeStockLocation? location;
|
||||
|
||||
@override
|
||||
@ -92,8 +94,6 @@ class _LocationDisplayState extends RefreshableState<LocationDisplayWidget> {
|
||||
);
|
||||
}
|
||||
|
||||
_LocationDisplayState(this.location);
|
||||
|
||||
List<InvenTreeStockLocation> _sublocations = [];
|
||||
|
||||
String _locationFilter = "";
|
||||
@ -428,10 +428,11 @@ List<Widget> detailTiles() {
|
||||
|
||||
|
||||
class SublocationList extends StatelessWidget {
|
||||
final List<InvenTreeStockLocation> _locations;
|
||||
|
||||
const SublocationList(this._locations);
|
||||
|
||||
final List<InvenTreeStockLocation> _locations;
|
||||
|
||||
void _openLocation(BuildContext context, int pk) {
|
||||
|
||||
InvenTreeStockLocation().get(pk).then((var loc) {
|
||||
@ -475,10 +476,10 @@ class SublocationList extends StatelessWidget {
|
||||
|
||||
class PaginatedStockList extends StatefulWidget {
|
||||
|
||||
final Map<String, String> filters;
|
||||
|
||||
const PaginatedStockList(this.filters);
|
||||
|
||||
final Map<String, String> filters;
|
||||
|
||||
@override
|
||||
_PaginatedStockListState createState() => _PaginatedStockListState(filters);
|
||||
}
|
||||
@ -486,14 +487,14 @@ class PaginatedStockList extends StatefulWidget {
|
||||
|
||||
class _PaginatedStockListState extends State<PaginatedStockList> {
|
||||
|
||||
_PaginatedStockListState(this.filters);
|
||||
|
||||
static const _pageSize = 25;
|
||||
|
||||
String _searchTerm = "";
|
||||
|
||||
final Map<String, String> filters;
|
||||
|
||||
_PaginatedStockListState(this.filters);
|
||||
|
||||
final PagingController<int, InvenTreeStockItem> _pagingController = PagingController(firstPageKey: 0);
|
||||
|
||||
@override
|
||||
|
@ -5,14 +5,14 @@ import "package:inventree/l10.dart";
|
||||
|
||||
class PaginatedSearchWidget extends StatelessWidget {
|
||||
|
||||
PaginatedSearchWidget(this.controller, this.onChanged, this.results);
|
||||
|
||||
Function onChanged;
|
||||
|
||||
int results = 0;
|
||||
|
||||
TextEditingController controller;
|
||||
|
||||
PaginatedSearchWidget(this.controller, this.onChanged, this.results);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListTile(
|
||||
|
@ -34,10 +34,10 @@ class PartDetailWidget extends StatefulWidget {
|
||||
|
||||
class _PartDisplayState extends RefreshableState<PartDetailWidget> {
|
||||
|
||||
InvenTreePart part;
|
||||
|
||||
_PartDisplayState(this.part);
|
||||
|
||||
InvenTreePart part;
|
||||
|
||||
@override
|
||||
String getAppBarTitle(BuildContext context) => L10().partDetails;
|
||||
|
||||
|
@ -10,10 +10,10 @@ import "package:inventree/l10.dart";
|
||||
|
||||
class PartNotesWidget extends StatefulWidget {
|
||||
|
||||
final InvenTreePart part;
|
||||
|
||||
const PartNotesWidget(this.part, {Key? key}) : super(key: key);
|
||||
|
||||
final InvenTreePart part;
|
||||
|
||||
@override
|
||||
_PartNotesState createState() => _PartNotesState(part);
|
||||
}
|
||||
@ -21,10 +21,10 @@ class PartNotesWidget extends StatefulWidget {
|
||||
|
||||
class _PartNotesState extends RefreshableState<PartNotesWidget> {
|
||||
|
||||
final InvenTreePart part;
|
||||
|
||||
_PartNotesState(this.part);
|
||||
|
||||
final InvenTreePart part;
|
||||
|
||||
@override
|
||||
Future<void> request() async {
|
||||
await part.reload();
|
||||
|
@ -17,18 +17,6 @@ import "package:inventree/api.dart";
|
||||
|
||||
class PartSearchDelegate extends SearchDelegate<InvenTreePart?> {
|
||||
|
||||
final partSearchKey = GlobalKey<ScaffoldState>();
|
||||
|
||||
BuildContext context;
|
||||
|
||||
// What did we search for last time?
|
||||
String _cachedQuery = "";
|
||||
|
||||
bool _searching = false;
|
||||
|
||||
// Custom filters for the part search
|
||||
Map<String, String> _filters = {};
|
||||
|
||||
PartSearchDelegate(this.context, {Map<String, String> filters = const {}}) {
|
||||
|
||||
// Copy filter values
|
||||
@ -42,6 +30,18 @@ class PartSearchDelegate extends SearchDelegate<InvenTreePart?> {
|
||||
}
|
||||
}
|
||||
|
||||
final partSearchKey = GlobalKey<ScaffoldState>();
|
||||
|
||||
BuildContext context;
|
||||
|
||||
// What did we search for last time?
|
||||
String _cachedQuery = "";
|
||||
|
||||
bool _searching = false;
|
||||
|
||||
// Custom filters for the part search
|
||||
Map<String, String> _filters = {};
|
||||
|
||||
@override
|
||||
String get searchFieldLabel => L10().searchParts;
|
||||
|
||||
@ -207,17 +207,6 @@ class PartSearchDelegate extends SearchDelegate<InvenTreePart?> {
|
||||
|
||||
class StockSearchDelegate extends SearchDelegate<InvenTreeStockItem?> {
|
||||
|
||||
final stockSearchKey = GlobalKey<ScaffoldState>();
|
||||
|
||||
final BuildContext context;
|
||||
|
||||
String _cachedQuery = "";
|
||||
|
||||
bool _searching = false;
|
||||
|
||||
// Custom filters for the stock item search
|
||||
Map<String, String> _filters = {};
|
||||
|
||||
StockSearchDelegate(this.context, {Map<String, String> filters = const {}}) {
|
||||
|
||||
// Copy filter values
|
||||
@ -231,6 +220,17 @@ class StockSearchDelegate extends SearchDelegate<InvenTreeStockItem?> {
|
||||
}
|
||||
}
|
||||
|
||||
final stockSearchKey = GlobalKey<ScaffoldState>();
|
||||
|
||||
final BuildContext context;
|
||||
|
||||
String _cachedQuery = "";
|
||||
|
||||
bool _searching = false;
|
||||
|
||||
// Custom filters for the stock item search
|
||||
Map<String, String> _filters = {};
|
||||
|
||||
@override
|
||||
String get searchFieldLabel => L10().searchStock;
|
||||
|
||||
|
@ -5,9 +5,6 @@ import "package:font_awesome_flutter/font_awesome_flutter.dart";
|
||||
import "package:inventree/app_colors.dart";
|
||||
|
||||
class Spinner extends StatefulWidget {
|
||||
final IconData? icon;
|
||||
final Duration duration;
|
||||
final Color color;
|
||||
|
||||
const Spinner({
|
||||
this.color = COLOR_GRAY_LIGHT,
|
||||
@ -16,6 +13,10 @@ class Spinner extends StatefulWidget {
|
||||
this.duration = const Duration(milliseconds: 1800),
|
||||
}) : super(key: key);
|
||||
|
||||
final IconData? icon;
|
||||
final Duration duration;
|
||||
final Color color;
|
||||
|
||||
@override
|
||||
_SpinnerState createState() => _SpinnerState();
|
||||
}
|
||||
|
@ -35,6 +35,8 @@ class StockDetailWidget extends StatefulWidget {
|
||||
|
||||
class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
||||
|
||||
_StockItemDisplayState(this.item);
|
||||
|
||||
@override
|
||||
String getAppBarTitle(BuildContext context) => L10().stockItem;
|
||||
|
||||
@ -46,8 +48,6 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
||||
final _countStockKey = GlobalKey<FormState>();
|
||||
final _moveStockKey = GlobalKey<FormState>();
|
||||
|
||||
_StockItemDisplayState(this.item);
|
||||
|
||||
@override
|
||||
List<Widget> getAppBarActions(BuildContext context) {
|
||||
|
||||
|
@ -26,6 +26,8 @@ class StockItemTestResultsWidget extends StatefulWidget {
|
||||
|
||||
class _StockItemTestResultDisplayState extends RefreshableState<StockItemTestResultsWidget> {
|
||||
|
||||
_StockItemTestResultDisplayState(this.item);
|
||||
|
||||
@override
|
||||
String getAppBarTitle(BuildContext context) => L10().testResults;
|
||||
|
||||
@ -49,8 +51,6 @@ class _StockItemTestResultDisplayState extends RefreshableState<StockItemTestRes
|
||||
|
||||
final InvenTreeStockItem item;
|
||||
|
||||
_StockItemTestResultDisplayState(this.item);
|
||||
|
||||
Future <void> addTestResult(BuildContext context, {String name = "", bool nameIsEditable = true, bool result = false, String value = "", bool valueRequired = false, bool attachmentRequired = false}) async {
|
||||
|
||||
InvenTreeStockItemTestResult().createForm(
|
||||
|
@ -12,10 +12,10 @@ import "package:inventree/api.dart";
|
||||
|
||||
class StockNotesWidget extends StatefulWidget {
|
||||
|
||||
final InvenTreeStockItem item;
|
||||
|
||||
const StockNotesWidget(this.item, {Key? key}) : super(key: key);
|
||||
|
||||
final InvenTreeStockItem item;
|
||||
|
||||
@override
|
||||
_StockNotesState createState() => _StockNotesState(item);
|
||||
}
|
||||
@ -23,10 +23,10 @@ class StockNotesWidget extends StatefulWidget {
|
||||
|
||||
class _StockNotesState extends RefreshableState<StockNotesWidget> {
|
||||
|
||||
final InvenTreeStockItem item;
|
||||
|
||||
_StockNotesState(this.item);
|
||||
|
||||
final InvenTreeStockItem item;
|
||||
|
||||
@override
|
||||
String getAppBarTitle(BuildContext context) => L10().stockItemNotes;
|
||||
|
||||
|
Reference in New Issue
Block a user