I put an Image in a Stack because I want to have a x-Button in the upper right corner. But I don't know, how to set the image like this.
This is the code:
list.add(Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
child: Stack(children: [
Flexible(
child:
Image.network("${globals.api}/download/$nextPicture")),
Align(
alignment: const Alignment(0.95, -0.95),
child: IconButton(
icon:
const Icon(Icons.cancel, color: Colors.white, size: 25),
onPressed: () {
deleteSelectedImageRemote(nextPicture);
},
),
)
]),
)
]));
Do you have any suggestions, how to make it look like the Details page?
Thank you very much!
CodePudding user response:
try this
list.add(Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
child: Stack(children: [
Container(
width:200,
height:200,
child:
Image.network("${globals.api}/download/$nextPicture")),
Align(
alignment: const Alignment(0.95, -0.95),
child: IconButton(
icon:
const Icon(Icons.cancel, color: Colors.white, size: 25),
onPressed: () {
deleteSelectedImageRemote(nextPicture);
},
),
)
]),
)
]));