import 'package:json_annotation/json_annotation.dart'; part 'base_api_models.g.dart'; @JsonSerializable() class ServiceBase { String? msg; int? code; dynamic data; ServiceBase({ this.msg, this.code, this.data, }); factory ServiceBase.fromJson(Map json) => _$ServiceBaseFromJson(json); Map toJson() => _$ServiceBaseToJson(this); } @JsonSerializable() class ServicePageBase { int current; int pages; int size; int total; ServicePageBase({ this.current = 1, this.pages = 1, this.size = 10, this.total = 0, }); factory ServicePageBase.fromJson(Map json) => _$ServicePageBaseFromJson(json); Map toJson() => _$ServicePageBaseToJson(this); }