2024-05-22 20:48:44 +00:00
// GENERATED CODE - DO NOT MODIFY BY HAND
part of ' simple_test_state.dart ' ;
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _ $SimpleTestStateCWProxy {
SimpleTestState seed ( int seed ) ;
SimpleTestState answer ( String answer ) ;
SimpleTestState isCorrect ( bool isCorrect ) ;
SimpleTestState isAnswered ( bool isAnswered ) ;
2024-06-08 23:34:38 +00:00
SimpleTestState isSkipped ( bool isSkipped ) ;
2024-05-22 20:48:44 +00:00
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 ? answer ,
bool ? isCorrect ,
bool ? isAnswered ,
2024-06-08 23:34:38 +00:00
bool ? isSkipped ,
2024-05-22 20:48:44 +00:00
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 answer ( String answer ) = > this ( answer: answer ) ;
@ override
SimpleTestState isCorrect ( bool isCorrect ) = > this ( isCorrect: isCorrect ) ;
@ override
SimpleTestState isAnswered ( bool isAnswered ) = > this ( isAnswered: isAnswered ) ;
2024-06-08 23:34:38 +00:00
@ override
SimpleTestState isSkipped ( bool isSkipped ) = > this ( isSkipped: isSkipped ) ;
2024-05-22 20:48:44 +00:00
@ 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 ? answer = const $CopyWithPlaceholder ( ) ,
Object ? isCorrect = const $CopyWithPlaceholder ( ) ,
Object ? isAnswered = const $CopyWithPlaceholder ( ) ,
2024-06-08 23:34:38 +00:00
Object ? isSkipped = const $CopyWithPlaceholder ( ) ,
2024-05-22 20:48:44 +00:00
Object ? testType = const $CopyWithPlaceholder ( ) ,
} ) {
return SimpleTestState (
seed: seed = = const $CopyWithPlaceholder ( ) | | seed = = null
? _value . seed
// ignore: cast_nullable_to_non_nullable
: seed as int ,
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 ,
2024-06-08 23:34:38 +00:00
isSkipped: isSkipped = = const $CopyWithPlaceholder ( ) | | isSkipped = = null
? _value . isSkipped
// ignore: cast_nullable_to_non_nullable
: isSkipped as bool ,
2024-05-22 20:48:44 +00:00
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 ( ) ,
answer: json [ ' answer ' ] as String ? ? ? ' ' ,
isCorrect: json [ ' isCorrect ' ] as bool ? ? ? false ,
isAnswered: json [ ' isAnswered ' ] as bool ? ? ? false ,
2024-06-08 23:34:38 +00:00
isSkipped: json [ ' isSkipped ' ] as bool ? ? ? false ,
2024-05-22 20:48:44 +00:00
testType:
$enumDecodeNullable ( _ $TestQuestionTypeEnumMap , json [ ' testType ' ] ) ? ?
TestQuestionType . simple ,
) ;
Map < String , dynamic > _ $SimpleTestStateToJson ( SimpleTestState instance ) = >
< String , dynamic > {
' testType ' : _ $TestQuestionTypeEnumMap [ instance . testType ] ! ,
' answer ' : instance . answer ,
' isCorrect ' : instance . isCorrect ,
' isAnswered ' : instance . isAnswered ,
2024-06-08 23:34:38 +00:00
' isSkipped ' : instance . isSkipped ,
2024-05-22 20:48:44 +00:00
' seed ' : instance . seed ,
} ;
const _ $TestQuestionTypeEnumMap = {
TestQuestionType . simple: ' simple ' ,
TestQuestionType . input_buttons: ' input_buttons ' ,
TestQuestionType . matrix: ' matrix ' ,
TestQuestionType . match: ' match ' ,
TestQuestionType . undefined: ' undefined ' ,
} ;