mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-08-25 19:59:40 +00:00
Refactor color management and UI components for consistency
- Updated color references in various widgets to use the new `opaquePrimary` color for better visual consistency. - Refactored `ColorsManager` to improve color definitions and removed redundant color declarations. - Enhanced UI elements across multiple dialogs and widgets to ensure a cohesive design language. This change promotes maintainability and aligns with the updated color scheme.
This commit is contained in:
@ -104,7 +104,7 @@ abstract final class RangeOfAqiChartsHelper {
|
||||
) {
|
||||
return LineTouchData(
|
||||
touchTooltipData: LineTouchTooltipData(
|
||||
getTooltipColor: (touchTooltipItem) => ColorsManager.whiteColors,
|
||||
getTooltipColor: (touchTooltipItem) => ColorsManager.white,
|
||||
tooltipBorder: const BorderSide(
|
||||
color: ColorsManager.semiTransparentBlack,
|
||||
),
|
||||
|
@ -77,7 +77,7 @@ class AqiDistributionChart extends StatelessWidget {
|
||||
BarTouchData _barTouchData(BuildContext context) {
|
||||
return BarTouchData(
|
||||
touchTooltipData: BarTouchTooltipData(
|
||||
getTooltipColor: (_) => ColorsManager.whiteColors,
|
||||
getTooltipColor: (_) => ColorsManager.white,
|
||||
tooltipBorder: const BorderSide(
|
||||
color: ColorsManager.semiTransparentBlack,
|
||||
),
|
||||
|
@ -65,7 +65,7 @@ class AqiGauge extends StatelessWidget {
|
||||
pointer: GaugePointer.circle(
|
||||
position: const GaugePointerPosition.surface(),
|
||||
radius: MediaQuery.sizeOf(context).width * 0.004,
|
||||
color: ColorsManager.whiteColors,
|
||||
color: ColorsManager.white,
|
||||
border: GaugePointerBorder(
|
||||
width: 6,
|
||||
color: statusColor,
|
||||
|
@ -20,7 +20,7 @@ class AqiLocationInfoCell extends StatelessWidget {
|
||||
return Expanded(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: ColorsManager.whiteColors,
|
||||
color: ColorsManager.white,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Stack(
|
||||
|
@ -62,7 +62,7 @@ class AqiSubValueWidget extends StatelessWidget {
|
||||
child: Container(
|
||||
padding: const EdgeInsetsDirectional.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: ColorsManager.whiteColors,
|
||||
color: ColorsManager.white,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Row(
|
||||
|
@ -46,7 +46,7 @@ class _AqiTypeDropdownState extends State<AqiTypeDropdown> {
|
||||
value: widget.selectedAqiType,
|
||||
isDense: true,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
dropdownColor: ColorsManager.whiteColors,
|
||||
dropdownColor: ColorsManager.white,
|
||||
underline: const SizedBox.shrink(),
|
||||
icon: const RotatedBox(
|
||||
quarterTurns: 1,
|
||||
|
@ -107,7 +107,7 @@ class RangeOfAqiChart extends StatelessWidget {
|
||||
show: true,
|
||||
getDotPainter: (_, __, ___, ____) => FlDotCirclePainter(
|
||||
radius: 2,
|
||||
color: ColorsManager.whiteColors,
|
||||
color: ColorsManager.white,
|
||||
strokeWidth: 2,
|
||||
strokeColor: color,
|
||||
),
|
||||
|
@ -45,7 +45,7 @@ class _MonthPickerWidgetState extends State<MonthPickerWidget> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Dialog(
|
||||
backgroundColor: ColorsManager.whiteColors,
|
||||
backgroundColor: ColorsManager.white,
|
||||
child: Container(
|
||||
padding: const EdgeInsetsDirectional.all(20),
|
||||
width: 320,
|
||||
@ -108,7 +108,7 @@ class _MonthPickerWidgetState extends State<MonthPickerWidget> {
|
||||
style: context.textTheme.titleSmall?.copyWith(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: ColorsManager.whiteColors,
|
||||
color: ColorsManager.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -217,7 +217,7 @@ class _MonthPickerWidgetState extends State<MonthPickerWidget> {
|
||||
style: context.textTheme.titleSmall?.copyWith(
|
||||
fontSize: 12,
|
||||
color: isSelected
|
||||
? ColorsManager.whiteColors
|
||||
? ColorsManager.white
|
||||
: isFutureMonth
|
||||
? ColorsManager.blackColor.withValues(alpha: 0.3)
|
||||
: ColorsManager.blackColor.withValues(alpha: 0.8),
|
||||
|
@ -59,7 +59,7 @@ class _AnalyticsSpaceTreeViewState extends State<AnalyticsSpaceTreeView> {
|
||||
: state.communityList;
|
||||
return Container(
|
||||
height: MediaQuery.sizeOf(context).height,
|
||||
decoration: const BoxDecoration(color: ColorsManager.whiteColors),
|
||||
decoration: const BoxDecoration(color: ColorsManager.white),
|
||||
child: state is SpaceTreeLoadingState
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: Column(
|
||||
|
@ -33,7 +33,7 @@ class _YearPickerWidgetState extends State<YearPickerWidget> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Dialog(
|
||||
backgroundColor: ColorsManager.whiteColors,
|
||||
backgroundColor: ColorsManager.white,
|
||||
child: Container(
|
||||
padding: const EdgeInsetsDirectional.all(20),
|
||||
width: 320,
|
||||
@ -92,7 +92,7 @@ class _YearPickerWidgetState extends State<YearPickerWidget> {
|
||||
style: context.textTheme.titleSmall?.copyWith(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: ColorsManager.whiteColors,
|
||||
color: ColorsManager.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -144,7 +144,7 @@ class _YearPickerWidgetState extends State<YearPickerWidget> {
|
||||
style: context.textTheme.titleSmall?.copyWith(
|
||||
fontSize: 12,
|
||||
color: isSelected
|
||||
? ColorsManager.whiteColors
|
||||
? ColorsManager.white
|
||||
: ColorsManager.blackColor.withValues(alpha: 0.8),
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
|
@ -81,7 +81,7 @@ abstract final class EnergyManagementChartsHelper {
|
||||
|
||||
static LineTouchTooltipData lineTouchTooltipData() {
|
||||
return LineTouchTooltipData(
|
||||
getTooltipColor: (touchTooltipItem) => ColorsManager.whiteColors,
|
||||
getTooltipColor: (touchTooltipItem) => ColorsManager.white,
|
||||
tooltipBorder: const BorderSide(color: ColorsManager.semiTransparentBlack),
|
||||
tooltipRoundedRadius: 16,
|
||||
showOnTopOfTheChartBoxArea: false,
|
||||
|
@ -72,7 +72,7 @@ class AnalyticsDeviceDropdown extends StatelessWidget {
|
||||
value: state.selectedDevice,
|
||||
isDense: true,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
dropdownColor: ColorsManager.whiteColors,
|
||||
dropdownColor: ColorsManager.white,
|
||||
underline: const SizedBox.shrink(),
|
||||
icon: const RotatedBox(
|
||||
quarterTurns: 1,
|
||||
|
@ -18,7 +18,6 @@ class EnergyConsumptionByPhasesChart extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return BarChart(
|
||||
BarChartData(
|
||||
|
||||
gridData: EnergyManagementChartsHelper.gridData().copyWith(
|
||||
checkToShowHorizontalLine: (value) => true,
|
||||
horizontalInterval: 250,
|
||||
@ -74,7 +73,7 @@ class EnergyConsumptionByPhasesChart extends StatelessWidget {
|
||||
BarTouchData _barTouchData(BuildContext context) {
|
||||
return BarTouchData(
|
||||
touchTooltipData: BarTouchTooltipData(
|
||||
getTooltipColor: (touchTooltipItem) => ColorsManager.whiteColors,
|
||||
getTooltipColor: (touchTooltipItem) => ColorsManager.white,
|
||||
tooltipBorder: const BorderSide(
|
||||
color: ColorsManager.semiTransparentBlack,
|
||||
),
|
||||
|
@ -34,7 +34,7 @@ class HeatMapTooltip extends StatelessWidget {
|
||||
style: context.textTheme.bodySmall?.copyWith(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: ColorsManager.whiteColors,
|
||||
color: ColorsManager.white,
|
||||
),
|
||||
),
|
||||
const Divider(height: 2, thickness: 1),
|
||||
@ -43,7 +43,7 @@ class HeatMapTooltip extends StatelessWidget {
|
||||
style: context.textTheme.bodySmall?.copyWith(
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: ColorsManager.whiteColors,
|
||||
color: ColorsManager.white,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -64,7 +64,7 @@ class OccupancyChart extends StatelessWidget {
|
||||
BarTouchData _barTouchData(BuildContext context) {
|
||||
return BarTouchData(
|
||||
touchTooltipData: BarTouchTooltipData(
|
||||
getTooltipColor: (touchTooltipItem) => ColorsManager.whiteColors,
|
||||
getTooltipColor: (touchTooltipItem) => ColorsManager.white,
|
||||
tooltipBorder: const BorderSide(
|
||||
color: ColorsManager.semiTransparentBlack,
|
||||
),
|
||||
|
Reference in New Issue
Block a user