• AnimatedPadding(每日Flutter 小部件)


    动画Padding  点击之后 有动画过渡

    class AnimatedPaddingWidget extends StatefulWidget {
      @override
      State<StatefulWidget> createState() => AnimatedPaddingWidgetState();
    }
    
    class AnimatedPaddingWidgetState extends State<AnimatedPaddingWidget> {
      double AnimatedPaddingOffset = 120;
    
      @override
      Widget build(BuildContext context) {
        return AnimatedPadding(
            curve: Curves.linear,
            padding: EdgeInsets.all(AnimatedPaddingOffset),
            duration: Duration(seconds: 1),
            child: GestureDetector(
              child: Image.network(
                  "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1584787666369&di=2595aefbc771e601d57cfc5102135d78&imgtype=0&src=http%3A%2F%2Fa3.att.hudong.com%2F68%2F61%2F300000839764127060614318218_950.jpg"),
              onTap: () {
                setState(() {
                  AnimatedPaddingOffset = AnimatedPaddingOffset - 10;
                });
              },
            ));
      }
    }
    

      

  • 相关阅读:
    Linux 学习
    mac 驱动
    用wubi安装ubuntu
    Eclipse安装Svn
    XML学习
    java集合类总结
    CVS学习
    [转载]java集合类总结
    Servlet学习
    JSP介绍
  • 原文地址:https://www.cnblogs.com/wjw334/p/12539866.html
Copyright © 2020-2023  润新知