上载问题与上载客户端集成出现问题

时间:2020-01-05 08:17:47

标签: flutter uploadcare

当我尝试使用uploadcare上传图片时。上传图像后,我将不会再收到任何回复。也许我缺少一些东西,但是我一直在关注uploadcare的文档。

uploadcare验证的初始化。

     @override
      void initState() {
        super.initState();
    _uploadcareClient = UploadcareClient.withSimpleAuth(
      publicKey: DotEnv().env['UPLOADCARE_PUBLIC_KEY'],
      privateKey: DotEnv().env['UPLOADCARE_PRIVATE_KEY'],
      apiVersion: 'v0.5',
    );
  }

我按照以下步骤上传图片

Future _onUpload() async {
final file = await showModalBottomSheet<File>(
    context: context,
    builder: (context) {
      return Column(
        mainAxisSize: MainAxisSize.min,
        children: <Widget>[
          ListTile(
            title: Text('Pick image from gallery'),
            onTap: () async => Navigator.pop(
              context,
              await ImagePicker.pickImage(
                source: ImageSource.gallery,
              ),
            ),
          ),
          ListTile(
            title: Text('Pick image from camera'),
            onTap: () async => Navigator.pop(
              context,
              await ImagePicker.pickImage(
                source: ImageSource.camera,
              ),
            ),
          ),
          ListTile(
            title: Text('Pick video from gallery'),
            onTap: () async => Navigator.pop(
              context,
              await ImagePicker.pickVideo(
                source: ImageSource.gallery,
              ),
            ),
          ),
          ListTile(
            title: Text('Pick video from camera'),
            onTap: () async => Navigator.pop(
              context,
              await ImagePicker.pickVideo(
                source: ImageSource.camera,
              ),
            ),
          ),
        ],
      );
    });

if (file != null) {

  Navigator.push(
      context,
      MaterialPageRoute(
        fullscreenDialog: true,
        builder: (context) => UploadScreen(
          file: file,
          uploadcareClient: _uploadcareClient,
        ),
      ));
}


 }

上传过程:

enter image description here

0 个答案:

没有答案