app_config_entity.g.dart 4.01 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 bool? androidForceUpdate = jsonConvert.convert<bool>(
      json['androidForceUpdate']);
  if (androidForceUpdate != null) {
    appConfigEntity.androidForceUpdate = androidForceUpdate;
  }
  final bool? androidRecommendUpdate = jsonConvert.convert<bool>(
      json['androidRecommendUpdate']);
  if (androidRecommendUpdate != null) {
    appConfigEntity.androidRecommendUpdate = androidRecommendUpdate;
  }
  final String? androidUpdatePackageUrl = jsonConvert.convert<String>(
      json['androidUpdatePackageUrl']);
  if (androidUpdatePackageUrl != null) {
    appConfigEntity.androidUpdatePackageUrl = androidUpdatePackageUrl;
  }
  final int? androidVersion = jsonConvert.convert<int>(json['androidVersion']);
  if (androidVersion != null) {
    appConfigEntity.androidVersion = androidVersion;
  }
  final bool? iosForceUpdate = jsonConvert.convert<bool>(
      json['iosForceUpdate']);
  if (iosForceUpdate != null) {
    appConfigEntity.iosForceUpdate = iosForceUpdate;
  }
  final bool? iosRecommendUpdate = jsonConvert.convert<bool>(
      json['iosRecommendUpdate']);
  if (iosRecommendUpdate != null) {
    appConfigEntity.iosRecommendUpdate = iosRecommendUpdate;
  }
  final int? iosVersion = jsonConvert.convert<int>(json['iosVersion']);
  if (iosVersion != null) {
    appConfigEntity.iosVersion = iosVersion;
  }
  final String? updatePackageDescription = jsonConvert.convert<String>(
      json['updatePackageDescription']);
  if (updatePackageDescription != null) {
    appConfigEntity.updatePackageDescription = updatePackageDescription;
  }
  final String? noticeBeforePurchaseUrl = jsonConvert.convert<String>(
      json['noticeBeforePurchaseUrl']);
  if (noticeBeforePurchaseUrl != null) {
    appConfigEntity.noticeBeforePurchaseUrl = noticeBeforePurchaseUrl;
  }
  final String? safe = jsonConvert.convert<String>(json['safe']);
  if (safe != null) {
    appConfigEntity.safe = safe;
  }
  return appConfigEntity;
}

Map<String, dynamic> $AppConfigEntityToJson(AppConfigEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['androidForceUpdate'] = entity.androidForceUpdate;
  data['androidRecommendUpdate'] = entity.androidRecommendUpdate;
  data['androidUpdatePackageUrl'] = entity.androidUpdatePackageUrl;
  data['androidVersion'] = entity.androidVersion;
  data['iosForceUpdate'] = entity.iosForceUpdate;
  data['iosRecommendUpdate'] = entity.iosRecommendUpdate;
  data['iosVersion'] = entity.iosVersion;
  data['updatePackageDescription'] = entity.updatePackageDescription;
  data['noticeBeforePurchaseUrl'] = entity.noticeBeforePurchaseUrl;
  data['safe'] = entity.safe;
  return data;
}

extension AppConfigEntityExtension on AppConfigEntity {
  AppConfigEntity copyWith({
    bool? androidForceUpdate,
    bool? androidRecommendUpdate,
    String? androidUpdatePackageUrl,
    int? androidVersion,
    bool? iosForceUpdate,
    bool? iosRecommendUpdate,
    int? iosVersion,
    String? updatePackageDescription,
    String? noticeBeforePurchaseUrl,
    String? safe,
  }) {
    return AppConfigEntity()
      ..androidForceUpdate = androidForceUpdate ?? this.androidForceUpdate
      ..androidRecommendUpdate = androidRecommendUpdate ??
          this.androidRecommendUpdate
      ..androidUpdatePackageUrl = androidUpdatePackageUrl ??
          this.androidUpdatePackageUrl
      ..androidVersion = androidVersion ?? this.androidVersion
      ..iosForceUpdate = iosForceUpdate ?? this.iosForceUpdate
      ..iosRecommendUpdate = iosRecommendUpdate ?? this.iosRecommendUpdate
      ..iosVersion = iosVersion ?? this.iosVersion
      ..updatePackageDescription = updatePackageDescription ??
          this.updatePackageDescription
      ..noticeBeforePurchaseUrl = noticeBeforePurchaseUrl ??
          this.noticeBeforePurchaseUrl
      ..safe = safe ?? this.safe;
  }
}