DefaultTextStyle.fallback constructor Null safety

const DefaultTextStyle.fallback(
  1. {Key? key}

A const-constructable default text style that provides fallback values.

Returned from of when the given BuildContext doesn't have an enclosing default text style.

This constructor creates a DefaultTextStyle with an invalid child, which means the constructed value cannot be incorporated into the tree.


const DefaultTextStyle.fallback({ super.key })
  : style = const TextStyle(),
    textAlign = null,
    softWrap = true,
    maxLines = null,
    overflow = TextOverflow.clip,
    textWidthBasis = TextWidthBasis.parent,
    textHeightBehavior = null,
    super(child: const _NullWidget());