|
1 | 1 | <div align="center"> |
2 | 2 | <img src="docs/images/figma-flutter-mcp.png" alt="Theme Setup Example" style="max-width: 100%; height: auto;"> |
3 | | - |
4 | 3 | <br> |
5 | 4 |
|
6 | 5 | <h1>Figma to Flutter MCP Server</h1> |
@@ -45,6 +44,12 @@ Use [Cursor](https://cursor.sh) or other AI-powered tools to access Figma's rich |
45 | 44 | - [🙋♂️ Author](#-author) |
46 | 45 | - [Muhammad Hamza](#muhammad-hamza) |
47 | 46 |
|
| 47 | +## 🦋 Observable<Flutter> #70 |
| 48 | +Featured on Observable<Flutter> with enhanced explanation and demo: |
| 49 | + |
| 50 | +<a href="https://www.youtube.com/live/d7qrvytOxSA?si=ESY8hPJpQm_OY4Ye"> |
| 51 | + <img src="https://i.ytimg.com/vi/d7qrvytOxSA/hq720.jpg?sqp=-oaymwEnCNAFEJQDSFryq4qpAxkIARUAAIhCGAHYAQHiAQoIGBACGAY4AUAB&rs=AOn4CLAtjlrlbNDcV_MQ-_MHJN3KAgwpKw" alt="Observable Flutter Figma to Flutter MCP" style="max-width: 100%; height: 300px;"> |
| 52 | +</a> |
48 | 53 |
|
49 | 54 | ## 🎥 Video Demo |
50 | 55 | Showcased almost all the features of Figma Flutter MCP with real figma design. |
@@ -174,32 +179,47 @@ This way your AI agent will use the MCP's output and ensure the flutter code is |
174 | 179 |
|
175 | 180 |  |
176 | 181 |
|
177 | | -This one has 8 variants, you may prompt whether you want to have variants or not. |
| 182 | +This one has 2 variants with enabled and disabled states. |
178 | 183 | ``` |
179 | | -"Create this widget in flutter <figma_link>, setup only 2 variants for now and break the files in smaller parts for code readability. |
| 184 | +"Create this widget in flutter from figma COMPONENT link: <figma_link>, use named constructors for variants and break the files in smaller parts for code readability." |
180 | 185 | ``` |
181 | 186 | If you **do not** have COMPONENTS in figma, you can use FRAME just prompt the AI that you want this to be a widget and it will handle the rest. |
182 | 187 |
|
183 | | -3. **Full Screen Generation**: If there are any IMAGE ASSETS available, it will export them and put them in `assets/` along with `pubspec.yaml` |
| 188 | +3. **Full Screen Generation**: If there are any IMAGE ASSETS (.png, .jpeg, .jpg etc.) available, it will export them and put them in `assets/` along with `pubspec.yaml` |
| 189 | + |
| 190 | +<img src="docs/images/screen.png" alt="Screen" height="500" width="auto"> |
| 191 | + |
184 | 192 | ``` |
185 | | -"Create full screen from this figma link <figma_link>, ensure the code is readable by having smaller files |
| 193 | +"Design this intro screen from the figma link <figma_link>, ensure the code is readable by having smaller files." |
186 | 194 | ``` |
187 | 195 | 4. **Assets Export**: |
188 | 196 | - Image Assets: Will work automatically when generating screens |
189 | 197 | ``` |
190 | | -"Export this image asset from figma <figma_link> |
| 198 | +"Export this image asset from figma link: <figma_link> |
191 | 199 | ``` |
192 | | -- SVG Assets: Will NOT work automatically, explained below. |
| 200 | +- SVG Assets: Will NOT work automatically if they are scrambled or are ungrouped, explained below. |
193 | 201 | ``` |
194 | | -"Export this as an SVG asset from Figma: <figma_link> |
| 202 | +"Export this as an SVG asset from Figma link: <figma_link>" |
195 | 203 | ``` |
196 | | -#### ⚠️ Why SVG assets don’t work with screen generation |
197 | | -In Figma vectors include icons and pen-tool shapes, so bulk exports may grab unintended nodes; recommend exporting SVGs separately. This process still saves you a lot of time by exporting them in your `assets/svg/` directory and updating your `pubspec.yaml`. |
| 204 | +#### ⚠️ If SVG assets don’t work with screen generation |
| 205 | +* In Figma vectors include icons and pen-tool shapes, so bulk exports may grab unintended nodes; |
| 206 | + * Recommend exporting SVGs **separately** i.e. to take them out an an independent FRAME or GROUP |
| 207 | + * Here's how the separation of SVGs looks like: |
| 208 | + |
| 209 | +<img src="docs/images/svgs_clean.gif" alt="Screen" height="500" width="auto"> |
| 210 | + |
| 211 | +<br> |
| 212 | + |
| 213 | +* Here's an example of identifying a GOOD vs BAD svg while exporting them: |
| 214 | + |
| 215 | +<br> |
| 216 | + |
| 217 | +<img src="docs/images/svg.gif" alt="Screen" height="500" width="auto"> |
198 | 218 |
|
199 | 219 | ## ⚠️ Disclaimers |
200 | 220 |
|
201 | | -- **Figma Design**: Since we're using Figma's API to fetch the node and its details, so the better design you have the more better it will interpret for the AI to consume i.e. auto layouts, frame usage over group usage, consistently aligned across the board. |
202 | 221 | - **Use Case**: At this stage, its highly recommend to NOT use it to develop scalable apps rather try and play it with MVPs, smaller and explanatory tasks. |
| 222 | +- **Figma Design**: Since we're using Figma's API to fetch the node and its details, so the better design you have the more better it will interpret for the AI to consume i.e. auto layouts, frame usage over group usage, consistently aligned across the board. |
203 | 223 | - **Rate limiting**: Heavy usage may trigger Figma rate limits (e.g., HTTP 429). The server includes retry with backoff, but it does not bypass Figma limits. If you encounter rate limits, wait a few minutes and reduce the request volume. |
204 | 224 |
|
205 | 225 | ## 🙌🏼 Acknowledgments |
|
0 commit comments