factoryKey property

String? factoryKey

The key to pass to your page factory to create a new page. This happens when recovering page stack on navigation.

While key commonly contains parameters to make similar pages differ, this one is mostly a simple constant, ex: 'ProfilePage'. This way it is easier to run it through switch-case in your page factory.

Defaults to key if not set explicitly or if null is passed.

Implementation

String? get factoryKey => _factoryKey ?? key;