irongirl
irongirl

Reputation: 935

How to Overlap Two Widgets in Flutter?

Expected output:

This is a combination of a circle avatar with the color and and image on top of it

This is a combination of a circle avatar with the color and and image on top of it.

Current output:

enter image description here

Code:

 leading: CircleAvatar(backgroundColor: contentWithIcon[value]['color']),

How do i overlap both on top of each other?

image path:

assets/img/forex.png 

Upvotes: 1

Views: 1033

Answers (1)

Alexander Kwint
Alexander Kwint

Reputation: 136

You don't need to overlap them or use the stack widget, CircleAvatar will handle this for you.

CircleAvatar(backgroundColor: contentWithIcon[value]['color'], 
             child: Image.asset("assets/img/forex.png "),)

be sure assets folder is added in pubspec.yaml

  assets:
    - assets/

Upvotes: 6

Related Questions