Skip to content

Commit cb89c7e

Browse files
committed
Tasarım güzelleştirildi , proje tamamlandı.
1 parent a277c83 commit cb89c7e

File tree

7 files changed

+215
-92
lines changed

7 files changed

+215
-92
lines changed

lib/Pages/CreateTask.dart

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'package:flutter/material.dart';
2+
import 'package:fluttertoast/fluttertoast.dart';
23
import 'package:taskmanager/Services/HiveDb.dart';
34
import 'package:taskmanager/locator.dart';
45
import 'package:uuid/uuid.dart';
@@ -40,6 +41,7 @@ class _CreateTaskState extends State<CreateTask> {
4041
"ID": Uuid().v4(),
4142
"Name": nameCon.text,
4243
"Period": myChoice,
44+
"RawTime": DateTime.now().millisecondsSinceEpoch
4345
};
4446
if (myChoice == "Daily") data["Time"] = timeCon.text;
4547
return await database.addTask(data);
@@ -50,16 +52,26 @@ class _CreateTaskState extends State<CreateTask> {
5052
localizations = MaterialLocalizations.of(context);
5153
return SafeArea(
5254
child: Scaffold(
53-
backgroundColor: Colors.orange[300],
55+
backgroundColor: Colors.blueGrey[700],
5456
appBar: AppBar(
5557
title: Text("Create Task"),
5658
centerTitle: true,
5759
),
5860
floatingActionButton: FloatingActionButton(
61+
shape: RoundedRectangleBorder(
62+
borderRadius: BorderRadius.all(Radius.circular(15))),
5963
onPressed: () async {
6064
await saveTask().then((value) {
6165
if (value) {
6266
print("Successful");
67+
Fluttertoast.showToast(
68+
msg: "Task Created",
69+
toastLength: Toast.LENGTH_SHORT,
70+
gravity: ToastGravity.BOTTOM,
71+
timeInSecForIosWeb: 1,
72+
backgroundColor: Colors.blue,
73+
textColor: Colors.white,
74+
fontSize: 16.0);
6375
Navigator.pop(context, true);
6476
}
6577
});
@@ -90,16 +102,30 @@ class _CreateTaskState extends State<CreateTask> {
90102
);
91103
}
92104

93-
DropdownButton<String> periodSelection() {
94-
return DropdownButton<String>(
95-
hint: Text("Choice Time Period"),
96-
value: myChoice,
97-
items: dropdownList,
98-
onChanged: (choice) {
99-
setState(() {
100-
myChoice = choice;
101-
});
102-
});
105+
Widget periodSelection() {
106+
return Card(
107+
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8.0)),
108+
color: Colors.blue[300],
109+
child: Padding(
110+
padding: const EdgeInsets.all(8.0),
111+
child: DropdownButton<String>(
112+
dropdownColor: Colors.blue[300],
113+
hint: Text("Choice Time Period"),
114+
value: myChoice,
115+
style: TextStyle(color: Colors.white, fontSize: 20),
116+
underline: Container(),
117+
items: dropdownList,
118+
icon: Icon(
119+
Icons.date_range,
120+
color: Colors.white,
121+
),
122+
onChanged: (choice) {
123+
setState(() {
124+
myChoice = choice;
125+
});
126+
}),
127+
),
128+
);
103129
}
104130

105131
Widget timePicker(BuildContext context) {
@@ -133,7 +159,7 @@ class _CreateTaskState extends State<CreateTask> {
133159
enabled: false,
134160
decoration: InputDecoration(
135161
labelStyle: TextStyle(fontSize: 20),
136-
hintText: 'Time not set'),
162+
hintText: 'Select Time (Optional)'),
137163
),
138164
),
139165
),
@@ -155,7 +181,10 @@ class _CreateTaskState extends State<CreateTask> {
155181
title: TextField(
156182
controller: nameCon,
157183
decoration: InputDecoration(
158-
border: OutlineInputBorder(),
184+
focusedBorder: OutlineInputBorder(
185+
borderSide: BorderSide(color: Colors.red, width: 2)),
186+
enabledBorder: OutlineInputBorder(
187+
borderSide: BorderSide(color: Colors.blue, width: 2)),
159188
labelText: 'Task Name',
160189
labelStyle: TextStyle(fontSize: 20),
161190
hintText: 'Enter a task name'),

lib/Pages/Home.dart

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ class HomePage extends StatefulWidget {
1212
class _HomePageState extends State<HomePage> {
1313
int _currentIndex = 0;
1414
List<BottomNavigationBarItem> bottomNavItems = [
15-
BottomNavigationBarItem(icon: Icon(Icons.list), title: Text("MyList")),
16-
BottomNavigationBarItem(icon: Icon(Icons.done_all), title: Text("Finished"))
15+
BottomNavigationBarItem(icon: Icon(Icons.list), title: Text("Task List")),
16+
BottomNavigationBarItem(
17+
icon: Icon(Icons.done_all), title: Text("Finished Tasks"))
1718
];
1819

1920
@override
@@ -26,8 +27,13 @@ class _HomePageState extends State<HomePage> {
2627
),
2728
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
2829
floatingActionButton: FloatingActionButton(
30+
shape: RoundedRectangleBorder(
31+
borderRadius: BorderRadius.all(Radius.circular(15))),
2932
backgroundColor: Colors.blue,
30-
child: Icon(Icons.add),
33+
child: Icon(
34+
Icons.add,
35+
size: MediaQuery.of(context).size.width / 15,
36+
),
3137
onPressed: () {
3238
Navigator.push(
3339
context,
@@ -46,6 +52,8 @@ class _HomePageState extends State<HomePage> {
4652
}),
4753
items: bottomNavItems,
4854
currentIndex: _currentIndex,
55+
selectedItemColor: Colors.red,
56+
iconSize: MediaQuery.of(context).size.width / 15,
4957
),
5058
),
5159
);

0 commit comments

Comments
 (0)