Null check operator used on a null value when calling a function from another class – Flutter
I have a class called DataCollectionPage where I have the following function in the initState function: void establishConnection (){ BluetoothConnection.toAddress(widget.server!.address).then((connection) { Utils.showSnackBar2("Successfully connected to your device"); this.connection = connection; setState(() { isConnecting = false; isDisconnecting = false; }); this.connection!.input!.listen(_onDataReceived).onDone(() {…