1

While I am trying to upload a picture using uploadcare. Once I upload an image I do not receive a further response. Maybe I am missing something, but I have been following uploadcare's documentations.

Initialization of uploadcare auth.

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

I followed the steps to upload image as shown bellow

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,
        ),
      ));
}


 }

Upload process:

enter image description here

T. Short
  • 3,481
  • 14
  • 30
Shahparan
  • 11
  • 3

0 Answers0