mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-25 06:17:55 +00:00
getting spaces and rooms from api {null checks}
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import 'package:syncrow_app/features/devices/model/device_category_model.dart';
|
||||
|
||||
class RoomModel {
|
||||
final String id;
|
||||
final String name;
|
||||
final int? id;
|
||||
final String? name;
|
||||
|
||||
final List<DevicesCategoryModel> categories;
|
||||
final List<DevicesCategoryModel>? categories;
|
||||
|
||||
RoomModel({
|
||||
required this.id,
|
||||
@@ -22,8 +22,8 @@ class RoomModel {
|
||||
|
||||
factory RoomModel.fromJson(Map<String, dynamic> json) {
|
||||
return RoomModel(
|
||||
id: json['id'],
|
||||
name: json['name'],
|
||||
id: json['roomId'],
|
||||
name: json['roomName'],
|
||||
categories: json['devices'],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user