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

_CastError when not specifying 'children' member #2

Open
Kanjuro opened this issue Nov 23, 2021 · 0 comments
Open

_CastError when not specifying 'children' member #2

Kanjuro opened this issue Nov 23, 2021 · 0 comments

Comments

@Kanjuro
Copy link

Kanjuro commented Nov 23, 2021

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant