MaterialApp(
home: Scaffold(
appBar: 상단에 넣을 위젯,
body: 중단에 넣을 위젯,
bottomNavigationBar: 하단에 넣을 위젯,
)
);
title: 왼쪽 제목 - appBar: AppBar(title: Text(**'앱임'**))
leading: 왼쪽에 넣은 아이콘 - appBar: AppBar(leading: Icon(Icons.star))
title과 leading 같이 사용 가능
actions: [] - 우측아이콘들 - appBar: AppBar(actions: [Icon(Icons.star), Icon(Icon.star)]
AppBar(
title : Text('앱제목'),
leading : Icon(Icons.star),
actions : [ Icon(Icons.star), Icon(Icons.star) ]
)
MaterialApp(
home: Scaffold(
appBar: AppBar( title: Text('앱제목') ),
body: Text('안녕'),
bottomNavigationBar: BottomAppBar( child: Text('하단바임 ㅅㄱ') ),
)
);
MaterialApp(
home: Scaffold(
body: Row(
children: [ Icon(Icons.star), Icon(Icons.star), Icon(Icons.star) ]
),
)
);
MaterialApp(
home: Scaffold(
body: Column(
children: [ Icon(Icons.star), Icon(Icons.star), Icon(Icons.star) ]
),
)
);
MaterialApp(
home: Scaffold(
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ Icon(Icons.star), Icon(Icons.star), Icon(Icons.star) ]
),
)
);

body: Container (
color: Colors.grey,
height : 400, //높이 넣어야 세로정렬 가능할듯
child : Row (
crossAxisAlignment: CrossAxisAlignment.start,
children: const [
Icon(Icons.star),
Icon(Icons.star),
Icon(Icons.star),
],
),
),


import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text('앱임')),
body: Text('안녕'),
bottomNavigationBar: BottomAppBar(
child: SizedBox(
height: 70,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Icon(Icons.phone),
Icon(Icons.message),
Icon(Icons.contact_page)
]
),
),),
)
);
}
}
Row(
children : [
Flexible( child: Container(color : Colors.blue), flex : 1 ),
Flexible( child: Container(Color : Colors.green), flex : 1 )
]
)Row(
children : [
Expanded( child: Container(color : Colors.blue), flex : 1 ),
Container(Color : Colors.green, width : 100),
]
)
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text('금호동3가'), actions: [Icon(Icons.search), Icon(Icons.add_alert)],),
body: Container (
height: 150,
padding: EdgeInsets.fromLTRB(5, 10, 10, 10),
child: Row(
children: [
Flexible(child: Image.asset('assets/dog.png', width: 150), flex: 3,),
Flexible(flex: 7,child: Container(
child: Column (
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('캐논 DSLR 100D (단렌즈, 충전기 16기가SD 포함)', style: TextStyle(fontSize: 18),),
Text('성동구 행당동 끌올 10분 전', style: TextStyle(color: Colors.grey, fontSize: 15),),
Text('210,000원', style: TextStyle(fontSize: 16),),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Icon(Icons.favorite),
Text('4')
],
)
],
),
),
)
],
)
)
)
);
}
}
class 클래스명 extends StatelessWidget {
const ({Key? key}) : super(key: key);
Widget build(BuildContext context) {
return 작성할 코드;
}
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text('금호동3가'), actions: [Icon(Icons.search), Icon(Icons.add_alert)],),
body: ShopItem()
)
);
}
}
class ShopItem extends StatelessWidget {
const ShopItem({Key? key}) : super(key: key);
Widget build(BuildContext context) {
return SizedBox(
child: Text('안녕'),
);
}
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text('금호동3가'), actions: [Icon(Icons.search), Icon(Icons.add_alert)],),
body: a
)
);
}
}
var a = SizedBox(
child: Text('안녕'),
);
ListView(
children: [
Text('안녕'),
Text('안녕'),
Text('안녕'),
],
)

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(),
body: ListView(
children: [
ListTile(
leading: Icon(Icons.account_circle_rounded),
title: Text('홍길동'),
),
ListTile(
leading: Icon(Icons.account_circle_rounded),
title: Text('홍길동'),
),
ListTile(
leading: Icon(Icons.account_circle_rounded),
title: Text('홍길동'),
)
],
),
bottomNavigationBar: BottomBar()
)
);
}
}
class BottomBar extends StatelessWidget {
const BottomBar({Key? key}) : super(key: key);
Widget build(BuildContext context) {
return BottomAppBar(
height: 70,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Icon(Icons.phone),
Icon(Icons.message),
Icon(Icons.contact_page)
],
),
);
}
}
MaterialApp(
home: Scaffold(
appBar: AppBar(),
body: ListView.builder(
itemCount: 반복 횟수,
itemBuilder: (c, i) {
return 반복할 함수
},
)
)
);
MaterialApp(
home: Scaffold(
appBar: AppBar(),
body: ListView.builder(
itemCount: 3,
itemBuilder: (c, i) {
return ListTile(
leading: Icon(Icons.account_circle_rounded),
title: Text('홍길동'),
);
},
)
)
);
