2022-12-29 08:45:28 +03:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:gallery_picker/views/album_view/album_appbar.dart';
|
2024-02-24 22:33:52 +03:00
|
|
|
|
2022-12-29 08:45:28 +03:00
|
|
|
import '../../../controller/gallery_controller.dart';
|
|
|
|
import '../../../models/gallery_album.dart';
|
|
|
|
import 'album_medias_view.dart';
|
|
|
|
|
|
|
|
class AlbumPage extends StatelessWidget {
|
2022-12-30 05:18:18 +03:00
|
|
|
final bool singleMedia;
|
|
|
|
final PhoneGalleryController controller;
|
2023-01-20 09:58:21 +03:00
|
|
|
final GalleryAlbum? album;
|
|
|
|
final bool isBottomSheet;
|
2022-12-30 05:18:18 +03:00
|
|
|
const AlbumPage(
|
2022-12-29 08:45:28 +03:00
|
|
|
{super.key,
|
|
|
|
required this.album,
|
|
|
|
required this.controller,
|
|
|
|
required this.singleMedia,
|
2023-01-20 09:58:21 +03:00
|
|
|
required this.isBottomSheet});
|
2022-12-29 08:45:28 +03:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2024-02-24 22:33:52 +03:00
|
|
|
return PopScope(
|
|
|
|
canPop: false,
|
|
|
|
onPopInvoked: (value) {
|
|
|
|
controller.backToPicker();
|
|
|
|
},
|
2023-01-20 09:58:21 +03:00
|
|
|
child: Scaffold(
|
|
|
|
backgroundColor: controller.config.backgroundColor,
|
|
|
|
appBar: album != null
|
|
|
|
? AlbumAppBar(
|
|
|
|
album: album!,
|
|
|
|
controller: controller,
|
|
|
|
isBottomSheet: isBottomSheet,
|
|
|
|
)
|
|
|
|
: null,
|
|
|
|
body: album != null
|
|
|
|
? AlbumMediasView(
|
|
|
|
galleryAlbum: album!,
|
|
|
|
controller: controller,
|
|
|
|
isBottomSheet: isBottomSheet,
|
|
|
|
singleMedia: singleMedia,
|
|
|
|
)
|
|
|
|
: Center(
|
|
|
|
child: Text(
|
|
|
|
"No Album Found",
|
|
|
|
style: controller.config.textStyle,
|
|
|
|
)),
|
2024-02-24 22:33:52 +03:00
|
|
|
));
|
2022-12-29 08:45:28 +03:00
|
|
|
}
|
|
|
|
}
|