Documentation

Trace: Using darkmode

(flutterui)

Using darkmode

If you want to build a different widget tree in dark mode, just do following:

screenBuilder: (context, screen) => Container(
  decoration: BoxDecoration(
    image: DecorationImage(
      fit: BoxFit.fill,
      image: AssetImage(
        Theme.of(context).brightness == Brightness.light
            ? 'assets/images/background.png'
            : 'assets/images/background_dark.png',
      ),
    ),
  ),
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information