mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-04 03:27:09 -05:00 
			
		
		
		
	* feat(mobile): drift recently taken page * fix: lint * refactor(mobile): timeline queries (#19818) refactor: remote assets query to take single user id Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> --------- Co-authored-by: shenlong <139912620+shenlong-tanwen@users.noreply.github.com> Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
		
			
				
	
	
		
			36 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Dart
		
	
	
	
	
	
import 'package:auto_route/auto_route.dart';
 | 
						|
import 'package:flutter/widgets.dart';
 | 
						|
import 'package:hooks_riverpod/hooks_riverpod.dart';
 | 
						|
import 'package:immich_mobile/presentation/widgets/timeline/timeline.widget.dart';
 | 
						|
import 'package:immich_mobile/providers/infrastructure/timeline.provider.dart';
 | 
						|
import 'package:immich_mobile/providers/user.provider.dart';
 | 
						|
 | 
						|
@RoutePage()
 | 
						|
class DriftRecentlyTakenPage extends StatelessWidget {
 | 
						|
  const DriftRecentlyTakenPage({super.key});
 | 
						|
 | 
						|
  @override
 | 
						|
  Widget build(BuildContext context) {
 | 
						|
    return ProviderScope(
 | 
						|
      overrides: [
 | 
						|
        timelineServiceProvider.overrideWith(
 | 
						|
          (ref) {
 | 
						|
            final user = ref.watch(currentUserProvider);
 | 
						|
            if (user == null) {
 | 
						|
              throw Exception(
 | 
						|
                'User must be logged in to access recently taken',
 | 
						|
              );
 | 
						|
            }
 | 
						|
 | 
						|
            final timelineService =
 | 
						|
                ref.watch(timelineFactoryProvider).remoteAssets(user.id);
 | 
						|
            ref.onDispose(timelineService.dispose);
 | 
						|
            return timelineService;
 | 
						|
          },
 | 
						|
        ),
 | 
						|
      ],
 | 
						|
      child: const Timeline(),
 | 
						|
    );
 | 
						|
  }
 | 
						|
}
 |