mirror of
https://github.com/immich-app/immich.git
synced 2025-01-28 00:59:18 -05:00
feat(mobile): Modified draggable area of detail modal (#14953)
Modified draggable area of detail modal
This commit is contained in:
parent
2be1cb7de2
commit
2255f3e966
3 changed files with 33 additions and 14 deletions
|
@ -127,21 +127,32 @@ class GalleryViewerPage extends HookConsumerWidget {
|
||||||
context: context,
|
context: context,
|
||||||
useSafeArea: true,
|
useSafeArea: true,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return FractionallySizedBox(
|
return DraggableScrollableSheet(
|
||||||
heightFactor: 0.75,
|
minChildSize: 0.5,
|
||||||
child: Padding(
|
maxChildSize: 1,
|
||||||
|
initialChildSize: 0.75,
|
||||||
|
expand: false,
|
||||||
|
builder: (context, scrollController) {
|
||||||
|
return Padding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
bottom: context.viewInsets.bottom,
|
bottom: context.viewInsets.bottom,
|
||||||
),
|
),
|
||||||
child: ref
|
child: ref.watch(appSettingsServiceProvider).getSetting<bool>(
|
||||||
.watch(appSettingsServiceProvider)
|
AppSettingsEnum.advancedTroubleshooting,
|
||||||
.getSetting<bool>(AppSettingsEnum.advancedTroubleshooting)
|
)
|
||||||
? AdvancedBottomSheet(assetDetail: asset)
|
? AdvancedBottomSheet(
|
||||||
: DetailPanel(asset: asset),
|
assetDetail: asset,
|
||||||
|
scrollController: scrollController,
|
||||||
|
)
|
||||||
|
: DetailPanel(
|
||||||
|
asset: asset,
|
||||||
|
scrollController: scrollController,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleSwipeUpDown(DragUpdateDetails details) {
|
void handleSwipeUpDown(DragUpdateDetails details) {
|
||||||
|
|
|
@ -6,12 +6,18 @@ import 'package:immich_mobile/entities/asset.entity.dart';
|
||||||
|
|
||||||
class AdvancedBottomSheet extends HookConsumerWidget {
|
class AdvancedBottomSheet extends HookConsumerWidget {
|
||||||
final Asset assetDetail;
|
final Asset assetDetail;
|
||||||
|
final ScrollController? scrollController;
|
||||||
|
|
||||||
const AdvancedBottomSheet({super.key, required this.assetDetail});
|
const AdvancedBottomSheet({
|
||||||
|
super.key,
|
||||||
|
required this.assetDetail,
|
||||||
|
this.scrollController,
|
||||||
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
|
controller: scrollController,
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: const EdgeInsets.symmetric(horizontal: 8.0),
|
margin: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||||
child: LayoutBuilder(
|
child: LayoutBuilder(
|
||||||
|
|
|
@ -9,12 +9,14 @@ import 'package:immich_mobile/entities/asset.entity.dart';
|
||||||
|
|
||||||
class DetailPanel extends HookConsumerWidget {
|
class DetailPanel extends HookConsumerWidget {
|
||||||
final Asset asset;
|
final Asset asset;
|
||||||
|
final ScrollController? scrollController;
|
||||||
|
|
||||||
const DetailPanel({super.key, required this.asset});
|
const DetailPanel({super.key, required this.asset, this.scrollController});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
return ListView(
|
return ListView(
|
||||||
|
controller: scrollController,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
|
|
Loading…
Add table
Reference in a new issue