getGlobalKey<T extends WidgetContainerState> method

GlobalKey<T> getGlobalKey<T extends WidgetContainerState>(
  1. String selector
)

Implementation

GlobalKey<T> getGlobalKey<T extends WidgetContainerState>(String selector) {
  final areYouThere = _widgetKeyMap[selector];
  if (areYouThere == null || areYouThere is! GlobalKey<T>) {
    final newKey = GlobalKey<T>();
    _widgetKeyMap[selector] = newKey;
    return newKey;
  } else {
    return areYouThere;
  }
}