'how to align image top right to the screen in flutter
I tried align top right the image, but that dosen't work, also I tried to do the positioned widget that also didn't work
Column(
children: [
Image.asset(
'assets/design_el_1.png',
alignment: Alignment.topRight
),
other elements
other elements
other elements
]
);
how can I align the image to top right of the screen?
i want to align the lite purple element
Solution 1:[1]
you have to use Align Widget like the code given below
Align(
alignment: Alignment.topRight,
child: Image.asset("Assets/user.png"))
Solution 2:[2]
Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Image.asset(
'assets/images/onboard.jpeg',
width: 200,
height: 100,
),
],
),
],
)
Output:
Solution 3:[3]
Wrap your Image.asset with Align widget and use it's alignment: Alignment.centerRight property. Your image will surely align right side.
Align(
alignment: Alignment.centerRight,
child: Image.asset("Assets/user.png"))
P.S :- You may use your asset image instead of my image :)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Sneha G Sneha |
| Solution 2 | |
| Solution 3 | Vaidarbhi |



