fix(ui): display selected device name when add devices in DetailGroupScreen
This commit is contained in:
@@ -136,9 +136,12 @@ class DeviceUtils {
|
||||
List<Device> sortDeviceByState(List<Device> devices) {
|
||||
List<Device> sortedDevices = List.from(devices);
|
||||
sortedDevices.sort((a, b) {
|
||||
int stateOrder = [2, 1, 3, 0, -1, 3].indexOf(a.state!) -
|
||||
[2, 1, 3, 0, -1, 3].indexOf(b.state!);
|
||||
return stateOrder;
|
||||
int stateOrder = [2, 1, 3, 0, -1].indexOf(a.state!) -
|
||||
[2, 1, 3, 0, -1].indexOf(b.state!);
|
||||
if (stateOrder != 0) {
|
||||
return stateOrder;
|
||||
}
|
||||
return a.name!.compareTo(b.name!);
|
||||
});
|
||||
|
||||
return sortedDevices;
|
||||
|
||||
@@ -21,3 +21,5 @@ void showSnackBarResponseByStatusCodeNoIcon(BuildContext context, int statusCode
|
||||
showNoIconTopSnackBar(context, failedMessage, Colors.red, Colors.white);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user