Bha*_*ani 1 flutter animationcontroller
主要目标是允许用户从图库/相机中选择图像,但为了使事情看起来不错,使用了一些动画并设计了整个图像拾取对话框
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));
      }
sid*_*sid 12
您需要使用SingleTickerProviderStateMixinmixin 来用作thisvsync 参数。您可以通过使用with关键字来实现此目的,具体方法如下:
class _ProfileImageState extends State<ProfileImage> with SingleTickerProviderStateMixin {
      @override
      File _image;
      //ImagePickerHandler imagePicker;
      @override
      void initState() {
        super.initState();
 
        var _controller = new AnimationController(
          vsync: this,
          duration: const Duration(milliseconds: 500),
        );
        imagePicker=new ImagePickerHandler(this.userImage(_image));
      }```
| 归档时间: | 
 | 
| 查看次数: | 3664 次 | 
| 最近记录: |