import 'package:json_annotation/json_annotation.dart'; part 'base_data.g.dart'; @JsonSerializable(genericArgumentFactories: true, explicitToJson: true) class BaseData { BaseData({ this.code, this.data, this.extra, this.isSuccess, this.msg, this.path, this.timestamp, }); int? code; T? data; dynamic extra; bool? isError; bool? isSuccess; String? msg; String? path; String? timestamp; factory BaseData.fromJson(Map json, fromJson) => _$BaseDataFromJson(json, fromJson); Map toJson(toJson) => _$BaseDataToJson(this, toJson); }