Search code examples
flutterdartoverflow

Flutter Bottom Overflowed by 143 pixels


Im trying to build a sushi app, but when i rotate my phone, theres black and yellow line, it says "Bottom Overflowed by 143 pixels"

app screenshot

code

I tried some tutorial on youtube, but then the result is blank


Solution

  • If you use SingleChildScrollView then it solve your problem but if Column/Row widget contain any widget which has infinite height then your screen show a blank screen. So please check is there any Expanded/Flexible widget in your column widget.

    Better paste your full code so that I can identify the problem

    UPDATED:

    I saw your code I think this is the problem

      Expanded( // Use SizedBox and set fixed height
                child: ListView.builder(
                  scrollDirection: Axis.horizontal,
                  itemCount: foodMenu.length,
                  itemBuilder: (context, index) => FoodTile(
                    food: foodMenu[index],
                    onTap: () => navigateToFoodDetails(index),
                  ),
                ),
              ),
    

    if you want whole screen scroll then --> wrap your Column with SingleChildScrollView --> Remove Expanded and use SizedBox with a fixed height