title: Unhandled Exception: type 'Future<dynamic>' is not a subtype of type 'PersistentBottomSheetController<dynamic>' in type cast
body: <p>I am now converting my codes into null safety. So now I have done this changes to my codes. Initially the return type was void then I have change into Future? but yet I do get the the error on this <code>Unhandled Exception: type 'Future&lt;dynamic&gt;' is not a subtype of type 'PersistentBottomSheetController&lt;dynamic&gt;' in type cast</code>. What are the other changes I can do to fix it.</p>
  <pre><code>Future&lt;dynamic&gt;? _showBottomSheet(
        context, MapDashboardDetails details) async {
     
      //_showPersBottomSheetCallBack = null;
      showingBottomSheet = true;
  
      _controller = _scaffoldKey.currentState!
          .showBottomSheet((context) {
            return VBottomSheet(
              details: details,            
              onCloseTapped: () {
                Navigator.of(context).pop();
              },
            );
          })
          .closed
          .whenComplete(() {
            if (mounted) {
              showingBottomSheet = false;
              _showPersBottomSheetCallBack = _showBottomSheet;
            }
          }) as PersistentBottomSheetController;
      return null;
    }
  </code></pre>
  <p>Here is how I am calling it. Even this was before void and then I added the  Future and async but yet not able to resolve it.</p>
  <pre><code>Future&lt;dynamic&gt; _onMarkerTapped(MapDashboardDetails details) async {
    
      if (showingBottomSheet) {
        Navigator.of(context).pop();
        showingBottomSheet = false;
      }   
      _showBottomSheet(context, details);
    }
  </code></pre>