2023-05-29 12:08:46 +02:00
|
|
|
import 'package:ernaehrung/android/components/statistics_circular_indicator_component.dart';
|
2023-05-30 09:38:54 +02:00
|
|
|
import 'package:ernaehrung/android/config/cast_helper.dart';
|
2023-05-29 12:08:46 +02:00
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:hive_flutter/adapters.dart';
|
|
|
|
import '../../android/components/card_component.dart';
|
|
|
|
import '../../android/components/diet_chart_component.dart';
|
|
|
|
|
|
|
|
class SectionComponent extends StatelessWidget {
|
|
|
|
const SectionComponent({Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return SingleChildScrollView(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
2023-06-02 00:38:19 +02:00
|
|
|
const StatisticsPercentComponent(
|
|
|
|
calorienLeftPercent: 0,
|
|
|
|
eaten: 0,
|
|
|
|
calorienBurned: 0,
|
|
|
|
calorienLeft: 0,
|
|
|
|
),
|
2023-05-29 12:08:46 +02:00
|
|
|
DietChatComponent(1500),
|
|
|
|
ValueListenableBuilder(
|
|
|
|
valueListenable: Hive.box("TODAY").listenable(),
|
|
|
|
builder: (context, box, widget) {
|
|
|
|
return ListView.builder(
|
|
|
|
primary: false,
|
|
|
|
shrinkWrap: true,
|
|
|
|
itemCount: box.keys.length,
|
|
|
|
itemBuilder: (context, i) {
|
2023-06-02 00:38:19 +02:00
|
|
|
if (box.keyAt(i).toString() == "DATE") {
|
2023-05-29 12:08:46 +02:00
|
|
|
return const SizedBox.shrink();
|
2023-06-02 00:38:19 +02:00
|
|
|
} else {
|
2023-05-29 12:08:46 +02:00
|
|
|
return CardComponent(
|
2023-06-02 00:38:19 +02:00
|
|
|
eatingMealName: box.keyAt(i).toString(),
|
|
|
|
selectedMeal: castDynamicToListFood(box.getAt(i)),
|
2023-05-30 09:38:54 +02:00
|
|
|
);
|
2023-05-29 12:08:46 +02:00
|
|
|
}
|
2023-06-02 00:38:19 +02:00
|
|
|
});
|
2023-05-29 12:08:46 +02:00
|
|
|
}),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|