import 'package:test_sa/models/base.dart'; class Rooms extends Base { int? id; // Now nullable @override String? name; // Now nullable int?value; // Now nullable Rooms({this.id, this.name, this.value}) : super(identifier: id?.toString() ?? '', name: name); // Handle potential null id Rooms.fromJson(Map? json) { // Handle potential null json input id = json?['id']?? json?['roomId']; name = json?['name']??json?['roomName']; value = json?['value']; } Map toJson() { final Map data = {}; data['id'] = id; data['name'] = name; data['value'] = value; return data; } } // class Rooms extends Base { // int? id; // Now nullable // int? departmentId; // Now nullable // int? clientRoomId; // Now nullable // String? roomName; // Now nullable // // Rooms({this.id, this.departmentId, this.clientRoomId, this.roomName}) : super(identifier: id?.toString() ?? '', name: roomName); // Handle potential null id // // Rooms.fromJson(Map? json) { // Handle potential null json input // id = json?['id']; // Use null-aware operator // departmentId = json?['departmentId']; // clientRoomId = json?['clientRoomId']; // roomName = json?['roomName']; // } // // Map toJson() { // final Map data = new Map();// data['id'] = this.id; // data['departmentId'] = this.departmentId; // data['clientRoomId'] = this.clientRoomId; // data['roomName'] = this.roomName; // return data; // } // }