title static method

String? title(
  1. BuildContext context
)

Returns the title of the MaterialApp.

Used to set title on pages to same one that is defined in each example as its app name. Handy as we only need to update in one place, where it belongs and no need to put it as a const somewhere and no need to pass it around via a title prop either. Also used in the showAppAboutDialog About box as app name.

Implementation

static String? title(BuildContext context) => (context as Element).findAncestorWidgetOfExactType<MaterialApp>()!.title;