2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-15 19:55:27 +00:00

Update Requirements (#541)
Some checks failed
Android / build (push) Has been cancelled
CI / test (push) Has been cancelled
iOS / build (push) Has been cancelled

* 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:
Oliver
2024-10-01 12:25:11 +10:00
committed by GitHub
parent 29948e5809
commit d990508237
28 changed files with 519 additions and 582 deletions

View File

@ -1,22 +1,29 @@
import "package:adaptive_theme/adaptive_theme.dart";
import "package:flutter/material.dart";
import "package:inventree/helpers.dart";
import "package:one_context/one_context.dart";
const Color COLOR_GRAY_LIGHT = Color.fromRGBO(150, 150, 150, 1);
bool isDarkMode() {
// Return an "action" color based on the current theme
Color get COLOR_ACTION {
// OneContext might not have context, e.g. in testing
if (!OneContext.hasContext) {
return Colors.lightBlue;
if (!hasContext()) {
return false;
}
BuildContext? context = OneContext().context;
if (context != null) {
return Theme.of(context).indicatorColor;
if (context == null) {
return false;
}
return AdaptiveTheme.of(context).brightness == Brightness.dark;
}
// Return an "action" color based on the current theme
Color get COLOR_ACTION {
if (isDarkMode()) {
return Colors.lightBlueAccent;
} else {
return Colors.lightBlue;
return Colors.blue;
}
}
@ -24,3 +31,4 @@ const Color COLOR_WARNING = Color.fromRGBO(250, 150, 50, 1);
const Color COLOR_DANGER = Color.fromRGBO(200, 50, 75, 1);
const Color COLOR_SUCCESS = Color.fromRGBO(100, 200, 75, 1);
const Color COLOR_PROGRESS = Color.fromRGBO(50, 100, 200, 1);
const Color COLOR_GRAY_LIGHT = Color.fromRGBO(150, 150, 150, 1);