Skip to content

Commit 198e599

Browse files
Added some fonts and done some UI changes.
1 parent 3fbb0cd commit 198e599

File tree

6 files changed

+86
-86
lines changed

6 files changed

+86
-86
lines changed

fonts/Nunito-VariableFont_wght.ttf

269 KB
Binary file not shown.

fonts/Poppins-Regular.ttf

155 KB
Binary file not shown.

lib/bottomSheet.dart

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,23 @@ class _MyBottomSheetState extends State<MyBottomSheet> {
2727
context: context,
2828
builder: (context) {
2929
return AlertDialog(
30-
title: Text('Alert', style: TextStyle(fontFamily: 'Ancizar'),),
31-
backgroundColor: Colors.blue[50],
32-
content: Text(
33-
'Heading cannot be empty!',
34-
style: TextStyle(fontFamily: 'Ancizar', fontSize: 18.0),
30+
title: Text(
31+
'Alert',
32+
style: Theme.of(context).textTheme.headlineLarge,
3533
),
34+
backgroundColor: Colors.blue[50],
35+
content: Text('Heading cannot be empty!'),
3636
actionsAlignment: MainAxisAlignment.center,
3737
actions: [
3838
ElevatedButton(
3939
onPressed: () {
4040
Navigator.of(context).pop();
4141
},
4242
style: ButtonStyle(
43-
backgroundColor: WidgetStatePropertyAll(Colors.white),
44-
foregroundColor: WidgetStatePropertyAll(Colors.black)
43+
foregroundColor: WidgetStatePropertyAll(Colors.black),
44+
backgroundColor: WidgetStatePropertyAll(Colors.white)
4545
),
46-
child: Text('Ok', style: TextStyle(fontFamily: 'Ancizar'),),
46+
child: Text('Ok'),
4747
),
4848
],
4949
);
@@ -75,14 +75,9 @@ class _MyBottomSheetState extends State<MyBottomSheet> {
7575
keyboardType: TextInputType.multiline,
7676
minLines: 1,
7777
maxLines: null,
78-
style: TextStyle(
79-
fontFamily: 'Ancizar',
80-
fontWeight: FontWeight.w600,
81-
fontSize: 18.0
82-
),
8378
decoration: InputDecoration(
8479
hintText: 'Heading',
85-
hintStyle: TextStyle(fontFamily: 'Ancizar'),
80+
hintStyle: TextStyle(fontFamily: 'Nunito'),
8681
enabledBorder: UnderlineInputBorder(
8782
borderSide: BorderSide(color: Colors.black),
8883
),
@@ -98,14 +93,9 @@ class _MyBottomSheetState extends State<MyBottomSheet> {
9893
keyboardType: TextInputType.multiline,
9994
minLines: 1,
10095
maxLines: null,
101-
style: TextStyle(
102-
fontFamily: 'Ancizar',
103-
fontWeight: FontWeight.w600,
104-
fontSize: 18.0,
105-
),
10696
decoration: InputDecoration(
10797
hintText: 'Description',
108-
hintStyle: TextStyle(fontFamily: 'Ancizar'),
98+
hintStyle: TextStyle(fontFamily: 'Nunito'),
10999
enabledBorder: UnderlineInputBorder(
110100
borderSide: BorderSide(color: Colors.black),
111101
),
@@ -124,21 +114,17 @@ class _MyBottomSheetState extends State<MyBottomSheet> {
124114
},
125115
style: ButtonStyle(
126116
backgroundColor: WidgetStatePropertyAll(Colors.white),
117+
foregroundColor: WidgetStatePropertyAll(Colors.black),
127118
),
128-
child: Text(
129-
'Cancel',
130-
style: TextStyle(fontFamily: 'Ancizar', color: Colors.black),
131-
),
119+
child: Text('Cancel'),
132120
),
133121
ElevatedButton(
134122
onPressed: onClickedDone,
135123
style: ButtonStyle(
136124
backgroundColor: WidgetStatePropertyAll(Colors.white),
125+
foregroundColor: WidgetStatePropertyAll(Colors.black),
137126
),
138-
child: Text(
139-
'Done',
140-
style: TextStyle(fontFamily: 'Ancizar', color: Colors.black),
141-
),
127+
child: Text('Done'),
142128
),
143129
],
144130
),

lib/main.dart

Lines changed: 66 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,53 @@ void main() async {
1616
await Hive.openBox('completed');
1717

1818
Storage.initialize();
19-
runApp(MaterialApp(home: MyHome()));
19+
runApp(
20+
MaterialApp(
21+
home: MyHome(),
22+
title: 'TODO',
23+
theme: ThemeData(
24+
primaryColor: Colors.blue,
25+
fontFamily: 'Nunito',
26+
textTheme: TextTheme(
27+
headlineLarge: TextStyle(
28+
fontFamily: 'Poppins',
29+
fontSize: 22.0,
30+
fontWeight: FontWeight.bold,
31+
color: Colors.black,
32+
),
33+
bodyMedium: TextStyle(fontSize: 17.0, color: Colors.black),
34+
),
35+
36+
appBarTheme: AppBarTheme(
37+
backgroundColor: Colors.blue,
38+
foregroundColor: Colors.white,
39+
elevation: 2,
40+
titleTextStyle: TextStyle(fontSize: 24.0),
41+
),
42+
43+
floatingActionButtonTheme: FloatingActionButtonThemeData(
44+
foregroundColor: Colors.white,
45+
backgroundColor: Colors.blue[700],
46+
),
47+
48+
navigationBarTheme: NavigationBarThemeData(
49+
backgroundColor: Colors.blue[300],
50+
indicatorColor: Colors.blue[50],
51+
labelBehavior: NavigationDestinationLabelBehavior.onlyShowSelected,
52+
),
53+
54+
elevatedButtonTheme: ElevatedButtonThemeData(
55+
style: ButtonStyle(
56+
backgroundColor: WidgetStatePropertyAll(Colors.blue[700]),
57+
foregroundColor: WidgetStatePropertyAll(Colors.white),
58+
shape: WidgetStatePropertyAll(
59+
RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
60+
),
61+
),
62+
),
63+
),
64+
),
65+
);
2066
}
2167

2268
class MyHome extends StatefulWidget {
@@ -32,20 +78,9 @@ class _MyHomeState extends State<MyHome> {
3278
@override
3379
Widget build(BuildContext context) {
3480
return Scaffold(
35-
appBar: AppBar(
36-
centerTitle: true,
37-
backgroundColor: Colors.blue,
38-
titleTextStyle: TextStyle(
39-
fontSize: 25.0,
40-
fontWeight: FontWeight.w600,
41-
fontFamily: 'Ancizar',
42-
),
43-
title: Text('Todos'),
44-
),
81+
appBar: AppBar(centerTitle: true, title: Text('Todos')),
4582
backgroundColor: Colors.blue[100],
4683
bottomNavigationBar: NavigationBar(
47-
backgroundColor: Colors.blue[300],
48-
indicatorColor: Colors.blue[50],
4984
animationDuration: Duration(milliseconds: 300),
5085
destinations: [
5186
NavigationDestination(
@@ -65,33 +100,26 @@ class _MyHomeState extends State<MyHome> {
65100
pageIndex = index;
66101
});
67102
},
68-
labelBehavior: NavigationDestinationLabelBehavior.onlyShowSelected,
69103
),
70-
body: <Widget>[
71-
CurrentTasks(),
72-
CompletedTasks()
73-
][pageIndex],
74-
floatingActionButton: pageIndex == 0 ? ElevatedButton.icon(
75-
onPressed: () async {
76-
final res = await showModalBottomSheet(
77-
context: context,
78-
backgroundColor: Colors.blue[50],
79-
isScrollControlled: true,
80-
builder: (context) => MyBottomSheet(),
81-
);
104+
body: <Widget>[CurrentTasks(), CompletedTasks()][pageIndex],
105+
floatingActionButton: pageIndex == 0
106+
? FloatingActionButton(
107+
onPressed: () async {
108+
final res = await showModalBottomSheet(
109+
context: context,
110+
backgroundColor: Colors.blue[50],
111+
isScrollControlled: true,
112+
builder: (context) => MyBottomSheet(),
113+
);
82114

83-
if (res == true) {
84-
setState(() {});
85-
}
86-
},
87-
label: Text('Add Note'),
88-
icon: Icon(Icons.add),
89-
style: ButtonStyle(
90-
backgroundColor: WidgetStatePropertyAll(Colors.blue[700]),
91-
foregroundColor: WidgetStatePropertyAll(Colors.white),
92-
// textStyle: WidgetStatePropertyAll(TextStyle(fontFamily: 'Ancizar')),
93-
),
94-
) : null,
115+
if (res == true) {
116+
setState(() {});
117+
}
118+
},
119+
backgroundColor: Colors.blue[700],
120+
child: Icon(Icons.add),
121+
)
122+
: null,
95123
);
96124
}
97125
}

lib/note.dart

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ class NoteCard extends StatelessWidget {
4040
padding: const EdgeInsets.fromLTRB(10.0, 5.0, 0.0, 0.0),
4141
child: Text(
4242
note.heading,
43-
style: TextStyle(
44-
fontFamily: 'Ancizar',
45-
fontWeight: FontWeight.w500,
46-
fontSize: 18.0,
47-
),
4843
overflow: TextOverflow.ellipsis,
4944
maxLines: 2,
5045
),
@@ -59,11 +54,6 @@ class NoteCard extends StatelessWidget {
5954
padding: const EdgeInsets.fromLTRB(10.0, 0.0, 0.0, 5.0),
6055
child: Text(
6156
(note.description == "" ? "no description" : note.description),
62-
style: TextStyle(
63-
fontFamily: 'Ancizar',
64-
fontWeight: FontWeight.w500,
65-
fontSize: 18.0,
66-
),
6757
overflow: TextOverflow.ellipsis,
6858
maxLines: 5,
6959
),
@@ -111,11 +101,6 @@ class NoteCardCompleted extends StatelessWidget {
111101
padding: const EdgeInsets.fromLTRB(10.0, 5.0, 0.0, 0.0),
112102
child: Text(
113103
note.heading,
114-
style: TextStyle(
115-
fontFamily: 'Ancizar',
116-
fontWeight: FontWeight.w500,
117-
fontSize: 18.0,
118-
),
119104
overflow: TextOverflow.ellipsis,
120105
maxLines: 2,
121106
),
@@ -130,11 +115,6 @@ class NoteCardCompleted extends StatelessWidget {
130115
padding: const EdgeInsets.fromLTRB(10.0, 0.0, 0.0, 5.0),
131116
child: Text(
132117
(note.description == "" ? "no description" : note.description),
133-
style: TextStyle(
134-
fontFamily: 'Ancizar',
135-
fontWeight: FontWeight.w500,
136-
fontSize: 18.0,
137-
),
138118
overflow: TextOverflow.ellipsis,
139119
maxLines: 5,
140120
),

pubspec.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ flutter:
8686
- family: Ancizar
8787
fonts:
8888
- asset: fonts/AncizarSans-VariableFont_wght.ttf
89+
- family: Nunito
90+
fonts:
91+
- asset: fonts/Nunito-VariableFont_wght.ttf
92+
- family: Poppins
93+
fonts:
94+
- asset: fonts/Poppins-Regular.ttf
8995
# - family: Trajan Pro
9096
# fonts:
9197
# - asset: fonts/TrajanPro.ttf

0 commit comments

Comments
 (0)