2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-07-30 01:01:37 +00:00

More cleanup

This commit is contained in:
Oliver
2021-07-15 23:28:55 +10:00
parent d2ce3fadf1
commit 83e29777c2
12 changed files with 23 additions and 60 deletions

View File

@@ -9,7 +9,7 @@ import 'package:InvenTree/widget/refreshable_state.dart';
abstract class CompanyListWidget extends StatefulWidget {
String title = "";
final String title = "";
Map<String, String> filters = {};
@override

View File

@@ -22,7 +22,7 @@ Future<void> confirmationDialog(String title, String text, {String? acceptText,
),
content: Text(text),
actions: [
FlatButton(
TextButton(
child: Text(_reject),
onPressed: () {
// Close this dialog
@@ -33,7 +33,7 @@ Future<void> confirmationDialog(String title, String text, {String? acceptText,
}
}
),
FlatButton(
TextButton(
child: Text(_accept),
onPressed: () {
// Close this dialog
@@ -176,7 +176,7 @@ void showFormDialog(String title, {String? acceptText, String? cancelText, Globa
// Undefined actions = OK + Cancel
if (actions == null) {
actions = <Widget>[
FlatButton(
TextButton(
child: Text(_cancel),
onPressed: () {
// Close the form
@@ -186,7 +186,7 @@ void showFormDialog(String title, {String? acceptText, String? cancelText, Globa
}
}
),
FlatButton(
TextButton(
child: Text(_accept),
onPressed: () {

View File

@@ -71,13 +71,13 @@ class ImagePickerField extends FormField<File> {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
FlatButton(
TextButton(
child: Text(L10().selectImage),
onPressed: () {
_selectFromGallery(state);
},
),
FlatButton(
TextButton(
child: Text(L10().takePicture),
onPressed: () {
_selectFromCamera(state);

View File

@@ -199,9 +199,7 @@ class PartSearchDelegate extends SearchDelegate<InvenTreePart?> {
// Ensure the search theme matches the app theme
@override
ThemeData appBarTheme(BuildContext context) {
assert(context != null);
final ThemeData theme = Theme.of(context);
assert(theme != null);
return theme;
}
}
@@ -389,9 +387,7 @@ class StockSearchDelegate extends SearchDelegate<InvenTreeStockItem?> {
// Ensure the search theme matches the app theme
@override
ThemeData appBarTheme(BuildContext context) {
assert(context != null);
final ThemeData theme = Theme.of(context);
assert(theme != null);
return theme;
}
}

View File

@@ -392,7 +392,7 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
}
// Location information
if ((item.locationId > 0) && (item.locationName != null) && (item.locationName.isNotEmpty)) {
if ((item.locationId > 0) && (item.locationName.isNotEmpty)) {
tiles.add(
ListTile(
title: Text(L10().stockLocation),
@@ -581,7 +581,7 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
);
// Add or remove custom barcode
if (item != null && item.uid.isEmpty) {
if (item.uid.isEmpty) {
tiles.add(
ListTile(
title: Text(L10().barcodeAssign),