body2 static method

Widget body2(
  1. String text, {
  2. BuildContext? context,
  3. TextAlign? textAlign,
  4. Key? key,
  5. Color? color,
  6. TextStyle? style,
})

Implementation

static Widget body2(
  String text, {
  BuildContext? context,
  TextAlign? textAlign,
  Key? key,
  Color? color,
  TextStyle? style,
}) {
  assert(color == null || style == null);
  if (context == null) {
    return Builder(
      builder: (context) {
        final GBThemeData themeData = GBTheme.of(context);
        return GBText(
          text,
          key: key,
          textAlign: textAlign,
          style: color != null
              ? themeData.textTheme.bodyMedium!.merge(TextStyle(
                  color: color,
                ))
              : themeData.textTheme.bodyMedium!.merge(style),
        );
      },
    );
  }
  final GBThemeData themeData = GBTheme.of(context);
  return GBText(
    text,
    key: key,
    style: color != null
        ? themeData.textTheme.bodyMedium!.merge(TextStyle(
            color: color,
          ))
        : themeData.textTheme.bodyMedium!.merge(style),
  );
}