Flutter
vscode snippet for flutter
Louiey
2025. 5. 29. 15:00
{
// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
// "scope": "javascript,typescript",
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"flutter clean screen": {
"prefix": "//-fcs",
"body": [
"import 'package:flutter/material.dart';"
"void main() {"
" runApp(const MyApp());"
"}"
"class MyApp extends StatelessWidget {"
"const MyApp({super.key});"
""
"@override"
"Widget build(BuildContext context) {"
" return MaterialApp("
" title: 'Flutter Clean',"
" debugShowCheckedModeBanner: false,"
" theme: ThemeData("
" colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),"
" useMaterial3: true,"
" ),"
" home: const MyHomePage(title: 'Flutter Clean'),"
" );"
"}"
"}"
""
"class MyHomePage extends StatefulWidget {"
"const MyHomePage({super.key, required this.title});"
""
"final String title;"
""
"@override"
"State<MyHomePage> createState() => _MyHomePageState();"
"}"
""
"class _MyHomePageState extends State<MyHomePage> {"
"" ""
"@override"
"Widget build(BuildContext context) {"
" return Scaffold("
" appBar: AppBar("
" backgroundColor: Theme.of(context).colorScheme.inversePrimary,"
" title: Text(widget.title),"
" ),"
" body: const Center("
" child: Column("
" mainAxisAlignment: MainAxisAlignment.center,"
" children: ["
" Text("
" 'Hello Louiey',"
" ),"
" ],"
" ),"
" ),"
" );"
"}"
"}"
],
"description": "louiey flutter clean screen"
},
"flutter bottom screen": {
"prefix": "//-fbs",
"body": [
"import 'package:flutter/material.dart';"
""
"void main() {"
" runApp(const MyApp());"
"}"
""
"class MyApp extends StatelessWidget {"
" const MyApp({super.key});"
""
" @override"
" Widget build(BuildContext context) {"
" return MaterialApp("
" title: 'Flutter Demo',"
" theme: ThemeData("
" colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),"
" useMaterial3: true,"
" ),"
" home: const MyHomePage(title: 'TO DO'),"
" );"
" }"
"}"
""
"class MyHomePage extends StatefulWidget {"
" const MyHomePage({super.key, required this.title});"
""
" final String title;"
""
" @override"
" State<MyHomePage> createState() => _MyHomePageState();"
"}"
""
"class _MyHomePageState extends State<MyHomePage> {"
" int _selectedIndex = 0;"
""
" void _onItemTapped(int index) {"
" setState(() {"
" _selectedIndex = index;"
" });"
" }"
""
" @override"
" Widget build(BuildContext context) {"
" return Scaffold("
" appBar: AppBar("
" backgroundColor: Theme.of(context).colorScheme.inversePrimary,"
" title: Text(widget.title),"
" ),"
" body: IndexedStack("
" index: _selectedIndex,"
" children: const ["
" // Add screen here"
" // VideoScreen(),"
" ],"
" ),"
" bottomNavigationBar: BottomNavigationBar("
" items: const ["
" BottomNavigationBarItem("
" icon: Icon(Icons.video_camera_front_outlined), label: \"Video\"),"
" BottomNavigationBarItem("
" icon: Icon(Icons.auto_graph_outlined), label: \"Chart\"),"
" BottomNavigationBarItem("
" icon: Icon(Icons.settings_applications_outlined), label: \"Preference\"),"
" ],"
" currentIndex: _selectedIndex,"
" selectedItemColor: Colors.amber[800],"
" onTap: _onItemTapped,"
" ),"
" );"
" }"
"}"
""
],
"description": "louiey flutter bottom navigation bar screen"
},
"flutter default screen": {
"prefix": "//-fds",
"body": [
"import 'package:flutter/material.dart';"
"void main() {"
" runApp(const MyApp());"
"}"
"class MyApp extends StatelessWidget {"
" const MyApp({super.key});"
" @override"
" Widget build(BuildContext context) {"
" return MaterialApp("
" title: 'Flutter Demo',"
" theme: ThemeData("
" colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),"
" useMaterial3: true,"
" ),"
" home: const MyHomePage(title: 'Flutter Demo Home Page'),"
" );"
" }"
"}"
"class MyHomePage extends StatefulWidget {"
" const MyHomePage({super.key, required this.title});"
" final String title;"
" @override"
" State<MyHomePage> createState() => _MyHomePageState();"
"}"
"class _MyHomePageState extends State<MyHomePage> {"
" int _counter = 0;"
" void _incrementCounter() {"
" setState(() {"
" _counter++;"
" });"
" }"
" @override"
" Widget build(BuildContext context) {"
" return Scaffold("
" appBar: AppBar("
" backgroundColor: Theme.of(context).colorScheme.inversePrimary,"
" title: Text(widget.title),"
" ),"
" body: Center("
" child: Column("
" mainAxisAlignment: MainAxisAlignment.center,"
" children: <Widget>["
" const Text('You have pushed the button this many times:'),"
" Text("
" '$_counter',"
" style: Theme.of(context).textTheme.headlineMedium,"
" ),"
" ],"
" ),"
" ),"
" floatingActionButton: FloatingActionButton("
" onPressed: _incrementCounter,"
" tooltip: 'Increment',"
" child: const Icon(Icons.add),"
" ),"
" );"
" }"
"}"
],
"description": "flutter default screen"
},
"flutter gitignore add": {
"prefix": "//-fgi",
"body": [
"## louiey"
"/android"
"/ios"
"/linux"
"/macos"
"/test"
"/web"
"/windows"
],
"description": "flutter gitignore"
},
"add louiey comment": {
"prefix": "//-lc",
"body": [
"// louiey, $CURRENT_YEAR-$CURRENT_MONTH-$CURRENT_DATE. "
],
"description": "louiey comment"
},
}
// 여기에 글로벌 스 니펫을 배치하십시오. 각 스 니펫은 스 니펫 이름으로 정의되며 범위, 접두사, 신체 및 // 설명. 스 니펫이 스코프 필드에 적용되는 언어의 쉼표로 분리 된 ID를 추가하십시오. 범위 // 비어 있거나 생략되면 스 니펫은 모든 언어에 적용됩니다. 접두사는 무엇입니까? // 스 니펫을 트리거하는 데 사용되면 몸체가 확장되어 삽입됩니다. 가능한 변수는 다음과 같습니다. // $ 1, $ 2, 탭 정지의 경우 $ 2, 최종 커서 위치의 경우 $ 0, $ {1 : label}, $ {2 : 다른} 자리 표시 자. // 동일한 ID를 가진 자리 표시자가 연결되어 있습니다. // 예: // "콘솔로 인쇄": { // "스코프": "JavaScript, typeScript", // "prefix": "log", // "몸": [ // "console.log ( '$ 1');", // "$ 2" //], // "설명": "콘솔에 로그 출력" //}