Improve transition to full screen image viewer
This commit is contained in:
parent
9a8b2dc8d9
commit
a3df02252d
@ -6,6 +6,8 @@ class FullscreenUrlImgViewer extends StatefulWidget {
|
||||
final List<String> urls;
|
||||
final int index;
|
||||
|
||||
static const double imageScale = 2.5;
|
||||
|
||||
@override
|
||||
State<FullscreenUrlImgViewer> createState() => _FullscreenUrlImgViewerState();
|
||||
}
|
||||
@ -95,7 +97,7 @@ class _ViewerState extends State<_Viewer> with SingleTickerProviderStateMixin {
|
||||
widget.url,
|
||||
),
|
||||
fit: BoxFit.contain,
|
||||
scale: 2.5,
|
||||
scale: FullscreenUrlImgViewer.imageScale,
|
||||
progress: true,
|
||||
),
|
||||
),
|
||||
|
@ -27,12 +27,14 @@ class _Header extends StatelessWidget {
|
||||
child: SafeArea(
|
||||
bottom: false,
|
||||
minimum: EdgeInsets.symmetric(vertical: $styles.insets.sm),
|
||||
child: AppImage(
|
||||
image: NetworkImage(data.image),
|
||||
fit: BoxFit.cover,
|
||||
alignment: Alignment.topCenter,
|
||||
distractor: true,
|
||||
scale: 1.0,
|
||||
child: Hero(
|
||||
tag: data.image,
|
||||
child: AppImage(
|
||||
image: NetworkImage(data.image),
|
||||
fit: BoxFit.contain,
|
||||
distractor: true,
|
||||
scale: FullscreenUrlImgViewer.imageScale, // so the image isn't reloaded
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -42,6 +44,6 @@ class _Header extends StatelessWidget {
|
||||
}
|
||||
|
||||
void _handleImagePressed(BuildContext context) {
|
||||
Navigator.push(context, CupertinoPageRoute(builder: (_) => FullscreenUrlImgViewer(urls: [data.image])));
|
||||
appLogic.showFullscreenDialogRoute(context, FullscreenUrlImgViewer(urls: [data.image]));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user