Using a SVG as a background image for a Container

The exact way to use an SvgPicture is like this:

Widget build(BuildContext context) {

  return Scaffold(
    body: Stack(
      children: <Widget>[
        SvgPicture.asset(
          'assets/images/splash/background.svg',
          alignment: Alignment.center,
          width: MediaQuery.of(context).size.width,
          height: MediaQuery.of(context).size.height,
        ),
        Container(
          child: Column(
            children: <Widget>[Expanded(child: _createLogo())],
          ),
        ),
      ],
    ),
  );
}

how about using a stack() and build everything on top of that. That is how I have done it with just an image as a background for the full viewport.

Tags:

Dart

Flutter