diff --git a/trackeroo/lib/frontend/views/details_view.dart b/trackeroo/lib/frontend/views/details_view.dart index 088e0e4b60e35bc0ede428f9cd7ff200a6231605..fe7476d20e2677f6821de72980041215a0fcf382 100644 --- a/trackeroo/lib/frontend/views/details_view.dart +++ b/trackeroo/lib/frontend/views/details_view.dart @@ -1,10 +1,19 @@ import 'package:flutter/material.dart'; import 'package:fl_chart/fl_chart.dart'; import 'package:trackeroo/frontend/utils/transaction_listtile.dart'; -import 'package:trackeroo/frontend/views/onboarding_view.dart'; import 'package:trackeroo/logic/models/transaction.dart'; +enum Timespan { daily, weekly, monthly, yearly, all } + +List<String> items = [ + 'C1', + 'C2', + 'C3', + 'C4' +]; +String? selectedValue; + class DetailsView extends StatefulWidget { const DetailsView({super.key}); @@ -20,22 +29,29 @@ class _DetailsViewState extends State<DetailsView> { Transaction trn = Transaction(title: "Bus Ticket VVS", amount: -5.32, categoryId: 'food_and_groceries', dueDate: DateTime.now()); Transaction trp = Transaction(title: "Gehalt", amount: 1300, categoryId: 'leisure_and_entertainment', dueDate: DateTime.now()); + Timespan timespanView = Timespan.monthly; + @override Widget build(BuildContext context) { return SingleChildScrollView( /* backgroundColor: Colors.blueGrey[900],*/ - padding: EdgeInsets.all(16.0), + padding: const EdgeInsets.all(16.0), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ - const Text( - 'Datails chart', - style: TextStyle( - fontSize: 14.0, - fontWeight: FontWeight.bold - ), + const Row( + children: [ + Text( + 'Datails chart', + style: TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.bold + ), + ), + + ] ), const SizedBox(height: 20.0), Center( @@ -123,6 +139,53 @@ class _DetailsViewState extends State<DetailsView> { ), ) ), + + const SizedBox(height: 10.0), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + FilterChip( + onSelected: (value) => setState(() { + timespanView = Timespan.daily; + }), + label: const Text('Daily'), + selected: timespanView == Timespan.daily, + showCheckmark: false + ), + FilterChip( + onSelected: (value) => setState(() { + timespanView = Timespan.weekly; + }), + label: const Text('Weekly'), + selected: timespanView == Timespan.weekly, + showCheckmark: false + ), + FilterChip( + onSelected: (value) => setState(() { + timespanView = Timespan.monthly; + }), + label: const Text('Montly'), + selected: timespanView == Timespan.monthly, + showCheckmark: false + ), + FilterChip( + onSelected: (value) => setState(() { + timespanView = Timespan.yearly; + }), + label: const Text('Yearly'), + selected: timespanView == Timespan.yearly, + showCheckmark: false + ), + FilterChip( + onSelected: (value) => setState(() { + timespanView = Timespan.all; + }), + label: const Text('All'), + selected: timespanView == Timespan.all, + showCheckmark: false + ) + ], + ), const SizedBox(height: 20.0), const Text( 'Transactions',