The main objective is to allow the user to choose an image from the gallery/camera but in order to make things look good some animation has been used and entire image picking dialogue box has been designed
class _ProfileImageState extends State<ProfileImage>{
@override
File _image;
//ImagePickerHandler imagePicker;
@override
void initState() {
super.initState();
//initiating to start so that transition from one state to another is smooth
var _controller = new AnimationController(
vsync: this,
duration: const Duration(milliseconds: 500),
);
imagePicker=new ImagePickerHandler(this.userImage(_image));
}
Extending SingleTickerProviderStateMixin fixed the issue:
class _ProfileImageState extends State with SingleTickerProviderStateMixin{