createDeck method

void createDeck(
  1. Deck deckReceived
)

Implementation

void createDeck(Deck deckReceived) {
  myController.text = myController.text.trimLeft();
  myController.text = myController.text.trimRight();

  if (deckReceived == null && myController.text != '') {
    Provider.of<Collection>(context, listen: false)
        .createDeck(myController.text);
  } else if (myController.text != '') {
    Provider.of<Collection>(context, listen: false)
        .setDeckName(oldName, myController.text);
  }
}