mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-27 04:56:48 +00:00
* Add code_scan_listener package * Implement wedge controller widget * Update barcode settings widget - Allow user to choose which barcode scanner to use * Fix typo * Select barcode scanner widget based on user preference * Fix rendering issues for wedge controller * Update release notes * Add unit test for wedge scanner widget - Required some tweaks to other code * Use better library - https://github.com/fuadreza/flutter_barcode_listener - Fork of https://github.com/shaxxx/flutter_barcode_listener - Properly handles key "case" issues (shift, essentially) - Verified that it works correctly for multiple character types * Local copy of code, rather than relying on package which is not available on pub.dev * Fix unit test
27 lines
766 B
Dart
27 lines
766 B
Dart
import "package:flutter/material.dart";
|
|
import "package:one_context/one_context.dart";
|
|
|
|
const Color COLOR_GRAY_LIGHT = Color.fromRGBO(150, 150, 150, 1);
|
|
|
|
// 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;
|
|
}
|
|
|
|
BuildContext? context = OneContext().context;
|
|
|
|
if (context != null) {
|
|
return Theme.of(context).indicatorColor;
|
|
} else {
|
|
return Colors.lightBlue;
|
|
}
|
|
}
|
|
|
|
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);
|