Dn-a / flutter_inner_drawer

Inner Drawer is an easy way to create an internal side section (left/right) where you can insert a list-menu or other.
https://pub.dartlang.org/packages/flutter_inner_drawer
MIT License
514 stars 129 forks source link

type 'List<Widget?>' is not a subtype of type 'List<Widget>' in type cast #74

Closed hukjordanjanaq closed 2 years ago

hukjordanjanaq commented 3 years ago

Hi, i'm testing with the example in the documentation but I'm getting error.

Captura de Pantalla 2021-09-08 a la(s) 11 42 09
swiftdev69 commented 3 years ago

hello @jordanjanaq did you get any solutiion?

hukjordanjanaq commented 3 years ago

Hi, i used a pull request. In the pubspec.yaml, i change for this: flutter_inner_drawer: git: url: https://github.com/kenjishiromajp/flutter_inner_drawer ref: kenjishiromajp-update-for-2.12-null-safety-casting

Captura de Pantalla 2021-09-11 a la(s) 10 05 19

swiftdev69 commented 3 years ago

Hi, i used a pull request. In the pubspec.yaml, i change for this: flutter_inner_drawer: git: url: https://github.com/kenjishiromajp/flutter_inner_drawer ref: kenjishiromajp-update-for-2.12-null-safety-casting

Captura de Pantalla 2021-09-11 a la(s) 10 05 19

This worked for me.

Wentris71 commented 3 years ago

thx, solution worked like a charm.

kksys commented 2 years ago

I've encountered this issue. And, this solution is worked for me.

yeasin50 commented 2 years ago

The issue is coming from

https://github.com/Dn-a/flutter_inner_drawer/blob/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/lib/inner_drawer.dart#L435-L437

children doesn't accept any nullable widget.

Also _trigger(..) method returning nullable widget

https://github.com/Dn-a/flutter_inner_drawer/blob/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/lib/inner_drawer.dart#L544-L563 And It is being used on https://github.com/Dn-a/flutter_inner_drawer/blob/9dbe02e648dd9db8ec018a0ce4b1ca3839cbc0b3/lib/inner_drawer.dart#L600-L620

While the children can't be null anymore, we can remove or replace _trigger() widget when it returns null.