copyWith method

FeatureState copyWith({
  1. String? id,
  2. String? key,
  3. bool? l,
  4. int? version,
  5. FeatureValueType? type,
  6. dynamic value,
  7. String? environmentId,
  8. List<FeatureRolloutStrategy>? strategies,
})

Implementation

FeatureState copyWith({
  String? id,
  String? key,
  bool? l,
  int? version,
  FeatureValueType? type,
  dynamic value,
  String? environmentId,
  List<FeatureRolloutStrategy>? strategies,
}) {
  final _copy_id = id ?? this.id;

  final _copy_key = key ?? this.key;

  final _copy_l = l ?? this.l;

  final _copy_version = version ?? this.version;

  final _copy_type = type ?? this.type;

  final _copy_value = value ?? this.value;

  final _copy_environmentId = environmentId ?? this.environmentId;

  final _copy_strategies = strategies ??
      ((List<FeatureRolloutStrategy> data) {
        return data.map((data) => data.copyWith()).toList();
      }(this.strategies));

  return FeatureState(
    id: _copy_id,
    key: _copy_key,
    l: _copy_l,
    version: _copy_version,
    type: _copy_type,
    value: _copy_value,
    environmentId: _copy_environmentId,
    strategies: _copy_strategies,
  );
}