renderPercentage method
dynamic
renderPercentage(
{ - Widget? child,
})
Implementation
renderPercentage({Widget? child}) {
double? mWidth;
double? mHeight;
if (base.getTypeOf(mStyles.width) == '%') {
mWidth =
double.parse((mStyles.width as String).replaceAll('%', '')) / 100;
}
if (base.getTypeOf(mStyles.height) == '%') {
mHeight =
double.parse((mStyles.height as String).replaceAll('%', '')) / 100;
}
return FractionallySizedBox(
widthFactor: mWidth ?? null,
heightFactor: mHeight ?? null,
child: child,
);
}