mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-15 11:45:31 +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:
19
lib/l10.dart
19
lib/l10.dart
@ -4,18 +4,23 @@ import "package:flutter_gen/gen_l10n/app_localizations_en.dart";
|
||||
import "package:one_context/one_context.dart";
|
||||
import "package:flutter/material.dart";
|
||||
|
||||
import "package:inventree/helpers.dart";
|
||||
|
||||
// Shortcut function to reduce boilerplate!
|
||||
I18N L10()
|
||||
{
|
||||
if (OneContext.hasContext) {
|
||||
BuildContext? _ctx = OneContext().context;
|
||||
// Testing mode - ignore context
|
||||
if (!hasContext()) {
|
||||
return I18NEn();
|
||||
}
|
||||
|
||||
if (_ctx != null) {
|
||||
I18N? i18n = I18N.of(_ctx);
|
||||
BuildContext? _ctx = OneContext().context;
|
||||
|
||||
if (i18n != null) {
|
||||
return i18n;
|
||||
}
|
||||
if (_ctx != null) {
|
||||
I18N? i18n = I18N.of(_ctx);
|
||||
|
||||
if (i18n != null) {
|
||||
return i18n;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user