88//.title~
99
1010// ignore_for_file: annotate_overrides
11+ // ignore_for_file: argument_type_not_assignable
1112// ignore_for_file: invalid_null_aware_operator
1213// ignore_for_file: overridden_fields
1314// ignore_for_file: require_trailing_commas
@@ -20,7 +21,8 @@ part of 'model_generate_screen_bindings.dart';
2021// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
2122
2223/// Generated class for [_ModelGenerateScreenBindings] .
23- class ModelGenerateScreenBindings extends _ModelGenerateScreenBindings {
24+ class ModelGenerateScreenBindings extends _ModelGenerateScreenBindings
25+ with EquatableMixin {
2426 //
2527 //
2628 //
@@ -31,6 +33,31 @@ class ModelGenerateScreenBindings extends _ModelGenerateScreenBindings {
3133 @override
3234 String get $className => CLASS_NAME ;
3335
36+ /// Field list backing `==` and `hashCode` via [EquatableMixin] . Preserves
37+ /// the same value semantics across hand-construction and `fromJson`
38+ /// round-trips since every field is included.
39+ @override
40+ List <Object ?> get props => [
41+ args,
42+ isAccessibleOnlyIfLoggedInAndVerified,
43+ isAccessibleOnlyIfLoggedIn,
44+ isAccessibleOnlyIfLoggedOut,
45+ isRedirectable,
46+ path,
47+ queryParameters,
48+ internalParameters,
49+ title,
50+ className,
51+ screenKey,
52+ keyStringCase
53+ ];
54+
55+ /// Preserves [BaseModel] 's JSON pretty-print toString rather than letting
56+ /// [EquatableMixin] 's default toString shadow it. The mixin sits after
57+ /// the BaseModel chain in the linearization, so we re-override here.
58+ @override
59+ String toString () => toJsonString ();
60+
3461 /// Optional arguments for configuration.
3562 final Map <dynamic , dynamic >? args;
3663
@@ -136,7 +163,9 @@ class ModelGenerateScreenBindings extends _ModelGenerateScreenBindings {
136163
137164 /// Constructs a new instance of [ModelGenerateScreenBindings] ,
138165 /// from the fields of [another] instance. Throws if the conversion fails.
139- factory ModelGenerateScreenBindings .from (BaseModel another) {
166+ factory ModelGenerateScreenBindings .from (
167+ BaseModel another,
168+ ) {
140169 try {
141170 return fromOrNull (another)! ;
142171 } catch (e) {
@@ -149,13 +178,18 @@ class ModelGenerateScreenBindings extends _ModelGenerateScreenBindings {
149178 /// from the fields of [another] instance. Returns `null` if [another] is
150179 /// `null` or if the conversion fails.
151180 @pragma ('vm:prefer-inline' )
152- static ModelGenerateScreenBindings ? fromOrNull (BaseModel ? another) {
153- return fromJsonOrNull (another? .toJson ())! ;
181+ static ModelGenerateScreenBindings ? fromOrNull (
182+ BaseModel ? another,
183+ ) {
184+ if (another == null ) return null ;
185+ return fromJsonOrNull (another.toJson ());
154186 }
155187
156188 /// Constructs a new instance of [ModelGenerateScreenBindings] ,
157189 /// from the fields of [another] instance. Throws if the conversion fails.
158- factory ModelGenerateScreenBindings .of (ModelGenerateScreenBindings another) {
190+ factory ModelGenerateScreenBindings .of (
191+ ModelGenerateScreenBindings another,
192+ ) {
159193 try {
160194 return ofOrNull (another)! ;
161195 } catch (e) {
@@ -177,7 +211,9 @@ class ModelGenerateScreenBindings extends _ModelGenerateScreenBindings {
177211 /// Constructs a new instance of [ModelGenerateScreenBindings] ,
178212 /// from [jsonString] , which must be a valid JSON String. Throws if the
179213 /// conversion fails.
180- factory ModelGenerateScreenBindings .fromJsonString (String jsonString) {
214+ factory ModelGenerateScreenBindings .fromJsonString (
215+ String jsonString,
216+ ) {
181217 try {
182218 return fromJsonStringOrNull (jsonString)! ;
183219 } catch (e) {
@@ -189,14 +225,13 @@ class ModelGenerateScreenBindings extends _ModelGenerateScreenBindings {
189225 /// Constructs a new instance of [ModelGenerateScreenBindings] ,
190226 /// from [jsonString] , which must be a valid JSON String. Returns `null` if
191227 /// [jsonString] is `null` or if the conversion fails.
192- static ModelGenerateScreenBindings ? fromJsonStringOrNull (String ? jsonString) {
228+ static ModelGenerateScreenBindings ? fromJsonStringOrNull (
229+ String ? jsonString,
230+ ) {
231+ if (jsonString == null || jsonString.isEmpty) return null ;
193232 try {
194- if (jsonString! .isNotEmpty) {
195- final decoded = letMapOrNull <String , dynamic >(jsonDecode (jsonString));
196- return ModelGenerateScreenBindings .fromJson (decoded);
197- } else {
198- return ModelGenerateScreenBindings .assertRequired ();
199- }
233+ final decoded = letMapOrNull <String , dynamic >(jsonDecode (jsonString));
234+ return ModelGenerateScreenBindings .fromJsonOrNull (decoded);
200235 } catch (_) {
201236 return null ;
202237 }
@@ -205,7 +240,9 @@ class ModelGenerateScreenBindings extends _ModelGenerateScreenBindings {
205240 /// Constructs a new instance of [ModelGenerateScreenBindings] ,
206241 /// from [json] , which must be a valid JSON object. Throws if the conversion
207242 /// fails.
208- factory ModelGenerateScreenBindings .fromJson (Map <String , dynamic >? json) {
243+ factory ModelGenerateScreenBindings .fromJson (
244+ Map <String , dynamic >? json,
245+ ) {
209246 try {
210247 return fromJsonOrNull (json)! ;
211248 } catch (e) {
@@ -221,26 +258,41 @@ class ModelGenerateScreenBindings extends _ModelGenerateScreenBindings {
221258 Map <String , dynamic >? json,
222259 ) {
223260 try {
224- final args = letMapOrNull <dynamic , dynamic >(
225- json? ['args' ],
226- )? .map ((p0, p1) => MapEntry (p0, p1)).nonNulls.nullIfEmpty? .unmodifiable;
227- final isAccessibleOnlyIfLoggedInAndVerified = letAsOrNull <bool >(
228- json? ['isAccessibleOnlyIfLoggedInAndVerified' ],
229- );
230- final isAccessibleOnlyIfLoggedIn = letAsOrNull <bool >(
231- json? ['isAccessibleOnlyIfLoggedIn' ],
232- );
233- final isAccessibleOnlyIfLoggedOut = letAsOrNull <bool >(
234- json? ['isAccessibleOnlyIfLoggedOut' ],
235- );
236- final isRedirectable = letAsOrNull <bool >(json? ['isRedirectable' ]);
261+ final args = letMapOrNull <dynamic , dynamic >(json? ['args' ])
262+ ? .map (
263+ (p0, p1) => MapEntry (
264+ p0,
265+ p1,
266+ ),
267+ )
268+ .nonNulls
269+ .nullIfEmpty
270+ ? .unmodifiable;
271+ final isAccessibleOnlyIfLoggedInAndVerified =
272+ letBoolOrNull (json? ['isAccessibleOnlyIfLoggedInAndVerified' ]);
273+ final isAccessibleOnlyIfLoggedIn =
274+ letBoolOrNull (json? ['isAccessibleOnlyIfLoggedIn' ]);
275+ final isAccessibleOnlyIfLoggedOut =
276+ letBoolOrNull (json? ['isAccessibleOnlyIfLoggedOut' ]);
277+ final isRedirectable = letBoolOrNull (json? ['isRedirectable' ]);
237278 final path = json? ['path' ]? .toString ().trim ().nullIfEmpty;
238- final queryParameters = letSetOrNull <dynamic >(
239- json? ['queryParameters' ],
240- )? .map ((p0) => p0).nonNulls.nullIfEmpty? .toSet ().unmodifiable;
241- final internalParameters = letSetOrNull <dynamic >(
242- json? ['internalParameters' ],
243- )? .map ((p0) => p0).nonNulls.nullIfEmpty? .toSet ().unmodifiable;
279+ final queryParameters = letSetOrNull <dynamic >(json? ['queryParameters' ])
280+ ? .map (
281+ (p0) => p0,
282+ )
283+ .nonNulls
284+ .nullIfEmpty
285+ ? .toSet ()
286+ .unmodifiable;
287+ final internalParameters =
288+ letSetOrNull <dynamic >(json? ['internalParameters' ])
289+ ? .map (
290+ (p0) => p0,
291+ )
292+ .nonNulls
293+ .nullIfEmpty
294+ ? .toSet ()
295+ .unmodifiable;
244296 final title = json? ['title' ]? .toString ().trim ().nullIfEmpty;
245297 final className = json? ['className' ]? .toString ().trim ().nullIfEmpty;
246298 final screenKey = json? ['screenKey' ]? .toString ().trim ().nullIfEmpty;
@@ -269,7 +321,9 @@ class ModelGenerateScreenBindings extends _ModelGenerateScreenBindings {
269321 /// Constructs a new instance of [ModelGenerateScreenBindings] ,
270322 /// from the query parameters of [uri] . Throws if the conversion
271323 /// fails.
272- factory ModelGenerateScreenBindings .fromUri (Uri ? uri) {
324+ factory ModelGenerateScreenBindings .fromUri (
325+ Uri ? uri,
326+ ) {
273327 try {
274328 return fromUriOrNull (uri)! ;
275329 } catch (e) {
@@ -281,33 +335,51 @@ class ModelGenerateScreenBindings extends _ModelGenerateScreenBindings {
281335 /// Constructs a new instance of [ModelGenerateScreenBindings] ,
282336 /// from the query parameters of [uri] . Returns `null` if [uri] is `null` or
283337 /// if the conversion fails.
284- static ModelGenerateScreenBindings ? fromUriOrNull (Uri ? uri) {
338+ static ModelGenerateScreenBindings ? fromUriOrNull (
339+ Uri ? uri,
340+ ) {
341+ if (uri == null || uri.path != CLASS_NAME ) return null ;
285342 try {
286- if (uri != null && uri.path == CLASS_NAME ) {
287- return ModelGenerateScreenBindings .fromJson (uri.queryParameters);
288- } else {
289- return ModelGenerateScreenBindings .assertRequired ();
290- }
343+ return ModelGenerateScreenBindings .fromJsonOrNull (uri.queryParameters);
291344 } catch (_) {
292345 return null ;
293346 }
294347 }
295348
296349 @override
297- Map <String , dynamic > toJson ({bool includeNulls = false }) {
350+ Map <String , dynamic > toJson ({
351+ bool includeNulls = false ,
352+ }) {
298353 try {
299- final args0 =
300- args? .map ((p0, p1) => MapEntry (p0, p1)).nonNulls.nullIfEmpty;
354+ final args0 = args
355+ ? .map (
356+ (p0, p1) => MapEntry (
357+ p0,
358+ p1,
359+ ),
360+ )
361+ .nonNulls
362+ .nullIfEmpty;
301363 final isAccessibleOnlyIfLoggedInAndVerified0 =
302364 isAccessibleOnlyIfLoggedInAndVerified;
303365 final isAccessibleOnlyIfLoggedIn0 = isAccessibleOnlyIfLoggedIn;
304366 final isAccessibleOnlyIfLoggedOut0 = isAccessibleOnlyIfLoggedOut;
305367 final isRedirectable0 = isRedirectable;
306368 final path0 = path? .trim ().nullIfEmpty;
307- final queryParameters0 =
308- queryParameters? .map ((p0) => p0).nonNulls.nullIfEmpty? .toList ();
309- final internalParameters0 =
310- internalParameters? .map ((p0) => p0).nonNulls.nullIfEmpty? .toList ();
369+ final queryParameters0 = queryParameters
370+ ? .map (
371+ (p0) => p0,
372+ )
373+ .nonNulls
374+ .nullIfEmpty
375+ ? .toList ();
376+ final internalParameters0 = internalParameters
377+ ? .map (
378+ (p0) => p0,
379+ )
380+ .nonNulls
381+ .nullIfEmpty
382+ ? .toList ();
311383 final title0 = title? .trim ().nullIfEmpty;
312384 final className0 = className? .trim ().nullIfEmpty;
313385 final screenKey0 = screenKey? .trim ().nullIfEmpty;
@@ -447,6 +519,30 @@ abstract final class ModelGenerateScreenBindingsFieldNames {
447519
448520 /// The field name of [ModelGenerateScreenBindings.keyStringCase] .
449521 static const keyStringCase = 'keyStringCase' ;
522+
523+ /// Every declared field-name constant in declaration order. Mirrors
524+ /// `enum.values` so consumers can iterate the schema without reflection.
525+ static const List <String > $values = [
526+ args,
527+ isAccessibleOnlyIfLoggedInAndVerified,
528+ isAccessibleOnlyIfLoggedIn,
529+ isAccessibleOnlyIfLoggedOut,
530+ isRedirectable,
531+ path,
532+ queryParameters,
533+ internalParameters,
534+ title,
535+ className,
536+ screenKey,
537+ keyStringCase
538+ ];
539+
540+ /// The field marked `primaryKey: true` , or `null` if none was declared.
541+ static const String ? $primaryKey = null ;
542+
543+ /// Foreign-key fields mapped to the referenced class name (as a String).
544+ /// Empty when no field uses `foreignKey:` / `references:` .
545+ static const Map <String , String > $foreignKeys = {};
450546}
451547
452548extension ModelGenerateScreenBindingsX on ModelGenerateScreenBindings {
0 commit comments