EntityDetailNavigator<T> class abstract

An abstract navigator for handling navigation to entity detail pages.

This class provides a generic interface for navigating to detail views of entities and retrieving entity data. Implementations should provide platform-specific or entity-type-specific navigation logic.

Type parameter:

  • T: The type of entity that this navigator handles

Example

class UserDetailNavigator extends EntityDetailNavigator<User> {
  @override
  Future<void> navigate(BuildContext context) async {
    Navigator.push(context, MaterialPageRoute(
      builder: (_) => UserDetailPage(),
    ));
  }

  @override
  Future<User> getEntity(int entityId) async {
    return await userRepository.getUserById(entityId);
  }
}

Constructors

EntityDetailNavigator()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getEntity(int entityId) Future<T>
Retrieves the entity data by its ID.
Navigates to the detail page for the entity.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited