setItem method

void setItem(
  1. BuildContext context,
  2. ItemType item
)

Pops the current picker route with the selected item.

Implementation

void setItem(BuildContext context, ItemType item) {
  if (!Navigator.of(context).canPop()) return;
  Navigator.of(context).pop<ItemType>(item);
}