zoukankan      html  css  js  c++  java
  • flutter AnimationBuilder

    class BuilderPage extends StatefulWidget {
      @override
      State<StatefulWidget> createState() {
        // TODO: implement createState
        return BuilderPageState();
      }
    }
    
    class BuilderPageState extends State<BuilderPage> with SingleTickerProviderStateMixin {
      @override
      Widget build(BuildContext context) {
        var controller = AnimationController(duration: Duration(seconds: 2),vsync: this);
        var tween = Tween(begin: 20.0, end: 100.0).animate(controller);
        return Scaffold(
          appBar: AppBar(title: Text('fade'),),
          body: AnimatedBuilder(
              animation: tween,
              child:Text('${tween.value}'),
              builder: (context, Widget child){
                print(controller.value);
                print(tween.value);
                return Container(
                  child: Column(
                    children: <Widget>[
                      RaisedButton(child: Text('btn'),onPressed: (){
                        controller.forward();
                      },),
                      Text('${tween.value} from 2'),
                      child,
                    ],
                  ),
                );
              }),
        );
      }
    }
    

      

  • 相关阅读:
    php 创建多级文件夹
    php 格式化文件大小
    php 微信授权登录
    获取单据编号 不重复 骚
    js获取数组中的最后一个
    php截取
    循序栈
    链表
    顺序表
    halcon学习之阈值算子threshold operators
  • 原文地址:https://www.cnblogs.com/pythonClub/p/10868795.html
Copyright © 2011-2022 走看看