고원빈

[frontend] appbar 기능 구현

...@@ -18,3 +18,8 @@ ...@@ -18,3 +18,8 @@
18 ![로그인_화면](/uploads/d12f35739c9263e37009cc9b3bbe06d4/로그인_화면.PNG) 18 ![로그인_화면](/uploads/d12f35739c9263e37009cc9b3bbe06d4/로그인_화면.PNG)
19 + 로그인 페이지 작업 완료 19 + 로그인 페이지 작업 완료
20 ![222](/uploads/8cc867cd159e28c04ff2a09e3a42c2d6/222.PNG) 20 ![222](/uploads/8cc867cd159e28c04ff2a09e3a42c2d6/222.PNG)
21 +
22 +
23 +### 2021-05-09
24 ++ Appbar 기능 구현
25 +appbar 관련 디자인은 추후 구현 예정
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -4,33 +4,143 @@ import '../shared/colors.dart'; ...@@ -4,33 +4,143 @@ import '../shared/colors.dart';
4 import 'package:flutter_screenutil/flutter_screenutil.dart'; 4 import 'package:flutter_screenutil/flutter_screenutil.dart';
5 5
6 class DashBoard extends StatefulWidget { 6 class DashBoard extends StatefulWidget {
7 + int pageNumber = 1;
8 +
7 @override 9 @override
8 _DashBoardState createState() => _DashBoardState(); 10 _DashBoardState createState() => _DashBoardState();
9 } 11 }
10 12
11 class _DashBoardState extends State<DashBoard> { 13 class _DashBoardState extends State<DashBoard> {
14 + int _selectedIndex = 0;
12 15
13 Widget build(BuildContext context) { 16 Widget build(BuildContext context) {
17 + _selectedIndex = widget.pageNumber;
14 final Size size = MediaQuery.of(context).size; 18 final Size size = MediaQuery.of(context).size;
15 return Scaffold( 19 return Scaffold(
16 backgroundColor: Color(0xffe5f4ff), 20 backgroundColor: Color(0xffe5f4ff),
17 appBar: PreferredSize( 21 appBar: PreferredSize(
18 preferredSize: Size.fromHeight(65), 22 preferredSize: Size.fromHeight(65),
19 - child:Container( 23 + child: Container(
20 - padding : const EdgeInsets.fromLTRB(0,10,0,0), 24 + padding: const EdgeInsets.fromLTRB(0, 10, 0, 0),
21 color: Colors.white, 25 color: Colors.white,
22 - child : AppBar( 26 + child: AppBar(
23 backgroundColor: Colors.white, 27 backgroundColor: Colors.white,
24 - actions: <Widget> [ 28 + actions: <Widget>[
25 - Container ( 29 + Container(
26 - width : size.width * 0.2 30 + width: size.width * 0.25,
27 - 31 + child: FlatButton(
28 - ) 32 + onPressed: () => {
29 - 33 + _onItemTapped(0),
34 + },
35 + child: Stack(
36 + children: <Widget>[
37 + Container(
38 + margin: EdgeInsets.fromLTRB(0, 4, 0, 0),
39 + padding: EdgeInsets.fromLTRB(5, 0, 5, 5),
40 + child: Text(
41 + '임시1',
42 + style: TextStyle(
43 + color: widget.pageNumber == 0
44 + ? Color(0xff1674f6)
45 + : null,
46 + fontSize: 14,
47 + fontFamily: 'Noto',
48 + fontWeight: FontWeight.bold),
49 + ),
50 + ),
30 ], 51 ],
31 -
32 - ))
33 ), 52 ),
53 + ),
54 + ),
55 + Container(
56 + width: size.width * 0.25,
57 + child: FlatButton(
58 + onPressed: () => {
59 + _onItemTapped(1),
60 + },
61 + child: Stack(
62 + children: <Widget>[
63 + Container(
64 + margin: EdgeInsets.fromLTRB(0, 4, 0, 0),
65 + padding: EdgeInsets.fromLTRB(5, 0, 5, 5),
66 + child: Text(
67 + '임시2',
68 + style: TextStyle(
69 + color: widget.pageNumber == 1
70 + ? Color(0xff1674f6)
71 + : null,
72 + fontSize: 14,
73 + fontFamily: 'Noto',
74 + fontWeight: FontWeight.bold),
75 + ),
76 + ),
77 + ],
78 + ),
79 + ),
80 + ),
81 + Container(
82 + width: size.width * 0.25,
83 + child: FlatButton(
84 + onPressed: () => {
85 + _onItemTapped(2),
86 + },
87 + child: Stack(
88 + children: <Widget>[
89 + Container(
90 + margin: EdgeInsets.fromLTRB(0, 4, 0, 0),
91 + padding: EdgeInsets.fromLTRB(5, 0, 5, 5),
92 + child: Text(
93 + '임시3',
94 + style: TextStyle(
95 + color: widget.pageNumber == 2
96 + ? Color(0xff1674f6)
97 + : null,
98 + fontSize: 14,
99 + fontFamily: 'Noto',
100 + fontWeight: FontWeight.bold),
101 + ),
102 + ),
103 + ],
104 + ),
105 + ),
106 + ),
107 + Container(
108 + width: size.width * 0.25,
109 + child: FlatButton(
110 + onPressed: () => {
111 + _onItemTapped(3),
112 + },
113 + child: Stack(
114 + children: <Widget>[
115 + Column(
116 + mainAxisAlignment: MainAxisAlignment.center,
117 + children: [
118 + Container(
119 + margin: EdgeInsets.fromLTRB(0, 4, 0, 0),
120 + padding: EdgeInsets.fromLTRB(5, 0, 5, 5),
121 + child: Image.asset(
122 + 'images/setting.png',
123 + color: widget.pageNumber == 3
124 + ? Color(0xff1674f6)
125 + : null,
126 + ),
127 + ),
128 + ],
34 ) 129 )
130 + ],
131 + ),
132 + ),
133 + ),
134 + ],
135 + ),
136 + ),
137 + ),
138 + );
139 + }
140 +
141 + void _onItemTapped(int index) {
142 + setState(() {
143 + widget.pageNumber = index;
144 + });
35 } 145 }
36 } 146 }
......
...@@ -41,4 +41,5 @@ flutter: ...@@ -41,4 +41,5 @@ flutter:
41 assets: 41 assets:
42 - images/ 42 - images/
43 - images/main_logo.png 43 - images/main_logo.png
44 + - images/setting.png
44 45
......