chore(ui): update device state colors to match web

Change color and dynamic height table
This commit is contained in:
anhtunz
2025-04-08 09:47:23 +07:00
parent 1ab544afbb
commit 725d35aa5b
3 changed files with 40 additions and 48 deletions

View File

@@ -87,14 +87,15 @@ class _DevicesManagerScreenState extends State<DevicesManagerScreen> {
stream: devicesManagerBloc.streamUserRole,
initialData: role,
builder: (context, roleSnapshot) {
return SizedBox(
height: context.dynamicHeight(0.4),
return SizedBox(
height: getTableHeight(allDeviceSnapshot.data?.length ?? 1),
child: PaginatedDataTable2(
wrapInCard: false,
headingRowHeight: 30,
columnSpacing: 30,
columnSpacing: 35,
horizontalMargin: 10,
fixedLeftColumns: 1,
autoRowsToHeight: true,
// autoRowsToHeight: true,
renderEmptyRowsInTheEnd: false,
dragStartBehavior: DragStartBehavior.down,
minWidth: 950,
@@ -146,11 +147,11 @@ class _DevicesManagerScreenState extends State<DevicesManagerScreen> {
onPageChanged: (int pageIndex) {
// log('Chuyen page: $pageIndex');
},
// rowsPerPage:
// (allDeviceSnapshot.data?.length ?? 1) < 6
// ? (allDeviceSnapshot.data?.length ??
// 0)
// : 5,
rowsPerPage:
(allDeviceSnapshot.data?.length ?? 1) < 6
? (allDeviceSnapshot.data?.length ??
0)
: 5,
actions: [
if (roleSnapshot.data ==
@@ -224,7 +225,16 @@ class _DevicesManagerScreenState extends State<DevicesManagerScreen> {
void getUserRole() async {
role = await apiServices.getUserRole();
devicesManagerBloc.sinkUserRole.add(role);
devicesManagerBloc.sinkUserRole.add(role);F:
cd
}
double getTableHeight(int dataLength){
if(dataLength < 3){
return context.dynamicHeight(0.3);
}else {
return context.dynamicHeight(0.4);
}
}
}