mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-04 03:27:09 -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>
		
			
				
	
	
		
			55 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			55 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			Dart
		
	
	
	
	
	
import 'dart:async';
 | 
						|
 | 
						|
import 'package:auto_route/auto_route.dart';
 | 
						|
import 'package:flutter/material.dart';
 | 
						|
import 'package:hooks_riverpod/hooks_riverpod.dart';
 | 
						|
import 'package:immich_mobile/presentation/widgets/album/album_selector.widget.dart';
 | 
						|
import 'package:immich_mobile/providers/infrastructure/album.provider.dart';
 | 
						|
import 'package:immich_mobile/providers/infrastructure/current_album.provider.dart';
 | 
						|
import 'package:immich_mobile/routing/router.dart';
 | 
						|
import 'package:immich_mobile/widgets/common/immich_sliver_app_bar.dart';
 | 
						|
 | 
						|
@RoutePage()
 | 
						|
class DriftAlbumsPage extends ConsumerStatefulWidget {
 | 
						|
  const DriftAlbumsPage({super.key});
 | 
						|
 | 
						|
  @override
 | 
						|
  ConsumerState<DriftAlbumsPage> createState() => _DriftAlbumsPageState();
 | 
						|
}
 | 
						|
 | 
						|
class _DriftAlbumsPageState extends ConsumerState<DriftAlbumsPage> {
 | 
						|
  Future<void> onRefresh() async {
 | 
						|
    await ref.read(remoteAlbumProvider.notifier).refresh();
 | 
						|
  }
 | 
						|
 | 
						|
  @override
 | 
						|
  Widget build(BuildContext context) {
 | 
						|
    return RefreshIndicator(
 | 
						|
      onRefresh: onRefresh,
 | 
						|
      edgeOffset: 100,
 | 
						|
      child: CustomScrollView(
 | 
						|
        slivers: [
 | 
						|
          ImmichSliverAppBar(
 | 
						|
            snap: false,
 | 
						|
            floating: false,
 | 
						|
            pinned: true,
 | 
						|
            actions: [
 | 
						|
              IconButton(
 | 
						|
                icon: const Icon(Icons.add_rounded, size: 28),
 | 
						|
                onPressed: () => context.pushRoute(const DriftCreateAlbumRoute()),
 | 
						|
              ),
 | 
						|
            ],
 | 
						|
            showUploadButton: false,
 | 
						|
          ),
 | 
						|
          AlbumSelector(
 | 
						|
            onAlbumSelected: (album) {
 | 
						|
              ref.read(currentRemoteAlbumProvider.notifier).setAlbum(album);
 | 
						|
              context.router.push(RemoteAlbumRoute(album: album));
 | 
						|
            },
 | 
						|
          ),
 | 
						|
        ],
 | 
						|
      ),
 | 
						|
    );
 | 
						|
  }
 | 
						|
}
 |