mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-14 11:15:26 +00:00
Update Requirements (#541)
* Update package requiremenst * github workflow updates * ios build updates * Theme adjustments * Further updates * Fix typo * Deprecated imperative apply of Flutter's Gradle plugins Ref: https://docs.flutter.dev/release/breaking-changes/flutter-gradle-plugin-apply * Refactor wedge scanner * Add context checks * Adjust behaviour if testing * Further refactoring * Moar checks * Logic fix * Fix for wedge scanner test * Fix for barcode processing * Fix * Yet another fix
This commit is contained in:
@ -31,6 +31,10 @@ Future<void> choiceDialog(String title, List<Widget> items, {Function? onSelecte
|
||||
);
|
||||
}
|
||||
|
||||
if (!hasContext()) {
|
||||
return;
|
||||
}
|
||||
|
||||
OneContext().showDialog(
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
@ -63,6 +67,10 @@ Future<void> confirmationDialog(String title, String text, {Color? color, IconDa
|
||||
String _accept = acceptText ?? L10().ok;
|
||||
String _reject = rejectText ?? L10().cancel;
|
||||
|
||||
if (!hasContext()) {
|
||||
return;
|
||||
}
|
||||
|
||||
OneContext().showDialog(
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
@ -176,6 +184,10 @@ Future<void> showErrorDialog(String title, {String description = "", APIResponse
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasContext()) {
|
||||
return;
|
||||
}
|
||||
|
||||
OneContext().showDialog(
|
||||
builder: (context) => SimpleDialog(
|
||||
title: ListTile(
|
||||
@ -196,7 +208,7 @@ Future<void> showErrorDialog(String title, {String description = "", APIResponse
|
||||
*/
|
||||
Future<void> showServerError(String url, String title, String description) async {
|
||||
|
||||
if (!OneContext.hasContext) {
|
||||
if (!hasContext()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ void showSnackIcon(String text, {IconData? icon, Function()? onAction, bool? suc
|
||||
debug("showSnackIcon: '${text}'");
|
||||
|
||||
// Escape quickly if we do not have context
|
||||
if (!OneContext.hasContext) {
|
||||
if (!hasContext()) {
|
||||
// Debug message for unit testing
|
||||
return;
|
||||
}
|
||||
|
@ -301,12 +301,16 @@ class _LocationDisplayState extends RefreshableState<LocationDisplayWidget> {
|
||||
// Serial number field is not required here
|
||||
fields.remove("serial");
|
||||
|
||||
Map<String, dynamic> data = {};
|
||||
|
||||
if (location != null) {
|
||||
data["location"] = location!.pk;
|
||||
}
|
||||
|
||||
InvenTreeStockItem().createForm(
|
||||
context,
|
||||
L10().stockItemCreate,
|
||||
data: {
|
||||
"location": location != null ? location!.pk : null,
|
||||
},
|
||||
data: data,
|
||||
fields: fields,
|
||||
onSuccess: (result) async {
|
||||
Map<String, dynamic> data = result as Map<String, dynamic>;
|
||||
|
Reference in New Issue
Block a user