mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-02 18:19:30 +01:00
50 lines
1.4 KiB
Dart
50 lines
1.4 KiB
Dart
import 'package:famedlysdk/famedlysdk.dart';
|
|
import 'package:fluffychat/components/image_bubble.dart';
|
|
import 'package:fluffychat/components/matrix.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_advanced_networkimage/zoomable.dart';
|
|
import '../utils/event_extension.dart';
|
|
|
|
class ImageView extends StatelessWidget {
|
|
final Event event;
|
|
|
|
const ImageView(this.event, {Key key}) : super(key: key);
|
|
|
|
void _forwardAction(BuildContext context) async {
|
|
Matrix.of(context).shareContent = event.content;
|
|
Navigator.of(context).popUntil((r) => r.isFirst);
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: Colors.black,
|
|
appBar: AppBar(
|
|
leading: IconButton(
|
|
icon: Icon(Icons.close),
|
|
onPressed: () => Navigator.of(context).pop(),
|
|
color: Colors.white,
|
|
),
|
|
backgroundColor: Colors.black,
|
|
actions: [
|
|
IconButton(
|
|
icon: Icon(Icons.reply),
|
|
onPressed: () => _forwardAction(context),
|
|
color: Colors.white,
|
|
),
|
|
IconButton(
|
|
icon: Icon(Icons.file_download),
|
|
onPressed: () => event.openFile(context),
|
|
color: Colors.white,
|
|
),
|
|
],
|
|
),
|
|
body: ZoomableWidget(
|
|
minScale: 1.0,
|
|
panLimit: 0.0,
|
|
child: ImageBubble(event, tapToView: false),
|
|
),
|
|
);
|
|
}
|
|
}
|