getMaxId method
Retrieves the maximum ID value for the given data.
Returns:
- The maximum ID value found in the data, or
0if IDs are of typeString.
Implementation
int getMaxId() {
if (TId is String) {
return 0;
}
return _data.values
.expand((routeData) => routeData.keys.whereType<int>())
.fold(0, (max, id) => id > max ? id : max);
}