I'm using Positioned
widget nested in Stack
widget and giving it the values right and bottom.
It worked nicely until I tried it on other screens with different sizes as I should've expected.
After Googling and stackoverflow-ing all the answers I've found advise to calculate the position depending on the device screen width
and height
.
I'm wondering if there is any way to position a widget relatively to its parent or to the stack widget - something like position: relative
; in CSS -
Stack(
fit: StackFit.expand,
children: <Widget>[
Positioned(
child: Icon(
Icons.touch_app,
color: Colors.blueAccent,
),
right: 110.0,
bottom: 300.0,
),
GestureDetector(
child: Chart(occData),
onTap: _setDetailedView,
),
],
)