diff --git a/cancerlinc/lib/pages/checklist_page.dart b/cancerlinc/lib/pages/checklist_page.dart index 5b442e3..2c49a1a 100644 --- a/cancerlinc/lib/pages/checklist_page.dart +++ b/cancerlinc/lib/pages/checklist_page.dart @@ -1,10 +1,172 @@ import 'package:flutter/material.dart'; -class ChecklistPage extends StatelessWidget { +class ChecklistPage extends StatefulWidget { const ChecklistPage({super.key}); + @override + State createState() => _ChecklistPageState(); +} + +class _ChecklistPageState extends State { + final List> _checklists = [ + { + 'title': '03/25/26 Appointment', + 'subtitle': 'Routine Oncology', + 'items': [ + 'List of Current Medications', + 'Photo ID', + 'Insurance Card', + 'Referral from Primary Care Doctor', + 'Eyeglasses', + ], + }, + { + 'title': '04/02/26 Appointment', + 'subtitle': 'Routine Oncology', + 'items': ['List of Current Medications', 'Photo ID'], + }, + ]; + + void _addChecklist() { + setState(() { + _checklists.add({ + 'title': 'New Checklist', + 'subtitle': 'Type of Appointment', + 'items': ['Placeholder Item'], + }); + }); + } + + void _deleteChecklist(int index) { + setState(() { + _checklists.removeAt(index); + }); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Checklists'), + actions: [ + TextButton(onPressed: _addChecklist, child: const Text('Add List')), + TextButton(onPressed: () {}, child: const Text('Delete Lists')), + TextButton(onPressed: () {}, child: const Text('List Archive')), + ], + ), + body: ListView.builder( + padding: const EdgeInsets.all(16), + itemCount: _checklists.length, + itemBuilder: (context, index) { + final checklist = _checklists[index]; + return Padding( + padding: const EdgeInsets.only(bottom: 16), + child: ChecklistCard( + title: checklist['title'], + subtitle: checklist['subtitle'], + items: List.from(checklist['items']), + onDelete: () => _deleteChecklist(index), + ), + ); + }, + ), + bottomNavigationBar: BottomNavigationBar( + currentIndex: 1, + items: const [ + BottomNavigationBarItem(icon: Icon(Icons.chat), label: 'Chat'), + BottomNavigationBarItem( + icon: Icon(Icons.checklist), + label: 'Checklist', + ), + BottomNavigationBarItem( + icon: Icon(Icons.menu_book), + label: 'Resources', + ), + BottomNavigationBarItem( + icon: Icon(Icons.calendar_today), + label: 'Calendar', + ), + ], + ), + ); + } +} + +class ChecklistCard extends StatelessWidget { + final String title; + final String subtitle; + final List items; + final VoidCallback? onDelete; + + const ChecklistCard({ + super.key, + required this.title, + required this.subtitle, + required this.items, + this.onDelete, + }); + @override Widget build(BuildContext context) { - return const Center(child: Text('Checklist Page')); + return Card( + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), + elevation: 2, + child: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: const TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 4), + Text( + subtitle, + style: TextStyle(fontSize: 14, color: Colors.grey[600]), + ), + ], + ), + IconButton( + icon: const Icon(Icons.delete_outline), + onPressed: onDelete, + ), + ], + ), + const SizedBox(height: 8), + for (var item in items) + Row( + children: [ + Checkbox(value: false, onChanged: (_) {}), + Text(item), + ], + ), + const SizedBox(height: 8), + Row( + children: [ + ElevatedButton( + onPressed: () {}, + child: const Text('Add Items'), + ), + const SizedBox(width: 8), + OutlinedButton( + onPressed: () {}, + child: const Text('Delete Items'), + ), + ], + ), + ], + ), + ), + ); } } diff --git a/cancerlinc/pubspec.lock b/cancerlinc/pubspec.lock index eaa659f..6695de4 100644 --- a/cancerlinc/pubspec.lock +++ b/cancerlinc/pubspec.lock @@ -79,26 +79,26 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" url: "https://pub.dev" source: hosted - version: "10.0.9" + version: "11.0.2" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" url: "https://pub.dev" source: hosted - version: "3.0.9" + version: "3.0.10" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" lints: dependency: transitive description: @@ -188,18 +188,18 @@ packages: dependency: transitive description: name: test_api - sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" url: "https://pub.dev" source: hosted - version: "0.7.4" + version: "0.7.6" vector_math: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" vm_service: dependency: transitive description: