GridView
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.blue,
title: const Text('Assignment 3'),
actions: [
IconButton(onPressed: (){}, icon: const Icon(Icons.add)) ,
IconButton(onPressed: (){}, icon: const Icon(Icons.search)),
IconButton(onPressed: (){}, icon: const Icon(Icons.person))// appbar 오른쪽에 플러스 버튼
],
),
body:
// 아래는 GridView이다. 내가 설정한 행의 개수에 따라서 그리드 형식의 뷰를 볼 수 있다.
GridView.count(
crossAxisCount: 3, // column을 몇개를 할 것이냐
children: [
Container(
color: Colors.red,
width: 100,
height: 100,
padding: EdgeInsets.all(8.0),
margin: EdgeInsets.all(8.0),
)
],
),
);
PageView
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.blue,
title: const Text('Assignment 3'),
actions: [
IconButton(onPressed: (){}, icon: const Icon(Icons.add)) ,
IconButton(onPressed: (){}, icon: const Icon(Icons.search)),
IconButton(onPressed: (){}, icon: const Icon(Icons.person))// appbar 오른쪽에 플러스 버튼
],
),
body:
// 아래는 PageView, children으로 넣은 page를 좌우 스크롤을 통해 볼 수 있다.
PageView(
children: [
Container(
color: Colors.red,
),
Container(
color: Colors.blue,
),
Container(
color: Colors.green,
)
],
)
);
return DefaultTabController(
length: 3,
child: Scaffold(
appBar: AppBar(
backgroundColor: Colors.blue,
title: const Text('Assignment 3'),
actions: [
IconButton(onPressed: (){}, icon: const Icon(Icons.add)) ,
IconButton(onPressed: (){}, icon: const Icon(Icons.search)),
IconButton(onPressed: (){}, icon: const Icon(Icons.person))// appbar 오른쪽에 플러스 버튼
],
bottom: const TabBar(
tabs: [
Tab(icon: Icon(Icons.tag_faces)),
Tab(text: 'Menu',),
Tab(icon: Icon(Icons.info), text: 'info',)
],
),
),
body:
// 아래는 PageView, children으로 넣은 page를 좌우 스크롤을 통해 볼 수 있다.
TabBarView(
children: [
Container(
color: Colors.red,
),
Container(
color: Colors.blue,
),
Container(
color: Colors.green,
)
],
),
drawer: const Drawer(),
),
);

bottomNavigationBar: BottomNavigationBar(
items: const [
BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Home'),
BottomNavigationBarItem(icon: Icon(Icons.person), label: 'Profile'),
BottomNavigationBarItem(icon: Icon(Icons.notifications), label: 'Notification'),
],
),

TabBarView(
children: [
Tab(
child: Container(
color: Colors.red,
width: 100,
height: 100,
),
),
Container(
color: Colors.blue,
),
Container(
color: Colors.green,
)
],
),
TabBarView(
children: [
Tab(
child: Column(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
color: Colors.red,
width: 100,
height: 100,
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
color: Colors.red,
width: 100,
height: 100,
),
),
],
),
),
Container(
color: Colors.blue,
),
Container(
color: Colors.green,
)
],
),

TabBarView(
children: [
Tab(
child: Align(
alignment: Alignment.centerLeft,
child: Container(
color: Colors.red,
width: 100,
height: 100,
),
),
),
Container(
color: Colors.blue,
),
Container(
color: Colors.green,
)
],
),
TabBarView(
children: [
Tab(
child: Row(
children: [
Expanded(
flex: 3,
child: Container(
color: Colors.red,
width: 100,
height: 100,
),
),
Expanded(
flex: 1,
child: Container(
color: Colors.green,
width: 100,
height: 100,
),
),
Expanded(
flex: 2,
child: Container(
color: Colors.blue,
width: 100,
height: 100,
),
),
],
),
),
Container(
color: Colors.blue,
),
Container(
color: Colors.green,
)
],
),

TabBarView(
children: [
Tab(
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
),
elevation: 4.0,
child: Container(
width: 100,
height: 100,
child: Center(child: Text('Card')),
),
)
),
Container(
color: Colors.blue,
),
Container(
color: Colors.green,
)
],
),

TabBarView(
children: [
Tab(
child: Row(
children: [
TextButton(
onPressed: (){},
child: Text('button'),
),
IconButton(
onPressed: (){},
icon: Icon(Icons.add),
iconSize: 100,
color: Colors.orange,),
FloatingActionButton(
onPressed: (){},
child: Icon(Icons.add),
)
],
)
),
Container(
color: Colors.blue,
),
Container(
color: Colors.green,
)
],
),

TabBarView(
children: [
Tab(
child: CircularProgressIndicator()
),
Container(
color: Colors.blue,
),
Container(
color: Colors.green,
)
],
),
TabBarView(
children: [
Tab(
child: LinearProgressIndicator()
),
Container(
color: Colors.blue,
),
Container(
color: Colors.green,
)
],
),