mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-03 19:17:11 -05:00 
			
		
		
		
	* chore: bump dart sdk to 3.8 * chore: make build * make pigeon * chore: format files --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
		
			
				
	
	
		
			18 lines
		
	
	
		
			567 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			567 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
import 'package:auto_route/auto_route.dart';
 | 
						|
import 'package:flutter/foundation.dart';
 | 
						|
 | 
						|
/// Guards against duplicate navigation to this route
 | 
						|
class DuplicateGuard extends AutoRouteGuard {
 | 
						|
  const DuplicateGuard();
 | 
						|
  @override
 | 
						|
  void onNavigation(NavigationResolver resolver, StackRouter router) async {
 | 
						|
    // Duplicate navigation
 | 
						|
    if (resolver.route.name == router.current.name) {
 | 
						|
      debugPrint('DuplicateGuard: Preventing duplicate route navigation for ${resolver.route.name}');
 | 
						|
      resolver.next(false);
 | 
						|
    } else {
 | 
						|
      resolver.next(true);
 | 
						|
    }
 | 
						|
  }
 | 
						|
}
 |