160 lines
5.8 KiB
Dart
160 lines
5.8 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'simple_test_state.dart';
|
|
|
|
// **************************************************************************
|
|
// CopyWithGenerator
|
|
// **************************************************************************
|
|
|
|
abstract class _$SimpleTestStateCWProxy {
|
|
SimpleTestState seed(int seed);
|
|
|
|
SimpleTestState word(String word);
|
|
|
|
SimpleTestState answer(String answer);
|
|
|
|
SimpleTestState isCorrect(bool isCorrect);
|
|
|
|
SimpleTestState isAnswered(bool isAnswered);
|
|
|
|
SimpleTestState isSkipped(bool isSkipped);
|
|
|
|
SimpleTestState testType(TestQuestionType testType);
|
|
|
|
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `SimpleTestState(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
|
///
|
|
/// Usage
|
|
/// ```dart
|
|
/// SimpleTestState(...).copyWith(id: 12, name: "My name")
|
|
/// ````
|
|
SimpleTestState call({
|
|
int? seed,
|
|
String? word,
|
|
String? answer,
|
|
bool? isCorrect,
|
|
bool? isAnswered,
|
|
bool? isSkipped,
|
|
TestQuestionType? testType,
|
|
});
|
|
}
|
|
|
|
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfSimpleTestState.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfSimpleTestState.copyWith.fieldName(...)`
|
|
class _$SimpleTestStateCWProxyImpl implements _$SimpleTestStateCWProxy {
|
|
const _$SimpleTestStateCWProxyImpl(this._value);
|
|
|
|
final SimpleTestState _value;
|
|
|
|
@override
|
|
SimpleTestState seed(int seed) => this(seed: seed);
|
|
|
|
@override
|
|
SimpleTestState word(String word) => this(word: word);
|
|
|
|
@override
|
|
SimpleTestState answer(String answer) => this(answer: answer);
|
|
|
|
@override
|
|
SimpleTestState isCorrect(bool isCorrect) => this(isCorrect: isCorrect);
|
|
|
|
@override
|
|
SimpleTestState isAnswered(bool isAnswered) => this(isAnswered: isAnswered);
|
|
|
|
@override
|
|
SimpleTestState isSkipped(bool isSkipped) => this(isSkipped: isSkipped);
|
|
|
|
@override
|
|
SimpleTestState testType(TestQuestionType testType) =>
|
|
this(testType: testType);
|
|
|
|
@override
|
|
|
|
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `SimpleTestState(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
|
///
|
|
/// Usage
|
|
/// ```dart
|
|
/// SimpleTestState(...).copyWith(id: 12, name: "My name")
|
|
/// ````
|
|
SimpleTestState call({
|
|
Object? seed = const $CopyWithPlaceholder(),
|
|
Object? word = const $CopyWithPlaceholder(),
|
|
Object? answer = const $CopyWithPlaceholder(),
|
|
Object? isCorrect = const $CopyWithPlaceholder(),
|
|
Object? isAnswered = const $CopyWithPlaceholder(),
|
|
Object? isSkipped = const $CopyWithPlaceholder(),
|
|
Object? testType = const $CopyWithPlaceholder(),
|
|
}) {
|
|
return SimpleTestState(
|
|
seed: seed == const $CopyWithPlaceholder() || seed == null
|
|
? _value.seed
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: seed as int,
|
|
word: word == const $CopyWithPlaceholder() || word == null
|
|
? _value.word
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: word as String,
|
|
answer: answer == const $CopyWithPlaceholder() || answer == null
|
|
? _value.answer
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: answer as String,
|
|
isCorrect: isCorrect == const $CopyWithPlaceholder() || isCorrect == null
|
|
? _value.isCorrect
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: isCorrect as bool,
|
|
isAnswered:
|
|
isAnswered == const $CopyWithPlaceholder() || isAnswered == null
|
|
? _value.isAnswered
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: isAnswered as bool,
|
|
isSkipped: isSkipped == const $CopyWithPlaceholder() || isSkipped == null
|
|
? _value.isSkipped
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: isSkipped as bool,
|
|
testType: testType == const $CopyWithPlaceholder() || testType == null
|
|
? _value.testType
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: testType as TestQuestionType,
|
|
);
|
|
}
|
|
}
|
|
|
|
extension $SimpleTestStateCopyWith on SimpleTestState {
|
|
/// Returns a callable class that can be used as follows: `instanceOfSimpleTestState.copyWith(...)` or like so:`instanceOfSimpleTestState.copyWith.fieldName(...)`.
|
|
// ignore: library_private_types_in_public_api
|
|
_$SimpleTestStateCWProxy get copyWith => _$SimpleTestStateCWProxyImpl(this);
|
|
}
|
|
|
|
// **************************************************************************
|
|
// JsonSerializableGenerator
|
|
// **************************************************************************
|
|
|
|
SimpleTestState _$SimpleTestStateFromJson(Map<String, dynamic> json) =>
|
|
SimpleTestState(
|
|
seed: (json['seed'] as num).toInt(),
|
|
word: json['word'] as String,
|
|
answer: json['answer'] as String? ?? '',
|
|
isCorrect: json['isCorrect'] as bool? ?? false,
|
|
isAnswered: json['isAnswered'] as bool? ?? false,
|
|
isSkipped: json['isSkipped'] as bool? ?? false,
|
|
testType:
|
|
$enumDecodeNullable(_$TestQuestionTypeEnumMap, json['testType']) ??
|
|
TestQuestionType.simple,
|
|
);
|
|
|
|
Map<String, dynamic> _$SimpleTestStateToJson(SimpleTestState instance) =>
|
|
<String, dynamic>{
|
|
'testType': _$TestQuestionTypeEnumMap[instance.testType]!,
|
|
'word': instance.word,
|
|
'answer': instance.answer,
|
|
'isCorrect': instance.isCorrect,
|
|
'isAnswered': instance.isAnswered,
|
|
'isSkipped': instance.isSkipped,
|
|
'seed': instance.seed,
|
|
};
|
|
|
|
const _$TestQuestionTypeEnumMap = {
|
|
TestQuestionType.simple: 'simple',
|
|
TestQuestionType.input_buttons: 'input_buttons',
|
|
TestQuestionType.matrix: 'matrix',
|
|
TestQuestionType.match: 'match',
|
|
TestQuestionType.undefined: 'undefined',
|
|
};
|