buildChart method
Implementation
@override
Widget buildChart() {
// Define default theme data
const defaultThemeData = ChartThemeData(
backgroundColor: Colors.white,
labelStyle: TextStyle(color: Colors.black, fontSize: 16),
valueStyle: TextStyle(
fontSize: 24, fontWeight: FontWeight.bold, color: Colors.red),
unitStyle: TextStyle(color: Colors.grey, fontSize: 14),
);
TextStyle labelStyle = themeData?.labelStyle ?? defaultThemeData.labelStyle;
TextStyle valueStyle = themeData?.valueStyle ?? defaultThemeData.valueStyle;
return ChartCard(
themeData: themeData ?? defaultThemeData,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
FittedBox(fit: BoxFit.contain, child: Text(label, style: labelStyle)),
AnimatedCountdownWidget(
initialTime: timeRemaining,
animate: animate,
textStyle: valueStyle),
FittedBox(fit: BoxFit.contain, child: Text(unit, style: labelStyle))
],
),
);
}