This repository has been archived on 2026-06-02. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
FabledApp/lib/data/models/milestone.dart
T
bvandeusen 868cb0e49e Add milestone data layer and redesign Projects tab
Milestone data layer:
- lib/data/models/milestone.dart: Milestone model with progress fields
  (total, completed, pct) from backend progress endpoint
- lib/data/api/milestones_api.dart: CRUD client for
  /api/projects/:id/milestones
- lib/data/repositories/milestones_repository.dart: thin repository wrapper
- lib/providers/milestones_provider.dart: FutureProvider.family keyed by
  project ID — lazily fetched per project when expanded
- api_client_provider.dart: registers milestonesApiProvider and
  milestonesRepositoryProvider

Projects tab redesign (project_list_screen.dart):
- Each project is now an ExpansionTile showing open task count in subtitle
- Expanding a project fetches its milestones and groups tasks under milestone
  headers with inline progress bar (completed/total count)
- Tasks show status icon, due date with overdue highlighting, priority dot
- 'No milestone' section at bottom for unassigned tasks
- Tapping a task navigates to the task editor
- Long-press on project title opens archive/complete/delete bottom sheet
- 'New task' button at bottom of each expanded project section

Bump version to 26.03.02+1

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 21:33:45 -05:00

42 lines
1.2 KiB
Dart

class Milestone {
final int id;
final int projectId;
final String title;
final String? description;
final String status; // active | completed | archived
final int orderIndex;
final int total;
final int completed;
final double pct;
final DateTime createdAt;
final DateTime updatedAt;
const Milestone({
required this.id,
required this.projectId,
required this.title,
this.description,
required this.status,
required this.orderIndex,
required this.total,
required this.completed,
required this.pct,
required this.createdAt,
required this.updatedAt,
});
factory Milestone.fromJson(Map<String, dynamic> json) => Milestone(
id: json['id'] as int,
projectId: json['project_id'] as int,
title: json['title'] as String? ?? '',
description: json['description'] as String?,
status: json['status'] as String? ?? 'active',
orderIndex: json['order_index'] as int? ?? 0,
total: json['total'] as int? ?? 0,
completed: json['completed'] as int? ?? 0,
pct: (json['pct'] as num?)?.toDouble() ?? 0.0,
createdAt: DateTime.parse(json['created_at'] as String),
updatedAt: DateTime.parse(json['updated_at'] as String),
);
}