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,591 @@
1
+ # Data Models
2
+
3
+ FlutterFlow projects define their data layer through four primary constructs stored as YAML files in the project cache: **Collections** (Firestore schemas), **Data Structs** (local typed objects), **Enums** (named constant sets), and **API Endpoints** (external HTTP integrations).
4
+
5
+ ---
6
+
7
+ ## Collections
8
+
9
+ Collections represent Firestore document schemas. Each collection file lives under `collections/id-<key>.yaml`.
10
+
11
+ ### Structure
12
+
13
+ ```yaml
14
+ identifier:
15
+ name: Establishments # Human-readable collection name
16
+ key: k2ktdun9 # Unique identifier key
17
+ fields:
18
+ Name: # Field name (map key = field name)
19
+ identifier:
20
+ name: Name
21
+ dataType:
22
+ scalarType: String # Scalar type for the field
23
+ latLon:
24
+ identifier:
25
+ name: latLon
26
+ dataType:
27
+ scalarType: LatLng # Geographic coordinate type
28
+ LogoURL:
29
+ identifier:
30
+ name: LogoURL
31
+ dataType:
32
+ scalarType: ImagePath # Firebase Storage image reference
33
+ Active:
34
+ identifier:
35
+ name: Active
36
+ dataType:
37
+ scalarType: Boolean
38
+ ContractEnds:
39
+ identifier:
40
+ name: ContractEnds
41
+ dataType:
42
+ scalarType: DateTime
43
+ description: ""
44
+ ```
45
+
46
+ ### Field layout
47
+
48
+ Every field in a collection is a map entry keyed by the field name. The value contains:
49
+
50
+ | Property | Required | Description |
51
+ |----------|----------|-------------|
52
+ | `identifier.name` | Yes | Field name (matches the map key) |
53
+ | `dataType.scalarType` | Yes | One of the supported scalar types (see table below) |
54
+ | `dataType.subType` | Only for references | Sub-type details (e.g., target collection for `DocumentReference`) |
55
+
56
+ ### DocumentReference fields
57
+
58
+ Fields that reference other documents use `scalarType: DocumentReference` with a `subType.collectionIdentifier` pointing to the target collection:
59
+
60
+ ```yaml
61
+ uid:
62
+ identifier:
63
+ name: uid
64
+ dataType:
65
+ scalarType: DocumentReference
66
+ subType:
67
+ collectionIdentifier:
68
+ name: PushNotificationUsers
69
+ key: g115cee9
70
+ ```
71
+
72
+ ### Sub-collections
73
+
74
+ A collection can be nested under a parent collection using `parentCollectionIdentifier`:
75
+
76
+ ```yaml
77
+ identifier:
78
+ name: review
79
+ key: 9ijnlv0r
80
+ fields:
81
+ rating:
82
+ identifier:
83
+ name: rating
84
+ dataType:
85
+ scalarType: Integer
86
+ comment:
87
+ identifier:
88
+ name: comment
89
+ dataType:
90
+ scalarType: String
91
+ user:
92
+ identifier:
93
+ name: user
94
+ dataType:
95
+ scalarType: DocumentReference
96
+ subType:
97
+ collectionIdentifier:
98
+ name: PushNotificationUsers
99
+ key: g115cee9
100
+ parentCollectionIdentifier: # Makes this a sub-collection
101
+ name: Establishments
102
+ key: k2ktdun9
103
+ ```
104
+
105
+ The `parentCollectionIdentifier` block references the parent collection by `name` and `key`. In Firestore this translates to `/Establishments/{docId}/review/{reviewId}`.
106
+
107
+ ### Full collection example
108
+
109
+ ```yaml
110
+ identifier:
111
+ name: Receipts
112
+ key: hj26cdh4
113
+ fields:
114
+ url:
115
+ identifier:
116
+ name: url
117
+ dataType:
118
+ scalarType: ImagePath
119
+ uid:
120
+ identifier:
121
+ name: uid
122
+ dataType:
123
+ scalarType: DocumentReference
124
+ subType:
125
+ collectionIdentifier:
126
+ name: PushNotificationUsers
127
+ key: g115cee9
128
+ establishment_name:
129
+ identifier:
130
+ name: establishment_name
131
+ dataType:
132
+ scalarType: String
133
+ establishment_location:
134
+ identifier:
135
+ name: establishment_location
136
+ dataType:
137
+ scalarType: LatLng
138
+ establishement_reference:
139
+ identifier:
140
+ name: establishement_reference
141
+ dataType:
142
+ scalarType: DocumentReference
143
+ subType:
144
+ collectionIdentifier:
145
+ name: Establishments
146
+ key: k2ktdun9
147
+ created_date:
148
+ identifier:
149
+ name: created_date
150
+ dataType:
151
+ scalarType: DateTime
152
+ ```
153
+
154
+ ---
155
+
156
+ ## Data Structs
157
+
158
+ Data Structs are local typed objects (not stored in Firestore). They live under `data-structs/id-<key>.yaml`. Unlike collections, their fields use an **array** format rather than a map.
159
+
160
+ ### Structure
161
+
162
+ ```yaml
163
+ identifier:
164
+ name: SubscriptionInfo
165
+ key: pjr4u
166
+ fields:
167
+ - identifier:
168
+ name: productName
169
+ key: aa4nr
170
+ dataType:
171
+ scalarType: String
172
+ description: ""
173
+ - identifier:
174
+ name: price
175
+ key: pge5t
176
+ dataType:
177
+ scalarType: Double
178
+ description: ""
179
+ - identifier:
180
+ name: isActive
181
+ key: gp4z4
182
+ dataType:
183
+ scalarType: Boolean
184
+ description: ""
185
+ - identifier:
186
+ name: expirationDate
187
+ key: tq0ql
188
+ dataType:
189
+ scalarType: DateTime
190
+ description: ""
191
+ description: ""
192
+ ```
193
+
194
+ ### Key differences from collections
195
+
196
+ | Aspect | Collections | Data Structs |
197
+ |--------|------------|--------------|
198
+ | Fields format | Map (keyed by field name) | Array of objects |
199
+ | Field identifiers | `name` only | `name` + `key` |
200
+ | `description` | On field (optional) | On each field + top-level |
201
+ | Storage | Firestore documents | In-memory / local |
202
+
203
+ ### List types
204
+
205
+ A field can hold a list of scalars using `listType` instead of `scalarType`:
206
+
207
+ ```yaml
208
+ - identifier:
209
+ name: ingredients
210
+ key: lu6lm
211
+ dataType:
212
+ listType:
213
+ scalarType: String
214
+ description: ""
215
+ ```
216
+
217
+ ### Nested struct references
218
+
219
+ A data struct can reference another data struct via `listType` with `scalarType: DataStruct` and a `subType.dataStructIdentifier`:
220
+
221
+ ```yaml
222
+ identifier:
223
+ name: CorelationSymptom
224
+ key: zu4s2
225
+ fields:
226
+ - identifier:
227
+ name: symptom_name
228
+ key: cu81s
229
+ dataType:
230
+ scalarType: String
231
+ description: ""
232
+ - identifier:
233
+ name: food
234
+ key: 3vypf
235
+ dataType:
236
+ listType:
237
+ scalarType: DataStruct # References another struct
238
+ subType:
239
+ dataStructIdentifier:
240
+ name: food
241
+ key: 2dns4
242
+ description: ""
243
+ description: ""
244
+ ```
245
+
246
+ ### Default values
247
+
248
+ Fields can specify default values using `defaultValue`:
249
+
250
+ ```yaml
251
+ - identifier:
252
+ name: isEligibleForTrial
253
+ key: 0emsg
254
+ dataType:
255
+ scalarType: Boolean
256
+ description: ""
257
+ ```
258
+
259
+ When no `defaultValue` is present, the field defaults to null (or the Dart default for the type).
260
+
261
+ ---
262
+
263
+ ## Enums
264
+
265
+ Enums define named constant sets. They live under `enums/id-<key>.yaml`.
266
+
267
+ ### Structure
268
+
269
+ ```yaml
270
+ identifier:
271
+ name: subscription
272
+ key: 8a348
273
+ elements:
274
+ - identifier:
275
+ name: monthly
276
+ key: 3lp2p
277
+ - identifier:
278
+ name: annual
279
+ key: jqsvd
280
+ - identifier:
281
+ name: free_trial
282
+ key: 5i7ti
283
+ description: ""
284
+ ```
285
+
286
+ ### Element format
287
+
288
+ Each element has:
289
+
290
+ | Property | Required | Description |
291
+ |----------|----------|-------------|
292
+ | `identifier.name` | Yes | The enum value name |
293
+ | `identifier.key` | Yes | Unique key for the element |
294
+ | `description` | No | Optional description of the element |
295
+
296
+ ### Larger enum example
297
+
298
+ ```yaml
299
+ identifier:
300
+ name: category_food
301
+ key: 7n3rj
302
+ elements:
303
+ - identifier:
304
+ name: alcoholic
305
+ key: uzgsa
306
+ - identifier:
307
+ name: bread_and_bakery
308
+ key: 4movm
309
+ - identifier:
310
+ name: breakfastFoods
311
+ key: kvzi2
312
+ description: ""
313
+ - identifier:
314
+ name: poultry
315
+ key: 5tmy7
316
+ description: ""
317
+ - identifier:
318
+ name: coffee_and_tea
319
+ key: jb054
320
+ - identifier:
321
+ name: dairyProducts
322
+ key: 0f3b2
323
+ # ... additional elements
324
+ description: ""
325
+ ```
326
+
327
+ ### Referencing enums in actions
328
+
329
+ Enums are referenced in action logic via the `ENUMS` source:
330
+
331
+ ```yaml
332
+ variable:
333
+ source: ENUMS
334
+ baseVariable:
335
+ enumVariable:
336
+ enumIdentifier:
337
+ name: AppUpdateState
338
+ key: fta87
339
+ enumElementIdentifier:
340
+ name: forceUpdate
341
+ key: biqqk
342
+ ```
343
+
344
+ ---
345
+
346
+ ## API Endpoints
347
+
348
+ API Endpoints define external HTTP calls. They live under `api-endpoint/id-<key>.yaml`.
349
+
350
+ ### Structure (GET request)
351
+
352
+ ```yaml
353
+ identifier:
354
+ name: Distance Matrix API Google
355
+ key: gpcto
356
+ url: "https://maps.googleapis.com/maps/api/distancematrix/json?destinations=[destination]&origins=[origin]&units=imperial&key=..."
357
+ callType: GET
358
+ variables:
359
+ - identifier:
360
+ name: destination
361
+ key: destination
362
+ type: String
363
+ testValue: Orem%20Utah
364
+ - identifier:
365
+ name: origin
366
+ key: origin
367
+ type: String
368
+ testValue: Pocatello%20Idaho
369
+ jsonPathDefinitions:
370
+ - identifier:
371
+ name: Distance
372
+ key: Distance
373
+ jsonPath:
374
+ jsonPath: "$.rows[0].elements[0].distance.text"
375
+ returnParameter:
376
+ dataType:
377
+ scalarType: String
378
+ endpointSettings: {}
379
+ parameters:
380
+ - identifier:
381
+ name: destination
382
+ key: destination
383
+ variableIdentifier:
384
+ name: destination
385
+ key: destination
386
+ - identifier:
387
+ name: origin
388
+ key: origin
389
+ variableIdentifier:
390
+ name: origin
391
+ key: origin
392
+ ```
393
+
394
+ ### Structure (POST request with body)
395
+
396
+ ```yaml
397
+ identifier:
398
+ name: CreateStripeBillingPortal
399
+ key: hx3jx
400
+ url: https://stripe-createbillingportalsession-zlackvbzaa-uc.a.run.app
401
+ callType: POST
402
+ variables:
403
+ - identifier:
404
+ name: token
405
+ key: b7vj02x7
406
+ type: String
407
+ testValue: "eyJhbGciOi..."
408
+ value:
409
+ inputValue: {}
410
+ - identifier:
411
+ name: customer_id
412
+ key: lnaoydbh
413
+ type: String
414
+ testValue: cus_S40aYcculStinV
415
+ value:
416
+ inputValue: {}
417
+ - identifier:
418
+ name: is_live_mode
419
+ key: 0b92rcbo
420
+ type: Boolean
421
+ testValue: "false"
422
+ value:
423
+ inputValue:
424
+ serializedValue: "true"
425
+ bodyType: JSON
426
+ body: "{\n \"data\": {\n \"customer_id\": \"<customer_id>\",\n \"is_live_mode\": <is_live_mode>\n }\n}"
427
+ jsonPathDefinitions:
428
+ - identifier:
429
+ name: resultUrl
430
+ key: w8h6xhwf
431
+ jsonPath:
432
+ jsonPath: $.result.url
433
+ returnParameter:
434
+ dataType:
435
+ scalarType: String
436
+ inferredParameter:
437
+ dataType:
438
+ scalarType: String
439
+ headers:
440
+ - "Authorization: Bearer [token]"
441
+ - "Content-Type: application/json"
442
+ endpointSettings:
443
+ escapeVariablesInRequestBody: true
444
+ parameters:
445
+ - identifier:
446
+ name: customer_id
447
+ key: wrfgis3r
448
+ variableIdentifier:
449
+ name: customer_id
450
+ key: lnaoydbh
451
+ - identifier:
452
+ name: is_live_mode
453
+ key: cyi1yf4b
454
+ variableIdentifier:
455
+ name: is_live_mode
456
+ key: 0b92rcbo
457
+ ```
458
+
459
+ ### Top-level fields
460
+
461
+ | Field | Required | Description |
462
+ |-------|----------|-------------|
463
+ | `identifier` | Yes | `name` and `key` for the endpoint |
464
+ | `url` | Yes | Full URL. Variables are interpolated using `[varName]` in query strings or `<varName>` in bodies |
465
+ | `callType` | Yes | HTTP method: `GET`, `POST`, `PUT`, `DELETE`, `PATCH` |
466
+ | `variables` | No | List of variables used in the request |
467
+ | `headers` | No | List of header strings (variables use `[varName]` syntax) |
468
+ | `bodyType` | No | Body encoding: `JSON`, `TEXT`, `X_WWW_FORM_URL_ENCODED` |
469
+ | `body` | No | Body template string (variables use `<varName>` syntax) |
470
+ | `jsonPathDefinitions` | No | JSON path extractors for parsing the response |
471
+ | `endpointSettings` | No | Additional settings (e.g., `escapeVariablesInRequestBody`) |
472
+ | `parameters` | No | Maps parameter identifiers to variable identifiers |
473
+
474
+ ### Variable definition
475
+
476
+ ```yaml
477
+ variables:
478
+ - identifier:
479
+ name: customer_id
480
+ key: lnaoydbh
481
+ type: String # Variable type: String, Boolean, Integer, etc.
482
+ testValue: cus_S40aYcculStinV # Test value for API testing panel
483
+ value: # Optional default value
484
+ inputValue: {}
485
+ ```
486
+
487
+ ### JSON path definitions
488
+
489
+ Extract values from API responses using JSONPath:
490
+
491
+ ```yaml
492
+ jsonPathDefinitions:
493
+ - identifier:
494
+ name: resultUrl
495
+ key: w8h6xhwf
496
+ jsonPath:
497
+ jsonPath: $.result.url # JSONPath expression
498
+ returnParameter:
499
+ dataType:
500
+ scalarType: String # Expected return type
501
+ inferredParameter: # Optional: auto-inferred type
502
+ dataType:
503
+ scalarType: String
504
+ ```
505
+
506
+ ### Variable interpolation
507
+
508
+ Variables are referenced differently depending on context:
509
+
510
+ | Context | Syntax | Example |
511
+ |---------|--------|---------|
512
+ | URL query parameters | `[varName]` | `?key=[apiKey]&q=[query]` |
513
+ | Request body | `<varName>` | `"customer_id": "<customer_id>"` |
514
+ | Headers | `[varName]` | `Authorization: Bearer [token]` |
515
+
516
+ ---
517
+
518
+ ## Scalar Types Reference
519
+
520
+ The following scalar types are supported across Collections, Data Structs, and custom code definitions:
521
+
522
+ | Scalar Type | Description | Dart Type | Used In |
523
+ |-------------|-------------|-----------|---------|
524
+ | `String` | Text value | `String` | All |
525
+ | `Integer` | Whole number | `int` | All |
526
+ | `Double` | Floating-point number | `double` | All |
527
+ | `Boolean` | True/false | `bool` | All |
528
+ | `DateTime` | Date and time | `DateTime` | All |
529
+ | `ImagePath` | Firebase Storage image URL | `String` | Collections |
530
+ | `LatLng` | Geographic coordinates | `LatLng` | Collections |
531
+ | `DocumentReference` | Firestore document reference | `DocumentReference` | Collections |
532
+ | `JSON` | Arbitrary JSON value | `dynamic` | Functions, API |
533
+ | `DataStruct` | Reference to a Data Struct type | Generated class | Data Structs |
534
+ | `UploadedFile` | File upload handle | `FFUploadedFile` | Custom code |
535
+ | `Action` | Callback action reference | `Future Function()` | Custom widgets |
536
+ | `WidgetProperty` | Widget configuration property | Varies | Custom widgets |
537
+ | `PostgresRow` | Supabase row reference | `SupabaseRow` | Custom code |
538
+ | `Color` | Color value | `Color` | Widgets, params |
539
+ | `SupabaseRow` | Supabase database row | `SupabaseRow` | Custom code |
540
+
541
+ ### Type modifiers
542
+
543
+ Scalar types can be wrapped with modifiers:
544
+
545
+ ```yaml
546
+ # Nullable scalar (default)
547
+ dataType:
548
+ scalarType: String
549
+
550
+ # Non-nullable scalar
551
+ dataType:
552
+ scalarType: String
553
+ nonNullable: true
554
+
555
+ # List of scalars
556
+ dataType:
557
+ listType:
558
+ scalarType: String
559
+
560
+ # Non-nullable list
561
+ dataType:
562
+ listType:
563
+ scalarType: String
564
+ nonNullable: true
565
+
566
+ # Scalar with sub-type (DocumentReference, DataStruct, PostgresRow)
567
+ dataType:
568
+ scalarType: DocumentReference
569
+ subType:
570
+ collectionIdentifier:
571
+ name: Users
572
+ key: abc123
573
+
574
+ # List of Data Structs
575
+ dataType:
576
+ listType:
577
+ scalarType: DataStruct
578
+ subType:
579
+ dataStructIdentifier:
580
+ name: food
581
+ key: 2dns4
582
+ ```
583
+
584
+ ### File key patterns
585
+
586
+ | Data type | File key pattern | Directory |
587
+ |-----------|-----------------|-----------|
588
+ | Collection | `collections/id-<key>` | `collections/` |
589
+ | Data Struct | `data-structs/id-<key>` | `data-structs/` |
590
+ | Enum | `enums/id-<key>` | `enums/` |
591
+ | API Endpoint | `api-endpoint/id-<key>` | `api-endpoint/` |