Skip to content
This repository was archived by the owner on Sep 9, 2024. It is now read-only.
This repository was archived by the owner on Sep 9, 2024. It is now read-only.

_CastError when not specifying 'children' member #2

@Kanjuro

Description

@Kanjuro

When instantiating the RoundedExpansionTile class without specifying the children member, a _CastError is thrown:

The following _CastError was thrown building RoundedExpansionTile(dirty, dependencies: [_EffectiveTickerMode], state: _RoundedExpansionTileState#b73e5(tickers: tracking 2 tickers)):
Null check operator used on a null value

When instantiating the original ExpansionTile class, one can omit the children member at first, so I thought it would be nice to have the same behaviour. The error can easily be prevented by changing

ListView(
  ...
  children: widget.children!,
  ...
),

to

ListView(
  ...
  children: widget.children ?? [],
  ...
),

in line 198 of rounded_expansion_tile.dart.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions