import 'package:flutter/material.dart'; import 'task_model.dart'; import 'datetime_extension.dart'; class TaskDetailsScreen extends StatelessWidget { final Task task; TaskDetailsScreen({required this.task}); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text(task.title), ), body: Padding( padding: const EdgeInsets.all(16.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( 'Category: ${task.category ?? 'Not specified'}', style: TextStyle(fontSize: 16), ), SizedBox(height: 8), Text( 'Priority: ${task.priority.name}', style: TextStyle(fontSize: 16), ), SizedBox(height: 8), Text( 'Deadline: ${task.deadline != null ? task.deadline!.toFormattedDate() : 'No deadline'}', style: TextStyle(fontSize: 16), ), SizedBox(height: 16), Text( 'Description:', style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold), ), SizedBox(height: 8), Text( task.description ?? 'No description available', style: TextStyle(fontSize: 16), ), SizedBox(height: 16), Text( 'Completed: ${task.isCompleted ? "Yes" : "No"}', style: TextStyle(fontSize: 16), ), ], ), ), ); } }