title: how to rename a pickedfile from image_picker in flutter?
body: <p>I want to rename the image name which is a pickedfile type when i'm uploading that image to the server.
  when it's uploading image name automatically changes like this scaled_image_picker825656736600296027.jpg</p>
  <p>getting image code :-</p>
  <pre><code>  void takePhoto(ImageSource source) async {
      final pickedFile = await _picker.getImage(
        source: source,
        imageQuality: 20,
      );
      setState(() {
        _imageFile = pickedFile;
      });
    }
  </code></pre>
  <p>uploading code is :-</p>
  <pre><code>void UploadImage() async {
      var request = http.MultipartRequest('POST', Uri.parse(URLs.image));
      request.fields['CompanyCode']=  &quot;${widget.CompanyCode}&quot;;
      request.fields['empCode'] ='$user_id';
      request.fields['documentType']=&quot;POD&quot;;
      if (_imageFile != null &amp;&amp; widget.image == null) {
        print('Original path: ${_imageFile.path}');
        String dir = path.dirname(_imageFile.path);
        String newPath = path.join(dir, widget.docketno + '-${DateTime.now()}.jpg');
        print('NewPath: ${newPath}');
         _imageFile.renameSync(newPath); // renameSync is showing error
        request.files
            .add(await http.MultipartFile.fromPath('file',_imageFile.path));
      }
      else if(_imageFile ==null &amp;&amp; widget.image != null){
        print('AddingUserProfilePic ${widget.image.path}');
        request.files.add(await http.MultipartFile.fromPath('file', widget.image.path));
      }
      var response = await request.send();
      var responseBody = await http.Response.fromStream(response);
      myData = json.decode(responseBody.body);
      print('Status code is : ${response.statusCode}  &amp;&amp; ${response}');
      if (response.statusCode == 200) {
        responseResult = myData['filePath'];
        print('the filepath is ' + responseResult.substring(60));
        image_path = responseResult.substring(60);
        Fluttertoast.showToast(msg: 'Uploaded Successfully');
        Navigator.push(context, MaterialPageRoute(builder: (context) =&gt; delivered(CompanyCode : widget.CompanyCode,docketno :widget.docketno,Year: widget.Year,
            drsno:widget.drsno,challan: widget.challan , package :widget.package , response : image_path)));
        // Navigator.popUntil(context, (route) {
        //   return count++ == 2;
        // });
      } else {
        Fluttertoast.showToast(msg: 'Upload Failed');
      }
    }
  </code></pre>
  <p>renameSync is showing the error that The method 'renameSync' isn't defined for the type 'PickedFile'.
  so how can i rename my image file????</p>