syncWithLibrary method

void syncWithLibrary()

The templates were reloaded or changed: keep showing the stored version of the chosen one, or go back to the list if it was deleted.

Implementation

void syncWithLibrary() {
  final template = _template;
  if (template == null) return;
  _template = library.templates
      .where((entry) => entry.id == template.id)
      .firstOrNull;
  notifyListeners();
}