caption static method

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

Implementation

static Widget caption(
  String? text, {
  BuildContext? context,
  TextAlign? textAlign,
  Key? key,
  Color? color,
  TextStyle? style,
}) {
  assert(color == null || style == null);
  if (context == null) {
    return Builder(
      builder: (ctx) => caption(
        text,
        context: ctx,
        textAlign: textAlign,
        key: key,
        color: color,
        style: style,
      ),
    );
  }
  return Text(
    text ?? '',
    key: key,
    textAlign: textAlign,
    style: _resolveStyle(
        context, Theme.of(context).textTheme.bodySmall, color, style),
  );
}