Content-Length: 312914 | pFad | http://github.com/flutter/flutter/issues/171664

D5 RenderBox was not laid out: _RenderSingleChildViewport error in ListView inside Column · Issue #171664 · flutter/flutter · GitHub
Skip to content

RenderBox was not laid out: _RenderSingleChildViewport error in ListView inside Column #171664

@zihadsikder

Description

@zihadsikder

Steps to reproduce

  1. Create a Column
  2. Add ListView.builder inside Column without height constraint
  3. Run app on any device/emulator
  4. Observe error

Expected results

The app should render the list view inside column without any layout error.

Actual results

RenderBox was not laid out: _RenderSingleChildViewport error thrown at runtime.

Code sample

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(home: MyHomePage());
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Column(
        children: [
          SizedBox(
            height: 230.h,
            child: ListView.builder(
              scrollDirection: Axis.horizontal,
              itemCount: homeController.popularProducts.length,
              itemBuilder: (context, index) {
                final product = homeController.popularProducts[index];
                return Container(
                  margin: EdgeInsets.only(right: 15.w),
                  width: 150.w,
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      // product widget...
                    ],
                  ),
                );
              },
            ),
          ),
        ],
      ),
    );
  }
}

Screenshots or Video

Image

Logs

════════ Exception caught by rendering library ═════════════════════════════════
RenderBox was not laid out: _RenderSingleChildViewport#...
...

Flutter Doctor output

Doctor output
[
[✓] Flutter (Channel stable, 3.32.4, on macOS 15.4.1 24E263 darwin-arm64, locale en-US) [520ms]
    • Flutter version 3.32.4 on channel stable at /Users/zihad/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 6fba2447e9 (3 weeks ago), 2025-06-12 19:03:56 -0700
    • Engine revision 8cd19e509d
    • Dart version 3.8.1
    • DevTools version 2.45.1

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1) [2.5s]
    • Android SDK at /Users/zihad/Library/Android/sdk
    • Platform android-35, build-tools 35.0.1
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.2) [2.2s]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16C5032a
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [9ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.1) [9ms]
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)

[✓] VS Code (version 1.97.2) [8ms]
    • VS Code at /Users/zihad/Downloads/Visual Studio Code.app/Contents
    • Flutter extension version 3.114.0

[✓] Connected device (4 available) [6.8s]
    • sdk gphone64 arm64 (mobile) • emulator-5554                        • android-arm64  • Android 15 (API 35) (emulator)
    • iPhone 16 (mobile)          • 92AE1B25-D01C-4A97-837C-9E21A81F4F26 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-18-3 (simulator)
    • macOS (desktop)             • macos                                • darwin-arm64   • macOS 15.4.1 24E263 darwin-arm64
    • Chrome (web)                • chrome                               • web-javascript • Google Chrome 137.0.7151.122
    ! Error: Browsing on the local area network for Md’s iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as
      this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
    ! Error: Browsing on the local area network for Musfiqur’s iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network
      as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
    ! Error: Browsing on the local area network for iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this
      Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources [1,444ms]
    • All expected network resources are available.

• No issues found!
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    r: invalidIssue is closed as not valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: http://github.com/flutter/flutter/issues/171664

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy