Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

flutter find a widget

var keyA = UniqueKey();
var keyB = UniqueKey();
var keyC = UniqueKey();
var keyD = UniqueKey();
List<Widget> widgetList = List<Widget>();

widgetList.add(WidgetA(key: keyA));
widgetList.add(WidgetB(key: keyB));
widgetList.add(WidgetC(key: keyC));
widgetList.add(WidgetD(key: keyD));

Widget activeWidget = widgetList.firstWhere((x) => x.key == keyB);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #flutter #find #widget
ADD COMMENT
Topic
Name
7+4 =