connect method
Implementation
Future<void> connect() async {
var info = await Service.getInfo();
if (info.serverUri == null) {
if (kDebugMode) {
print('service protocol url is null,start vm service fail');
}
return;
}
service = await getService(info);
if (kDebugMode) {
print('socket connected in service $info');
}
vm = await service?.getVM();
var isolates = vm?.isolates;
main = isolates?.firstWhere((ref) => ref.name?.contains('main') == true);
main ??= isolates?.first;
connected = true;
}