mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-08-25 15:29: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:
@ -17,7 +17,7 @@ Future<void> showPopUpFilterMenu({
|
||||
await showMenu(
|
||||
context: context,
|
||||
position: position,
|
||||
color: ColorsManager.whiteColors,
|
||||
color: ColorsManager.white,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(10)),
|
||||
),
|
||||
|
@ -51,7 +51,7 @@ class _RoleDropdownState extends State<RoleDropdown> {
|
||||
const SizedBox(height: 8),
|
||||
SizedBox(
|
||||
child: DropdownButtonFormField<String>(
|
||||
dropdownColor: ColorsManager.whiteColors,
|
||||
dropdownColor: ColorsManager.white,
|
||||
// alignment: Alignment.,
|
||||
focusColor: Colors.white,
|
||||
autofocus: true,
|
||||
|
@ -28,9 +28,7 @@ class RolesAndPermission extends StatelessWidget {
|
||||
Text(
|
||||
'Role & Permissions',
|
||||
style: context.textTheme.bodyLarge?.copyWith(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 20,
|
||||
color: Colors.black),
|
||||
fontWeight: FontWeight.w700, fontSize: 20, color: Colors.black),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
@ -67,21 +65,18 @@ class RolesAndPermission extends StatelessWidget {
|
||||
border: Border.all(
|
||||
color: ColorsManager.grayBorder)),
|
||||
child: TextFormField(
|
||||
style:
|
||||
const TextStyle(color: Colors.black),
|
||||
controller:
|
||||
_blocRole.roleSearchController,
|
||||
style: const TextStyle(color: Colors.black),
|
||||
controller: _blocRole.roleSearchController,
|
||||
onChanged: (value) {
|
||||
_blocRole.add(SearchPermission(
|
||||
nodes: _blocRole.permissions,
|
||||
searchTerm: value));
|
||||
},
|
||||
decoration: textBoxDecoration(radios: 20)!
|
||||
.copyWith(
|
||||
decoration:
|
||||
textBoxDecoration(radios: 20)!.copyWith(
|
||||
fillColor: Colors.white,
|
||||
suffixIcon: Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(right: 16),
|
||||
padding: const EdgeInsets.only(right: 16),
|
||||
child: SvgPicture.asset(
|
||||
Assets.textFieldSearch,
|
||||
width: 24,
|
||||
@ -108,7 +103,7 @@ class RolesAndPermission extends StatelessWidget {
|
||||
color: ColorsManager.circleRolesBackground,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
color: ColorsManager.whiteColors,
|
||||
color: ColorsManager.white,
|
||||
child: PermissionManagement(
|
||||
bloc: _blocRole,
|
||||
))))
|
||||
|
@ -23,7 +23,7 @@ Future<void> showDateFilterMenu({
|
||||
await showMenu(
|
||||
context: context,
|
||||
position: position,
|
||||
color: ColorsManager.whiteColors,
|
||||
color: ColorsManager.white,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomRight: Radius.circular(10),
|
||||
@ -41,9 +41,8 @@ Future<void> showDateFilterMenu({
|
||||
title: Text(
|
||||
"Sort from newest to oldest",
|
||||
style: TextStyle(
|
||||
color: isSelected == "NewestToOldest"
|
||||
? Colors.black
|
||||
: Colors.blueGrey),
|
||||
color:
|
||||
isSelected == "NewestToOldest" ? Colors.black : Colors.blueGrey),
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -57,9 +56,8 @@ Future<void> showDateFilterMenu({
|
||||
title: Text(
|
||||
"Sort from oldest to newest",
|
||||
style: TextStyle(
|
||||
color: isSelected == "OldestToNewest"
|
||||
? Colors.black
|
||||
: Colors.blueGrey),
|
||||
color:
|
||||
isSelected == "OldestToNewest" ? Colors.black : Colors.blueGrey),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -23,7 +23,7 @@ Future<void> showDeActivateFilterMenu({
|
||||
await showMenu(
|
||||
context: context,
|
||||
position: position,
|
||||
color: ColorsManager.whiteColors,
|
||||
color: ColorsManager.white,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomRight: Radius.circular(10),
|
||||
@ -41,9 +41,8 @@ Future<void> showDeActivateFilterMenu({
|
||||
title: Text(
|
||||
"Sort A to Z",
|
||||
style: TextStyle(
|
||||
color: isSelected == "NewestToOldest"
|
||||
? Colors.black
|
||||
: Colors.blueGrey),
|
||||
color:
|
||||
isSelected == "NewestToOldest" ? Colors.black : Colors.blueGrey),
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -57,9 +56,8 @@ Future<void> showDeActivateFilterMenu({
|
||||
title: Text(
|
||||
"Sort Z to A",
|
||||
style: TextStyle(
|
||||
color: isSelected == "OldestToNewest"
|
||||
? Colors.black
|
||||
: Colors.blueGrey),
|
||||
color:
|
||||
isSelected == "OldestToNewest" ? Colors.black : Colors.blueGrey),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -23,7 +23,7 @@ Future<void> showNameMenu({
|
||||
await showMenu(
|
||||
context: context,
|
||||
position: position,
|
||||
color: ColorsManager.whiteColors,
|
||||
color: ColorsManager.white,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomRight: Radius.circular(10),
|
||||
|
@ -83,8 +83,7 @@ class _TableRow extends StatelessWidget {
|
||||
for (int i = 0; i < cells.length; i++)
|
||||
Container(
|
||||
width: columnWidths[i],
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||
// decoration: BoxDecoration(
|
||||
// border: Border(
|
||||
// right: BorderSide(color: ColorsManager.boxDivider),
|
||||
@ -201,7 +200,7 @@ class _DynamicTableScreenState extends State<DynamicTableScreen> {
|
||||
|
||||
return Container(
|
||||
decoration: containerDecoration.copyWith(
|
||||
color: ColorsManager.whiteColors,
|
||||
color: ColorsManager.white,
|
||||
borderRadius: const BorderRadius.only(
|
||||
bottomLeft: Radius.circular(15),
|
||||
bottomRight: Radius.circular(15),
|
||||
@ -231,8 +230,7 @@ class _DynamicTableScreenState extends State<DynamicTableScreen> {
|
||||
if (_lastAvailableWidth != availableWidth) {
|
||||
final equalWidth =
|
||||
(availableWidth - totalDividersWidth) / widget.titles.length;
|
||||
final clampedWidth =
|
||||
equalWidth.clamp(_minColumnWidth, _maxColumnWidth);
|
||||
final clampedWidth = equalWidth.clamp(_minColumnWidth, _maxColumnWidth);
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
setState(() {
|
||||
@ -249,7 +247,7 @@ class _DynamicTableScreenState extends State<DynamicTableScreen> {
|
||||
child: Container(
|
||||
width: totalTableWidth,
|
||||
decoration: containerDecoration.copyWith(
|
||||
color: ColorsManager.whiteColors,
|
||||
color: ColorsManager.white,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(20)),
|
||||
),
|
||||
child: Column(
|
||||
|
@ -61,8 +61,7 @@ class UsersPage extends StatelessWidget {
|
||||
: ColorsManager.disabledPink.withOpacity(0.5),
|
||||
),
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(left: 10, right: 10, bottom: 5, top: 5),
|
||||
padding: const EdgeInsets.only(left: 10, right: 10, bottom: 5, top: 5),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@ -93,8 +92,7 @@ class UsersPage extends StatelessWidget {
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(left: 5, right: 5, bottom: 5, top: 5),
|
||||
padding: const EdgeInsets.only(left: 5, right: 5, bottom: 5, top: 5),
|
||||
child: SvgPicture.asset(
|
||||
status == "invited"
|
||||
? Assets.invitedIcon
|
||||
@ -142,7 +140,7 @@ class UsersPage extends StatelessWidget {
|
||||
},
|
||||
style: const TextStyle(color: Colors.black),
|
||||
decoration: textBoxDecoration(radios: 15)!.copyWith(
|
||||
fillColor: ColorsManager.whiteColors,
|
||||
fillColor: ColorsManager.white,
|
||||
errorStyle: const TextStyle(height: 0),
|
||||
hintStyle: context.textTheme.titleSmall?.copyWith(
|
||||
color: Colors.grey,
|
||||
@ -430,14 +428,12 @@ class UsersPage extends StatelessWidget {
|
||||
Text(user.createdTime ?? ''),
|
||||
Text(user.invitedBy),
|
||||
status(
|
||||
status: user.isEnabled == false
|
||||
? 'disabled'
|
||||
: user.status,
|
||||
status:
|
||||
user.isEnabled == false ? 'disabled' : user.status,
|
||||
),
|
||||
changeIconStatus(
|
||||
status: user.isEnabled == false
|
||||
? 'disabled'
|
||||
: user.status,
|
||||
status:
|
||||
user.isEnabled == false ? 'disabled' : user.status,
|
||||
userId: user.uuid,
|
||||
onTap: user.status != "invited"
|
||||
? () {
|
||||
@ -484,11 +480,10 @@ class UsersPage extends StatelessWidget {
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (BuildContext context) {
|
||||
return DeleteUserDialog(
|
||||
onTapDelete: () async {
|
||||
return DeleteUserDialog(onTapDelete: () async {
|
||||
try {
|
||||
_blocRole.add(DeleteUserEvent(
|
||||
user.uuid, context));
|
||||
_blocRole.add(
|
||||
DeleteUserEvent(user.uuid, context));
|
||||
await Future.delayed(
|
||||
const Duration(seconds: 2));
|
||||
return true;
|
||||
@ -521,8 +516,7 @@ class UsersPage extends StatelessWidget {
|
||||
visiblePagesCount: 4,
|
||||
buttonRadius: 10,
|
||||
selectedButtonColor: ColorsManager.secondaryColor,
|
||||
buttonUnSelectedBorderColor:
|
||||
ColorsManager.grayBorder,
|
||||
buttonUnSelectedBorderColor: ColorsManager.grayBorder,
|
||||
lastPageIcon:
|
||||
const Icon(Icons.keyboard_double_arrow_right),
|
||||
firstPageIcon:
|
||||
|
@ -9,7 +9,7 @@ class RoleCard extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: ColorsManager.whiteColors, // Card background color
|
||||
color: ColorsManager.white, // Card background color
|
||||
borderRadius: BorderRadius.circular(20), // Rounded corners
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
@ -22,8 +22,8 @@ class RoleCard extends StatelessWidget {
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: ColorsManager.whiteColors,
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
color: ColorsManager.white,
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
|
@ -1,6 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/common/bloc/project_manager.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/navigate_home_grid_view.dart';
|
||||
import 'package:syncrow_web/pages/roles_and_permission/bloc/roles_permission_bloc.dart';
|
||||
import 'package:syncrow_web/pages/roles_and_permission/bloc/roles_permission_state.dart';
|
||||
@ -30,8 +29,7 @@ class RolesAndPermissionPage extends StatelessWidget {
|
||||
enableMenuSidebar: false,
|
||||
appBarTitle: Text(
|
||||
'Roles & Permissions',
|
||||
style:
|
||||
ResponsiveTextTheme.of(context).deviceManagementTitle,
|
||||
style: ResponsiveTextTheme.of(context).deviceManagementTitle,
|
||||
),
|
||||
rightBody: const NavigateHomeGridView(),
|
||||
centerBody: Row(
|
||||
@ -66,7 +64,7 @@ class RolesAndPermissionPage extends StatelessWidget {
|
||||
'Users',
|
||||
style: context.textTheme.titleMedium?.copyWith(
|
||||
color: (_blocRole.tapSelect == true)
|
||||
? ColorsManager.whiteColors
|
||||
? ColorsManager.white
|
||||
: ColorsManager.grayColor,
|
||||
fontWeight: (_blocRole.tapSelect == true)
|
||||
? FontWeight.w700
|
||||
|
@ -32,7 +32,7 @@ class RolesPage extends StatelessWidget {
|
||||
controller: searchController,
|
||||
style: const TextStyle(color: Colors.black),
|
||||
decoration: textBoxDecoration(radios: 15)!.copyWith(
|
||||
fillColor: ColorsManager.whiteColors,
|
||||
fillColor: ColorsManager.white,
|
||||
errorStyle: const TextStyle(height: 0),
|
||||
hintStyle: context.textTheme.titleSmall?.copyWith(
|
||||
color: Colors.grey,
|
||||
|
Reference in New Issue
Block a user