Home > Software engineering >  Is it possible to Repeat Icons in flutter like ImageRepeat
Is it possible to Repeat Icons in flutter like ImageRepeat

Time:04-22

I am wondering if it is possible to repeat an actual icon widget like the image I have attached.

Currently getting this result using ImageRepeat but would like to be able to use and actual icon so it can be modular and the icon can change.

( the repeating image can currently change but I don't want to have to create 100 images of icons. )

Current Solution:

SizedBox.expand(
 child: Image.asset(
  _backGroundImage,
  repeat: ImageRepeat.repeat,
)), 

Desired Result using ImageRepeat.repeat

CodePudding user response:

try Wrap:

Container(
        width: MediaQuery.of(context).size.width,
        height: MediaQuery.of(context).size.height,
        color: Colors.orange,
        child: Wrap(
          children: List<Widget>.generate(2000, (int index) {
            return Icon(Icons.add);
          }),
        ),
      ),
  • Related