@tac0de/flutter-mcp 0.1.0 → 1.0.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.
- package/README.md +64 -0
- package/dist/index.js +182 -0
- package/dist/index.js.map +1 -1
- package/dist/tools/rendering.d.ts +110 -0
- package/dist/tools/rendering.d.ts.map +1 -0
- package/dist/tools/rendering.js +430 -0
- package/dist/tools/rendering.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -56,6 +56,12 @@ AI Thought Process:
|
|
|
56
56
|
- **flutter_validate_code**: Validate Flutter/Dart code before execution with syntax checks, import validation, and common issue detection
|
|
57
57
|
- **flutter_check_dependencies**: Check dependencies for compatibility, version conflicts, and availability
|
|
58
58
|
|
|
59
|
+
### Rendering & Canvas Support
|
|
60
|
+
|
|
61
|
+
- **flutter_recommend_rendering**: Analyze rendering intent and recommend whether to use Widget composition or CustomPaint/Canvas. Considers performance, accessibility, and target platform
|
|
62
|
+
- **flutter_generate_custom_painter**: Generate Flutter CustomPainter code with proper structure, semantics support, and best practices. Includes widget wrapper and handles common rendering scenarios
|
|
63
|
+
- **flutter_audit_paint_performance**: Audit CustomPainter code for performance issues, accessibility problems, and correctness errors. Returns detailed report with severity ratings and fix suggestions
|
|
64
|
+
|
|
59
65
|
## 🚀 Installation & Configuration
|
|
60
66
|
|
|
61
67
|
### MCP Server Setup
|
|
@@ -105,6 +111,64 @@ Check Flutter project dependencies for compatibility and issues.
|
|
|
105
111
|
|
|
106
112
|
List all Flutter widgets found in the project.
|
|
107
113
|
|
|
114
|
+
### flutter_recommend_rendering
|
|
115
|
+
|
|
116
|
+
Analyze rendering intent and recommend whether to use Widget composition or CustomPaint/Canvas.
|
|
117
|
+
|
|
118
|
+
**Input:**
|
|
119
|
+
- `intent` (required): Description of the UI or visual effect you want to create (e.g., "circular progress indicator", "particle effect", "custom chart")
|
|
120
|
+
- `performanceCritical` (optional): Whether performance is critical for this component
|
|
121
|
+
- `accessibilityRequired` (optional): Whether accessibility support is required
|
|
122
|
+
- `webTargeted` (optional): Whether targeting Flutter web (affects renderer selection)
|
|
123
|
+
|
|
124
|
+
**Output:**
|
|
125
|
+
- `approach`: "widgets" or "custom_paint"
|
|
126
|
+
- `confidence`: "high", "medium", or "low"
|
|
127
|
+
- `reasoning`: Explanation of the recommendation
|
|
128
|
+
- `suggestions`: List of implementation suggestions
|
|
129
|
+
|
|
130
|
+
### flutter_generate_custom_painter
|
|
131
|
+
|
|
132
|
+
Generate Flutter CustomPainter code with proper structure, semantics support, and best practices.
|
|
133
|
+
|
|
134
|
+
**Input:**
|
|
135
|
+
- `name` (required): Name for the painter class (will auto-append "Painter" if needed)
|
|
136
|
+
- `description` (required): Description of what the painter draws (used for documentation)
|
|
137
|
+
- `visuals` (required): Array of visual elements to include (e.g., ["circle", "path", "text"])
|
|
138
|
+
- `size` (optional): Size parameter declaration (e.g., "double size = 100")
|
|
139
|
+
- `theme` (optional): Theme configuration with colors (e.g., { primaryColor: "Colors.blue" })
|
|
140
|
+
- `semantics` (optional): Semantics configuration for accessibility
|
|
141
|
+
- `label`: Semantic label for screen readers
|
|
142
|
+
- `hint`: Semantic hint for additional context
|
|
143
|
+
- `actions`: Array of semantic actions (e.g., ["tap", "longPress"])
|
|
144
|
+
|
|
145
|
+
**Output:**
|
|
146
|
+
Complete, production-ready Flutter CustomPainter code with:
|
|
147
|
+
- Proper class structure
|
|
148
|
+
- Widget wrapper
|
|
149
|
+
- Semantics support (if requested)
|
|
150
|
+
- Best practices implemented
|
|
151
|
+
|
|
152
|
+
### flutter_audit_paint_performance
|
|
153
|
+
|
|
154
|
+
Audit CustomPainter code for performance issues, accessibility problems, and correctness errors.
|
|
155
|
+
|
|
156
|
+
**Input:**
|
|
157
|
+
- `painterCode` (required): CustomPainter code to audit
|
|
158
|
+
- `summary` (optional): Pre-analyzed summary if code analysis already performed
|
|
159
|
+
- `usesSaveLayer`: Whether the painter uses saveLayer()
|
|
160
|
+
- `allocationsInPaint`: Whether paint() contains allocations
|
|
161
|
+
- `hasSemantics`: Whether semantics are implemented
|
|
162
|
+
- `usesRepaintBoundary`: Whether wrapped in RepaintBoundary
|
|
163
|
+
|
|
164
|
+
**Output:**
|
|
165
|
+
Detailed performance audit report with:
|
|
166
|
+
- Score (0-100)
|
|
167
|
+
- Issues with severity ratings (critical/high/medium/low)
|
|
168
|
+
- Warnings
|
|
169
|
+
- Optimization suggestions
|
|
170
|
+
- Specific fix recommendations
|
|
171
|
+
|
|
108
172
|
## 💻 Development
|
|
109
173
|
|
|
110
174
|
```bash
|
package/dist/index.js
CHANGED
|
@@ -113,6 +113,122 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
113
113
|
},
|
|
114
114
|
},
|
|
115
115
|
},
|
|
116
|
+
{
|
|
117
|
+
name: "flutter_recommend_rendering",
|
|
118
|
+
description: "Analyze rendering intent and recommend whether to use Widget composition or CustomPaint/Canvas. Considers performance, accessibility, and target platform. Returns decision with reasoning and suggestions.",
|
|
119
|
+
inputSchema: {
|
|
120
|
+
type: "object",
|
|
121
|
+
properties: {
|
|
122
|
+
intent: {
|
|
123
|
+
type: "string",
|
|
124
|
+
description: "Description of the UI or visual effect you want to create (e.g., 'circular progress indicator', 'particle effect', 'custom chart')",
|
|
125
|
+
},
|
|
126
|
+
performanceCritical: {
|
|
127
|
+
type: "boolean",
|
|
128
|
+
description: "Whether performance is critical for this component (optional)",
|
|
129
|
+
},
|
|
130
|
+
accessibilityRequired: {
|
|
131
|
+
type: "boolean",
|
|
132
|
+
description: "Whether accessibility support is required (optional)",
|
|
133
|
+
},
|
|
134
|
+
webTargeted: {
|
|
135
|
+
type: "boolean",
|
|
136
|
+
description: "Whether targeting Flutter web (affects renderer selection) (optional)",
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
required: ["intent"],
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: "flutter_generate_custom_painter",
|
|
144
|
+
description: "Generate Flutter CustomPainter code with proper structure, semantics support, and best practices. Includes widget wrapper and handles common rendering scenarios.",
|
|
145
|
+
inputSchema: {
|
|
146
|
+
type: "object",
|
|
147
|
+
properties: {
|
|
148
|
+
name: {
|
|
149
|
+
type: "string",
|
|
150
|
+
description: "Name for the painter class (will auto-append 'Painter' if needed)",
|
|
151
|
+
},
|
|
152
|
+
description: {
|
|
153
|
+
type: "string",
|
|
154
|
+
description: "Description of what the painter draws (used for documentation)",
|
|
155
|
+
},
|
|
156
|
+
visuals: {
|
|
157
|
+
type: "array",
|
|
158
|
+
items: {
|
|
159
|
+
type: "string",
|
|
160
|
+
},
|
|
161
|
+
description: "Visual elements to include (e.g., ['circle', 'path', 'text'])",
|
|
162
|
+
},
|
|
163
|
+
size: {
|
|
164
|
+
type: "string",
|
|
165
|
+
description: "Size parameter declaration (e.g., 'double size = 100') (optional)",
|
|
166
|
+
},
|
|
167
|
+
theme: {
|
|
168
|
+
type: "object",
|
|
169
|
+
description: "Theme configuration with colors (e.g., { primaryColor: 'Colors.blue' }) (optional)",
|
|
170
|
+
},
|
|
171
|
+
semantics: {
|
|
172
|
+
type: "object",
|
|
173
|
+
description: "Semantics configuration for accessibility (optional)",
|
|
174
|
+
properties: {
|
|
175
|
+
label: {
|
|
176
|
+
type: "string",
|
|
177
|
+
description: "Semantic label for screen readers",
|
|
178
|
+
},
|
|
179
|
+
hint: {
|
|
180
|
+
type: "string",
|
|
181
|
+
description: "Semantic hint for additional context",
|
|
182
|
+
},
|
|
183
|
+
actions: {
|
|
184
|
+
type: "array",
|
|
185
|
+
items: {
|
|
186
|
+
type: "string",
|
|
187
|
+
},
|
|
188
|
+
description: "Semantic actions (e.g., ['tap', 'longPress'])",
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
required: ["name", "description", "visuals"],
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
name: "flutter_audit_paint_performance",
|
|
198
|
+
description: "Audit CustomPainter code for performance issues, accessibility problems, and correctness errors. Returns detailed report with severity ratings and fix suggestions. Covers saveLayer usage, allocations, semantics, RepaintBoundary, and more.",
|
|
199
|
+
inputSchema: {
|
|
200
|
+
type: "object",
|
|
201
|
+
properties: {
|
|
202
|
+
painterCode: {
|
|
203
|
+
type: "string",
|
|
204
|
+
description: "CustomPainter code to audit",
|
|
205
|
+
},
|
|
206
|
+
summary: {
|
|
207
|
+
type: "object",
|
|
208
|
+
description: "Optional summary if code analysis already performed (optional)",
|
|
209
|
+
properties: {
|
|
210
|
+
usesSaveLayer: {
|
|
211
|
+
type: "boolean",
|
|
212
|
+
description: "Whether the painter uses saveLayer()",
|
|
213
|
+
},
|
|
214
|
+
allocationsInPaint: {
|
|
215
|
+
type: "boolean",
|
|
216
|
+
description: "Whether paint() contains allocations",
|
|
217
|
+
},
|
|
218
|
+
hasSemantics: {
|
|
219
|
+
type: "boolean",
|
|
220
|
+
description: "Whether semantics are implemented",
|
|
221
|
+
},
|
|
222
|
+
usesRepaintBoundary: {
|
|
223
|
+
type: "boolean",
|
|
224
|
+
description: "Whether wrapped in RepaintBoundary",
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
required: ["painterCode"],
|
|
230
|
+
},
|
|
231
|
+
},
|
|
116
232
|
],
|
|
117
233
|
};
|
|
118
234
|
});
|
|
@@ -198,6 +314,71 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
198
314
|
],
|
|
199
315
|
};
|
|
200
316
|
}
|
|
317
|
+
case "flutter_recommend_rendering": {
|
|
318
|
+
const intent = args?.intent;
|
|
319
|
+
const performanceCritical = args?.performanceCritical;
|
|
320
|
+
const accessibilityRequired = args?.accessibilityRequired;
|
|
321
|
+
const webTargeted = args?.webTargeted;
|
|
322
|
+
if (!intent) {
|
|
323
|
+
throw new McpError(ErrorCode.InvalidParams, "Intent is required for rendering recommendation");
|
|
324
|
+
}
|
|
325
|
+
const result = analyzeRenderingIntent(intent, {
|
|
326
|
+
performanceCritical,
|
|
327
|
+
accessibilityRequired,
|
|
328
|
+
webTargeted,
|
|
329
|
+
});
|
|
330
|
+
return {
|
|
331
|
+
content: [
|
|
332
|
+
{
|
|
333
|
+
type: "text",
|
|
334
|
+
text: JSON.stringify(result, null, 2),
|
|
335
|
+
},
|
|
336
|
+
],
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
case "flutter_generate_custom_painter": {
|
|
340
|
+
const name = args?.name;
|
|
341
|
+
const description = args?.description;
|
|
342
|
+
const visuals = args?.visuals;
|
|
343
|
+
const size = args?.size;
|
|
344
|
+
const theme = args?.theme;
|
|
345
|
+
const semantics = args?.semantics;
|
|
346
|
+
if (!name || !description || !visuals) {
|
|
347
|
+
throw new McpError(ErrorCode.InvalidParams, "name, description, and visuals are required for custom painter generation");
|
|
348
|
+
}
|
|
349
|
+
const result = generateCustomPainter({
|
|
350
|
+
name,
|
|
351
|
+
description,
|
|
352
|
+
visuals,
|
|
353
|
+
size: size ?? undefined,
|
|
354
|
+
theme: theme ?? undefined,
|
|
355
|
+
semantics: semantics ?? undefined,
|
|
356
|
+
});
|
|
357
|
+
return {
|
|
358
|
+
content: [
|
|
359
|
+
{
|
|
360
|
+
type: "text",
|
|
361
|
+
text: result,
|
|
362
|
+
},
|
|
363
|
+
],
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
case "flutter_audit_paint_performance": {
|
|
367
|
+
const painterCode = args?.painterCode;
|
|
368
|
+
const summary = args?.summary;
|
|
369
|
+
if (!painterCode) {
|
|
370
|
+
throw new McpError(ErrorCode.InvalidParams, "painterCode is required for performance audit");
|
|
371
|
+
}
|
|
372
|
+
const result = auditPaintPerformance(painterCode, summary);
|
|
373
|
+
return {
|
|
374
|
+
content: [
|
|
375
|
+
{
|
|
376
|
+
type: "text",
|
|
377
|
+
text: formatPerformanceAudit(result),
|
|
378
|
+
},
|
|
379
|
+
],
|
|
380
|
+
};
|
|
381
|
+
}
|
|
201
382
|
default:
|
|
202
383
|
throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
|
|
203
384
|
}
|
|
@@ -213,6 +394,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
213
394
|
import { validateDartCode } from "./tools/validate.js";
|
|
214
395
|
import { checkDependencies } from "./tools/dependencies.js";
|
|
215
396
|
import { listWidgets } from "./tools/widgets.js";
|
|
397
|
+
import { analyzeRenderingIntent, generateCustomPainter, auditPaintPerformance, formatPerformanceAudit } from "./tools/rendering.js";
|
|
216
398
|
// Start server
|
|
217
399
|
async function main() {
|
|
218
400
|
const transport = new StdioServerTransport();
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,QAAQ,EACR,SAAS,GACV,MAAM,oCAAoC,CAAC;AAG5C,4BAA4B;AAC5B,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAE5B,wCAAwC;AACxC,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE;IACxC,OAAO,CAAC,KAAK,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAC;IAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE;IACnD,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IACrE,OAAO,CAAC,IAA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,SAAS,CAAC,aAAa,EACvB,0BAA0B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CACnF,CAAC;IACJ,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,8BAA8B;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEpI,eAAe;AACf,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;AACvD,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;IAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flutter Rendering & Canvas Knowledge Base
|
|
3
|
+
* Provides guidance on when to use Widget composition vs CustomPaint/Canvas
|
|
4
|
+
*/
|
|
5
|
+
export interface RenderingDecision {
|
|
6
|
+
approach: "widgets" | "custom_paint";
|
|
7
|
+
confidence: "high" | "medium" | "low";
|
|
8
|
+
reasoning: string;
|
|
9
|
+
suggestions: string[];
|
|
10
|
+
}
|
|
11
|
+
export interface CustomPainterSpec {
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
visuals: string[];
|
|
15
|
+
size?: string;
|
|
16
|
+
theme?: Record<string, any>;
|
|
17
|
+
semantics?: {
|
|
18
|
+
label?: string;
|
|
19
|
+
hint?: string;
|
|
20
|
+
actions?: string[];
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export interface PaintPerformanceAudit {
|
|
24
|
+
issues: PerformanceIssue[];
|
|
25
|
+
warnings: string[];
|
|
26
|
+
optimizations: string[];
|
|
27
|
+
score: number;
|
|
28
|
+
}
|
|
29
|
+
export interface PerformanceIssue {
|
|
30
|
+
severity: "critical" | "high" | "medium" | "low";
|
|
31
|
+
category: "performance" | "accessibility" | "correctness";
|
|
32
|
+
message: string;
|
|
33
|
+
location?: string;
|
|
34
|
+
fix: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* RENDERING KNOWLEDGE BASE
|
|
38
|
+
* Decision rules and best practices for Flutter rendering
|
|
39
|
+
*/
|
|
40
|
+
export declare const RENDERING_KNOWLEDGE: {
|
|
41
|
+
whenToUseWidgets: {
|
|
42
|
+
principles: string[];
|
|
43
|
+
examples: string[];
|
|
44
|
+
};
|
|
45
|
+
whenToUseCustomPaint: {
|
|
46
|
+
principles: string[];
|
|
47
|
+
examples: string[];
|
|
48
|
+
};
|
|
49
|
+
canvasAPI: {
|
|
50
|
+
coreConcepts: string[];
|
|
51
|
+
commonMethods: string[];
|
|
52
|
+
textPainting: string[];
|
|
53
|
+
};
|
|
54
|
+
performance: {
|
|
55
|
+
bestPractices: string[];
|
|
56
|
+
antiPatterns: string[];
|
|
57
|
+
};
|
|
58
|
+
accessibility: {
|
|
59
|
+
requirements: string[];
|
|
60
|
+
examples: string[];
|
|
61
|
+
};
|
|
62
|
+
webRendering: {
|
|
63
|
+
renderers: {
|
|
64
|
+
canvaskit: {
|
|
65
|
+
name: string;
|
|
66
|
+
description: string;
|
|
67
|
+
useWhen: string;
|
|
68
|
+
tradeoffs: string;
|
|
69
|
+
};
|
|
70
|
+
html: {
|
|
71
|
+
name: string;
|
|
72
|
+
description: string;
|
|
73
|
+
useWhen: string;
|
|
74
|
+
tradeoffs: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
autoSelection: string;
|
|
78
|
+
skwasm: {
|
|
79
|
+
name: string;
|
|
80
|
+
description: string;
|
|
81
|
+
status: string;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Analyze intent and recommend rendering approach
|
|
87
|
+
*/
|
|
88
|
+
export declare function analyzeRenderingIntent(intent: string, constraints?: {
|
|
89
|
+
performanceCritical?: boolean;
|
|
90
|
+
accessibilityRequired?: boolean;
|
|
91
|
+
webTargeted?: boolean;
|
|
92
|
+
}): RenderingDecision;
|
|
93
|
+
/**
|
|
94
|
+
* Generate CustomPainter code
|
|
95
|
+
*/
|
|
96
|
+
export declare function generateCustomPainter(spec: CustomPainterSpec): string;
|
|
97
|
+
/**
|
|
98
|
+
* Audit CustomPainter for performance issues
|
|
99
|
+
*/
|
|
100
|
+
export declare function auditPaintPerformance(painterCode: string, painterSummary?: {
|
|
101
|
+
usesSaveLayer?: boolean;
|
|
102
|
+
allocationsInPaint?: boolean;
|
|
103
|
+
hasSemantics?: boolean;
|
|
104
|
+
usesRepaintBoundary?: boolean;
|
|
105
|
+
}): PaintPerformanceAudit;
|
|
106
|
+
/**
|
|
107
|
+
* Generate performance report text
|
|
108
|
+
*/
|
|
109
|
+
export declare function formatPerformanceAudit(audit: PaintPerformanceAudit): string;
|
|
110
|
+
//# sourceMappingURL=rendering.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rendering.d.ts","sourceRoot":"","sources":["../../src/tools/rendering.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,SAAS,GAAG,cAAc,CAAC;IACrC,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACtC,SAAS,EAAE,M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AE,iBAAiB,GAAG,MAAM,CAyGrE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,EACnB,cAAc,CAAC,EAAE;IACf,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,GACA,qBAAqB,CAoGvB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,qBAAqB,GAAG,MAAM,CAqC3E"}
|
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flutter Rendering & Canvas Knowledge Base
|
|
3
|
+
* Provides guidance on when to use Widget composition vs CustomPaint/Canvas
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* RENDERING KNOWLEDGE BASE
|
|
7
|
+
* Decision rules and best practices for Flutter rendering
|
|
8
|
+
*/
|
|
9
|
+
export const RENDERING_KNOWLEDGE = {
|
|
10
|
+
whenToUseWidgets: {
|
|
11
|
+
principles: [
|
|
12
|
+
"Use Material widgets for standard UI components (buttons, cards, lists)",
|
|
13
|
+
"Prefer composition over custom painting for layouts",
|
|
14
|
+
"Use Container/DecoratedBox for simple shapes and borders",
|
|
15
|
+
"Use RichText for formatted text with multiple styles",
|
|
16
|
+
"Use Flex/Row/Column for layout structure"
|
|
17
|
+
],
|
|
18
|
+
examples: [
|
|
19
|
+
"User profile card",
|
|
20
|
+
"Form with input fields",
|
|
21
|
+
"Navigation bar",
|
|
22
|
+
"List of items",
|
|
23
|
+
"Standard buttons and controls"
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
whenToUseCustomPaint: {
|
|
27
|
+
principles: [
|
|
28
|
+
"Procedural graphics (runes, glyphs, rings, particles)",
|
|
29
|
+
"Custom charts and data visualizations",
|
|
30
|
+
"Complex shapes not achievable with Container/DecoratedBox",
|
|
31
|
+
"High-performance drawing requirements",
|
|
32
|
+
"Custom animations with many moving parts",
|
|
33
|
+
"Game graphics or interactive visualizations"
|
|
34
|
+
],
|
|
35
|
+
examples: [
|
|
36
|
+
"Circular progress indicators",
|
|
37
|
+
"Custom charts (line, pie, radar)",
|
|
38
|
+
"Particle effects",
|
|
39
|
+
"Drawing applications",
|
|
40
|
+
"Custom game graphics",
|
|
41
|
+
"Complex gradients or mesh patterns",
|
|
42
|
+
"SVG-like vector graphics"
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
canvasAPI: {
|
|
46
|
+
coreConcepts: [
|
|
47
|
+
"Canvas: The drawing surface",
|
|
48
|
+
"CustomPainter: The class that implements painting logic",
|
|
49
|
+
"CustomPaint: The widget that hosts a CustomPainter",
|
|
50
|
+
"Paint: The style configuration (color, stroke width, etc.)",
|
|
51
|
+
"TextPainter: For measuring and painting text"
|
|
52
|
+
],
|
|
53
|
+
commonMethods: [
|
|
54
|
+
"drawCircle() - Draw circles",
|
|
55
|
+
"drawRect() - Draw rectangles",
|
|
56
|
+
"drawLine() - Draw lines",
|
|
57
|
+
"drawPath() - Draw complex shapes",
|
|
58
|
+
"drawImage() - Draw images",
|
|
59
|
+
"clipRect() / clipRRect() / clipPath() - Limit drawing area",
|
|
60
|
+
"saveLayer() - Create offscreen buffer (use sparingly)",
|
|
61
|
+
"translate() / rotate() / scale() - Transformations"
|
|
62
|
+
],
|
|
63
|
+
textPainting: [
|
|
64
|
+
"TextPainter for text measurement and rendering",
|
|
65
|
+
"Always call layout() before paint()",
|
|
66
|
+
"Use TextStyle for font configuration",
|
|
67
|
+
"TextSpan for rich text with multiple styles"
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
performance: {
|
|
71
|
+
bestPractices: [
|
|
72
|
+
"Avoid saveLayer() - it's expensive, use clipping instead",
|
|
73
|
+
"Use RepaintBoundary to isolate expensive repaints",
|
|
74
|
+
"Keep paint() method pure - no allocations when possible",
|
|
75
|
+
"Use isComplex and willChange hints judiciously",
|
|
76
|
+
"Cache Paint objects - don't recreate in paint()",
|
|
77
|
+
"Use shouldRepaint() efficiently - return false when possible"
|
|
78
|
+
],
|
|
79
|
+
antiPatterns: [
|
|
80
|
+
"Creating objects in paint() method",
|
|
81
|
+
"Using saveLayer() unnecessarily",
|
|
82
|
+
"Not using RepaintBoundary for complex animations",
|
|
83
|
+
"Forgetting to mark shouldRepaint correctly",
|
|
84
|
+
"Not implementing semantics for interactive painted content"
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
accessibility: {
|
|
88
|
+
requirements: [
|
|
89
|
+
"Painted content that conveys meaning needs semantics",
|
|
90
|
+
"Interactive painted elements need semantic actions",
|
|
91
|
+
"Use CustomPainter.semanticsBuilder for semantic annotations",
|
|
92
|
+
"Override shouldRebuildSemantics when semantics change",
|
|
93
|
+
"Use Semantics widget as alternative to semanticsBuilder"
|
|
94
|
+
],
|
|
95
|
+
examples: [
|
|
96
|
+
"Custom chart: Use semantics to describe data values",
|
|
97
|
+
"Custom button: Use semantic actions for tap/click",
|
|
98
|
+
"Drawing canvas: Use semantics to describe current selection"
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
webRendering: {
|
|
102
|
+
renderers: {
|
|
103
|
+
canvaskit: {
|
|
104
|
+
name: "CanvasKit",
|
|
105
|
+
description: "WebAssembly-based renderer, full feature parity",
|
|
106
|
+
useWhen: "Need full Flutter feature set, complex graphics, Canvas operations",
|
|
107
|
+
tradeoffs: "Larger bundle size (~2MB), slower initial load"
|
|
108
|
+
},
|
|
109
|
+
html: {
|
|
110
|
+
name: "HTML/DOM",
|
|
111
|
+
description: "HTML+CSS renderer, limited feature set",
|
|
112
|
+
useWhen: "Text-heavy apps, simpler graphics, faster initial load",
|
|
113
|
+
tradeoffs: "Limited Canvas support, some widgets not available"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
autoSelection: "Flutter auto-selects renderer based on features used. Using CustomPaint forces CanvasKit.",
|
|
117
|
+
skwasm: {
|
|
118
|
+
name: "Skwasm (Experimental)",
|
|
119
|
+
description: "Wasm-based renderer with improved performance",
|
|
120
|
+
status: "Experimental in Flutter 3.22+, better performance than CanvasKit"
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Analyze intent and recommend rendering approach
|
|
126
|
+
*/
|
|
127
|
+
export function analyzeRenderingIntent(intent, constraints) {
|
|
128
|
+
const intentLower = intent.toLowerCase();
|
|
129
|
+
// Patterns that suggest CustomPaint
|
|
130
|
+
const customPaintKeywords = [
|
|
131
|
+
"procedural", "particle", "chart", "graph", "drawing", "canvas",
|
|
132
|
+
"custom shape", "runes", "glyphs", "ring", "circular", "animation",
|
|
133
|
+
"visual effect", "fade", "glow", "mesh", "gradient", "path",
|
|
134
|
+
"vector graphics", "svg", "game", "visualization"
|
|
135
|
+
];
|
|
136
|
+
// Patterns that suggest Widgets
|
|
137
|
+
const widgetKeywords = [
|
|
138
|
+
"button", "card", "list", "form", "input", "text", "navigation",
|
|
139
|
+
"dialog", "bottom sheet", "app bar", "tab", "container"
|
|
140
|
+
];
|
|
141
|
+
const hasCustomPaintKeywords = customPaintKeywords.some(kw => intentLower.includes(kw));
|
|
142
|
+
const hasWidgetKeywords = widgetKeywords.some(kw => intentLower.includes(kw));
|
|
143
|
+
if (hasWidgetKeywords && !hasCustomPaintKeywords) {
|
|
144
|
+
return {
|
|
145
|
+
approach: "widgets",
|
|
146
|
+
confidence: "high",
|
|
147
|
+
reasoning: "Intent matches standard UI components best served by Material/Cupertino widgets",
|
|
148
|
+
suggestions: [
|
|
149
|
+
"Use Container for simple shapes and decorations",
|
|
150
|
+
"Use DecoratedBox for borders and backgrounds",
|
|
151
|
+
"Use standard widgets for interactive elements"
|
|
152
|
+
]
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
if (hasCustomPaintKeywords) {
|
|
156
|
+
return {
|
|
157
|
+
approach: "custom_paint",
|
|
158
|
+
confidence: "high",
|
|
159
|
+
reasoning: "Intent requires custom graphics or procedural visuals",
|
|
160
|
+
suggestions: [
|
|
161
|
+
"Create a CustomPainter subclass",
|
|
162
|
+
"Implement paint(Canvas canvas, Size size) method",
|
|
163
|
+
"Consider using RepaintBoundary if animating",
|
|
164
|
+
"Implement semantics if interactive"
|
|
165
|
+
]
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
// Ambiguous case - use constraints to decide
|
|
169
|
+
if (constraints?.performanceCritical) {
|
|
170
|
+
return {
|
|
171
|
+
approach: "custom_paint",
|
|
172
|
+
confidence: "medium",
|
|
173
|
+
reasoning: "Performance-critical rendering may benefit from direct Canvas access",
|
|
174
|
+
suggestions: [
|
|
175
|
+
"Profile both widget and custom paint approaches",
|
|
176
|
+
"Use RepaintBoundary to isolate repaints",
|
|
177
|
+
"Avoid saveLayer() and allocations in paint()"
|
|
178
|
+
]
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
return {
|
|
182
|
+
approach: "widgets",
|
|
183
|
+
confidence: "medium",
|
|
184
|
+
reasoning: "Default to widgets for simplicity and maintainability",
|
|
185
|
+
suggestions: [
|
|
186
|
+
"Start with widget-based approach",
|
|
187
|
+
"Move to CustomPaint if widgets become complex or janky",
|
|
188
|
+
"Profile performance before optimizing"
|
|
189
|
+
]
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Generate CustomPainter code
|
|
194
|
+
*/
|
|
195
|
+
export function generateCustomPainter(spec) {
|
|
196
|
+
const { name, description, visuals, size, theme, semantics } = spec;
|
|
197
|
+
const painterName = name.endsWith("Painter") ? name : `${name}Painter`;
|
|
198
|
+
// Extract theme colors
|
|
199
|
+
const primaryColor = theme?.primaryColor ?? "Colors.blue";
|
|
200
|
+
const secondaryColor = theme?.secondaryColor ?? "Colors.blue.shade100";
|
|
201
|
+
// Generate semantics builder if needed
|
|
202
|
+
let semanticsCode = "";
|
|
203
|
+
if (semantics) {
|
|
204
|
+
semanticsCode = `
|
|
205
|
+
|
|
206
|
+
@override
|
|
207
|
+
SemanticsBuilderCallback get semanticsBuilder {
|
|
208
|
+
return (Size size) {
|
|
209
|
+
return [
|
|
210
|
+
Semantics(
|
|
211
|
+
label: '${semantics.label}',
|
|
212
|
+
hint: '${semantics.hint ?? ""}',
|
|
213
|
+
${semantics.actions ? `
|
|
214
|
+
actions: <SemanticsAction>[${semantics.actions.map(a => `SemanticsAction.${a}`).join(', ')}],
|
|
215
|
+
` : ''}textDirection: TextDirection.ltr,
|
|
216
|
+
),
|
|
217
|
+
];
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
@override
|
|
222
|
+
bool shouldRebuildSemantics(CustomPainter oldDelegate) {
|
|
223
|
+
return oldDelegate is !${painterName};
|
|
224
|
+
}
|
|
225
|
+
`;
|
|
226
|
+
}
|
|
227
|
+
// Generate paint method based on visuals
|
|
228
|
+
let paintCode = "";
|
|
229
|
+
if (visuals.includes("circle") || visuals.includes("circular")) {
|
|
230
|
+
paintCode = ` // Draw circle
|
|
231
|
+
final center = Offset(size.width / 2, size.height / 2);
|
|
232
|
+
final radius = size.width / 2;
|
|
233
|
+
canvas.drawCircle(center, radius, _paint);`;
|
|
234
|
+
}
|
|
235
|
+
else if (visuals.includes("rect") || visuals.includes("rectangle")) {
|
|
236
|
+
paintCode = ` // Draw rectangle
|
|
237
|
+
final rect = Rect.fromLTWH(0, 0, size.width, size.height);
|
|
238
|
+
canvas.drawRect(rect, _paint);`;
|
|
239
|
+
}
|
|
240
|
+
else if (visuals.includes("line")) {
|
|
241
|
+
paintCode = ` // Draw line
|
|
242
|
+
final start = Offset(0, size.height / 2);
|
|
243
|
+
final end = Offset(size.width, size.height / 2);
|
|
244
|
+
canvas.drawLine(start, end, _paint);`;
|
|
245
|
+
}
|
|
246
|
+
else if (visuals.includes("path") || visuals.includes("curve")) {
|
|
247
|
+
paintCode = ` // Draw path
|
|
248
|
+
final path = Path()
|
|
249
|
+
..moveTo(0, size.height)
|
|
250
|
+
..lineTo(size.width / 2, 0)
|
|
251
|
+
..lineTo(size.width, size.height)
|
|
252
|
+
..close();
|
|
253
|
+
canvas.drawPath(path, _paint);`;
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
paintCode = ` // Custom drawing - implement your visual here
|
|
257
|
+
final center = Offset(size.width / 2, size.height / 2);
|
|
258
|
+
canvas.drawCircle(center, size.width / 2, _paint);`;
|
|
259
|
+
}
|
|
260
|
+
return `import 'package:flutter/material.dart';
|
|
261
|
+
|
|
262
|
+
/// ${description}
|
|
263
|
+
class ${painterName} extends CustomPainter {
|
|
264
|
+
const ${painterName}();
|
|
265
|
+
|
|
266
|
+
@override
|
|
267
|
+
void paint(Canvas canvas, Size size) {
|
|
268
|
+
final _paint = Paint()
|
|
269
|
+
..color = ${primaryColor}
|
|
270
|
+
..style = PaintingStyle.fill
|
|
271
|
+
..strokeWidth = 2.0;
|
|
272
|
+
|
|
273
|
+
${paintCode}
|
|
274
|
+
}
|
|
275
|
+
${semanticsCode}
|
|
276
|
+
@override
|
|
277
|
+
bool shouldRepaint(covariant CustomPainter oldDelegate) {
|
|
278
|
+
// Return true if paint properties changed
|
|
279
|
+
return oldDelegate is !${painterName};
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/// Widget wrapper for ${painterName}
|
|
284
|
+
class ${name} extends StatelessWidget {
|
|
285
|
+
final ${size ?? "double size = 100"};
|
|
286
|
+
|
|
287
|
+
const ${name}({Key? key${size ? ", this.size" : ""}}) : super(key: key);
|
|
288
|
+
|
|
289
|
+
@override
|
|
290
|
+
Widget build(BuildContext context) {
|
|
291
|
+
return CustomPaint(
|
|
292
|
+
size: Size.square(size),
|
|
293
|
+
painter: ${painterName}(),
|
|
294
|
+
);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
`;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Audit CustomPainter for performance issues
|
|
301
|
+
*/
|
|
302
|
+
export function auditPaintPerformance(painterCode, painterSummary) {
|
|
303
|
+
const issues = [];
|
|
304
|
+
const warnings = [];
|
|
305
|
+
const optimizations = [];
|
|
306
|
+
let score = 100;
|
|
307
|
+
// Check for saveLayer usage
|
|
308
|
+
if (painterSummary?.usesSaveLayer ?? painterCode.includes("saveLayer")) {
|
|
309
|
+
issues.push({
|
|
310
|
+
severity: "high",
|
|
311
|
+
category: "performance",
|
|
312
|
+
message: "Uses saveLayer() which is expensive",
|
|
313
|
+
fix: "Consider using clipRect/clipRRect/clipPath instead, or ensure saveLayer is necessary"
|
|
314
|
+
});
|
|
315
|
+
score -= 20;
|
|
316
|
+
}
|
|
317
|
+
// Check for allocations in paint()
|
|
318
|
+
if (painterSummary?.allocationsInPaint ?? /paint\(Canvas canvas,\s*Size size\)\s*{[\s\S]*?new |paint\(Canvas canvas,\s*Size size\)\s*{[\s\S]*?\.toList\(\)/.test(painterCode)) {
|
|
319
|
+
issues.push({
|
|
320
|
+
severity: "high",
|
|
321
|
+
category: "performance",
|
|
322
|
+
message: "Potential allocations in paint() method",
|
|
323
|
+
fix: "Move object creation outside paint() or cache them as fields"
|
|
324
|
+
});
|
|
325
|
+
score -= 15;
|
|
326
|
+
}
|
|
327
|
+
// Check for semantics on interactive content
|
|
328
|
+
if (!(painterSummary?.hasSemantics ?? (painterCode.includes("semanticsBuilder") || painterCode.includes("Semantics")))) {
|
|
329
|
+
if (painterSummary === undefined && (painterCode.includes("GestureDetector") || painterCode.includes("onTap"))) {
|
|
330
|
+
issues.push({
|
|
331
|
+
severity: "high",
|
|
332
|
+
category: "accessibility",
|
|
333
|
+
message: "Interactive painted content lacks semantics",
|
|
334
|
+
fix: "Implement semanticsBuilder or wrap with Semantics widget"
|
|
335
|
+
});
|
|
336
|
+
score -= 25;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
// Check for RepaintBoundary on complex painters
|
|
340
|
+
if (!(painterSummary?.usesRepaintBoundary ?? false)) {
|
|
341
|
+
if (painterCode.includes("AnimationController") || painterCode.includes("AnimatedBuilder")) {
|
|
342
|
+
warnings.push("Animated CustomPainter not wrapped in RepaintBoundary - may cause unnecessary repaints");
|
|
343
|
+
optimizations.push("Wrap in RepaintBoundary widget to isolate repaints");
|
|
344
|
+
score -= 10;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
// Check for Paint object caching
|
|
348
|
+
if (/Paint\(\)/.test(painterCode) && painterCode.includes("paint(Canvas")) {
|
|
349
|
+
optimizations.push("Consider caching Paint objects as class fields instead of creating in paint()");
|
|
350
|
+
}
|
|
351
|
+
// Check for isComplex/willChange hints
|
|
352
|
+
if (!painterCode.includes("isComplex") && !painterCode.includes("willChange")) {
|
|
353
|
+
optimizations.push("Consider setting isComplex: true for complex drawings or willChange: true for frequently changing content");
|
|
354
|
+
}
|
|
355
|
+
// Check for shouldRepaint optimization
|
|
356
|
+
if (!painterCode.includes("shouldRepaint")) {
|
|
357
|
+
warnings.push("Missing shouldRepaint implementation - defaults to always repainting");
|
|
358
|
+
score -= 5;
|
|
359
|
+
}
|
|
360
|
+
else if (/shouldRepaint.*return true/.test(painterCode)) {
|
|
361
|
+
warnings.push("shouldRepaint always returns true - consider comparing properties");
|
|
362
|
+
optimizations.push("Compare painter properties in shouldRepaint to avoid unnecessary repaints");
|
|
363
|
+
score -= 5;
|
|
364
|
+
}
|
|
365
|
+
// Check for TextPainter usage
|
|
366
|
+
if (painterCode.includes("TextPainter")) {
|
|
367
|
+
if (!painterCode.includes("layout()")) {
|
|
368
|
+
issues.push({
|
|
369
|
+
severity: "critical",
|
|
370
|
+
category: "correctness",
|
|
371
|
+
message: "TextPainter used without calling layout()",
|
|
372
|
+
fix: "Always call layout() before calling paint() on TextPainter"
|
|
373
|
+
});
|
|
374
|
+
score -= 30;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
// Check for canvas state management
|
|
378
|
+
if (painterCode.includes("save()") && !painterCode.includes("restore()")) {
|
|
379
|
+
issues.push({
|
|
380
|
+
severity: "critical",
|
|
381
|
+
category: "correctness",
|
|
382
|
+
message: "Canvas save() without matching restore()",
|
|
383
|
+
fix: "Ensure every save() has a corresponding restore() call"
|
|
384
|
+
});
|
|
385
|
+
score -= 40;
|
|
386
|
+
}
|
|
387
|
+
return {
|
|
388
|
+
issues,
|
|
389
|
+
warnings,
|
|
390
|
+
optimizations,
|
|
391
|
+
score: Math.max(0, score)
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Generate performance report text
|
|
396
|
+
*/
|
|
397
|
+
export function formatPerformanceAudit(audit) {
|
|
398
|
+
const lines = [];
|
|
399
|
+
lines.push(`## Paint Performance Audit`);
|
|
400
|
+
lines.push(`**Score**: ${audit.score}/100\n`);
|
|
401
|
+
if (audit.issues.length > 0) {
|
|
402
|
+
lines.push(`### Issues (${audit.issues.length})`);
|
|
403
|
+
audit.issues.forEach((issue, i) => {
|
|
404
|
+
lines.push(`${i + 1}. **[${issue.severity.toUpperCase()}]** ${issue.message}`);
|
|
405
|
+
if (issue.location)
|
|
406
|
+
lines.push(` - Location: ${issue.location}`);
|
|
407
|
+
lines.push(` - Fix: ${issue.fix}`);
|
|
408
|
+
});
|
|
409
|
+
lines.push("");
|
|
410
|
+
}
|
|
411
|
+
if (audit.warnings.length > 0) {
|
|
412
|
+
lines.push(`### Warnings (${audit.warnings.length})`);
|
|
413
|
+
audit.warnings.forEach((warning, i) => {
|
|
414
|
+
lines.push(`${i + 1}. ${warning}`);
|
|
415
|
+
});
|
|
416
|
+
lines.push("");
|
|
417
|
+
}
|
|
418
|
+
if (audit.optimizations.length > 0) {
|
|
419
|
+
lines.push(`### Optimizations (${audit.optimizations.length})`);
|
|
420
|
+
audit.optimizations.forEach((opt, i) => {
|
|
421
|
+
lines.push(`${i + 1}. ${opt}`);
|
|
422
|
+
});
|
|
423
|
+
lines.push("");
|
|
424
|
+
}
|
|
425
|
+
if (audit.issues.length === 0 && audit.warnings.length === 0 && audit.optimizations.length === 0) {
|
|
426
|
+
lines.push("✅ No issues found! Your CustomPainter looks good.");
|
|
427
|
+
}
|
|
428
|
+
return lines.join("\n");
|
|
429
|
+
}
|
|
430
|
+
//# sourceMappingURL=rendering.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rendering.js","sourceRoot":"","sources":["../../src/tools/rendering.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqCH;;;GAGG;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,gBAAgB,EAAE;QAChB,UAAU,EAAE;YACV,yEAAyE;YACzE,qDAAqD;YACrD,0DAA0D;YAC1D,sDAAsD;YACtD,0CAA0C;SAC3C;QACD,QAAQ,EAAE;YACR,mBAAmB;YACnB,wBAAwB;YACxB,gBAAgB;YAChB,eAAe;YACf,+BAA+B;SAChC;KACF;IAED,oBAAoB,EAAE;QACpB,UAAU,EAAE;YACV,uDAAuD;YACvD,uCAAuC;YACvC,2DAA2D;YAC3D,uCAAuC;YACvC,0CAA0C;YAC1C,6CAA6C;SAC9C;QACD,QAAQ,EAAE;YACR,8BAA8B;YAC9B,kCAAkC;YAClC,kBAAkB;YAClB,sBAAsB;YACtB,sBAAsB;YACtB,oCAAoC;YACpC,0BAA0B;SAC3B;KACF;IAED,SAAS,EAAE;QACT,YAAY,EAAE;YACZ,6BAA6B;YAC7B,yDAAyD;YACzD,oDAAoD;YACpD,4DAA4D;YAC5D,8CAA8C;SAC/C;QACD,aAAa,EAAE;YACb,6BAA6B;YAC7B,8BAA8B;YAC9B,yBAAyB;YACzB,kCAAkC;YAClC,2BAA2B;YAC3B,4DAA4D;YAC5D,uDAAuD;YACvD,oDAAoD;SACrD;QACD,YAAY,EAAE;YACZ,gDAAgD;YAChD,qCAAqC;YACrC,sCAAsC;YACtC,6CAA6C;SAC9C;KACF;IAED,WAAW,EAAE;QACX,aAAa,EAAE;YACb,0DAA0D;YAC1D,mDAAmD;YACnD,yDAAyD;YACzD,gDAAgD;YAChD,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