StatelessWidget

A StatelessWidget is a widget with no internal state: its rendering depends only on its parameters, set at construction. Its build method returns the widget tree to display. It suits display elements that do not change by themselves.

Example

class Titre extends StatelessWidget {
  const Titre(this.texte, {super.key});
  final String texte;
  @override
  Widget build(BuildContext c) => Text(texte);
}

Related concepts

The whole glossary