Skip to content

Commit 4dfc3fa

Browse files
committed
latest
1 parent fe263f3 commit 4dfc3fa

12 files changed

Lines changed: 839 additions & 108 deletions

blueprint.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
'''
2+
# Task Manager App Blueprint
3+
4+
## Overview
5+
6+
A streamlined task management app using Flutter to organize daily to-do lists. Key features include adding tasks with due dates, marking tasks as complete, viewing tasks by priority or due date, and quick editing options. The app uses a clean light mode theme with a modernistic UI and very slick design with color choices, providing a perfect and user-friendly experience with modern trendy UX.
7+
8+
## Features
9+
10+
* **Add Tasks:** Users can add new tasks with a title, due date, and priority through a redesigned form with clear input fields and date picker.
11+
* **Edit Tasks:** Existing tasks can be easily edited via a dedicated screen, pre-populated with current task details.
12+
* **Delete Tasks:** Tasks can be deleted with a simple swipe-to-delete gesture, accompanied by a confirmation snackbar.
13+
* **Mark as Complete:** Tasks can be marked as complete using a checkbox, with a visual line-through effect on the title and a confirmation snackbar.
14+
* **Priority Levels:** Tasks can be assigned a priority level (High, Medium, or Low), visually represented by a color-coded circular avatar with the initial of the priority.
15+
* **Due Dates:** Each task has a due date, clearly displayed and easily editable via an integrated date picker.
16+
* **Modern UI/UX:** The app features a clean light mode theme with a modernistic and slick design. This includes:
17+
* **Custom Color Scheme:** A vibrant yet professional color palette with a deep purple primary color and a teal accent.
18+
* **Typography:** Utilizes `GoogleFonts.poppins` for headlines and `GoogleFonts.lato`/`GoogleFonts.openSans` for body text, ensuring readability and a modern aesthetic.
19+
* **Elevated Components:** Buttons, cards, and floating action buttons feature multi-layered drop shadows and elegant color glows to create a strong sense of depth and interactivity.
20+
* **Input Fields:** Cleanly designed input fields with subtle fill colors and focused border highlighting.
21+
* **Task Cards:** Each task is presented within an elevated card, providing visual separation and a lifted appearance.
22+
* **Empty State:** A user-friendly message and icon are displayed when there are no tasks, guiding the user to add new ones.
23+
* **Snackbars:** Informative snackbars provide feedback for actions like task deletion or completion.
24+
25+
## Project Structure
26+
27+
```
28+
lib
29+
├── models
30+
│ └── task.dart
31+
├── providers
32+
│ └── task_provider.dart
33+
├── screens
34+
│ ├── add_task_screen.dart
35+
│ └── task_list_screen.dart
36+
├── theme
37+
│ └── my_theme.dart
38+
└── widgets
39+
├── empty_tasks.dart
40+
└── task_list_item.dart
41+
```
42+
43+
## Dependencies
44+
45+
* `provider`: For state management.
46+
* `google_fonts`: For custom fonts and typography.
47+
* `flutter_slidable`: For the swipeable task list items (delete and edit).
48+
* `intl`: For date formatting.
49+
50+
## Current Plan: UI/UX Refinement
51+
52+
**Goal:** Implement a clean light mode theme with modernistic UI and very slick design with color choices, ensuring a perfect UI with user-friendliness and modern trendy UX.
53+
54+
**Steps:**
55+
1. **Create `lib/theme/my_theme.dart`:** Define a custom `ThemeData` for the light mode, incorporating `ColorScheme.fromSeed`, `GoogleFonts` for `TextTheme`, and custom `AppBarTheme`, `ElevatedButtonTheme`, `FloatingActionButtonTheme`, `InputDecorationTheme`, and `CardTheme` for a consistent and modern look.
56+
2. **Update `lib/main.dart`:** Apply the `MyTheme.lightTheme` to the `MaterialApp` and set `debugShowCheckedModeBanner` to `false` for a cleaner presentation.
57+
3. **Create `lib/widgets/empty_tasks.dart`:** Implement a widget to display a friendly message and icon when the task list is empty.
58+
4. **Update `lib/screens/task_list_screen.dart`:** Integrate the `EmptyTasks` widget and update the `AppBar` styling to align with the new theme.
59+
5. **Update `lib/widgets/task_list_item.dart`:** Refactor the `TaskListItem` to use `Card` widgets for better visual appeal, apply theme-defined styles for text, colors, and shadows, and integrate `Slidable` for swipe actions (delete and edit) with themed colors and snackbar feedback.
60+
6. **Update `lib/screens/add_task_screen.dart`:** Enhance the `AddTaskScreen` with themed input decorations, a styled date picker, and improved layout for a more user-friendly experience.
61+
7. **Error Handling:** Ensure that all UI changes are implemented without introducing new errors and that existing functionalities remain robust.
62+
'''

devtools_options.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
description: This file stores settings for Dart & Flutter DevTools.
2+
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
3+
extensions:

lib/main.dart

Lines changed: 13 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1+
12
import 'package:flutter/material.dart';
3+
import 'package:provider/provider.dart';
4+
5+
import 'providers/task_provider.dart';
6+
import 'screens/task_list_screen.dart';
7+
import 'theme/my_theme.dart'; // Import the custom theme
28

39
void main() {
410
runApp(const MyApp());
@@ -7,116 +13,16 @@ void main() {
713
class MyApp extends StatelessWidget {
814
const MyApp({super.key});
915

10-
// This widget is the root of your application.
11-
@override
12-
Widget build(BuildContext context) {
13-
return MaterialApp(
14-
title: 'Flutter Demo',
15-
theme: ThemeData(
16-
// This is the theme of your application.
17-
//
18-
// TRY THIS: Try running your application with "flutter run". You'll see
19-
// the application has a purple toolbar. Then, without quitting the app,
20-
// try changing the seedColor in the colorScheme below to Colors.green
21-
// and then invoke "hot reload" (save your changes or press the "hot
22-
// reload" button in a Flutter-supported IDE, or press "r" if you used
23-
// the command line to start the app).
24-
//
25-
// Notice that the counter didn't reset back to zero; the application
26-
// state is not lost during the reload. To reset the state, use hot
27-
// restart instead.
28-
//
29-
// This works for code too, not just values: Most code changes can be
30-
// tested with just a hot reload.
31-
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
32-
),
33-
home: const MyHomePage(title: 'Flutter Demo Home Page'),
34-
);
35-
}
36-
}
37-
38-
class MyHomePage extends StatefulWidget {
39-
const MyHomePage({super.key, required this.title});
40-
41-
// This widget is the home page of your application. It is stateful, meaning
42-
// that it has a State object (defined below) that contains fields that affect
43-
// how it looks.
44-
45-
// This class is the configuration for the state. It holds the values (in this
46-
// case the title) provided by the parent (in this case the App widget) and
47-
// used by the build method of the State. Fields in a Widget subclass are
48-
// always marked "final".
49-
50-
final String title;
51-
52-
@override
53-
State<MyHomePage> createState() => _MyHomePageState();
54-
}
55-
56-
class _MyHomePageState extends State<MyHomePage> {
57-
int _counter = 0;
58-
59-
void _incrementCounter() {
60-
setState(() {
61-
// This call to setState tells the Flutter framework that something has
62-
// changed in this State, which causes it to rerun the build method below
63-
// so that the display can reflect the updated values. If we changed
64-
// _counter without calling setState(), then the build method would not be
65-
// called again, and so nothing would appear to happen.
66-
_counter++;
67-
});
68-
}
69-
7016
@override
7117
Widget build(BuildContext context) {
72-
// This method is rerun every time setState is called, for instance as done
73-
// by the _incrementCounter method above.
74-
//
75-
// The Flutter framework has been optimized to make rerunning build methods
76-
// fast, so that you can just rebuild anything that needs updating rather
77-
// than having to individually change instances of widgets.
78-
return Scaffold(
79-
appBar: AppBar(
80-
// TRY THIS: Try changing the color here to a specific color (to
81-
// Colors.amber, perhaps?) and trigger a hot reload to see the AppBar
82-
// change color while the other colors stay the same.
83-
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
84-
// Here we take the value from the MyHomePage object that was created by
85-
// the App.build method, and use it to set our appbar title.
86-
title: Text(widget.title),
87-
),
88-
body: Center(
89-
// Center is a layout widget. It takes a single child and positions it
90-
// in the middle of the parent.
91-
child: Column(
92-
// Column is also a layout widget. It takes a list of children and
93-
// arranges them vertically. By default, it sizes itself to fit its
94-
// children horizontally, and tries to be as tall as its parent.
95-
//
96-
// Column has various properties to control how it sizes itself and
97-
// how it positions its children. Here we use mainAxisAlignment to
98-
// center the children vertically; the main axis here is the vertical
99-
// axis because Columns are vertical (the cross axis would be
100-
// horizontal).
101-
//
102-
// TRY THIS: Invoke "debug painting" (choose the "Toggle Debug Paint"
103-
// action in the IDE, or press "p" in the console), to see the
104-
// wireframe for each widget.
105-
mainAxisAlignment: MainAxisAlignment.center,
106-
children: <Widget>[
107-
const Text('You have pushed the button this many times:'),
108-
Text(
109-
'$_counter',
110-
style: Theme.of(context).textTheme.headlineMedium,
111-
),
112-
],
113-
),
18+
return ChangeNotifierProvider(
19+
create: (context) => TaskProvider(),
20+
child: MaterialApp(
21+
title: 'Task Manager',
22+
theme: MyTheme.lightTheme, // Apply the custom light theme
23+
home: const TaskListScreen(),
24+
debugShowCheckedModeBanner: false, // Hide the debug banner
11425
),
115-
floatingActionButton: FloatingActionButton(
116-
onPressed: _incrementCounter,
117-
tooltip: 'Increment',
118-
child: const Icon(Icons.add),
119-
), // This trailing comma makes auto-formatting nicer for build methods.
12026
);
12127
}
12228
}

lib/models/task.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
enum Priority { high, medium, low }
3+
4+
class Task {
5+
String id;
6+
String title;
7+
DateTime dueDate;
8+
Priority priority;
9+
bool isCompleted;
10+
11+
Task({
12+
required this.id,
13+
required this.title,
14+
required this.dueDate,
15+
this.priority = Priority.medium,
16+
this.isCompleted = false,
17+
});
18+
}

lib/providers/task_provider.dart

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import 'package:flutter/material.dart';
2+
import '../models/task.dart';
3+
4+
class TaskProvider with ChangeNotifier {
5+
final List<Task> _tasks = [
6+
Task(id: '1', title: 'Complete Flutter UI', dueDate: DateTime.now(), priority: Priority.high),
7+
Task(id: '2', title: 'Write documentation', dueDate: DateTime.now().add(const Duration(days: 1)), priority: Priority.medium),
8+
Task(id: '3', title: 'Test the app', dueDate: DateTime.now().add(const Duration(days: 2)), isCompleted: true, priority: Priority.low),
9+
];
10+
11+
List<Task> get tasks => _tasks;
12+
13+
void addTask(Task task) {
14+
_tasks.add(task);
15+
notifyListeners();
16+
}
17+
18+
void updateTask(Task task) {
19+
final index = _tasks.indexWhere((t) => t.id == task.id);
20+
if (index != -1) {
21+
_tasks[index] = task;
22+
notifyListeners();
23+
}
24+
}
25+
26+
void toggleTaskCompletion(String taskId) {
27+
final index = _tasks.indexWhere((t) => t.id == taskId);
28+
if (index != -1) {
29+
_tasks[index].isCompleted = !_tasks[index].isCompleted;
30+
notifyListeners();
31+
}
32+
}
33+
34+
void deleteTask(String taskId) {
35+
_tasks.removeWhere((t) => t.id == taskId);
36+
notifyListeners();
37+
}
38+
}

0 commit comments

Comments
 (0)