mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-08-25 04:52:28 +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:
@ -1,5 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/bloc/device_mgmt_bloc/device_managment_bloc.dart';
|
||||
@ -47,8 +46,8 @@ class DeviceSettingsPanel extends StatelessWidget {
|
||||
return BlocBuilder<SettingDeviceBloc, DeviceSettingsState>(
|
||||
builder: (context, state) {
|
||||
final _bloc = context.read<SettingDeviceBloc>();
|
||||
final iconPath = DeviceIconTypeHelper.getDeviceIconByTypeCode(
|
||||
device.productType);
|
||||
final iconPath =
|
||||
DeviceIconTypeHelper.getDeviceIconByTypeCode(device.productType);
|
||||
final deviceInfo = state is DeviceSettingsUpdate
|
||||
? state.deviceInfo ?? DeviceInfoModel.empty()
|
||||
: DeviceInfoModel.empty();
|
||||
@ -77,11 +76,9 @@ class DeviceSettingsPanel extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
'Device Settings',
|
||||
style: context.theme.textTheme.titleLarge!
|
||||
.copyWith(
|
||||
style: context.theme.textTheme.titleLarge!.copyWith(
|
||||
fontWeight: FontWeight.w700,
|
||||
color: ColorsManager.vividBlue
|
||||
.withOpacity(0.7),
|
||||
color: ColorsManager.vividBlue.withOpacity(0.7),
|
||||
fontSize: 24),
|
||||
),
|
||||
],
|
||||
@ -98,7 +95,7 @@ class DeviceSettingsPanel extends StatelessWidget {
|
||||
backgroundColor:
|
||||
ColorsManager.grayBorder.withOpacity(0.5),
|
||||
child: CircleAvatar(
|
||||
backgroundColor: ColorsManager.whiteColors,
|
||||
backgroundColor: ColorsManager.white,
|
||||
radius: 36,
|
||||
child: SvgPicture.asset(
|
||||
iconPath,
|
||||
@ -116,8 +113,7 @@ class DeviceSettingsPanel extends StatelessWidget {
|
||||
const SizedBox(height: 15),
|
||||
Text(
|
||||
'Device Name:',
|
||||
style: context.textTheme.bodyMedium!
|
||||
.copyWith(
|
||||
style: context.textTheme.bodyMedium!.copyWith(
|
||||
color: ColorsManager.grayColor,
|
||||
),
|
||||
),
|
||||
@ -143,13 +139,13 @@ class DeviceSettingsPanel extends StatelessWidget {
|
||||
_bloc.add(const ChangeNameEvent(
|
||||
value: false));
|
||||
deviceManagementBloc
|
||||
..add(UpdateDeviceName(
|
||||
deviceId: device.uuid!,
|
||||
newName: _bloc
|
||||
.nameController
|
||||
.text))..add(ResetSelectedDevices());
|
||||
..add(UpdateDeviceName(
|
||||
deviceId: device.uuid!,
|
||||
newName:
|
||||
_bloc.nameController.text))
|
||||
..add(ResetSelectedDevices());
|
||||
},
|
||||
decoration:const InputDecoration(
|
||||
decoration: const InputDecoration(
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.zero,
|
||||
border: InputBorder.none,
|
||||
@ -164,18 +160,16 @@ class DeviceSettingsPanel extends StatelessWidget {
|
||||
width: 15,
|
||||
height: 25,
|
||||
child: Visibility(
|
||||
visible:
|
||||
_bloc.editName != true,
|
||||
visible: _bloc.editName != true,
|
||||
replacement: const SizedBox(),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
_bloc.add(
|
||||
const ChangeNameEvent(
|
||||
value: true));
|
||||
value: true));
|
||||
},
|
||||
child: SvgPicture.asset(
|
||||
Assets
|
||||
.editNameIconSettings,
|
||||
Assets.editNameIconSettings,
|
||||
color: ColorsManager
|
||||
.lightGrayBorderColor,
|
||||
height: 15,
|
||||
|
Reference in New Issue
Block a user