ClassConfig class
Represents values from JsonSerializable when merged with local
configuration.
Values are all known, so types are non-nullable.
Constructors
-
ClassConfig({required bool anyMap, required bool checked, required bool createFactory, required bool createToJson, required bool disallowUnrecognizedKeys, required bool explicitToJson, required FieldRename fieldRename, required bool genericArgumentFactories, required bool ignoreUnannotated, required bool includeIfNull, Map<
String, String> ctorParamDefaults = const {}}) -
const
Properties
- anyMap → bool
-
If
true, Map types are not assumed to be Map<String, dynamic> – which is the default type of Map instances return by JSON decode indart:convert.final - checked → bool
-
If
true, generatedfromJsonfunctions include extra checks to validate proper deserialization of types.final - createFactory → bool
-
If
true(the default), a private, static_$ExampleFromJsonmethod is created in the generated part file.final - createToJson → bool
-
If
true(the default), A top-level function is created that you can reference from your class.final -
ctorParamDefaults
→ Map<
String, String> -
final
- disallowUnrecognizedKeys → bool
-
If
false(the default), then the generatedFromJsonfunction will ignore unrecognized keys in the provided JSON Map.final - explicitToJson → bool
-
If
true, generatedtoJsonmethods will explicitly calltoJsonon nested objects.final - fieldRename → FieldRename
-
Defines the automatic naming strategy when converting class field names
into JSON map keys.
final
- genericArgumentFactories → bool
-
When
trueon classes with type parameters (generic types), extra "helper" parameters will be generated forfromJsonand/ortoJsonto support serializing values of those types.final - hashCode → int
-
The hash code for this object.
no setterinherited
- ignoreUnannotated → bool
-
When
true, only fields annotated withJsonKeywill have code generated.final - includeIfNull → bool
-
Whether the generator should include fields with
nullvalues in the serialized output.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
-
withDefaults(
) → JsonSerializable -
Returns a new
JsonSerializableinstance with fields equal to the corresponding values inthis, if notnull.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- defaults → const ClassConfig
-
An instance of
JsonSerializablewith all fields set to their default values.