Merge pull request #135 from inventree/unit-testing

Unit testing

(cherry picked from commit d55f594342)
This commit is contained in:
Oliver 2022-05-22 10:11:36 +10:00 committed by Oliver Walters
parent 10b435f4fa
commit cfc9f09b80
35 changed files with 893 additions and 317 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();
}