1. @override
dynamic onRemoving()

Callback used to notify a node that it is about to be removed.

Source

@override
onRemoving() {
  if (database != null) {
    database.close();
  }
}