From 04a1baf442188c0c53eaed761ecebd7c7bd91c93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E8=90=8C?= <494089941@qq.com> Date: Thu, 26 May 2022 14:22:50 +0800 Subject: [PATCH] alrm model gernerate --- .../websocket/alarm_models/fire_model.dart | 10 ++-- .../websocket/alarm_models/fire_model.g.dart | 59 ++++++++++++++++--- 2 files changed, 56 insertions(+), 13 deletions(-) diff --git a/lib/utils/websocket/alarm_models/fire_model.dart b/lib/utils/websocket/alarm_models/fire_model.dart index 06cc8f91..db4dee2b 100644 --- a/lib/utils/websocket/alarm_models/fire_model.dart +++ b/lib/utils/websocket/alarm_models/fire_model.dart @@ -45,7 +45,7 @@ class FireModel extends Equatable { class FireAlarm extends Equatable { final String time; final String deviceName; - +factory FireAlarm.fromJson(Map json) =>_$FireAlarmFromJson(json); @override List get props => [ time, @@ -62,7 +62,7 @@ class FireAlarm extends Equatable { class DeviceAlarm extends Equatable { final String time; final String deviceName; - +factory DeviceAlarm.fromJson(Map json) =>_$DeviceAlarmFromJson(json); @override List get props => [ time, @@ -81,7 +81,7 @@ class OneButtonAlarm extends Equatable { final String roomName; final String name; final String tel; - +factory OneButtonAlarm.fromJson(Map json) =>_$OneButtonAlarmFromJson(json); @override List get props => [ time, @@ -102,7 +102,7 @@ class OneButtonAlarm extends Equatable { class ClientAlarm extends Equatable { final String time; final String content; - +factory ClientAlarm.fromJson(Map json) =>_$ClientAlarmFromJson(json); @override List get props => [ time, @@ -120,7 +120,7 @@ class ElderlyCareEquipmentReminder extends Equatable { final String deviceNo; final int deviceType; final String content; - +factory ElderlyCareEquipmentReminder.fromJson(Map json) =>_$ElderlyCareEquipmentReminderFromJson(json); @override List get props => [ deviceNo, diff --git a/lib/utils/websocket/alarm_models/fire_model.g.dart b/lib/utils/websocket/alarm_models/fire_model.g.dart index b4fa2a01..3900f809 100644 --- a/lib/utils/websocket/alarm_models/fire_model.g.dart +++ b/lib/utils/websocket/alarm_models/fire_model.g.dart @@ -7,12 +7,55 @@ part of 'fire_model.dart'; // ************************************************************************** FireModel _$FireModelFromJson(Map json) => FireModel( - model: json['model'] as String?, - communityCode: json['communityCode'] as String?, - alarmType: json['alarmType'] as int?, - alarmNo: json['alarmNo'] as String?, - deviceNo: json['deviceNo'] as String?, - deviceName: json['deviceName'] as String?, - time: json['time'] as String?, - alarmContent: json['alarmContent'] as String?, + model: json['model'] as String, + communityCode: json['communityCode'] as String, + type: json['type'] as int, + fireAlarm: json['fireAlarm'] == null + ? null + : FireAlarm.fromJson(json['fireAlarm'] as Map), + deviceAlarm: json['deviceAlarm'] == null + ? null + : DeviceAlarm.fromJson(json['deviceAlarm'] as Map), + oneButtonAlarm: json['oneButtonAlarm'] == null + ? null + : OneButtonAlarm.fromJson( + json['oneButtonAlarm'] as Map), + clientAlarm: json['clientAlarm'] == null + ? null + : ClientAlarm.fromJson(json['clientAlarm'] as Map), + elderlyCareEquipmentReminder: json['elderlyCareEquipmentReminder'] == null + ? null + : ElderlyCareEquipmentReminder.fromJson( + json['elderlyCareEquipmentReminder'] as Map), + ); + +FireAlarm _$FireAlarmFromJson(Map json) => FireAlarm( + time: json['time'] as String, + deviceName: json['deviceName'] as String, + ); + +DeviceAlarm _$DeviceAlarmFromJson(Map json) => DeviceAlarm( + time: json['time'] as String, + deviceName: json['deviceName'] as String, + ); + +OneButtonAlarm _$OneButtonAlarmFromJson(Map json) => + OneButtonAlarm( + time: json['time'] as String, + roomName: json['roomName'] as String, + name: json['name'] as String, + tel: json['tel'] as String, + ); + +ClientAlarm _$ClientAlarmFromJson(Map json) => ClientAlarm( + time: json['time'] as String, + content: json['content'] as String, + ); + +ElderlyCareEquipmentReminder _$ElderlyCareEquipmentReminderFromJson( + Map json) => + ElderlyCareEquipmentReminder( + deviceNo: json['deviceNo'] as String, + deviceType: json['deviceType'] as int, + content: json['content'] as String, );