Documentation

(flutterui)

Background customizing

This is an old revision of the document!


It's easy to globally change the background of application overview, menu or screens. Simply provide a backgroundBuilder in your main:

void main() async {
  await FlutterUI.start(
    FlutterUI(
      ...,
      backgroundBuilder: (context, type) {
        if (type == BackgroundType.WorkScreen) {
          if (IConfigService().offline.value)
          {
            //return null;
          }
        }
 
        return Container(
          decoration: BoxDecoration(
            color: Colors.white,
            image: DecorationImage(
              fit: BoxFit.fill,
              image: AssetImage('assets/images/custom_screen_background.jpg'),
            ),
          )
        );
      },
      safeAreaColorBuilder: (context) => Colors.white,
    ),
  );
}

In this example, we show a background image and also show safe-areas in white.

This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information