标签:xtend lis pac 数组 new 谷歌 unit ide dem
ExpansionTile Widget
就是一个可以展开闭合的组件,常用的属性有如下几个。
Text Widget
。代码示例如下:
import ‘package:flutter/material.dart‘; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title:‘Flutter Demo‘, theme: new ThemeData.dark(), home:ExpansionTileDemo() ); } } class ExpansionTileDemo extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: Text(‘Expansion Tile Demo‘)), body: Center( child: ExpansionTile( title: Text(‘Expansion Tile‘), leading: Icon(Icons.ac_unit), backgroundColor: Colors.white12, children: <Widget>[ ListTile( title: Text(‘list tile‘), subtitle: Text(‘subtitle‘), ), ], initiallyExpanded: true, //打开状态 不写默认false闭合状态 ), ), ); } }
标签:xtend lis pac 数组 new 谷歌 unit ide dem
原文地址:https://www.cnblogs.com/joe235/p/11225861.html