first
This commit is contained in:
86
lib/common/channel/model/call_log_model.dart
Normal file
86
lib/common/channel/model/call_log_model.dart
Normal file
@@ -0,0 +1,86 @@
|
||||
import 'dart:convert';
|
||||
|
||||
/// number : "18092171236"
|
||||
/// date : "2024-11-21 09:32:27"
|
||||
/// duration : 0
|
||||
/// type : 5
|
||||
/// name : gong
|
||||
|
||||
CallLogModel callLogModelFromJson(String str) =>
|
||||
CallLogModel.fromJson(json.decode(str));
|
||||
|
||||
String callLogModelToJson(CallLogModel data) => json.encode(data.toJson());
|
||||
|
||||
class CallLogModel {
|
||||
CallLogModel({
|
||||
String? number,
|
||||
String? date,
|
||||
num? duration,
|
||||
num? type,
|
||||
String? name,
|
||||
String? time,
|
||||
}) {
|
||||
_number = number;
|
||||
_date = date;
|
||||
_duration = duration;
|
||||
_type = type;
|
||||
_name = name;
|
||||
_time = time;
|
||||
}
|
||||
|
||||
CallLogModel.fromJson(dynamic json) {
|
||||
_number = json['number'];
|
||||
_date = json['date'];
|
||||
_duration = json['duration'];
|
||||
_type = json['type'];
|
||||
_name = json['name'];
|
||||
_time = json['time'];
|
||||
}
|
||||
|
||||
String? _number;
|
||||
String? _date;
|
||||
num? _duration;
|
||||
num? _type;
|
||||
String? _name;
|
||||
String? _time;
|
||||
|
||||
CallLogModel copyWith({
|
||||
String? number,
|
||||
String? date,
|
||||
num? duration,
|
||||
num? type,
|
||||
String? name,
|
||||
String? time,
|
||||
}) =>
|
||||
CallLogModel(
|
||||
number: number ?? _number,
|
||||
date: date ?? _date,
|
||||
duration: duration ?? _duration,
|
||||
type: type ?? _type,
|
||||
name: name ?? _name,
|
||||
time: time ?? _time,
|
||||
);
|
||||
|
||||
String? get number => _number;
|
||||
|
||||
String? get date => _date;
|
||||
|
||||
num? get duration => _duration;
|
||||
|
||||
num? get type => _type;
|
||||
|
||||
String? get name => _name;
|
||||
|
||||
String? get time => _time;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final map = <String, dynamic>{};
|
||||
map['number'] = _number;
|
||||
map['date'] = _date;
|
||||
map['duration'] = _duration;
|
||||
map['type'] = _type;
|
||||
map['name'] = _name;
|
||||
map['time'] = _time;
|
||||
return map;
|
||||
}
|
||||
}
|
||||
54
lib/common/channel/model/call_status_change_model.dart
Normal file
54
lib/common/channel/model/call_status_change_model.dart
Normal file
@@ -0,0 +1,54 @@
|
||||
import 'dart:convert';
|
||||
/// state : "Incoming"
|
||||
/// number : "18020143310"
|
||||
/// name : "gong"
|
||||
/// region : "江苏省 南京市"
|
||||
|
||||
CallStatusChangeModel callStatusChangeModelFromJson(String str) => CallStatusChangeModel.fromJson(json.decode(str));
|
||||
String callStatusChangeModelToJson(CallStatusChangeModel data) => json.encode(data.toJson());
|
||||
class CallStatusChangeModel {
|
||||
CallStatusChangeModel({
|
||||
String? state,
|
||||
String? number,
|
||||
String? name,
|
||||
String? region,}){
|
||||
_state = state;
|
||||
_number = number;
|
||||
_name = name;
|
||||
_region = region;
|
||||
}
|
||||
|
||||
CallStatusChangeModel.fromJson(dynamic json) {
|
||||
_state = json['state'];
|
||||
_number = json['number'];
|
||||
_name = json['name'];
|
||||
_region = json['region'];
|
||||
}
|
||||
String? _state;
|
||||
String? _number;
|
||||
String? _name;
|
||||
String? _region;
|
||||
CallStatusChangeModel copyWith({ String? state,
|
||||
String? number,
|
||||
String? name,
|
||||
String? region,
|
||||
}) => CallStatusChangeModel( state: state ?? _state,
|
||||
number: number ?? _number,
|
||||
name: name ?? _name,
|
||||
region: region ?? _region,
|
||||
);
|
||||
String? get state => _state;
|
||||
String? get number => _number;
|
||||
String? get name => _name;
|
||||
String? get region => _region;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final map = <String, dynamic>{};
|
||||
map['state'] = _state;
|
||||
map['number'] = _number;
|
||||
map['name'] = _name;
|
||||
map['region'] = _region;
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user