123456789101112131415161718192021222324252627282930313233 |
- import 'package:domain/generated/json/base/json_convert_content.dart';
- import 'package:domain/entity/response/id_name_entity.dart';
- IdNameEntity $IdNameEntityFromJson(Map<String, dynamic> json) {
- final IdNameEntity idNameEntity = IdNameEntity();
- final String? id = jsonConvert.convert<String>(json['id']);
- if (id != null) {
- idNameEntity.id = id;
- }
- final String? name = jsonConvert.convert<String>(json['name']);
- if (name != null) {
- idNameEntity.name = name;
- }
- return idNameEntity;
- }
- Map<String, dynamic> $IdNameEntityToJson(IdNameEntity entity) {
- final Map<String, dynamic> data = <String, dynamic>{};
- data['id'] = entity.id;
- data['name'] = entity.name;
- return data;
- }
- extension IdNameEntityExtension on IdNameEntity {
- IdNameEntity copyWith({
- String? id,
- String? name,
- }) {
- return IdNameEntity()
- ..id = id ?? this.id
- ..name = name ?? this.name;
- }
- }
|