frosty/lib/widgets/photo_view.dart
Tommy Chow f68de827cd
Refresh themes and styling (#394)
* consolidate themes

* update and tweak styles, add border styling

* add borders between video and chat

* tweak heights

* improve reply threads
- taller new design
- can now tap parent's reply
- fix crash when tapping self

* tweak border colors

* tweak theme

* tweak theme

* tweak theme

* add accent color picker in settings

* overhaul colors and styles

* remove print

* add divider to chat user modal and revert height

* increase deleted message opacity

* revert highlight color

* tweak color

* tweak colors

* tweak padding

* tweak padding

* tweak placeholder color

* revert input fill color

* use error color
2024-09-06 21:43:27 -07:00

48 lines
1.6 KiB
Dart

import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:frosty/theme.dart';
import 'package:photo_view/photo_view.dart';
import 'package:provider/provider.dart';
class FrostyPhotoViewDialog extends StatefulWidget {
final String imageUrl;
const FrostyPhotoViewDialog({super.key, required this.imageUrl});
@override
State<FrostyPhotoViewDialog> createState() => _FrostyPhotoViewDialogState();
}
class _FrostyPhotoViewDialogState extends State<FrostyPhotoViewDialog> {
PhotoViewScaleState photoViewScaleState = PhotoViewScaleState.initial;
@override
Widget build(BuildContext context) {
return Stack(
alignment: Alignment.topCenter,
children: [
Dismissible(
key: const Key('photo_view_dismissible'),
direction: photoViewScaleState == PhotoViewScaleState.initial
? DismissDirection.vertical
: DismissDirection.none,
onDismissed: Navigator.of(context).pop,
child: PhotoView(
imageProvider: CachedNetworkImageProvider(widget.imageUrl),
scaleStateChangedCallback: (value) =>
setState(() => photoViewScaleState = value),
backgroundDecoration:
const BoxDecoration(color: Colors.transparent),
),
),
IconButton(
icon: Icon(
Icons.close,
color: context.watch<FrostyThemes>().dark.colorScheme.onSurface,
),
onPressed: Navigator.of(context).pop,
),
],
);
}
}