import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Drawer"),
),
drawer: Drawer(
child: ListView(
children: <Widget>[
DrawerHeader(
child: Text(
"Drawer header",
style: TextStyle(color:Colors.red),
),
decoration: BoxDecoration(
color: Colors.blue,
image: DecorationImage(
image: AssetImage('assets/images/1.jpg'),
fit:BoxFit.cover
)
),
),
ListTile(
leading: CircleAvatar(
backgroundImage: AssetImage('assets/images/1.jpg'),
),
title: Text("아이돌1"),
),
ListTile(
leading: CircleAvatar(
backgroundImage: AssetImage('assets/images/2.jpg'),
),
title: Text("아이돌2"),
),
ListTile(
leading: CircleAvatar(
backgroundImage: AssetImage('assets/images/3.jpeg'),
),
title: Text("아이돌3"),
),
ListTile(
leading: CircleAvatar(
backgroundImage: AssetImage('assets/images/4.jpeg'),
),
title: Text("아이돌4"),
),
],
),
),
);
}
}
'인프런 - 강의 > 플루터로 앱 만들기 고고(입문)' 카테고리의 다른 글
18 - Todo App - 1 (0) | 2020.05.07 |
---|---|
17 - My 아이돌 앱 3 (0) | 2020.04.28 |
15 - My 아이돌 앱 (0) | 2020.04.27 |
14 - 커플게임 4 (0) | 2020.04.24 |
13 - 커플게임 3 (0) | 2020.04.24 |