I want to achieve the exact behavior like below link in Flutter:
https://jsfiddle.net/6vzcosyj/
html:
<html>
<body>
<div class="container">
<div class="content">
I am content<br>
I am content<br>I am content<br>I am content<br>I am content<br>
I am content<br>
I am content<br>I am content<br>I am content<br>I am content<br>
</div>
<div class="footer">
I am footer
</div>
</div>
</body>
</html>
css:
.container {
height: 100vh;
display: flex;
flex-direction: column;
}
.content {
}
.footer {
margin-top: auto;
}
In above link, if there is space, then content will always try to expand it self, and the footer is always in the bottom. But if there is not enough space, the content and footer can be scroll and the footer will no longer stick at the bottom.
You can try to adjust the size of the window in the above link to get what I want to achieve.
I cannot make this behavior in Flutter, so any advice?
Thanks.
3
Answers
I finally found a solution:
https://stackoverflow.com/a/68572964/13774019
Here is how to do it in Flutter :