Potential Bug: Unable to Call PersistentBottomSheetController.setState() using Null Safety

Hi , I have been working on an app that I would like to deploy in the near future. I decided to switch over to null safety as recommended and got everything working well except the fact that I cannot call PersistentBottomSheetController.setState() with null safety enabled. The reason I need to to call the setState() of the PersistentBottomSheetController is because I need to gracefully update the bottomBar while it is being shown without closing and reopening it. This means that I need to store the PersistentBottomSheetController. However, it states that I must initialize the controller and this would mean showing the bottomBar at the start of App when it's not necessary. I decided to try this approach but it disallows the calling of its setState. It gives the error "the function can't be unconditionally invoked because it can be 'null'." and if I use the null check "!" it says the exact same thing although I was initialized it as a non nullable variable. This should not be the case.
If I try the approach of declaring the PersistentBottomSheetController as a nullable it gives me the exact same error. Therefore, there is something internally that's preventing me from calling setState on a PersistentBottomSheetController under the null safety environment. I tried several scenarios and it seems to be a potential bug. It's rather important to be able to call setState for a stateful builder.
Steps to Reproduce

My App is a rather too large and complex Bible app to be pasted here so I tested a scenario using a default flutter base project. Where whenever the FloatingActionButton is clicked it increments the counter that is shown in the bottom bar that ideally should be shown the first time the FloatingActionButton clicked and the counter inside it is updated each time without having to close and reopen the bottom bar. However, I am unable to access PersistentBottomSheetController.setState() due to null safety error. Please assist. Maybe I am doing something wrong? Please see code in the code section below.

Execute flutter run on the code sample
√  Built build\app\outputs\flutter-apk\app-debug.apk.
Installing ..\build\app\outputs\flutter-apk\app.apk...           1,106ms
Syncing files to device sdk gphone x86 arm...                       90ms

Flutter run key commands.
r Hot reload.
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).
Running with sound null safety

...
Please see description above.
...
Build error when calling PersistentBottomSheetController.setState()
Expected results:
Updated bottom bar state with counter
Actual results:

code sample
import 'package:flutter/material.dart';
PersistentBottomSheetController? _controller;

void main() async {

  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        // This is the theme of your application.
        //
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then, without quitting the app, try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",
        // or simply save your changes to "hot reload" in a Flutter IDE).
        // Notice that the counter didn't reset back to zero; the application
        // is not restarted.
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  // This widget is the home page of your application. It is stateful, meaning
  // that it has a State object (defined below) that contains fields that affect
  // how it looks.

  // This class is the configuration for the state. It holds the values (in this
  // case the title) provided by the parent (in this case the App widget) and
  // used by the build method of the State. Fields in a Widget subclass are
  // always marked "final".

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;
  GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
  bool bottomSheetShown = false;

  @override
  void initState() {
    super.initState();

  }

  void _incrementCounter() {
    setState(() {
      // This call to setState tells the Flutter framework that something has
      // changed in this State, which causes it to rerun the build method below
      // so that the display can reflect the updated values. If we changed
      // _counter without calling setState(), then the build method would not be
      // called again, and so nothing would appear to happen.
      _counter++;
    });
  }

  void _versesBottomSheet(context)  {

    var theScaffold = scaffoldKey.currentState;

    _controller = theScaffold!.showBottomSheet((BuildContext context) {
      return StatefulBuilder(builder: (BuildContext bc, StateSetter setState) {
        return Container(
          color: Colors.grey,
          width: double.infinity,
          height: 100,
          child:  Text('Toggle count: ${_counter.toString()}' ),
        );
      });
    })
      ..closed.then((value) {
        //_controller = null;
      });

    bottomSheetShown = true;
  }

  @override
  Widget build(BuildContext context) {
    // This method is rerun every time setState is called, for instance as done
    // by the _incrementCounter method above.
    //
    // The Flutter framework has been optimized to make rerunning build methods
    // fast, so that you can just rebuild anything that needs updating rather
    // than having to individually change instances of widgets.
    return Scaffold(
      key: scaffoldKey,
      appBar: AppBar(
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        title: Text(widget.title),
      ),
      body: Center(
        // Center is a layout widget. It takes a single child and positions it
        // in the middle of the parent.
        child: Column(
          // Column is also a layout widget. It takes a list of children and
          // arranges them vertically. By default, it sizes itself to fit its
          // children horizontally, and tries to be as tall as its parent.
          //
          // Invoke "debug painting" (press "p" in the console, choose the
          // "Toggle Debug Paint" action from the Flutter Inspector in Android
          // Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
          // to see the wireframe for each widget.
          //
          // Column has various properties to control how it sizes itself and
          // how it positions its children. Here we use mainAxisAlignment to
          // center the children vertically; the main axis here is the vertical
          // axis because Columns are vertical (the cross axis would be
          // horizontal).
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text(
              'Bottom sheet shown?',
            ),
            Text(
              bottomSheetShown.toString(),
              style: Theme.of(context).textTheme.headline4,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () {
          _incrementCounter();
          if( bottomSheetShown ==  false){
            _versesBottomSheet(context);
          }else{
            _controller!.setState((){});
           // _controller!.close();
            //bottomSheetShown = false;
          }
          setState(() {

          });

        },
        tooltip: 'Toggle',
        child: const Icon(Icons.toggle_on),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        // This is the theme of your application.
        //
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then, without quitting the app, try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",
        // or simply save your changes to "hot reload" in a Flutter IDE).
        // Notice that the counter didn't reset back to zero; the application
        // is not restarted.
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  // This widget is the home page of your application. It is stateful, meaning
  // that it has a State object (defined below) that contains fields that affect
  // how it looks.

  // This class is the configuration for the state. It holds the values (in this
  // case the title) provided by the parent (in this case the App widget) and
  // used by the build method of the State. Fields in a Widget subclass are
  // always marked "final".

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      // This call to setState tells the Flutter framework that something has
      // changed in this State, which causes it to rerun the build method below
      // so that the display can reflect the updated values. If we changed
      // _counter without calling setState(), then the build method would not be
      // called again, and so nothing would appear to happen.
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    // This method is rerun every time setState is called, for instance as done
    // by the _incrementCounter method above.
    //
    // The Flutter framework has been optimized to make rerunning build methods
    // fast, so that you can just rebuild anything that needs updating rather
    // than having to individually change instances of widgets.
    return Scaffold(
      appBar: AppBar(
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        title: Text(widget.title),
      ),
      body: Center(
        // Center is a layout widget. It takes a single child and positions it
        // in the middle of the parent.
        child: Column(
          // Column is also a layout widget. It takes a list of children and
          // arranges them vertically. By default, it sizes itself to fit its
          // children horizontally, and tries to be as tall as its parent.
          //
          // Invoke "debug painting" (press "p" in the console, choose the
          // "Toggle Debug Paint" action from the Flutter Inspector in Android
          // Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
          // to see the wireframe for each widget.
          //
          // Column has various properties to control how it sizes itself and
          // how it positions its children. Here we use mainAxisAlignment to
          // center the children vertically; the main axis here is the vertical
          // axis because Columns are vertical (the cross axis would be
          // horizontal).
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headline4,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

Logs

[  +66 ms] executing: [C:\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +139 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[   +1 ms] 85684f9300908116a78138ea4c6036c35c9a1236
[        ] executing: [C:\flutter/] git tag --points-at 85684f9300908116a78138ea4c6036c35c9a1236
[ +142 ms] Exit code 0 from: git tag --points-at 85684f9300908116a78138ea4c6036c35c9a1236
[   +1 ms] 3.0.4
[   +8 ms] executing: [C:\flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[ +106 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/stable
[        ] executing: [C:\flutter/] git ls-remote --get-url origin
[ +102 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[ +172 ms] executing: [C:\flutter/] git rev-parse --abbrev-ref HEAD
[ +112 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] stable
[  +86 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +55 ms] executing: C:\Users\agilharry\AppData\Local\Android\sdk\platform-tools\adb.exe devices -l
[ +100 ms] List of devices attached
                    emulator-5554          device product:sdk_gphone_x86_arm model:sdk_gphone_x86_arm device:generic_x86_arm transport_id:1
[   +6 ms] C:\Users\agilharry\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell getprop
[  +83 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[   +5 ms] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +31 ms] Changing current working directory to: C:\Users\agilharry\AndroidStudioProjects\flutter_app_issue
[  +99 ms] Skipping pub get: version match.
[  +74 ms] Generating C:\Users\agilharry\AndroidStudioProjects\flutter_app_issue\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java
[  +75 ms] ro.hardware = ranchu
[  +13 ms] Using hardware rendering with device sdk gphone x86 arm. If you notice graphics artifacts, consider enabling software rendering with "--enable-software-rendering".
[  +25 ms] Initializing file store
[  +12 ms] Skipping target: gen_localizations
[   +8 ms] gen_dart_plugin_registrant: Starting due to {InvalidatedReasonKind.inputChanged: The following inputs have updated contents: C:\Users\agilharry\AndroidStudioProjects\flutter_app_issue\.dart_tool\package_config_subset}
[  +27 ms] gen_dart_plugin_registrant: Complete
[   +3 ms] Skipping target: _composite
[   +2 ms] complete
[   +6 ms] Launching lib\main.dart on sdk gphone x86 arm in debug mode...
[   +5 ms] C:\flutter\bin\cache\dart-sdk\bin\dart.exe --disable-dart-dev C:\flutter\bin\cache\dart-sdk\bin\snapshots\frontend_server.dart.snapshot --sdk-root C:\flutter\bin\cache\artifacts\engine\common\flutter_patched_sdk/
--incremental --target=flutter --debugger-module-names --experimental-emit-debug-metadata -DFLUTTER_WEB_AUTO_DETECT=true --output-dill C:\Users\AGILHA~1\AppData\Local\Temp\flutter_tools.7fb42fba\flutter_tool.69fbcbca\app.dill
--packages C:\Users\agilharry\AndroidStudioProjects\flutter_app_issue\.dart_tool\package_config.json -Ddart.vm.profile=false -Ddart.vm.product=false --enable-asserts --track-widget-creation --filesystem-scheme org-dartlang-root
--initialize-from-dill build\c075001b96339384a97db4862b8ab8db.cache.dill.track.dill --enable-experiment=alternative-invalidation-strategy
[  +10 ms] executing: C:\Users\agilharry\AppData\Local\Android\sdk\build-tools\30.0.3\aapt dump xmltree C:\Users\agilharry\AndroidStudioProjects\flutter_app_issue\build\app\outputs\flutter-apk\app.apk AndroidManifest.xml
[  +62 ms] Exit code 0 from: C:\Users\agilharry\AppData\Local\Android\sdk\build-tools\30.0.3\aapt dump xmltree C:\Users\agilharry\AndroidStudioProjects\flutter_app_issue\build\app\outputs\flutter-apk\app.apk AndroidManifest.xml
[        ] N: android=http://schemas.android.com/apk/res/android
             E: manifest (line=2)
               A: android:versionCode(0x0101021b)=(type 0x10)0x1
               A: android:versionName(0x0101021c)="1.0.0" (Raw: "1.0.0")
               A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1f
               A: android:compileSdkVersionCodename(0x01010573)="12" (Raw: "12")
               A: package="com.example.flutter_app_issue" (Raw: "com.example.flutter_app_issue")
               A: platformBuildVersionCode=(type 0x10)0x1f
               A: platformBuildVersionName=(type 0x10)0xc
               E: uses-sdk (line=7)
                 A: android:minSdkVersion(0x0101020c)=(type 0x10)0x10
                 A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1f
               E: uses-permission (line=15)
                 A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET")
               E: application (line=17)
                 A: android:label(0x01010001)="flutter_app_issue" (Raw: "flutter_app_issue")
                 A: android:icon(0x01010002)=@0x7f080000
                 A: android:name(0x01010003)="android.app.Application" (Raw: "android.app.Application")
                 A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff
                 A: android:appComponentFactory(0x0101057a)="androidx.core.app.CoreComponentFactory" (Raw: "androidx.core.app.CoreComponentFactory")
                 E: activity (line=23)
                   A: android:theme(0x01010000)=@0x7f0a0000
                   A: android:name(0x01010003)="com.example.flutter_app_issue.MainActivity" (Raw: "com.example.flutter_app_issue.MainActivity")
                   A: android:exported(0x01010010)=(type 0x12)0xffffffff
                   A: android:launchMode(0x0101001d)=(type 0x10)0x1
                   A: android:configChanges(0x0101001f)=(type 0x11)0x40003fb4
                   A: android:windowSoftInputMode(0x0101022b)=(type 0x11)0x10
                   A: android:hardwareAccelerated(0x010102d3)=(type 0x12)0xffffffff
                   E: meta-data (line=38)
                     A: android:name(0x01010003)="io.flutter.embedding.android.NormalTheme" (Raw: "io.flutter.embedding.android.NormalTheme")
                     A: android:resource(0x01010025)=@0x7f0a0001
                   E: intent-filter (line=42)
                     E: action (line=43)
                       A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN")
                     E: category (line=45)
                       A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw: "android.intent.category.LAUNCHER")
                 E: meta-data (line=52)
                   A: android:name(0x01010003)="flutterEmbedding" (Raw: "flutterEmbedding")
                   A: android:value(0x01010024)=(type 0x10)0x2
                 E: uses-library (line=56)
                   A: android:name(0x01010003)="androidx.window.extensions" (Raw: "androidx.window.extensions")
                   A: android:required(0x0101028e)=(type 0x12)0x0
                 E: uses-library (line=59)
                   A: android:name(0x01010003)="androidx.window.sidecar" (Raw: "androidx.window.sidecar")
                   A: android:required(0x0101028e)=(type 0x12)0x0
[   +6 ms] executing: C:\Users\agilharry\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell -x logcat -v time -t 1
[ +838 ms] <- compile package:flutter_app_issue/main.dart
[  +95 ms] --------- beginning of main
           07-08 16:09:23.674 D/NetworkMonitor/107( 1061): PROBE_DNS www.google.com 10021ms FAIL in type ADDRCONFIG android.net.DnsResolver$DnsException: android.system.ErrnoException: resNetworkResult failed: ETIMEDOUT (Connection
           timed out)
[  +14 ms] executing: C:\Users\agilharry\AppData\Local\Android\sdk\platform-tools\adb.exe version
[  +64 ms] Android Debug Bridge version 1.0.41
           Version 30.0.5-6877874
           Installed as C:\Users\agilharry\AppData\Local\Android\sdk\platform-tools\adb.exe
[   +2 ms] executing: C:\Users\agilharry\AppData\Local\Android\sdk\platform-tools\adb.exe start-server
[  +60 ms] Building APK
[  +17 ms] Running Gradle task 'assembleDebug'...
[   +5 ms] Using gradle from C:\Users\agilharry\AndroidStudioProjects\flutter_app_issue\android\gradlew.bat.
[  +17 ms] executing: C:\Program Files\Android\Android Studio\jre\bin\java -version
[ +140 ms] Exit code 0 from: C:\Program Files\Android\Android Studio\jre\bin\java -version
[        ] openjdk version "1.8.0_242-release"
           OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
           OpenJDK 64-Bit Server VM (build 25.242-b01, mixed mode)
[   +2 ms] executing: [C:\Users\agilharry\AndroidStudioProjects\flutter_app_issue\android/] C:\Users\agilharry\AndroidStudioProjects\flutter_app_issue\android\gradlew.bat -Pverbose=true -Ptarget-platform=android-x86
-Ptarget=C:\Users\agilharry\AndroidStudioProjects\flutter_app_issue\lib\main.dart -Pbase-application-name=android.app.Application -Pdart-defines=RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ== -Pdart-obfuscation=false
-Ptrack-widget-creation=true -Ptree-shake-icons=false -Pfilesystem-scheme=org-dartlang-root assembleDebug
[ +588 ms] lib/main.dart:152:34: Error: Can't use an expression of type 'void Function(void Function())?' as a function because it's potentially null.
[   +2 ms] Try calling using ?.call instead.
[        ]             _controller!.setState((){});
[        ]                                  ^
[+1441 ms] > Task :app:preBuild UP-TO-DATE
[        ] > Task :app:preDebugBuild UP-TO-DATE
[        ] > Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
[+5999 ms] > Task :app:compileFlutterBuildDebug
[   +1 ms] lib/main.dart:152:34: Error: Can't use an expression of type 'void Function(void Function())?' as a function because it's potentially null.
[   +2 ms] Try calling using ?.call instead.
[   +1 ms]             _controller!.setState((){});
[        ]                                  ^
[+5683 ms] > Task :app:compileFlutterBuildDebug FAILED
[   +1 ms] Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
[   +1 ms] You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
[   +1 ms] See https://docs.gradle.org/7.4/userguide/command_line_interface.html#sec:command_line_warnings
[        ] 1 actionable task: 1 executed
[        ] FAILURE: Build failed with an exception.
[        ] * Where:
[        ] Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1156
[        ] * What went wrong:
[        ] Execution failed for task ':app:compileFlutterBuildDebug'.
[        ] > Process 'command 'C:\flutter\bin\flutter.bat'' finished with non-zero exit value 1
[        ] * Try:
[        ] > Run with --stacktrace option to get the stack trace.
[        ] > Run with --info or --debug option to get more log output.
[        ] > Run with --scan to get full insights.
[        ] * Get more help at https://help.gradle.org
[   +1 ms] BUILD FAILED in 13s
[ +590 ms] Running Gradle task 'assembleDebug'... (completed in 14.5s)
[   +3 ms] Exception: Gradle task assembleDebug failed with exit code 1
[   +1 ms] "flutter run" took 16,342ms.
[   +4 ms]
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:699:9)
           <asynchronous suspension>
           #2      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1183:27)
           <asynchronous suspension>
           #3      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #4      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
           <asynchronous suspension>
           #5      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)
           <asynchronous suspension>
           #6      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #7      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
           <asynchronous suspension>
           #8      run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
           <asynchronous suspension>
           #9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #10     main (package:flutter_tools/executable.dart:94:3)
           <asynchronous suspension>

[ +123 ms] ensureAnalyticsSent: 121ms
[   +1 ms] Running shutdown hooks
[        ] Shutdown hooks complete
[        ] exiting with code 1

Analyzing android...
No issues found! (ran in 1.8s)

C:\Users\agilharry\AndroidStudioProjects\flutter_app_issue\android>flutter doctor -v
[√] Flutter (Channel stable, 3.0.4, on Microsoft Windows [Version 10.0.19044.1766], locale en-US)
    • Flutter version 3.0.4 at C:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 85684f9300 (8 days ago), 2022-06-30 13:22:47 -0700
    • Engine revision 6ba2af10bb
    • Dart version 2.17.5
    • DevTools version 2.12.2

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at C:\Users\agilharry\AppData\Local\Android\sdk
    • Platform android-31, build-tools 30.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.3.5)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.3.29411.108
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 4.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.67.0)
    • VS Code at C:\Users\agilharry\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (4 available)
    • sdk gphone x86 arm (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
    • Windows (desktop)           • windows       • windows-x64    • Microsoft Windows [Version 10.0.19044.1766]
    • Chrome (web)                • chrome        • web-javascript • Google Chrome 102.0.5005.115
    • Edge (web)                  • edge          • web-javascript • Microsoft Edge 103.0.1264.44

[√] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

Hi @albert-gilharry, Thanks for filing the issue. Your code sample works except for the slight change I made   to have a null check
 _controller!.setState!(() {});

code sample 1
import 'package:flutter/material.dart';

PersistentBottomSheetController? _controller;

void main() async {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;
  GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
  bool bottomSheetShown = false;

  @override
  void initState() {
    super.initState();
  }

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  void _versesBottomSheet(context) {
    var theScaffold = scaffoldKey.currentState;

    _controller = theScaffold!.showBottomSheet((BuildContext context) {
      return StatefulBuilder(builder: (BuildContext bc, StateSetter setState) {
        return Container(
          color: Colors.grey,
          width: double.infinity,
          height: 100,
          child: Text('Toggle count: ${_counter.toString()}'),
        );
      });
    })
      ..closed.then((value) {});

    bottomSheetShown = true;
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      key: scaffoldKey,
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text(
              'Bottom sheet shown?',
            ),
            Text(
              bottomSheetShown.toString(),
              style: Theme.of(context).textTheme.headline4,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () {
          _incrementCounter();
          if (bottomSheetShown == false) {
            _versesBottomSheet(context);
          } else {
            _controller!.setState!(() {});
          }
          setState(() {});
        },
        tooltip: 'Toggle',
        child: const Icon(Icons.toggle_on),
      ),
    );
  }
}

flutter doctor -v (mac)
[✓] Flutter (Channel stable, 3.0.4, on macOS 12.4 21F79 darwin-arm, locale en-IN)
    • Flutter version 3.0.4 at /Users/mahesh/Documents/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 85684f9300 (4 days ago), 2022-06-30 13:22:47 -0700
    • Engine revision 6ba2af10bb
    • Dart version 2.17.5
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc4)
    • Android SDK at /Users/mahesh/Library/Android/sdk
    • Platform android-32, build-tools 33.0.0-rc4
    • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] IntelliJ IDEA Community Edition (version 2021.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 61.2.4
    • Dart plugin version 212.5080.8

[✓] VS Code (version 1.67.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.44.0

[✓] Connected device (3 available)
    • sdk gphone arm64 (mobile) • emulator-5554 • android-arm64  • Android 11 (API 30) (emulator)
    • macOS (desktop)           • macos         • darwin-arm64   • macOS 12.4 21F79 darwin-arm
    • Chrome (web)              • chrome        • web-javascript • Google Chrome 103.0.5060.53

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!


inst_loss: nan

Hello author, when I run this command, CUDA_VISIBLE_DEVICES=0 python tools/train.py configs/ESAM_CA/ESAM_sv_scannet200_CA.py --work-dir work_dirs/ESAM_sv_scannet200_CA/，naN appears in the loss obtained by training.
After debugging, I found that in this command, mask_bce_losses.append(F.binary_cross_entropy_with_logits(
            pred_mask, tgt_mask.float()))，pred_mask and tgt_mask.float() sometimes become tenser[], which leads to loss is naN.
Do you konw how to solve this problem？

That's ok. This nan will not affect the training.


[ENHANCEMENT] Conformalized quantile regression

As described in section 2.2 of this tutorial:
http://people.eecs.berkeley.edu/~angelopoulos/publications/downloads/gentle_intro_conformal_dfuq.pdf

Would be very useful to add, see also the descriptions here: https://towardsdatascience.com/how-to-predict-risk-proportional-intervals-with-conformal-quantile-regression-175775840dc4.

Hey @gmartinonQM , I can take this up if nobody else is working on it!
I guess we should implement a new class for this as even though technically we are still creating prediction sets for regression, we need a different class of estimators (quantile prediction) and would probably need to specify alpha as part of __init__.

With great pleasure @RudrakshTuwani ! Yes a new class in a separate file quantile_regression.py would be perfect

Are there still plans to implement this?

Conformalized QR as proposed by Romano et al. (2019) was implemented in PR #167 .


Add react-flow-renderer as dependency

Overview
I was having an error while running the server, react-flow-renderer was missing in order to run the project.
I just added it, let me know if that makes sense!

Thanks for the PR! The react-flow-renderer is actually deprecated as they've moved to just reactflow. I must've missed this instance when I was upgading.

Great to know! Thanks for the repo, it's been really insightful to read your code


Support for laravel-websockets

Hi
Great package, been trying to get it working with laravel-websockets. It seems that there is only a minor change needed to make it work.
It needs to point to another websockets server, normally on port 6001 and then there is some auth routes also included with the package for laravel. The echo client seems to support changing of these variables so you can connect to your own websockets server without Pusher :)
I am having trouble because i have to copy the vue components and change them and reimport them. Would be really nice if you could make the vue components publishable so i don't have to have my own :+1:
Any assistance would be greatly appreciated! Have a nice day

Definitely in the roadmap. Coming soon.

Hi @einardivision just tagged v1.1.0. This adds the ability to support laravel-websockets and hopefully other configs as well. Will add to readme about this soon.