mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-26 18:04:54 +00:00
Update email and password validation logic in the LoginForm widget to only perform validation when the state is not AuthTokenError. This ensures that validation is skipped when there is an authentication token error.
37 lines
729 B
Dart
37 lines
729 B
Dart
import 'package:syncrow_app/features/devices/model/device_model.dart';
|
|
|
|
class RoomModel {
|
|
final int? id;
|
|
final String? name;
|
|
|
|
List<DeviceModel>? devices;
|
|
|
|
RoomModel({
|
|
required this.id,
|
|
required this.name,
|
|
required this.devices,
|
|
});
|
|
|
|
Map<String, dynamic> toJson() {
|
|
return {
|
|
'id': id,
|
|
'name': name,
|
|
'devices': devices,
|
|
};
|
|
}
|
|
|
|
factory RoomModel.fromJson(Map<String, dynamic> json) {
|
|
List<DeviceModel> devices = [];
|
|
if (json['devices'] != null) {
|
|
for (var device in json['devices']) {
|
|
devices.add(DeviceModel.fromJson(device));
|
|
}
|
|
}
|
|
return RoomModel(
|
|
id: json['roomId'],
|
|
name: json['roomName'],
|
|
devices: devices,
|
|
);
|
|
}
|
|
}
|