Flutter-Ernaehrungsapp/lib/components/statistics_circular_indicat...

38 lines
1.1 KiB
Dart
Raw Normal View History

import 'package:flutter/material.dart';
import 'package:percent_indicator/circular_percent_indicator.dart';
class StatisticsPercentComponent extends StatelessWidget {
late String eaten, calorienBurned, calorienLeft, calorienLeftPercent;
StatisticsPercentComponent(int eaten, int calorienBurned, int calorienLeft, {super.key}){
this.eaten = '$eaten Gegessen';
this.calorienBurned = '$calorienBurned Verbrannt';
this.calorienLeft = '$calorienLeft Kcal Übrig';
}
String get getEaten => eaten;
get getCalorienBurned => calorienBurned;
get getCalorienLeft => calorienLeft;
get getCalorienLeftPercent => calorienLeftPercent;
@override
Widget build(BuildContext context) {
return Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(eaten),
CircularPercentIndicator(
radius: 60.0,
lineWidth: 5.0,
percent: 0.5,
center: const Text("100%"), //TODO: anpassen
progressColor: Colors.lightGreen,
),
Text(calorienBurned),
],
);
}
}