Skip to main content
added 24 characters in body
Source Link

arg is List<dynamic> not List<SendPort> so code is not valid

SendPort sendPort = args[0];

please try, if arg[0] is SendPort:

void _readAndParseJson(List<dynamic> args) async {
  SendPort? responsePort;
  final dynamic _responsePort = args[0];

  if (_responsePort != null && _responsePort is SendPort) {
    responsePort = _responsePort;
  }
  String? fileName;
  final dynamic _fileName = args[1];
  if (_fileName != null && _fileName is String) {
    fileName = _fileName;
  }
  final fileData = await File(fileName).readAsString();
  final result = jsonDecode(fileData); as Map<String, dynamic>;
  Isolate.exit(responsePort, result);
}

arg is List<dynamic> not List<SendPort> so code is not valid

SendPort sendPort = args[0];

please try, if arg[0] is SendPort:

void _readAndParseJson(List<dynamic> args) async {
  SendPort? responsePort;
  final dynamic _responsePort = args[0];

  if (_responsePort != null && _responsePort is SendPort) {
    responsePort = _responsePort;
  }
  String? fileName;
  final dynamic _fileName = args[1];
  if (_fileName != null && _fileName is String) {
    fileName = _fileName;
  }
  final fileData = await File(fileName).readAsString();
  final result = jsonDecode(fileData);
  Isolate.exit(responsePort, result);
}

arg is List<dynamic> not List<SendPort> so code is not valid

SendPort sendPort = args[0];

please try, if arg[0] is SendPort:

void _readAndParseJson(List<dynamic> args) async {
  SendPort? responsePort;
  final dynamic _responsePort = args[0];

  if (_responsePort != null && _responsePort is SendPort) {
    responsePort = _responsePort;
  }
  String? fileName;
  final dynamic _fileName = args[1];
  if (_fileName != null && _fileName is String) {
    fileName = _fileName;
  }
  final fileData = await File(fileName).readAsString();
  final result = jsonDecode(fileData) as Map<String, dynamic>;
  Isolate.exit(responsePort, result);
}
added 527 characters in body
Source Link

arg is List<dynamic> not List<SendPort> so code is not valid

SendPort sendPort = args[0];

please try, if arg[0] is SendPort:

void _readAndParseJson(List<dynamic> args) async {
  SendPort? sendPortresponsePort;
  final dynamic _responsePort = args[0]args[0];

 as SendPort;if (_responsePort != null && _responsePort is SendPort) {
    responsePort = _responsePort;
  }
  String? fileName;
  final dynamic _fileName = args[1];
  if (_fileName != null && _fileName is String) {
    fileName = _fileName;
  }
  final fileData = await File(fileName).readAsString();
  final result = jsonDecode(fileData);
  Isolate.exit(responsePort, result);
}

arg is List<dynamic> not List<SendPort> so code is not valid

SendPort sendPort = args[0];

please try, if arg[0] is SendPort:

SendPort sendPort = args[0] as SendPort;

arg is List<dynamic> not List<SendPort> so code is not valid

SendPort sendPort = args[0];

please try, if arg[0] is SendPort:

void _readAndParseJson(List<dynamic> args) async {
  SendPort? responsePort;
  final dynamic _responsePort = args[0];

  if (_responsePort != null && _responsePort is SendPort) {
    responsePort = _responsePort;
  }
  String? fileName;
  final dynamic _fileName = args[1];
  if (_fileName != null && _fileName is String) {
    fileName = _fileName;
  }
  final fileData = await File(fileName).readAsString();
  final result = jsonDecode(fileData);
  Isolate.exit(responsePort, result);
}
added 86 characters in body
Source Link

arg is List<dynamic> not List<SendPort> so code is not valid

SendPort sendPort = args[0];

please try, if arg[0] is SendPort:

SendPort sendPort = args[0] as SendPort;

arg is List<dynamic> not List<SendPort> so code is not valid

SendPort sendPort = args[0];

arg is List<dynamic> not List<SendPort> so code is not valid

SendPort sendPort = args[0];

please try, if arg[0] is SendPort:

SendPort sendPort = args[0] as SendPort;
Source Link
Loading