getNewName method

  1. @override
  2. @protected
String getNewName(
  1. String doctype
)
override

Returns a new name for a doctype.

Depends on the document count saved in newNameCount.

Implementation

@override
@protected
String getNewName(String doctype) {
  EmptyDoctypeError.verify(doctype);

  ModelController.newNameCount[doctype] ??= 0;
  ModelController.newNameCount.update(doctype, (value) => value++);
  return 'New $doctype ${ModelController.newNameCount[doctype]}';
}