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);