getTextStyleFromName function

TextStyle getTextStyleFromName(
  1. BuildContext context,
  2. String textStyleName
)

Implementation

TextStyle getTextStyleFromName(BuildContext context, String textStyleName) {
  final model = context.stylesState.textStyles[textStyleName]!;
  return TextStyle(
    fontFamily: model.fontFamily,
    fontSize: model.fontSize.size,
    fontWeight: model.fontWeight.get,
  );
  /*switch (textStyleName) {
    case 'Hero':
      return Theme.of(context).textTheme.displayLarge!;
    case 'Headline':
      return Theme.of(context).textTheme.headlineLarge!;
    case 'Important':
      return Theme.of(context).textTheme.titleLarge!;
    case 'Paragraph':
      return Theme.of(context).textTheme.bodyLarge!;
    case 'Detail':
      return Theme.of(context).textTheme.labelLarge!;
    default:
      return Theme.of(context).textTheme.bodyLarge!;
  }*/
}