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
516 stars 130 forks source link

Fix type cast using 'whereType' instead of 'as' operator #73

Open bikcrum opened 3 years ago

bikcrum commented 3 years ago

Description

This is the minimal fix for typecasting error caused in null safety mode.

Implementation:

Issue:

<Widget?>[....].where((a) => a != null).toList() as List<Widget>

// causes type 'List<Widget?>' is not a subtype of type 'List<Widget>' in type cast

Fix:

<Widget?>[....].where((a) => a != null).whereType<Widget>().toList()

Effective line numbers: [435-437], [600-620]

Related Issues

69 #70 #71 #72

housecode commented 3 years ago

is it ready to use at production ?

definitelyme commented 3 years ago

@Dn-a can this be merged?