CenterText constructor

const CenterText(
  1. String text, {
  2. Key? key,
})

Display a text at the center of a widget.

The font color is in gray, that no matter light mode (background white) or dark mode (background black), the text is likely to be visible.

  1. It's usually only used for debug propose or a placeholder as child.
  2. There's wrapper to ensure the inherit requirement of the text.
  3. Don't use for production if you want to improve performance.

Implementation

const CenterText(this.text, {super.key});