You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The null-safe branch has just been merged. It still has a few unsafe casts to non-nullable in it, but in principle it should give you a much better idea of what could be null and what can't.
If you use the current master version from Git, you could check if this flags the problematic call.
I am getting error of:
The getter 'address' was called on null. Bluetooth connection to a device
import 'dart:convert';
import 'dart:typed_data';
import 'package:flutter_bluetooth_serial/flutter_bluetooth_serial.dart';
class Obd {
BluetoothConnection connection;
String address;
String _messageBuffer = '';
void initObd(address) {
BluetoothConnection.toAddress(address).then((_connection) {
print('Connected to the device');
connection = _connection;
}
void _onDataReceived(Uint8List data) {
// Allocate buffer for parsed data
}
void sendMessage(String text) async {
print(text);
text = text.trim();
print(text);
}
}
The text was updated successfully, but these errors were encountered: