mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-08-25 15: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:
@ -127,13 +127,11 @@ class _DynamicTableState extends State<DynamicTable> {
|
||||
controller: _horizontalScrollController,
|
||||
thumbVisibility: true,
|
||||
trackVisibility: true,
|
||||
notificationPredicate: (notif) =>
|
||||
notif.metrics.axis == Axis.horizontal,
|
||||
notificationPredicate: (notif) => notif.metrics.axis == Axis.horizontal,
|
||||
child: SingleChildScrollView(
|
||||
controller: _horizontalScrollController,
|
||||
scrollDirection: Axis.horizontal,
|
||||
physics:
|
||||
widget.isEmpty ? const NeverScrollableScrollPhysics() : null,
|
||||
physics: widget.isEmpty ? const NeverScrollableScrollPhysics() : null,
|
||||
child: SizedBox(
|
||||
width: _totalTableWidth,
|
||||
child: Column(
|
||||
@ -195,29 +193,25 @@ class _DynamicTableState extends State<DynamicTable> {
|
||||
widget.headers[colIndex] == 'Settings'
|
||||
? buildSettingsIcon(
|
||||
width: _settingsColumnWidth,
|
||||
onTap: () => widget
|
||||
.onSettingsPressed
|
||||
onTap: () => widget.onSettingsPressed
|
||||
?.call(rowIndex),
|
||||
)
|
||||
: _buildTableCell(
|
||||
row[colIndex].toString(),
|
||||
width: widget.headers[
|
||||
colIndex] ==
|
||||
width: widget.headers[colIndex] ==
|
||||
'Settings'
|
||||
? _settingsColumnWidth
|
||||
: (_totalTableWidth -
|
||||
(widget.withCheckBox
|
||||
? _checkboxColumnWidth
|
||||
: 0) -
|
||||
(widget.headers
|
||||
.contains(
|
||||
'Settings')
|
||||
(widget.headers.contains(
|
||||
'Settings')
|
||||
? _settingsColumnWidth
|
||||
: 0)) /
|
||||
(widget.headers.length -
|
||||
(widget.headers
|
||||
.contains(
|
||||
'Settings')
|
||||
(widget.headers.contains(
|
||||
'Settings')
|
||||
? 1
|
||||
: 0)),
|
||||
rowIndex: rowIndex,
|
||||
@ -241,7 +235,7 @@ class _DynamicTableState extends State<DynamicTable> {
|
||||
|
||||
Widget _buildEmptyState() => Container(
|
||||
height: widget.size.height,
|
||||
color: ColorsManager.whiteColors,
|
||||
color: ColorsManager.white,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
@ -281,9 +275,8 @@ class _DynamicTableState extends State<DynamicTable> {
|
||||
),
|
||||
child: Checkbox(
|
||||
value: _selectAll,
|
||||
onChanged: widget.withSelectAll && widget.data.isNotEmpty
|
||||
? _toggleSelectAll
|
||||
: null,
|
||||
onChanged:
|
||||
widget.withSelectAll && widget.data.isNotEmpty ? _toggleSelectAll : null,
|
||||
),
|
||||
);
|
||||
}
|
||||
@ -300,7 +293,7 @@ class _DynamicTableState extends State<DynamicTable> {
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
color: ColorsManager.whiteColors,
|
||||
color: ColorsManager.white,
|
||||
),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Center(
|
||||
@ -341,9 +334,7 @@ class _DynamicTableState extends State<DynamicTable> {
|
||||
}
|
||||
|
||||
Widget _buildTableCell(String content,
|
||||
{required double width,
|
||||
required int rowIndex,
|
||||
required int columnIndex}) {
|
||||
{required double width, required int rowIndex, required int columnIndex}) {
|
||||
bool isBatteryLevel = content.endsWith('%');
|
||||
double? batteryLevel;
|
||||
|
||||
@ -415,7 +406,7 @@ class _DynamicTableState extends State<DynamicTable> {
|
||||
height: _fixedRowHeight,
|
||||
padding: const EdgeInsets.only(left: 15, top: 10, bottom: 10),
|
||||
decoration: const BoxDecoration(
|
||||
color: ColorsManager.whiteColors,
|
||||
color: ColorsManager.white,
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: ColorsManager.boxDivider,
|
||||
|
Reference in New Issue
Block a user