mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-14 19:25:27 +00:00
Refactor colors used in the app
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import 'package:inventree/app_colors.dart';
|
||||
import 'package:inventree/user_profile.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@ -131,7 +132,7 @@ class _InvenTreeHomePageState extends State<InvenTreeHomePage> {
|
||||
leading: FaIcon(FontAwesomeIcons.server),
|
||||
trailing: FaIcon(
|
||||
FontAwesomeIcons.user,
|
||||
color: Color.fromRGBO(250, 50, 50, 1),
|
||||
color: COLOR_DANGER,
|
||||
),
|
||||
onTap: () {
|
||||
_selectProfile();
|
||||
@ -147,7 +148,7 @@ class _InvenTreeHomePageState extends State<InvenTreeHomePage> {
|
||||
leading: FaIcon(FontAwesomeIcons.server),
|
||||
trailing: Spinner(
|
||||
icon: FontAwesomeIcons.spinner,
|
||||
color: Color.fromRGBO(50, 50, 250, 1),
|
||||
color: COLOR_PROGRESS,
|
||||
),
|
||||
onTap: () {
|
||||
_selectProfile();
|
||||
@ -160,7 +161,7 @@ class _InvenTreeHomePageState extends State<InvenTreeHomePage> {
|
||||
leading: FaIcon(FontAwesomeIcons.server),
|
||||
trailing: FaIcon(
|
||||
FontAwesomeIcons.checkCircle,
|
||||
color: Color.fromRGBO(50, 250, 50, 1)
|
||||
color: COLOR_SUCCESS
|
||||
),
|
||||
onTap: () {
|
||||
_selectProfile();
|
||||
@ -173,7 +174,7 @@ class _InvenTreeHomePageState extends State<InvenTreeHomePage> {
|
||||
leading: FaIcon(FontAwesomeIcons.server),
|
||||
trailing: FaIcon(
|
||||
FontAwesomeIcons.timesCircle,
|
||||
color: Color.fromRGBO(250, 50, 50, 1),
|
||||
color: COLOR_DANGER,
|
||||
),
|
||||
onTap: () {
|
||||
_selectProfile();
|
||||
|
@ -4,6 +4,7 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:inventree/app_colors.dart';
|
||||
|
||||
import 'package:inventree/l10.dart';
|
||||
import 'package:inventree/api_form.dart';
|
||||
@ -198,7 +199,7 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
|
||||
subtitle: Text("${part.description}"),
|
||||
trailing: IconButton(
|
||||
icon: FaIcon(part.starred ? FontAwesomeIcons.solidStar : FontAwesomeIcons.star,
|
||||
color: part.starred ? Color.fromRGBO(250, 250, 100, 1) : null,
|
||||
color: part.starred ? COLOR_STAR : null,
|
||||
),
|
||||
onPressed: _toggleStar,
|
||||
),
|
||||
@ -232,6 +233,29 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
|
||||
return tiles;
|
||||
}
|
||||
|
||||
if (!part.isActive) {
|
||||
tiles.add(
|
||||
ListTile(
|
||||
title: Text(
|
||||
L10().inactive,
|
||||
style: TextStyle(
|
||||
color: COLOR_DANGER
|
||||
)
|
||||
),
|
||||
subtitle: Text(
|
||||
L10().inactiveDetail,
|
||||
style: TextStyle(
|
||||
color: COLOR_DANGER
|
||||
)
|
||||
),
|
||||
leading: FaIcon(
|
||||
FontAwesomeIcons.exclamationCircle,
|
||||
color: COLOR_DANGER
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Category information
|
||||
if (part.categoryName.isNotEmpty) {
|
||||
tiles.add(
|
||||
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:inventree/app_colors.dart';
|
||||
|
||||
class Spinner extends StatefulWidget {
|
||||
final IconData? icon;
|
||||
@ -9,7 +10,7 @@ class Spinner extends StatefulWidget {
|
||||
final Color color;
|
||||
|
||||
const Spinner({
|
||||
this.color = const Color.fromRGBO(150, 150, 150, 1),
|
||||
this.color = COLOR_GRAY_LIGHT,
|
||||
Key? key,
|
||||
@required this.icon,
|
||||
this.duration = const Duration(milliseconds: 1800),
|
||||
|
@ -1,3 +1,4 @@
|
||||
import 'package:inventree/app_colors.dart';
|
||||
import 'package:inventree/inventree/part.dart';
|
||||
import 'package:inventree/inventree/stock.dart';
|
||||
import 'package:inventree/inventree/model.dart';
|
||||
@ -207,7 +208,7 @@ class _StockItemTestResultDisplayState extends RefreshableState<StockItemTestRes
|
||||
String _value = "";
|
||||
String _notes = "";
|
||||
|
||||
FaIcon _icon = FaIcon(FontAwesomeIcons.questionCircle, color: Color.fromRGBO(0, 0, 250, 1));
|
||||
FaIcon _icon = FaIcon(FontAwesomeIcons.questionCircle, color: COLOR_BLUE);
|
||||
bool _valueRequired = false;
|
||||
bool _attachmentRequired = false;
|
||||
|
||||
@ -229,11 +230,11 @@ class _StockItemTestResultDisplayState extends RefreshableState<StockItemTestRes
|
||||
|
||||
if (_result == true) {
|
||||
_icon = FaIcon(FontAwesomeIcons.checkCircle,
|
||||
color: Color.fromRGBO(0, 250, 0, 0.8)
|
||||
color: COLOR_SUCCESS,
|
||||
);
|
||||
} else if (_result == false) {
|
||||
_icon = FaIcon(FontAwesomeIcons.timesCircle,
|
||||
color: Color.fromRGBO(250, 0, 0, 0.8)
|
||||
color: COLOR_DANGER,
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user