小编Dan*_*aja的帖子

Flutter 参数类型“List<int>”无法分配给参数类型“Uint8List”

我有一个代码(最初不是我编写的),在尝试更新它时,我收到此错误:

ui.encodePng(temp)  "The argument type 'List<int>' can't be assigned to the parameter type 'Uint8List'"
Run Code Online (Sandbox Code Playgroud)

这是基本代码:

    // create crop image for each block
    ui.Image temp = ui.copyCrop(
      fullImage,
      xAxis.round(),
      yAxis.round(),
      widthPerBlockTemp.round(),
      heightPerBlockTemp.round(),
    );

    // get offset for each block show on center base later
    Offset offset = Offset(size.width / 2 - widthPerBlockTemp / 2,
        size.height / 2 - heightPerBlockTemp / 2);

    ImageBox imageBox = new ImageBox(
      image: Image.memory(
        ui.encodePng(temp),
        fit: BoxFit.contain,
      ),
      isDone: false,
      offsetCenter: offsetCenter,
      posSide: jigsawPosSide,
      radiusPoint: minSize,
      size: …
Run Code Online (Sandbox Code Playgroud)

dart flutter

4
推荐指数
1
解决办法
1948
查看次数

标签 统计

dart ×1

flutter ×1