Repeat background pattern image in flutter

Viewed 683

I'm new to Flutter and currently try to make a website. I have a pattern image like this: enter image description here

Now I wanna set it to be background of my website with this code:

import 'package:flutter/material.dart';

class HomeScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    Size size = MediaQuery.of(context).size;
    return Container(
      height: size.height,
      width: size.width,
      decoration: BoxDecoration(
          image: DecorationImage(
              fit: BoxFit.cover,
              image: AssetImage("assets/images/double-bubble-dark.png"))),
    );
  }
}

But here the result: enter image description here

How can I make it fit with & responsive with the browser window instead of scale the image?

1 Answers

Just use

Image.asset(
    "assets/images/double-bubble-dark.png",
    repeat: ImageRepeat.repeat,
  )
Related