博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Flutter MergeableMaterialItem
阅读量:7168 次
发布时间:2019-06-29

本文共 1922 字,大约阅读时间需要 6 分钟。

简介

MaterialSlice 和 MaterialGap的基本类型

  • 所有的MergeableMaterialItem对象都需要LocalKey

基础用法

MaterialSlice进行演示

  • MaterialSlice做为 MergeableMaterial子类。它作为Material,可以和其他的slices合并使用

实例演示

import 'package:flutter/material.dart';class MergeableMaterialItemDemo extends StatefulWidget {  _MergeableMaterialItemState createState() => _MergeableMaterialItemState();}class _MergeableMaterialItemState extends State
{ final List
items =
[]; bool currIndex = false; int currIndexNum = 1; _isChildExpanded() { setState(() { currIndex ? currIndex = false : currIndex = true; currIndexNum++; }); } @override Widget build(BuildContext context) { items.add( //class MaterialSlice extends MergeableMaterialItem MaterialSlice( key: ValueKey
(currIndexNum), child: Column(children:
[ // header, AnimatedCrossFade( firstChild: Container( height: 20.0, width: 20.0, color: Colors.green, ), secondChild: Container( height: 20.0, width: 20.0, color: Colors.red, ), crossFadeState: currIndex ? CrossFadeState.showSecond : CrossFadeState.showFirst, firstCurve: const Interval(0.0, 0.6, curve: Curves.fastOutSlowIn), secondCurve: const Interval(0.4, 1.0, curve: Curves.fastOutSlowIn), sizeCurve: Curves.fastOutSlowIn, duration: Duration(microseconds: 6), ) ]))); return Column( children:
[ MergeableMaterial(hasDividers: true, children: items), RaisedButton( child: Text("点击添加"), onPressed: () { _isChildExpanded(); }, ) ], ); }}

转载地址:http://yaqwm.baihongyu.com/

你可能感兴趣的文章
linux安装
查看>>
利用dbms_repair来标记和跳过坏块
查看>>
解决ssh免密码登录 非默认端口22免密钥登录
查看>>
HTTP错误码解释(状态码)
查看>>
ubuntu解压命令
查看>>
python3.x的print()函数默认参数
查看>>
嵌入式 Linux进程间通信(二)——exec族函数
查看>>
Oracle数据库精讲课程之Rac管理最全课程
查看>>
我的友情链接
查看>>
Spring学习总结(4)——Spring AOP教程
查看>>
Jenkins自动化构建(一)
查看>>
log4j配置详解
查看>>
我的友情链接
查看>>
面试100题之8
查看>>
一些以太网非核心功能的标准
查看>>
oracle EBS 克隆之数据库克隆
查看>>
大型网站技术架构(八)网站的安全架构
查看>>
关于深度学习中优化问题的一些感受
查看>>
又写了一段Perl
查看>>
多态的静态绑定(CRTP手法)
查看>>