8000 GitHub - Sangampal11/task_managent_web · GitHub
[go: up one dir, main page]

Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

VelocTasks - Premium Responsive Task Manager 🚀

A highly responsive, premium personal task management web application built using Flutter Web (Material 3). The application showcases advanced frontend capabilities, featuring custom 3D perspective tilt transforms, custom canvas particle confetti animations, checklist/sub-task progress tracking, light/dark mode toggling, advanced sorting/filtering, and local storage data persistence.

🔗 Submission Links


📖 Table of Contents

  1. Project Flow & Architecture
  2. Data Persistence & Storage Mechanics
  3. Premium UI & Animation Engines
  4. Folder Directory & File Structure
  5. Setup & Execution Instructions
  6. Testing & Quality Assurance

1. Project Flow & Architecture

The application adopts the Single Source of Truth pattern, separating state management from the UI layer to achieve clean rendering loops and 60fps web performance.

graph TD
    UI[User Interface: task_card / task_form_dialog] -->|User Interaction: Toggle/Add/Edit| Provider[State Provider: TaskProvider]
    Provider -->|Serialize & Save| Storage[(Local Storage: SharedPreferences)]
    Provider -->|Notify Listeners| Builder[ListenableBuilder in main.dart]
    Builder -->|Rebuild Widgets| UI
    Storage -->|On App Startup: Load & Deserialize| Provider
Loading
  1. State Engine (TaskProvider):
    • Implemented as a ChangeNotifier. It manages the global list of tasks, current search queries, active status filters, category filters, and user theme selections.
    • Any modification (adding a task, checking a sub-task, deleting, or sorting) mutates the state and triggers notifyListeners().
  2. Main Application entrypoint (main.dart):
    • Instantiates the TaskProvider and binds the root MaterialApp using a ListenableBuilder.
    • When the provider triggers updates (e.g., toggling dark mode or loading saved tasks), the MaterialApp instantly adapts and redraws.
  3. Responsive UI assembly (dashboard_screen.dart):
    • Builds responsive layouts using the ResponsiveLayout helper. It switches between single-column mobile viewports (collapsing sidebars into slide-up bottom sheets and floating action buttons) and tablet/desktop viewports (multi-column grids or structured table layouts).

2. Data Persistence & Storage Mechanics

Task records and user preferences survive page refreshes, tab closures, and browser restarts. The data lifecycle operates through the following steps:

Phase 1: Data Serialization (Task & SubTask Models)

To write complex Dart structures to local storage, tasks are serialized. In lib/models/task.dart, the Task and SubTask classes define serialization methods:

  • toJson(): Converted from Dart objects to standard key-value maps (Map<String, dynamic>).
  • fromJson(): Deserialized from raw maps back into structured typed Dart instances.
// Example of nested serialization in task.dart
Map<String, dynamic> toJson() => {
  'id': id,
  'title': title,
  'description': description,
  'priority': priority.name,
  'status': status.name,
  'category': category.name,
  'dueDate': dueDate.toIso8601String(),
  'subTasks': subTasks.map((st) => st.toJson()).toList(),
};

Phase 2: Writing Data to Browser Storage (TaskProvider)

Whenever a user mutates a task, the change propagates to the shared_preferences database key 'veloc_tasks':

  1. The method _saveTasksToLocalStorage() is triggered inside TaskProvider.
  2. The entire List<Task> is converted into a serialized JSON string:
    final String jsonString = jsonEncode(_tasks.map((t) => t.toJson()).toList());
  3. The string is saved asynchronously:
    await prefs.setString('veloc_tasks', jsonString);
  4. Dark mode preference is saved similarly under the key 'is_dark_mode'.

Phase 3: Loading Data on Cold Startup

  1. When the app launches, loadTasksFromLocalStorage() runs asynchronously inside the provider's initialization constructor.
  2. It queries the key 'veloc_tasks'. If data exists, it decodes the raw JSON list string:
    final List<dynamic> decodedList = jsonDecode(jsonString);
  3. It maps the decoded list items back into Task objects:
    _tasks = decodedList.map((item) => Task.fromJson(item)).toList();
  4. isLoading is set to false, and notifyListeners() updates the screen, transitioning from a loading spinner to the dashboard.

3. Premium UI & Animation Engines

The frontend incorporates professional animations to maximize visual impact:

A. 3D Perspective Hover Transforms

  • Managed in task_card.dart and stats_card.dart using a custom interactive MouseRegion.
  • Hovering over cards tracks mouse cursor offset relative to the card's bounding center. It translates coordinates into X-axis and Y-axis rotation tilts using a projection transform matrix:
    Matrix4.identity()
      ..setEntry(3, 2, 0.001) // perspective depth index
      ..rotateX(_tiltX * 0.08)
      ..rotateY(_tiltY * 0.08)
  • This tilts the card in 3D space toward the cursor. A radial gradient spotlight follows the mouse movement, creating a polished glowing glassmorphism effect.

B. Custom Canvas-Based Confetti Particle Simulation

  • Built in confetti_overlay.dart using a custom particle physics loop.
  • Completing a task or marking all checklist items as checked launches the confetti overlay:
    • Generates dozens of particle vectors with random colors, sizes, rotational velocities, and drag coefficients.
    • Implements physics calculations (gravity drag, horizontal wind velocity resistance, and opacity fade-outs) rendered via a high-performance CustomPainter ticker.

C. Layout Overflow Mitigations

  • Card content blocks, checklist rows, and filter panels are wrapped with flexible containers, horizontal/vertical SingleChildScrollView widgets, and Expanded grids. This guarantees zero pixel overflow warnings, regardless of test viewport scales.

4. Folder Directory & File Structure

lib/
├── models/
│   └── task.dart               # Task and SubTask models, JSON serializations
├── providers/
│   └── task_provider.dart      # ChangeNotifier managing tasks, filters, and local IO
├── theme/
│   └── app_theme.dart          # Styling tokens, glowing neon shadows, light/dark themes
├── widgets/
│   ├── responsive_layout.dart  # Mobile/Tablet/Desktop breakpoint handlers
│   ├── task_card.dart          # 3D interactive tilt-card with checklist progress indicators
│   ├── task_form_dialog.dart   # Validation logic, due date calendar picker, subtask list builder
│   ├── stats_card.dart         # Numerical dashboard counters with glowing neon borders
│   ├── empty_state.dart        # Floating loop empty illustration graphics
│   └── confetti_overlay.dart   # Custom physics particle confetti engine
├── screens/
│   └── dashboard_screen.dart   # Master dashboard coordinator
└── main.dart                   # Root layout bootstrap and theme state listener

5. Setup & Execution Instructions

Ensure you have the Flutter SDK installed on your machine.

1. Download Dependencies

flutter pub get

2. Run the Development Server

To launch the application locally in Chrome:

flutter run -d chrome --web-port 8080

Open your browser and navigate to: http://localhost:8080

3. Build Optimized Production Bundle

To build a static production package:

flutter build web --release

This builds an optimized web bundle inside the build/web/ folder, utilizing the CanvasKit rendering pipeline.


6. Testing & Quality Assurance

Integrated widget test assertions are located in test/widget_test.dart:

  • Automatically sets up a mock browser local storage environment (SharedPreferences.setMockInitialValues).
  • Tests core layout elements (Total Tasks, Completed, Pending, High Priority labels).
  • Simulates clicking the "Add Task" button and verifies that the validation forms load successfully.

To execute tests:

flutter test

Output:

00:00 +0: loading E:/veloc_assignment/test/widget_test.dart
00:00 +0: Task manager dashboard smoke test
00:01 +1: All tests passed!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0