import 'package:common_pub/ui/history_detail/sum_bar_chart.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

import 'data_detail_controller.dart';

class DataDetailBarCharts extends GetView<DataDetailController> {
  const DataDetailBarCharts({super.key});

  @override
  Widget build(BuildContext context) {
    final detail = controller.selectedDetail.value!;

    return Container(
      width: double.infinity,
      padding: const EdgeInsets.all(2.8),
      decoration: BoxDecoration(
          color: const Color(0xffe0e0e0),
          borderRadius: BorderRadius.circular(3.56)),
      child: Column(children: [
        BarChartHrPRange(hrPercentRangeList: detail.hrPercentRangeList),
        const SizedBox(height: 2),
        BarChartPaceDistance(
            paceDistancePercentRangeList: detail.paceDistancePercentRangeList,
            distance: detail.distance),
        const SizedBox(height: 2),
        BarChartPaceTime(
            paceTimePercentRangeList: detail.paceTimePercentRangeList,
            duration: detail.duration)
      ]),
    );
  }
}
