mirror of
https://github.com/immich-app/immich.git
synced 2025-07-31 15:08:44 -04:00
* feat: add to album on new beta timeline * handle add album button * tune --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
62 lines
1.8 KiB
Dart
62 lines
1.8 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),
|
|
);
|
|
},
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|