LCOV - code coverage report
Current view: top level - lib/charts - bar_vertical_group.dart Coverage Total Hit
Test: lcov.info Lines: 100.0 % 16 16
Test Date: 2026-11-14 15:08:11 Functions: - 0 0

            Line data    Source code
       1              : // Copyright 2023 The terCAD team. All rights reserved.
       2              : // Use of this source code is governed by a CC BY-NC-ND 4.0 license that can be found in the LICENSE file.
       3              : 
       4              : import 'package:material_ui/material_ui.dart';
       5              : 
       6              : class BarVerticalGroup extends StatelessWidget {
       7              :   final List<Color> color;
       8              :   final List<double> value;
       9              :   final double height;
      10              :   final double width;
      11              : 
      12            1 :   const BarVerticalGroup({
      13              :     super.key,
      14              :     required this.color,
      15              :     required this.value,
      16              :     this.height = 32,
      17              :     this.width = 4,
      18              :   });
      19              : 
      20            1 :   @override
      21              :   Widget build(BuildContext context) {
      22            4 :     double left = value.fold(1.0, (v, e) => v - e);
      23            3 :     value.insert(0, left < 0 ? 0.0 : left);
      24            2 :     color.insert(0, Colors.grey);
      25            1 :     return SizedBox(
      26            1 :       width: width,
      27            1 :       height: height,
      28            1 :       child: ListView.builder(
      29            2 :         itemCount: value.length,
      30            1 :         itemBuilder: (context, index) {
      31            1 :           return Container(
      32            2 :             color: color[index],
      33            1 :             child: SizedBox(
      34            1 :               width: width,
      35            7 :               height: height * (value[index] > 0 ? value[index] : 0.0),
      36              :             ),
      37              :           );
      38              :         },
      39              :       ),
      40              :     );
      41              :   }
      42              : }
        

Generated by: LCOV version 2.0-1