mirror of
https://github.com/immich-app/immich.git
synced 2025-07-09 03:04:16 -04:00
fix(mobile): Fixes bottom exif info sheet modal drag controls (#7165)
* WIPip * Fixed show modal bottom sheet to use drag handle * Fixes advanced bottom sheet scrolling --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
parent
9c1dd373a5
commit
88214a485b
@ -12,14 +12,6 @@ class AdvancedBottomSheet extends HookConsumerWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
child: Card(
|
|
||||||
shape: const RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.only(
|
|
||||||
topLeft: Radius.circular(15),
|
|
||||||
topRight: Radius.circular(15),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
margin: const EdgeInsets.all(0),
|
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: const EdgeInsets.symmetric(horizontal: 8.0),
|
margin: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||||
child: LayoutBuilder(
|
child: LayoutBuilder(
|
||||||
@ -28,7 +20,6 @@ class AdvancedBottomSheet extends HookConsumerWidget {
|
|||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 32.0),
|
|
||||||
const Align(
|
const Align(
|
||||||
child: Text(
|
child: Text(
|
||||||
"ADVANCED INFO",
|
"ADVANCED INFO",
|
||||||
@ -52,20 +43,23 @@ class AdvancedBottomSheet extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
child: ListView(
|
child: ListView(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
children: [
|
children: [
|
||||||
Align(
|
Align(
|
||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Clipboard.setData(
|
Clipboard.setData(
|
||||||
ClipboardData(text: assetDetail.toString()),
|
ClipboardData(
|
||||||
|
text: assetDetail.toString(),
|
||||||
|
),
|
||||||
).then((_) {
|
).then((_) {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Text(
|
content: Text(
|
||||||
"Copied to clipboard",
|
"Copied to clipboard",
|
||||||
style: context.textTheme.bodyLarge
|
style:
|
||||||
?.copyWith(
|
context.textTheme.bodyLarge?.copyWith(
|
||||||
color: context.primaryColor,
|
color: context.primaryColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -99,7 +93,6 @@ class AdvancedBottomSheet extends HookConsumerWidget {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,6 @@ import 'package:immich_mobile/modules/asset_viewer/ui/description_input.dart';
|
|||||||
import 'package:immich_mobile/modules/map/widgets/map_thumbnail.dart';
|
import 'package:immich_mobile/modules/map/widgets/map_thumbnail.dart';
|
||||||
import 'package:immich_mobile/shared/models/asset.dart';
|
import 'package:immich_mobile/shared/models/asset.dart';
|
||||||
import 'package:immich_mobile/shared/providers/asset.provider.dart';
|
import 'package:immich_mobile/shared/providers/asset.provider.dart';
|
||||||
import 'package:immich_mobile/shared/ui/drag_sheet.dart';
|
|
||||||
import 'package:immich_mobile/utils/selection_handlers.dart';
|
import 'package:immich_mobile/utils/selection_handlers.dart';
|
||||||
import 'package:immich_mobile/utils/bytes_units.dart';
|
import 'package:immich_mobile/utils/bytes_units.dart';
|
||||||
import 'package:maplibre_gl/maplibre_gl.dart';
|
import 'package:maplibre_gl/maplibre_gl.dart';
|
||||||
@ -126,20 +125,6 @@ class ExifBottomSheet extends HookConsumerWidget {
|
|||||||
return text.isNotEmpty ? text : null;
|
return text.isNotEmpty ? text : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
buildDragHeader() {
|
|
||||||
return const Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
SizedBox(height: 12),
|
|
||||||
Align(
|
|
||||||
alignment: Alignment.center,
|
|
||||||
child: CustomDraggingHandle(),
|
|
||||||
),
|
|
||||||
SizedBox(height: 12),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
buildLocation() {
|
buildLocation() {
|
||||||
// Guard no lat/lng
|
// Guard no lat/lng
|
||||||
if (!hasCoordinates()) {
|
if (!hasCoordinates()) {
|
||||||
@ -341,46 +326,32 @@ class ExifBottomSheet extends HookConsumerWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return GestureDetector(
|
return SingleChildScrollView(
|
||||||
onTap: () {
|
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||||
// FocusScope.of(context).unfocus();
|
|
||||||
},
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
child: Card(
|
|
||||||
shape: const RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.only(
|
|
||||||
topLeft: Radius.circular(15),
|
|
||||||
topRight: Radius.circular(15),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
margin: const EdgeInsets.all(0),
|
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: const EdgeInsets.symmetric(horizontal: 16.0),
|
margin: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||||
child: LayoutBuilder(
|
child: LayoutBuilder(
|
||||||
builder: (context, constraints) {
|
builder: (context, constraints) {
|
||||||
if (constraints.maxWidth > 600) {
|
if (constraints.maxWidth > 600) {
|
||||||
// Two column
|
// Two column
|
||||||
return Padding(
|
return Column(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12.0),
|
mainAxisSize: MainAxisSize.min,
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
buildDragHeader(),
|
|
||||||
buildDate(),
|
buildDate(),
|
||||||
if (asset.isRemote) DescriptionInput(asset: asset),
|
if (asset.isRemote) DescriptionInput(asset: asset),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Flexible(
|
Expanded(
|
||||||
flex: hasCoordinates() ? 5 : 0,
|
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(right: 8.0),
|
padding: const EdgeInsets.only(right: 8.0),
|
||||||
child: buildLocation(),
|
child: buildLocation(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Flexible(
|
ConstrainedBox(
|
||||||
flex: 5,
|
constraints: const BoxConstraints(maxWidth: 300),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(left: 8.0),
|
padding: const EdgeInsets.only(left: 8.0),
|
||||||
child: buildDetail(),
|
child: buildDetail(),
|
||||||
@ -390,15 +361,14 @@ class ExifBottomSheet extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 50),
|
const SizedBox(height: 50),
|
||||||
],
|
],
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// One column
|
// One column
|
||||||
return Column(
|
return Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
buildDragHeader(),
|
|
||||||
buildDate(),
|
buildDate(),
|
||||||
assetWithExif.when(
|
assetWithExif.when(
|
||||||
data: (data) => DescriptionInput(asset: data),
|
data: (data) => DescriptionInput(asset: data),
|
||||||
@ -421,8 +391,6 @@ class ExifBottomSheet extends HookConsumerWidget {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -136,6 +136,7 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|||||||
// swallow error silently
|
// swallow error silently
|
||||||
debugPrint('Error precaching next image: $exception, $stackTrace');
|
debugPrint('Error precaching next image: $exception, $stackTrace');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (index < totalAssets && index >= 0) {
|
if (index < totalAssets && index >= 0) {
|
||||||
final asset = loadAsset(index);
|
final asset = loadAsset(index);
|
||||||
precacheImage(
|
precacheImage(
|
||||||
@ -152,10 +153,11 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|||||||
borderRadius: BorderRadius.all(Radius.circular(15.0)),
|
borderRadius: BorderRadius.all(Radius.circular(15.0)),
|
||||||
),
|
),
|
||||||
barrierColor: Colors.transparent,
|
barrierColor: Colors.transparent,
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
useSafeArea: true,
|
showDragHandle: true,
|
||||||
|
enableDrag: true,
|
||||||
context: context,
|
context: context,
|
||||||
|
useSafeArea: true,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user