app_config_entity.g.dart 1.47 KB
import 'package:wow_english/generated/json/base/json_convert_content.dart';
import 'package:wow_english/models/app_config_entity.dart';

AppConfigEntity $AppConfigEntityFromJson(Map<String, dynamic> json) {
  final AppConfigEntity appConfigEntity = AppConfigEntity();
  final String? safe = jsonConvert.convert<String>(json['safe']);
  if (safe != null) {
    appConfigEntity.safe = safe;
  }
  final List<String>? customerMobileList =
      (json['customerMobileList'] as List<dynamic>?)
          ?.map((e) => jsonConvert.convert<String>(e) as String)
          .toList();
  if (customerMobileList != null) {
    appConfigEntity.customerMobileList = customerMobileList;
  }
  final String? customerQr = jsonConvert.convert<String>(json['customerQr']);
  if (customerQr != null) {
    appConfigEntity.customerQr = customerQr;
  }
  return appConfigEntity;
}

Map<String, dynamic> $AppConfigEntityToJson(AppConfigEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['safe'] = entity.safe;
  data['customerMobileList'] = entity.customerMobileList;
  data['customerQr'] = entity.customerQr;
  return data;
}

extension AppConfigEntityExtension on AppConfigEntity {
  AppConfigEntity copyWith({
    String? safe,
    List<String>? customerMobileList,
    String? customerQr,
  }) {
    return AppConfigEntity()
      ..safe = safe ?? this.safe
      ..customerMobileList = customerMobileList ?? this.customerMobileList
      ..customerQr = customerQr ?? this.customerQr;
  }
}