mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-15 19:55:27 +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:
@ -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);
|
||||
|
Reference in New Issue
Block a user