chore: Move show image viewer one step up
This commit is contained in:
parent
6ed67cd714
commit
b2654f4cc1
2 changed files with 10 additions and 15 deletions
|
|
@ -5,7 +5,6 @@ import 'package:matrix/matrix.dart';
|
||||||
|
|
||||||
import 'package:fluffychat/config/app_config.dart';
|
import 'package:fluffychat/config/app_config.dart';
|
||||||
import 'package:fluffychat/config/setting_keys.dart';
|
import 'package:fluffychat/config/setting_keys.dart';
|
||||||
import 'package:fluffychat/pages/image_viewer/image_viewer.dart';
|
|
||||||
import 'package:fluffychat/utils/file_description.dart';
|
import 'package:fluffychat/utils/file_description.dart';
|
||||||
import 'package:fluffychat/utils/url_launcher.dart';
|
import 'package:fluffychat/utils/url_launcher.dart';
|
||||||
import 'package:fluffychat/widgets/mxc_image.dart';
|
import 'package:fluffychat/widgets/mxc_image.dart';
|
||||||
|
|
@ -59,19 +58,6 @@ class ImageBubble extends StatelessWidget {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onTap(BuildContext context) {
|
|
||||||
if (onTap != null) {
|
|
||||||
onTap!();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!tapToView) return;
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (_) =>
|
|
||||||
ImageViewer(event, timeline: timeline, outerContext: context),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final theme = Theme.of(context);
|
final theme = Theme.of(context);
|
||||||
|
|
@ -105,7 +91,7 @@ class ImageBubble extends StatelessWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () => _onTap(context),
|
onTap: onTap,
|
||||||
borderRadius: borderRadius,
|
borderRadius: borderRadius,
|
||||||
child: Hero(
|
child: Hero(
|
||||||
tag: event.eventId,
|
tag: event.eventId,
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import 'package:fluffychat/config/setting_keys.dart';
|
||||||
import 'package:fluffychat/l10n/l10n.dart';
|
import 'package:fluffychat/l10n/l10n.dart';
|
||||||
import 'package:fluffychat/pages/chat/events/poll.dart';
|
import 'package:fluffychat/pages/chat/events/poll.dart';
|
||||||
import 'package:fluffychat/pages/chat/events/video_player.dart';
|
import 'package:fluffychat/pages/chat/events/video_player.dart';
|
||||||
|
import 'package:fluffychat/pages/image_viewer/image_viewer.dart';
|
||||||
import 'package:fluffychat/utils/adaptive_bottom_sheet.dart';
|
import 'package:fluffychat/utils/adaptive_bottom_sheet.dart';
|
||||||
import 'package:fluffychat/utils/date_time_extension.dart';
|
import 'package:fluffychat/utils/date_time_extension.dart';
|
||||||
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
|
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
|
||||||
|
|
@ -142,6 +143,14 @@ class MessageContent extends StatelessWidget {
|
||||||
borderRadius: borderRadius,
|
borderRadius: borderRadius,
|
||||||
timeline: timeline,
|
timeline: timeline,
|
||||||
textColor: textColor,
|
textColor: textColor,
|
||||||
|
onTap: () => showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (_) => ImageViewer(
|
||||||
|
event,
|
||||||
|
timeline: timeline,
|
||||||
|
outerContext: context,
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
case CuteEventContent.eventType:
|
case CuteEventContent.eventType:
|
||||||
return CuteContent(event);
|
return CuteContent(event);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue