DynamicFontsModel.fromFonts constructor

DynamicFontsModel.fromFonts(
  1. double inputSize
)

Returns a DynamicFontsModel from the given inputSize.

Implementation

factory DynamicFontsModel.fromFonts(double inputSize) {
  Color primFntColor;
  Color secFntColor;
  double tlSize = inputSize;
  double headSize = tlSize - 5;
  double txtSize = tlSize - 20;

  if (SettingsSharedPref.getTheme() == 'dark'
      ) {
    primFntColor = Colors.white;
    secFntColor = Colors.black;
  } else {
    primFntColor = Colors.black;
    secFntColor = Colors.white;
  }
  return DynamicFontsModel(
    primaryFontColor: primFntColor,
    secondaryFontColor: secFntColor,
    titleSize: tlSize,
    headingSize: headSize,
    textSize: txtSize,
  );
}