2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-12 18:25:26 +00:00

Start of unit tests for the actual API code

This commit is contained in:
Oliver Walters
2022-05-22 00:02:27 +10:00
parent 62b0fcbec5
commit e424a3cf7b
6 changed files with 103 additions and 51 deletions

View File

@ -7,16 +7,18 @@ import "package:flutter/material.dart";
// Shortcut function to reduce boilerplate!
I18N L10()
{
BuildContext? _ctx = OneContext().context;
if (OneContext.hasContext) {
BuildContext? _ctx = OneContext().context;
if (_ctx != null) {
I18N? i18n = I18N.of(_ctx);
if (_ctx != null) {
I18N? i18n = I18N.of(_ctx);
if (i18n != null) {
return i18n;
if (i18n != null) {
return i18n;
}
}
}
// Fallback for "null" context
return I18NEn();
return I18NEn();
}