Repository navigation
Expand file tree
/
Copy pathmain.dart
More file actions
123 lines (117 loc) · 3.34 KB
/
Copy pathmain.dart
File metadata and controls
123 lines (117 loc) · 3.34 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
import 'package:flutter/material.dart';
import 'package:todoapp/pages/event_page.dart';
import 'package:todoapp/pages/task_page.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),
),
Expanded(child: EventPage())
],
);
}
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"),
),
),
],
);
}
}