TextStyle _convertTextStyle(
bool isHidden, BuildContext context, common.TextStyleSpec? textStyle) {
Color? color = textStyle?.color != null
? ColorUtil.toDartColor(textStyle!.color!)
: null;
if (isHidden) {
// Use a default color for hidden legend entries if none is provided.
color ??= Theme.of(context).textTheme.bodyLarge!.color; // here replace "body1" by bodyLarge on somme new parameters
color = color!.withOpacity(0.26);
}
return new TextStyle(
inherit: true,
fontFamily: textStyle?.fontFamily,
fontSize: textStyle?.fontSize != null
? textStyle!.fontSize!.toDouble()
: null,
color: color);
}