flutter String转Uint8List

Uint8List? bodyBytes;
   webViewBody = WebViewBody(tricksterType: tricksterType, orderNo: orderNo);
      //String转List
      List<int> list = json.encode(webViewBody).codeUnits;
     //List转Uint8List
     bodyBytes = Uint8List.fromList(list);

你可能感兴趣的:(flutter,flutter)