The correct way is to check first whether the reLoadPage variable is bool or not so that you can check its type.
final reLoadPage = null; if((reLoadPage is bool) ? reLoadPage : false){ print("Can reLoadPage"); } else{ print("Can Not reLoadPage"); }