navigateToWidget<T> static method
Navigate to a screen using MaterialPageRoute
Implementation
static Future<T?>? navigateToWidget<T>(Widget widget) {
final ctx = context;
if (ctx == null) {
DebugLogger.log('[DependencyInjection] ⚠️ Cannot navigate: No context available');
return null;
}
return Navigator.of(ctx).push<T>(MaterialPageRoute(builder: (_) => widget));
}