Dynamic app title in Flutter

The app title can be dynamically changed on all platforms using SystemChrome.setApplicationSwitcherDescription :

@override Widget build(BuildContext context) { SystemChrome.setApplicationSwitcherDescription(ApplicationSwitcherDescription( label: 'Dynamic web app title', primaryColor: Theme.of(context).primaryColor.value, )); return Container(...); }

SystemChrome becomes available with import 'package:flutter/services.dart'; and you want to call setApplicationSwitcherDescription in your build method.

This is also how Title does it (see source code), which is the widget used by WidgetsApp , MaterialApp , etc.

Thus, you can also use a Title widget instead of accessing SystemChrome yourself:

@override Widget build(Context context) { return Title( label: 'Dynamic app title', primaryColor: Theme.of(context).primaryColor.value, child: .., ); }

label

The label parameter is pretty straight forward: it maps exactly to what title is in your MaterialApp and just a String .

primaryColor

The primaryColor will determine the color the system might use in the application switcher, e.g. the title bar color in recents on Android.

This is an int instead of a Color , which is why you need to call Color.value to convert your primary color to an integer.

Interference with other Title s