• flutter widget


    AnimatedContainer Container动画

    AnimatedContainer(
      // Use the properties stored in the State class.
       _width,
      height: _height,
      decoration: BoxDecoration(
        color: _color,
        borderRadius: _borderRadius,
      ),
      // Define how long the animation should take.
      duration: Duration(seconds: 1),
      // Provide an optional curve to make the animation feel smoother.
      curve: Curves.fastOutSlowIn,
    );
    

    Overlay 自定义弹窗 悬浮窗

    意思是Overlay是一个Stack组件,可以将OverlayEntry插入到Overlay中,使其独立的child窗口悬浮于其它组件之上,利用这个特性可以自定义弹窗或者悬浮窗

      OverlayEntry entry = OverlayEntry(builder: (context) {
          return Positioned(
            top: 64,
            left: 0,
              child: Material(
                color: Colors.white,
                child: Container(
                  height: 40,
                   MediaQuery.of(context).size.width,
                 color: Colors.orange,
                  alignment: Alignment.center,
                  child: Text('我是弹窗'),
                ),
              ));
        });
        Overlay.of(context).insert(entry);
        Future.delayed(Duration(seconds: 2)).then((res) {
          entry.remove();
        });
    

    Hero 页面过渡动画

    Hero的使用非常的简单,需要关联的两个组件用Hero组件包裹,并指定相同的tag参数,代码如下:

    ///列表item
    InkWell(
          child: ClipRRect(
            borderRadius: BorderRadius.circular(4),
            child: Hero(
              tag: widget.data,
              child: LoadImage(
                '${widget.data.img}',
                 81.0,
                height: 81.0,
                fit: BoxFit.fitHeight,
              ),
            ),
          ),
          onTap: () {
            Navigator.of(context).push(MaterialPageRoute(
                builder: (context) => GoodsDetailsPage(data: widget.data)));
          },
        );
    ///详情
     Hero(
        tag: tag,
        child: LoadImage(
            imageUrl,
             double.infinity,
            height: 300,
            fit: BoxFit.cover,
            ),
        )
    
    

    BackdropFilter 高斯模糊

    ClipRect(
        BackdropFilter(
            filter: ImageFilter.blur(sigmaX, sigmaY),
            child: ...)
    )
    
  • 相关阅读:
    Linux 用户管理
    oracle索引(转)
    oracle物理视图(转)
    oracle事物总结(转)
    SQL条件循环语句以及异常知识整理
    ORACLE 中ROWNUM用法总结! (转)
    PL/SQL编程重点语句输出整理
    Oracle函数整理
    Oracle子查询中any、some、all之间的区别
    Oracle DQL查询语言整理
  • 原文地址:https://www.cnblogs.com/qqcc1388/p/12975843.html
Copyright © 2020-2023  润新知