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;
  }
}
