MCPcopy Index your code
hub / github.com/bernaferrari/FigmaToCode / getFullAppTemplate

Function getFullAppTemplate

packages/backend/src/flutter/flutterMain.ts:23–54  ·  view source on GitHub ↗
(name: string, injectCode: string)

Source from the content-addressed store, hash-verified

21let previousExecutionCache: string[];
22
23const getFullAppTemplate = (name: string, injectCode: string): string =>
24 `import 'package:flutter/material.dart';
25
26void main() {
27 runApp(const FigmaToCodeApp());
28}
29
30// Generated by: https://www.figma.com/community/plugin/842128343887142055/
31class FigmaToCodeApp extends StatelessWidget {
32 const FigmaToCodeApp({super.key});
33
34 @override
35 Widget build(BuildContext context) {
36 return MaterialApp(
37 theme: ThemeData.dark().copyWith(
38 scaffoldBackgroundColor: const Color.fromARGB(255, 18, 32, 47),
39 ),
40 home: Scaffold(
41 body: ListView(children: [
42 ${name}(),
43 ]),
44 ),
45 );
46 }
47}
48
49class ${name} extends StatelessWidget {
50 @override
51 Widget build(BuildContext context) {
52 return ${indentString(injectCode, 4).trimStart()};
53 }
54}`;
55
56const getStatelessTemplate = (name: string, injectCode: string): string =>
57 `class ${name} extends StatelessWidget {

Callers 1

flutterMainFunction · 0.85

Calls 1

indentStringFunction · 0.90

Tested by

no test coverage detected