generate static method

ValueKey<String> generate(
  1. String screenName
)

Generates a unique key for a navigation page.

This method returns a unique ValueKey for each call, ensuring that multiple instances of the same screen type have different keys.

The key is generated using a combination of the screen name and a counter.

Implementation

static ValueKey<String> generate(String screenName) {
  final uniqueId = '${screenName}_${_counter++}';

  return ValueKey<String>(uniqueId);
}