Sorry because I don't know how to explain this behavior exactly in English. So I give a gif image for easy understanding.
I want to avoid/ prevent seeing white background when scrolling over the top of SingleChildScrollView.
These are my code for this behavior:
@override
Widget build(BuildContext context) {
return Scaffold(
body: SingleChildScrollView(
child: Container(
color: Colors.amberAccent,
height: LayoutUtils.getScreenHeight(context) + 1000, // Just get screen height and plus 1000 units
)),
);
Does anyone know how to fix it? And please correct my question to make sense. Thank you in advance.
Kaushik Chandru
18k4 gold badges24 silver badges44 bronze badges
asked Jul 10, 2022 at 13:53
Quang Khải Đàm
6332 gold badges10 silver badges27 bronze badges
1 Answer 1
To the SingleChildScrollView add
physics : ClampingScrollPhysics(),
For more info about scrollphysics check this
answered Jul 10, 2022 at 14:14
Kaushik Chandru
18k4 gold badges24 silver badges44 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
Explore related questions
See similar questions with these tags.
lang-dart
Scaffoldbackground color to the sameColors.amberAccent?physics : ClampingScrollPhysics()as @Kaushik Chandru suggest and it work like a charm.