Skip to content

Exception "The getter 'itemHeights' was called on null" when using AutoSizeText with DropdownButton #52

@migalv

Description

@migalv

Create an app with the following constraints:

  1. Have a DropdownButton where the DropdownMenuItems have as a child a AutoSizeText
  2. Add a Textfield somewhere

Steps to reproduce:

  1. Click on the Dropdown
  2. Click on the TextField

Exception:

════════ Exception caught by rendering library ═════════════════════════════════════════════════════
The following NoSuchMethodError was thrown during performLayout():
The getter 'itemHeights' was called on null.
Receiver: null
Tried calling: itemHeights

The relevant error-causing widget was: 
  MaterialApp file:///D:/Projects/AndroidStudioProjects/chaldea/lib/main.dart:20:12
When the exception was thrown, this was the stack: 
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
#1      _DropdownButtonState._handleTap.<anonymous closure> (package:flutter/src/material/dropdown.dart:1146:26)
#2      _RenderMenuItem.performLayout (package:flutter/src/material/dropdown.dart:617:5)
#3      RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
#4      RenderPadding.performLayout (package:flutter/src/rendering/shifted_box.dart:206:11)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions