2025-06-30 21:24:50 -05:00
|
|
|
import 'dart:async';
|
|
|
|
|
|
|
|
|
|
import 'package:auto_route/auto_route.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
2025-07-25 01:10:33 -05:00
|
|
|
import 'package:immich_mobile/presentation/widgets/album/album_selector.widget.dart';
|
2025-06-30 21:24:50 -05:00
|
|
|
import 'package:immich_mobile/providers/infrastructure/album.provider.dart';
|
2025-07-15 20:37:44 -05:00
|
|
|
import 'package:immich_mobile/providers/infrastructure/current_album.provider.dart';
|
2025-06-30 21:24:50 -05:00
|
|
|
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,
|
2025-07-18 13:16:22 -05:00
|
|
|
edgeOffset: 100,
|
2025-06-30 21:24:50 -05:00
|
|
|
child: CustomScrollView(
|
|
|
|
|
slivers: [
|
2025-07-10 11:59:15 -05:00
|
|
|
ImmichSliverAppBar(
|
2025-07-18 13:16:22 -05:00
|
|
|
snap: false,
|
|
|
|
|
floating: false,
|
|
|
|
|
pinned: true,
|
2025-07-10 11:59:15 -05:00
|
|
|
actions: [
|
|
|
|
|
IconButton(
|
2025-07-29 00:34:03 +05:30
|
|
|
icon: const Icon(Icons.add_rounded, size: 28),
|
|
|
|
|
onPressed: () => context.pushRoute(const DriftCreateAlbumRoute()),
|
2025-07-10 11:59:15 -05:00
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
showUploadButton: false,
|
|
|
|
|
),
|
2025-07-25 01:10:33 -05:00
|
|
|
AlbumSelector(
|
|
|
|
|
onAlbumSelected: (album) {
|
|
|
|
|
ref.read(currentRemoteAlbumProvider.notifier).setAlbum(album);
|
2025-07-29 00:34:03 +05:30
|
|
|
context.router.push(RemoteAlbumRoute(album: album));
|
2025-07-25 01:10:33 -05:00
|
|
|
},
|
2025-06-30 21:24:50 -05:00
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|