💄 Optimize attachment zoom page

This commit is contained in:
LittleSheep 2025-01-19 01:00:00 +08:00
parent 1625a957f8
commit ddc1dc7daf
3 changed files with 205 additions and 188 deletions

View File

@ -17,6 +17,7 @@
android:label="Solian"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"
android:enableOnBackInvokedCallback="true"
android:requestLegacyExternalStorage="true">
<activity
android:name=".MainActivity"

View File

@ -52,5 +52,15 @@ Future<ThemeData> createAppTheme(
foregroundColor: hasAppBarBlurry ? colorScheme.onSurface : colorScheme.onPrimary,
),
scaffoldBackgroundColor: Colors.transparent,
pageTransitionsTheme: PageTransitionsTheme(
builders: {
TargetPlatform.android: PredictiveBackPageTransitionsBuilder(),
TargetPlatform.iOS: ZoomPageTransitionsBuilder(),
TargetPlatform.macOS: ZoomPageTransitionsBuilder(),
TargetPlatform.fuchsia: ZoomPageTransitionsBuilder(),
TargetPlatform.linux: ZoomPageTransitionsBuilder(),
TargetPlatform.windows: ZoomPageTransitionsBuilder(),
},
),
);
}

View File

@ -144,9 +144,11 @@ class _AttachmentZoomViewState extends State<AttachmentZoomView> {
onDismissed: () {
Navigator.of(context).pop();
},
direction: DismissiblePageDismissDirection.down,
direction: DismissiblePageDismissDirection.none,
backgroundColor: Colors.transparent,
isFullScreen: true,
child: GestureDetector(
behavior: HitTestBehavior.translucent,
child: Scaffold(
body: Stack(
children: [
@ -357,6 +359,10 @@ class _AttachmentZoomViewState extends State<AttachmentZoomView> {
],
),
),
onTap: () {
Navigator.of(context).pop();
},
),
);
}
}