2023-04-29 15:56:04 +02:00
|
|
|
import 'package:ernaehrung/components/diet_chart_component.dart';
|
|
|
|
import 'package:ernaehrung/components/statistics_circular_indicator_component.dart';
|
|
|
|
import 'package:ernaehrung/mockdata.dart';
|
2023-04-23 13:08:04 +02:00
|
|
|
import 'package:flutter/material.dart';
|
2023-04-29 15:56:04 +02:00
|
|
|
import '../../components/card_component.dart';
|
2023-04-23 13:08:04 +02:00
|
|
|
|
|
|
|
class TodayPage extends StatefulWidget {
|
|
|
|
final String title;
|
|
|
|
|
|
|
|
const TodayPage({Key? key, required this.title}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
State<TodayPage> createState() => _TodayPageState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _TodayPageState extends State<TodayPage> {
|
2023-04-29 15:56:04 +02:00
|
|
|
List<CardComponent> getCardComponent() {
|
|
|
|
List<CardComponent> listOfCards = [];
|
|
|
|
cards.forEach((key, value) {
|
|
|
|
listOfCards.add(CardComponent(
|
|
|
|
key.keys.elementAt(0), key.values.elementAt(0), 300, value.toList()));
|
|
|
|
});
|
|
|
|
|
|
|
|
return listOfCards;
|
|
|
|
}
|
2023-04-23 13:08:04 +02:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
2023-04-29 15:56:04 +02:00
|
|
|
body: SizedBox(
|
|
|
|
width: double.infinity,
|
|
|
|
height: double.infinity,
|
|
|
|
child: Container(
|
|
|
|
decoration: const BoxDecoration(
|
|
|
|
gradient: LinearGradient(
|
|
|
|
colors: [Color(0xff000000), Color(0xff47a44b)],
|
|
|
|
stops: [0.1, 5],
|
|
|
|
begin: Alignment.bottomCenter,
|
|
|
|
end: Alignment.topCenter,
|
|
|
|
)
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
StatisticsPercentComponent(300, 100, 400),
|
|
|
|
DietChatComponent(1500),
|
|
|
|
SingleChildScrollView(child: Column(children: getCardComponent()))
|
|
|
|
],
|
2023-04-23 13:08:04 +02:00
|
|
|
),
|
2023-04-29 15:56:04 +02:00
|
|
|
),
|
|
|
|
));
|
2023-04-23 13:08:04 +02:00
|
|
|
}
|
|
|
|
}
|