GTMessageModel.fromJson constructor Null safety

GTMessageModel.fromJson(
  1. Map json
)

Implementation

GTMessageModel.fromJson(Map<dynamic, dynamic> json) {
  offLine = json['offLine'] as bool?;
  fromGeTui = json['fromGeTui'] as bool?;
  messageId = json['messageId'] as String?;
  title = json['title'] as String?;
  payload = json['payload'] as String?;
  payloadId = json['payloadId'] as String?;
  taskId = json['taskId'] as String?;
  content = json['content'] as String?;
  final Map<dynamic, dynamic>? aps = json['aps'] as Map<dynamic, dynamic>?;
  if (aps != null) {
    final _ApsModel apsModel = _ApsModel.fromJson(aps);
    title = apsModel.alert?.title;
    content = apsModel.alert?.body;
    sound = apsModel.sound;
  }
}