import 'package:ernaehrung/android/components/meal_page_text/statistics_text_component.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:percent_indicator/linear_percent_indicator.dart'; class LineCircularWiTextComponent extends StatelessWidget { final Color progressColor; final double value; final int total; final String textName; const LineCircularWiTextComponent( this.progressColor, this.value, this.total, this.textName, {super.key}); @override Widget build(BuildContext context) { double progress = double.parse((value/total).toStringAsFixed(1)); progress = progress > 1.0 ? 1.0 : progress; return Padding( padding: const EdgeInsets.symmetric(vertical: 0, horizontal: 8), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ StaticsTextComponent(double.parse(value.toString()).toStringAsFixed(2), true), const SizedBox(height: 4,), LinearPercentIndicator( padding: EdgeInsets.zero, lineHeight: 8.0, percent: progress, progressColor: progressColor, ), const SizedBox(height: 4,), StaticsTextComponent(textName, false), ], ), ); } }