Commit f64b7c33 authored by 杜欣's avatar 杜欣

add activity

parent 2a6ef164
.DS_Store .DS_Store
.history
.dart_tool/ .dart_tool/
.packages .packages
......
...@@ -37,19 +37,12 @@ class _AnimatedListSampleState extends State<AnimatedListSample> { ...@@ -37,19 +37,12 @@ class _AnimatedListSampleState extends State<AnimatedListSample> {
_listKey.currentState.insertItem(length, duration: Duration(milliseconds: seconds)); _listKey.currentState.insertItem(length, duration: Duration(milliseconds: seconds));
}); });
}); });
return new MaterialApp( return Padding(
home: new Scaffold( padding: const EdgeInsets.all(16.0),
appBar: new AppBar( child: new AnimatedList(
title: Text('${_list.length}') key: _listKey,
), initialItemCount: _list.length,
body: new Padding( itemBuilder: _buildItem,
padding: const EdgeInsets.all(16.0),
child: new AnimatedList(
key: _listKey,
initialItemCount: _list.length,
itemBuilder: _buildItem,
),
),
), ),
); );
} }
...@@ -69,14 +62,14 @@ class CardItem extends StatelessWidget { ...@@ -69,14 +62,14 @@ class CardItem extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
TextStyle textStyle = Theme.of(context).textTheme.display1; TextStyle textStyle = Theme.of(context).textTheme.display1;
return new Padding( return Padding(
padding: const EdgeInsets.all(2.0), padding: const EdgeInsets.all(2.0),
child: new SizeTransition( child: SizeTransition(
axis: Axis.vertical, axis: Axis.vertical,
sizeFactor: animation, sizeFactor: animation,
child:SizedBox( child: SizedBox(
height: 100, height: 100,
child: Text('Item ${item['b']}', style: textStyle), child: Text('Item $item', style: textStyle),
) )
) )
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment