Issue
How to move floatingactionbutton like in the picture?
Solution
You need to use floatingActionButtonLocation
on Scaffold
. While I can't find partial positioning method, you can create a custom class by extending FloatingActionButtonLocation
class CustomFabLoc extends FloatingActionButtonLocation {
@override
Offset getOffset(ScaffoldPrelayoutGeometry scaffoldGeometry) {
return Offset(
scaffoldGeometry.scaffoldSize.width * .25, ///customize here
scaffoldGeometry.scaffoldSize.height - kToolbarHeight,
);
}
}
And use
return Scaffold(
floatingActionButtonLocation: CustomFabLoc(),
floatingActionButton: FloatingActionButton(
onPressed: () {},
),
);
Answered By - Yeasin Sheikh
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.