flutterflow-mcp 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/README.md +124 -0
  2. package/build/api/flutterflow.d.ts +11 -0
  3. package/build/api/flutterflow.js +61 -0
  4. package/build/index.d.ts +2 -0
  5. package/build/index.js +54 -0
  6. package/build/prompts/dev-workflow.d.ts +2 -0
  7. package/build/prompts/dev-workflow.js +68 -0
  8. package/build/prompts/generate-page.d.ts +2 -0
  9. package/build/prompts/generate-page.js +36 -0
  10. package/build/prompts/inspect-project.d.ts +2 -0
  11. package/build/prompts/inspect-project.js +30 -0
  12. package/build/prompts/modify-component.d.ts +2 -0
  13. package/build/prompts/modify-component.js +39 -0
  14. package/build/resources/docs.d.ts +2 -0
  15. package/build/resources/docs.js +76 -0
  16. package/build/resources/projects.d.ts +3 -0
  17. package/build/resources/projects.js +60 -0
  18. package/build/tools/find-component-usages.d.ts +7 -0
  19. package/build/tools/find-component-usages.js +225 -0
  20. package/build/tools/find-page-navigations.d.ts +7 -0
  21. package/build/tools/find-page-navigations.js +228 -0
  22. package/build/tools/get-component-summary.d.ts +22 -0
  23. package/build/tools/get-component-summary.js +193 -0
  24. package/build/tools/get-page-by-name.d.ts +3 -0
  25. package/build/tools/get-page-by-name.js +56 -0
  26. package/build/tools/get-page-summary.d.ts +22 -0
  27. package/build/tools/get-page-summary.js +220 -0
  28. package/build/tools/get-yaml-docs.d.ts +6 -0
  29. package/build/tools/get-yaml-docs.js +217 -0
  30. package/build/tools/get-yaml.d.ts +3 -0
  31. package/build/tools/get-yaml.js +47 -0
  32. package/build/tools/list-files.d.ts +3 -0
  33. package/build/tools/list-files.js +30 -0
  34. package/build/tools/list-pages.d.ts +25 -0
  35. package/build/tools/list-pages.js +101 -0
  36. package/build/tools/list-projects.d.ts +3 -0
  37. package/build/tools/list-projects.js +19 -0
  38. package/build/tools/sync-project.d.ts +3 -0
  39. package/build/tools/sync-project.js +144 -0
  40. package/build/tools/update-yaml.d.ts +3 -0
  41. package/build/tools/update-yaml.js +24 -0
  42. package/build/tools/validate-yaml.d.ts +3 -0
  43. package/build/tools/validate-yaml.js +22 -0
  44. package/build/utils/cache.d.ts +48 -0
  45. package/build/utils/cache.js +162 -0
  46. package/build/utils/decode-yaml.d.ts +7 -0
  47. package/build/utils/decode-yaml.js +31 -0
  48. package/build/utils/page-summary/action-summarizer.d.ts +9 -0
  49. package/build/utils/page-summary/action-summarizer.js +291 -0
  50. package/build/utils/page-summary/formatter.d.ts +13 -0
  51. package/build/utils/page-summary/formatter.js +121 -0
  52. package/build/utils/page-summary/node-extractor.d.ts +17 -0
  53. package/build/utils/page-summary/node-extractor.js +207 -0
  54. package/build/utils/page-summary/tree-walker.d.ts +6 -0
  55. package/build/utils/page-summary/tree-walker.js +55 -0
  56. package/build/utils/page-summary/types.d.ts +56 -0
  57. package/build/utils/page-summary/types.js +4 -0
  58. package/build/utils/parse-folders.d.ts +9 -0
  59. package/build/utils/parse-folders.js +29 -0
  60. package/docs/ff-yaml/00-overview.md +137 -0
  61. package/docs/ff-yaml/01-project-files.md +513 -0
  62. package/docs/ff-yaml/02-pages.md +572 -0
  63. package/docs/ff-yaml/03-components.md +413 -0
  64. package/docs/ff-yaml/04-widgets/README.md +122 -0
  65. package/docs/ff-yaml/04-widgets/button.md +444 -0
  66. package/docs/ff-yaml/04-widgets/container.md +358 -0
  67. package/docs/ff-yaml/04-widgets/dropdown.md +579 -0
  68. package/docs/ff-yaml/04-widgets/form.md +256 -0
  69. package/docs/ff-yaml/04-widgets/image.md +276 -0
  70. package/docs/ff-yaml/04-widgets/layout.md +355 -0
  71. package/docs/ff-yaml/04-widgets/misc.md +553 -0
  72. package/docs/ff-yaml/04-widgets/text-field.md +326 -0
  73. package/docs/ff-yaml/04-widgets/text.md +302 -0
  74. package/docs/ff-yaml/05-actions.md +843 -0
  75. package/docs/ff-yaml/06-variables.md +834 -0
  76. package/docs/ff-yaml/07-data.md +591 -0
  77. package/docs/ff-yaml/08-custom-code.md +715 -0
  78. package/docs/ff-yaml/09-theming.md +592 -0
  79. package/docs/ff-yaml/10-editing-guide.md +454 -0
  80. package/docs/ff-yaml/README.md +105 -0
  81. package/package.json +55 -0
  82. package/skills/ff-widget-patterns.md +141 -0
  83. package/skills/ff-yaml-dev.md +58 -0
@@ -0,0 +1,834 @@
1
+ # Variables and Data Binding
2
+
3
+ Variables are the data binding mechanism in FlutterFlow YAML. They appear anywhere a widget property or action parameter needs a dynamic value -- text content, colors, visibility conditions, action arguments, and more.
4
+
5
+ ---
6
+
7
+ ## Variable Structure
8
+
9
+ Every variable follows a universal schema:
10
+
11
+ ```yaml
12
+ variable:
13
+ source: SOURCE_TYPE
14
+ baseVariable: { ... } # Source-specific accessor
15
+ operations: [ ... ] # Optional chained transformations
16
+ nodeKeyRef: { key: ... } # Widget/page context reference
17
+ defaultValue: # Fallback when value is null
18
+ serializedValue: "-"
19
+ uiBuilderValue: # Preview value shown in UI builder
20
+ serializedValue: "Example"
21
+ actionComponentKeyRef: {} # Reference when inside action component
22
+ ```
23
+
24
+ All fields except `source` are optional depending on context. The `nodeKeyRef` references the containing widget or page scaffold, providing context for where the variable is evaluated.
25
+
26
+ ---
27
+
28
+ ## Variable Sources
29
+
30
+ ### `WIDGET_CLASS_PARAMETER` -- Page/Component Parameter
31
+
32
+ Accesses a parameter passed to the current page or component.
33
+
34
+ ```yaml
35
+ variable:
36
+ source: WIDGET_CLASS_PARAMETER
37
+ defaultValue:
38
+ serializedValue: "-"
39
+ baseVariable:
40
+ widgetClass:
41
+ paramIdentifier:
42
+ name: dealTitle
43
+ key: t8j0tg
44
+ nodeKeyRef:
45
+ key: Container_qsdo2h11
46
+ ```
47
+
48
+ | Field | Description |
49
+ |---|---|
50
+ | `widgetClass.paramIdentifier.name` | Human-readable parameter name |
51
+ | `widgetClass.paramIdentifier.key` | Unique parameter key |
52
+ | `nodeKeyRef.key` | Key of the widget class (page scaffold or component container) |
53
+
54
+ ### `WIDGET_STATE` -- Widget State Value
55
+
56
+ Reads the current value of an interactive widget (TextField, RatingBar, etc.).
57
+
58
+ ```yaml
59
+ variable:
60
+ source: WIDGET_STATE
61
+ baseVariable:
62
+ widgetState:
63
+ returnParameter:
64
+ allowedDestinationTypes:
65
+ - Integer
66
+ - Double
67
+ - Boolean
68
+ - ImagePath
69
+ - VideoPath
70
+ - AudioPath
71
+ dataType:
72
+ scalarType: String
73
+ nodeKeyRef:
74
+ key: TextField_mxlvp4hj
75
+ ```
76
+
77
+ | Field | Description |
78
+ |---|---|
79
+ | `widgetState.returnParameter.dataType` | Data type the widget returns |
80
+ | `widgetState.returnParameter.allowedDestinationTypes` | Compatible type conversions |
81
+ | `nodeKeyRef.key` | Key of the widget whose state is being read |
82
+
83
+ ### `LOCAL_STATE` -- Component or App State
84
+
85
+ Accesses a state variable defined on the component or at the app level.
86
+
87
+ ```yaml
88
+ variable:
89
+ source: LOCAL_STATE
90
+ defaultValue:
91
+ serializedValue: "-"
92
+ baseVariable:
93
+ localState:
94
+ fieldIdentifier:
95
+ name: activeSub
96
+ key: y5j8n
97
+ stateVariableType: WIDGET_CLASS_STATE
98
+ nodeKeyRef:
99
+ key: Container_hn5rs9xq
100
+ ```
101
+
102
+ | Field | Description |
103
+ |---|---|
104
+ | `localState.fieldIdentifier.name` | State field name |
105
+ | `localState.fieldIdentifier.key` | Unique field key |
106
+ | `localState.stateVariableType` | `WIDGET_CLASS_STATE` (component-level) or `APP_STATE` (app-level) |
107
+
108
+ ### `FIREBASE_AUTH_USER` -- Authenticated User Data
109
+
110
+ Accesses properties of the currently authenticated Firebase user.
111
+
112
+ ```yaml
113
+ variable:
114
+ source: FIREBASE_AUTH_USER
115
+ baseVariable:
116
+ auth:
117
+ property: USER_REFERENCE
118
+ ```
119
+
120
+ With user document fields:
121
+
122
+ ```yaml
123
+ variable:
124
+ source: FIREBASE_AUTH_USER
125
+ baseVariable:
126
+ auth:
127
+ property: USERS_DATA_FIELD
128
+ usersDataField:
129
+ name: zipCode
130
+ ```
131
+
132
+ **Available `property` values:**
133
+
134
+ | Property | Description |
135
+ |---|---|
136
+ | `EMAIL` | User's email address |
137
+ | `DISPLAY_NAME` | User's display name |
138
+ | `UID` | Firebase user ID |
139
+ | `PHONE_NUMBER` | User's phone number |
140
+ | `JWT_TOKEN` | Current JWT auth token |
141
+ | `USER_REFERENCE` | Firestore document reference to the user |
142
+ | `USERS_DATA_FIELD` | Access a field from the user's Firestore document (requires `usersDataField.name`) |
143
+
144
+ ### `GLOBAL_PROPERTIES` -- System Properties
145
+
146
+ Accesses platform and runtime properties.
147
+
148
+ ```yaml
149
+ variable:
150
+ source: GLOBAL_PROPERTIES
151
+ baseVariable:
152
+ globalProperties:
153
+ property: CURRENT_TIMESTAMP
154
+ ```
155
+
156
+ **Available `property` values:**
157
+
158
+ | Property | Description |
159
+ |---|---|
160
+ | `CURRENT_TIMESTAMP` | Current date/time |
161
+ | `CURRENT_DEVICE_LOCATION` | Device GPS location (LatLng) |
162
+ | `IS_IOS` | Whether the device is iOS |
163
+
164
+ ### `ACTION_OUTPUTS` -- Previous Action Result
165
+
166
+ Reads the output of a previously executed action in the same trigger chain.
167
+
168
+ ```yaml
169
+ variable:
170
+ source: ACTION_OUTPUTS
171
+ defaultValue:
172
+ serializedValue: "-"
173
+ baseVariable:
174
+ actionOutput:
175
+ outputVariableIdentifier:
176
+ name: actSub
177
+ actionKeyRef:
178
+ key: dq212dg5
179
+ nodeKeyRef:
180
+ key: Container_62tpyf7s
181
+ actionComponentKeyRef: {}
182
+ ```
183
+
184
+ | Field | Description |
185
+ |---|---|
186
+ | `actionOutput.outputVariableIdentifier.name` | Name matching the producing action's `outputVariableName` |
187
+ | `actionOutput.actionKeyRef.key` | Key of the action that produced the output |
188
+ | `actionComponentKeyRef.key` | Key of the action component (if output comes from a reusable action block) |
189
+
190
+ ### `FUNCTION_CALL` -- Computed/Conditional Values
191
+
192
+ Evaluates functions, conditions, string interpolation, code expressions, or custom functions. This is the most versatile source type.
193
+
194
+ **String interpolation:**
195
+
196
+ ```yaml
197
+ variable:
198
+ source: FUNCTION_CALL
199
+ functionCall:
200
+ stringInterpolation: {}
201
+ values:
202
+ - inputValue:
203
+ serializedValue: "An OTP code has been sent to +1 *** **"
204
+ - variable:
205
+ source: FUNCTION_CALL
206
+ functionCall:
207
+ values:
208
+ - variable:
209
+ source: WIDGET_STATE
210
+ baseVariable:
211
+ widgetState:
212
+ returnParameter:
213
+ dataType:
214
+ scalarType: String
215
+ nodeKeyRef:
216
+ key: TextField_hci45i6l
217
+ codeExpression:
218
+ arguments:
219
+ - identifier:
220
+ name: var1
221
+ dataType:
222
+ scalarType: String
223
+ nonNullable: true
224
+ returnParameter:
225
+ dataType:
226
+ scalarType: String
227
+ nonNullable: true
228
+ expression: var1.substring(var1.length - 2)
229
+ valid: true
230
+ ```
231
+
232
+ **Conditional value (if/else):**
233
+
234
+ ```yaml
235
+ variable:
236
+ source: FUNCTION_CALL
237
+ functionCall:
238
+ conditionalValue:
239
+ ifConditionalValues:
240
+ - condition:
241
+ source: FUNCTION_CALL
242
+ functionCall:
243
+ values:
244
+ - variable:
245
+ source: LOCAL_STATE
246
+ baseVariable:
247
+ localState:
248
+ fieldIdentifier:
249
+ name: NavBarStatus
250
+ key: p4n8k8yh
251
+ stateVariableType: APP_STATE
252
+ - variable:
253
+ source: ENUMS
254
+ baseVariable:
255
+ enumVariable:
256
+ enumIdentifier:
257
+ name: NavBar
258
+ key: qik04
259
+ enumElementIdentifier:
260
+ name: profile
261
+ key: fnvnd
262
+ condition:
263
+ relation: EQUAL_TO
264
+ value:
265
+ inputValue:
266
+ color:
267
+ themeColor: PRIMARY
268
+ elseValue:
269
+ inputValue:
270
+ color:
271
+ value: "4279966491"
272
+ returnParameter:
273
+ dataType:
274
+ scalarType: Color
275
+ ```
276
+
277
+ **Custom function call:**
278
+
279
+ ```yaml
280
+ variable:
281
+ source: FUNCTION_CALL
282
+ functionCall:
283
+ values:
284
+ - variable:
285
+ source: GLOBAL_PROPERTIES
286
+ baseVariable:
287
+ globalProperties:
288
+ property: CURRENT_DEVICE_LOCATION
289
+ - variable:
290
+ source: FIRESTORE_REQUEST
291
+ baseVariable:
292
+ firestore: {}
293
+ operations:
294
+ - accessDocumentField:
295
+ fieldIdentifier:
296
+ name: latLon
297
+ nodeKeyRef:
298
+ key: GridView_gi0dnunq
299
+ customFunction:
300
+ name: distanceBetween2PointsMiles
301
+ key: 3thuk
302
+ ```
303
+
304
+ ### `ENUMS` -- Enum Values
305
+
306
+ References a specific enum element.
307
+
308
+ ```yaml
309
+ variable:
310
+ source: ENUMS
311
+ baseVariable:
312
+ enumVariable:
313
+ enumIdentifier:
314
+ name: subscription
315
+ key: 8a348
316
+ enumElementIdentifier:
317
+ name: monthly
318
+ key: 3lp2p
319
+ ```
320
+
321
+ ### `DATA_STRUCTS` -- Create Data Struct Inline
322
+
323
+ Creates a data struct value inline with field values.
324
+
325
+ ```yaml
326
+ variable:
327
+ source: DATA_STRUCTS
328
+ baseVariable:
329
+ createDataStruct:
330
+ dataStructIdentifier:
331
+ name: Deal
332
+ key: lpezy
333
+ fields:
334
+ - fieldIdentifier:
335
+ name: Name
336
+ key: htoak
337
+ value:
338
+ variable:
339
+ source: LOCAL_STATE
340
+ baseVariable:
341
+ localState:
342
+ fieldIdentifier:
343
+ name: selectedDeal
344
+ key: cxtga
345
+ stateVariableType: WIDGET_CLASS_STATE
346
+ operations:
347
+ - accessDocumentField:
348
+ fieldIdentifier:
349
+ name: Name
350
+ nodeKeyRef:
351
+ key: Scaffold_4qdr9nq8
352
+ ```
353
+
354
+ ### `CONSTANTS` -- Literal Constants
355
+
356
+ References built-in constant values.
357
+
358
+ ```yaml
359
+ variable:
360
+ source: CONSTANTS
361
+ baseVariable:
362
+ constants:
363
+ value: EMPTY_STRING
364
+ ```
365
+
366
+ ### `GENERATOR_VARIABLE` -- List Item Variable
367
+
368
+ Accesses the current item in a generated list (ListView, GridView). Only valid inside widgets that iterate over a data source.
369
+
370
+ ```yaml
371
+ variable:
372
+ source: GENERATOR_VARIABLE
373
+ baseVariable:
374
+ generatorVariable: {}
375
+ operations:
376
+ - accessDocumentField:
377
+ fieldIdentifier:
378
+ name: Name
379
+ nodeKeyRef:
380
+ key: ListView_8lh3xfe2
381
+ ```
382
+
383
+ ### `FIRESTORE_REQUEST` -- Backend Query Result
384
+
385
+ References data from a Firestore query bound to a widget (via `databaseRequest` on the widget node).
386
+
387
+ ```yaml
388
+ variable:
389
+ source: FIRESTORE_REQUEST
390
+ baseVariable:
391
+ firestore: {}
392
+ operations:
393
+ - accessDocumentField:
394
+ fieldIdentifier:
395
+ name: latLon
396
+ nodeKeyRef:
397
+ key: GridView_gi0dnunq
398
+ ```
399
+
400
+ ### `LIST_MAP` -- List Map Variable
401
+
402
+ Used inside list operations to reference the current item during mapping/filtering.
403
+
404
+ ```yaml
405
+ variable:
406
+ source: LIST_MAP
407
+ baseVariable:
408
+ listMap:
409
+ containingParentReturnParameter:
410
+ dataType:
411
+ listType:
412
+ scalarType: Document
413
+ subType:
414
+ collectionIdentifier:
415
+ name: RedeemedUserDeals
416
+ key: lzo3gj3d
417
+ operations:
418
+ - accessDocumentField:
419
+ fieldIdentifier:
420
+ name: Deal
421
+ ```
422
+
423
+ ### `FIREBASE_REMOTE_CONFIG` -- Remote Config Values
424
+
425
+ Reads Firebase Remote Config fields.
426
+
427
+ ```yaml
428
+ variable:
429
+ source: FIREBASE_REMOTE_CONFIG
430
+ baseVariable:
431
+ firebaseRemoteConfig:
432
+ fieldIdentifier:
433
+ name: newiOSVersion
434
+ ```
435
+
436
+ ---
437
+
438
+ ## Operations
439
+
440
+ Operations are chained transformations applied to a variable value. They are evaluated in order, each transforming the result of the previous.
441
+
442
+ ### `accessDocumentField` -- Access Document Field
443
+
444
+ Reads a field from a Firestore document.
445
+
446
+ ```yaml
447
+ operations:
448
+ - accessDocumentField:
449
+ fieldIdentifier:
450
+ name: Name
451
+ ```
452
+
453
+ Access the document reference itself:
454
+
455
+ ```yaml
456
+ operations:
457
+ - accessDocumentField:
458
+ documentProperty: REFERENCE
459
+ ```
460
+
461
+ ### `accessDataStructField` -- Access Data Struct Field
462
+
463
+ Reads a field from a custom data struct.
464
+
465
+ ```yaml
466
+ operations:
467
+ - accessDataStructField:
468
+ fieldIdentifier:
469
+ name: nextBillingDate
470
+ key: "14e46"
471
+ ```
472
+
473
+ ### `listItemAtIndex` -- Access List Item
474
+
475
+ Gets a specific item from a list by position.
476
+
477
+ ```yaml
478
+ operations:
479
+ - listItemAtIndex:
480
+ type: FIRST
481
+ index:
482
+ inputValue:
483
+ serializedValue: "0"
484
+ ```
485
+
486
+ | `type` value | Description |
487
+ |---|---|
488
+ | `FIRST` | First item in the list |
489
+ | `LAST` | Last item in the list |
490
+ | (index only) | Item at the specified index |
491
+
492
+ ### `numberFormat` -- Format Number
493
+
494
+ Formats a numeric value as a string.
495
+
496
+ ```yaml
497
+ operations:
498
+ - numberFormat:
499
+ formatType: CUSTOM
500
+ customFormat: "###.#"
501
+ ```
502
+
503
+ With currency formatting:
504
+
505
+ ```yaml
506
+ operations:
507
+ - numberFormat:
508
+ formatType: CUSTOM
509
+ isCurrency: true
510
+ currencySymbol: $
511
+ customFormat: "#,##0.##"
512
+ ```
513
+
514
+ ### `dateTimeFormat` -- Format Date/Time
515
+
516
+ Formats a DateTime value as a string.
517
+
518
+ ```yaml
519
+ operations:
520
+ - dateTimeFormat:
521
+ format: yMd
522
+ isCustom: false
523
+ ```
524
+
525
+ ### `listWhereOperation` -- Filter a List
526
+
527
+ Filters a list based on a condition.
528
+
529
+ ```yaml
530
+ operations:
531
+ - listWhereOperation:
532
+ conditionVariable:
533
+ source: FUNCTION_CALL
534
+ functionCall:
535
+ values:
536
+ - variable:
537
+ source: LIST_MAP
538
+ baseVariable:
539
+ listMap:
540
+ containingParentReturnParameter:
541
+ dataType:
542
+ listType:
543
+ scalarType: Document
544
+ operations:
545
+ - accessDocumentField:
546
+ fieldIdentifier:
547
+ name: DealRef
548
+ - variable:
549
+ source: GENERATOR_VARIABLE
550
+ baseVariable:
551
+ generatorVariable: {}
552
+ operations:
553
+ - accessDocumentField:
554
+ documentProperty: REFERENCE
555
+ condition:
556
+ relation: EQUAL_TO
557
+ ```
558
+
559
+ ### `listSortOperation` -- Sort a List
560
+
561
+ Sorts a list by a key field.
562
+
563
+ ```yaml
564
+ operations:
565
+ - listSortOperation:
566
+ sortKey:
567
+ source: LIST_MAP
568
+ baseVariable:
569
+ listMap:
570
+ containingParentReturnParameter:
571
+ dataType:
572
+ listType:
573
+ scalarType: Document
574
+ operations:
575
+ - accessDocumentField:
576
+ fieldIdentifier:
577
+ name: RedeemedAt
578
+ isDescending: true
579
+ ```
580
+
581
+ ### `listMapOperation` -- Map Over a List
582
+
583
+ Transforms each item in a list.
584
+
585
+ ```yaml
586
+ operations:
587
+ - listMapOperation:
588
+ listMapVariable:
589
+ source: LIST_MAP
590
+ baseVariable:
591
+ listMap:
592
+ containingParentReturnParameter:
593
+ dataType:
594
+ listType:
595
+ scalarType: Document
596
+ operations:
597
+ - accessDocumentField:
598
+ fieldIdentifier:
599
+ name: Deal
600
+ - accessDataStructField:
601
+ fieldIdentifier:
602
+ name: Value
603
+ key: tij66
604
+ ```
605
+
606
+ ### Chaining Multiple Operations
607
+
608
+ Operations are applied left to right. This example accesses a struct field, then formats the date:
609
+
610
+ ```yaml
611
+ operations:
612
+ - accessDataStructField:
613
+ fieldIdentifier:
614
+ name: nextBillingDate
615
+ key: "14e46"
616
+ - dateTimeFormat:
617
+ format: yMd
618
+ isCustom: false
619
+ ```
620
+
621
+ This example sorts a list, takes the first item, then accesses a field:
622
+
623
+ ```yaml
624
+ operations:
625
+ - listSortOperation:
626
+ sortKey: { ... }
627
+ isDescending: true
628
+ - listItemAtIndex:
629
+ type: FIRST
630
+ index:
631
+ inputValue:
632
+ serializedValue: "0"
633
+ - accessDocumentField:
634
+ fieldIdentifier:
635
+ name: RedeemedAt
636
+ ```
637
+
638
+ ---
639
+
640
+ ## Condition Patterns
641
+
642
+ Conditions use `FUNCTION_CALL` with a `condition` block to compare values.
643
+
644
+ ### Comparison
645
+
646
+ ```yaml
647
+ variable:
648
+ source: FUNCTION_CALL
649
+ functionCall:
650
+ values:
651
+ - variable:
652
+ source: LOCAL_STATE
653
+ baseVariable:
654
+ localState:
655
+ fieldIdentifier:
656
+ name: NavBarStatus
657
+ key: p4n8k8yh
658
+ stateVariableType: APP_STATE
659
+ - variable:
660
+ source: ENUMS
661
+ baseVariable:
662
+ enumVariable:
663
+ enumIdentifier:
664
+ name: NavBar
665
+ key: qik04
666
+ enumElementIdentifier:
667
+ name: profile
668
+ key: fnvnd
669
+ condition:
670
+ relation: EQUAL_TO
671
+ ```
672
+
673
+ ### Existence Check
674
+
675
+ ```yaml
676
+ functionCall:
677
+ values:
678
+ - variable:
679
+ source: WIDGET_STATE
680
+ baseVariable:
681
+ widgetState:
682
+ returnParameter:
683
+ dataType:
684
+ scalarType: String
685
+ nodeKeyRef:
686
+ key: TextField_h9mnfddk
687
+ - {}
688
+ condition:
689
+ relation: EXISTS_AND_NON_EMPTY
690
+ ```
691
+
692
+ ### Null/Empty Check
693
+
694
+ ```yaml
695
+ functionCall:
696
+ values:
697
+ - variable:
698
+ source: FIREBASE_AUTH_USER
699
+ baseVariable:
700
+ auth:
701
+ property: USERS_DATA_FIELD
702
+ usersDataField:
703
+ name: push_notifications
704
+ - inputValue: {}
705
+ condition:
706
+ relation: DOES_NOT_EXIST_OR_IS_EMPTY
707
+ ```
708
+
709
+ ### Available Condition Relations
710
+
711
+ | Relation | Description |
712
+ |---|---|
713
+ | `EQUAL_TO` | Values are equal |
714
+ | `NOT_EQUAL_TO` | Values are not equal |
715
+ | `GREATER_THAN` | Left value is greater |
716
+ | `LESS_THAN` | Left value is less |
717
+ | `GREATER_THAN_OR_EQUAL` | Left value is greater or equal |
718
+ | `LESS_THAN_OR_EQUAL` | Left value is less or equal |
719
+ | `EXISTS_AND_NON_EMPTY` | Value exists and is not empty |
720
+ | `DOES_NOT_EXIST_OR_IS_EMPTY` | Value is null, missing, or empty |
721
+
722
+ ### Conditional Values (If/Else)
723
+
724
+ Used to compute a value based on conditions (not for control flow -- for that, see `conditionActions` in the Actions guide):
725
+
726
+ ```yaml
727
+ functionCall:
728
+ conditionalValue:
729
+ ifConditionalValues:
730
+ - condition:
731
+ source: GLOBAL_PROPERTIES
732
+ baseVariable:
733
+ globalProperties:
734
+ property: IS_IOS
735
+ value:
736
+ variable:
737
+ source: FIREBASE_REMOTE_CONFIG
738
+ baseVariable:
739
+ firebaseRemoteConfig:
740
+ fieldIdentifier:
741
+ name: newiOSVersion
742
+ elseValue:
743
+ variable:
744
+ source: FIREBASE_REMOTE_CONFIG
745
+ baseVariable:
746
+ firebaseRemoteConfig:
747
+ fieldIdentifier:
748
+ name: newAndroidVersion
749
+ returnParameter:
750
+ dataType:
751
+ scalarType: String
752
+ nonNullable: true
753
+ ```
754
+
755
+ ---
756
+
757
+ ## Code Expressions
758
+
759
+ Inline Dart expressions can be used inside `FUNCTION_CALL` for string manipulation and computation:
760
+
761
+ ```yaml
762
+ functionCall:
763
+ values:
764
+ - variable:
765
+ source: WIDGET_STATE
766
+ baseVariable:
767
+ widgetState:
768
+ returnParameter:
769
+ dataType:
770
+ scalarType: String
771
+ nodeKeyRef:
772
+ key: TextField_hci45i6l
773
+ codeExpression:
774
+ arguments:
775
+ - identifier:
776
+ name: phone
777
+ dataType:
778
+ scalarType: String
779
+ nonNullable: true
780
+ returnParameter:
781
+ dataType:
782
+ scalarType: String
783
+ nonNullable: true
784
+ expression: "phone.replaceAll(RegExp(r'[-()\\s]'),\"\")"
785
+ valid: true
786
+ ```
787
+
788
+ | Field | Description |
789
+ |---|---|
790
+ | `arguments` | Named parameters with types, mapped to `values` in order |
791
+ | `returnParameter.dataType` | Return type of the expression |
792
+ | `expression` | Dart expression string |
793
+ | `valid` | Whether the expression has been validated |
794
+
795
+ ---
796
+
797
+ ## Value Patterns Summary
798
+
799
+ Values can appear in three forms across the YAML:
800
+
801
+ **Literal value:**
802
+ ```yaml
803
+ inputValue:
804
+ serializedValue: "hello"
805
+ mostRecentInputValue:
806
+ serializedValue: "hello" # Must match inputValue
807
+ ```
808
+
809
+ **Variable binding:**
810
+ ```yaml
811
+ variable:
812
+ source: WIDGET_CLASS_PARAMETER
813
+ baseVariable:
814
+ widgetClass:
815
+ paramIdentifier:
816
+ name: title
817
+ key: abc123
818
+ nodeKeyRef:
819
+ key: Container_xyz
820
+ ```
821
+
822
+ **Color values use a special format:**
823
+ ```yaml
824
+ inputValue:
825
+ color:
826
+ themeColor: PRIMARY # Theme color reference
827
+ ```
828
+ ```yaml
829
+ inputValue:
830
+ color:
831
+ value: "4294967295" # ARGB integer as string
832
+ ```
833
+
834
+ The `mostRecentInputValue` field must always stay in sync with `inputValue` when both are present.