| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- // ignore_for_file: non_constant_identifier_names
- // ignore_for_file: camel_case_types
- // ignore_for_file: prefer_single_quotes
- // This file is automatically generated. DO NOT EDIT, all your changes would be lost.
- import 'package:amap_location/generated/json/location_result_entity_helper.dart';
- import 'package:amap_location/location_result_entity.dart';
- class JsonConvert<T> {
- T fromJson(Map<String, dynamic> json) {
- return _getFromJson<T>(runtimeType, this, json);
- }
- Map<String, dynamic> toJson() {
- return _getToJson<T>(runtimeType, this);
- }
- static _getFromJson<T>(Type type, data, json) {
- switch (type) {
- case LocationResultEntity:
- return locationResultEntityFromJson(data as LocationResultEntity, json)
- as T;
- }
- return data as T;
- }
- static _getToJson<T>(Type type, data) {
- switch (type) {
- case LocationResultEntity:
- return locationResultEntityToJson(data as LocationResultEntity);
- }
- return data as T;
- }
- static T fromJsonAsT<T>(json) {
- switch (T.toString()) {
- case 'LocationResultEntity':
- return LocationResultEntity().fromJson(json) as T;
- }
- return null;
- }
- }
|