코딩셰프 플러터 강좌
VSC 기준
import '';
import 'package:flutter/material.dart';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
const MyApp({ Key? key }) : super(key: key);
Widget build(BuildContext context) {
return MaterialApp(
title: 'Fist App',
theme: ThemeData(
primarySwatch: Colors.blue
),
home: MyHomePage(),
);
}
}
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
Widget build(BuildContext context) {
return MaterialApp(
title: 'Fist App', //앱 총칭
theme: ThemeData(primarySwatch: Colors.blue),
home: MyHomePage(), //경로 역할, 없으면 아무것도 안뜸
);
}
}
class MyHomePage extends StatelessWidget {
const MyHomePage({Key? key}) : super(key: key);
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('First App'), //타이틀바 내용
),
body: Center(
child: Column(
children: [Text('hello'), Text('hello'), Text('hello')],
),
),
);
}
}