Widgetbuild(BuildContext context){returnCenter(child:Flow(delegate:FlowMenuDelegate(animation:_ctrlAnimationPopMenu),children:menuItems.map<Widget>((IconData icon)=>flowMenuItem(icon)).toList(),),);}} FlowMenuDelegate定义如下: 代码语言:javascript 复制 classFlowMenuDelegateextendsFlowDelegate{FlowMenuD...
children: menuItems .map<int, Widget>((int k, IconData v) => MapEntry<int, Widget>(k, buildItem(k, v))) .values .toList(), ), ), ); } } class FlowMenuDelegate extends FlowDelegate { FlowMenuDelegate({this.menuAnimation}) : super(repaint: menuAnimation); final Animation<double...
Say you have a lot of items in your list, say ListView for example. Then you can migrate to ListView.builder, or anything that could shrinkWrap:false, since it will recycle the widgets that isn't visibile in the viewport. That will improves the speed. Or, if it is not possibile to us...
final Map<int, IconData> menuItems = <IconData>[ IconData lastTapped = Icons.notifications; final List<IconData> menuItems = <IconData>[ Icons.home, Icons.new_releases, Icons.notifications, Icons.settings, Icons.menu, ].asMap();