79556059

Date: 2025-04-04 18:51:47
Score: 1
Natty:
Report link

Check if the current location is already /object before pushing

final currentLocation = GoRouter.of(context).location;
if (currentLocation != '/object') {
  context.push('/object');
}

This ensures you don't push the same screen twice if it's already open.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Harsh Jani