Repository navigation
Expand file tree
/
Copy pathmain.dart
More file actions
166 lines (158 loc) · 4.37 KB
/
Copy pathmain.dart
File metadata and controls
166 lines (158 loc) · 4.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Demo',
theme: ThemeData(primarySwatch: Colors.red, fontFamily: "Montserrat"),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
children: <Widget>[
Container(
height: 35,
color: Theme.of(context).accentColor,
),
Positioned(
right: 0,
child: Text(
"6",
style: TextStyle(fontSize: 200, color: Color(0x10000000)),
),
),
_mainContent(context),
],
),
floatingActionButton: FloatingActionButton(
onPressed: () {},
child: Icon(Icons.add),
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
bottomNavigationBar: BottomAppBar(
shape: CircularNotchedRectangle(),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
IconButton(
icon: Icon(Icons.settings),
onPressed: () {},
),
IconButton(
icon: Icon(Icons.more_vert),
onPressed: () {},
)
],
),
),
// This trailing comma makes auto-formatting nicer for build methods.
);
}
Column _mainContent(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(height: 60),
Padding(
padding: const EdgeInsets.all(24.0),
child: Text(
"Monday",
style: TextStyle(fontSize: 32, fontWeight: FontWeight.bold),
),
),
Padding(
padding: const EdgeInsets.all(24.0),
child: _button(context),
),
_taskUncomplete("Call Tom about appointment"),
_taskUncomplete("Fix onboarding experience"),
_taskUncomplete("Edit API documentation"),
_taskUncomplete("Setup user focus group"),
Divider(),
SizedBox(height: 16),
_taskComplete("Have coffe with Sam"),
_taskComplete("Meet with sales"),
],
);
}
Widget _taskUncomplete(String task) {
return Padding(
padding: const EdgeInsets.only(left: 20.0, bottom: 24.0),
child: Row(
children: <Widget>[
Icon(
Icons.radio_button_unchecked,
color: Theme.of(context).accentColor,
size: 20,
),
SizedBox(
width: 28,
),
Text(task)
],
),
);
}
Widget _taskComplete(String task) {
return Padding(
padding: const EdgeInsets.only(left: 20.0, bottom: 24.0),
child: Row(
children: <Widget>[
Icon(
Icons.radio_button_checked,
color: Theme.of(context).accentColor,
size: 20,
),
SizedBox(
width: 28,
),
Text(task)
],
),
);
}
Widget _button(BuildContext context) {
return Row(
children: <Widget>[
Expanded(
child: MaterialButton(
onPressed: () {},
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12)),
color: Theme.of(context).accentColor,
textColor: Colors.white,
padding: const EdgeInsets.all(14.0),
child: Text("Tasks"),
),
),
SizedBox(
width: 32,
),
Expanded(
child: MaterialButton(
onPressed: () {},
shape: RoundedRectangleBorder(
side: BorderSide(color: Theme.of(context).accentColor),
borderRadius: BorderRadius.circular(12)),
color: Theme.of(context).accentColor,
textColor: Colors.white,
padding: const EdgeInsets.all(14.0),
child: Text("Tasks"),
),
),
],
);
}
}