2021-08-07 19:36:42 +02:00
|
|
|
import 'package:flutter/material.dart';
|
2021-10-26 18:50:34 +02:00
|
|
|
|
2021-08-07 19:36:42 +02:00
|
|
|
import 'package:adaptive_dialog/adaptive_dialog.dart';
|
2021-10-26 18:50:34 +02:00
|
|
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
|
|
|
import 'package:matrix/matrix.dart';
|
|
|
|
|
2021-11-09 21:32:16 +01:00
|
|
|
import '../../../config/app_config.dart';
|
2021-08-07 19:36:42 +02:00
|
|
|
import 'image_bubble.dart';
|
|
|
|
|
|
|
|
class Sticker extends StatefulWidget {
|
|
|
|
final Event event;
|
|
|
|
|
|
|
|
const Sticker(this.event, {Key key}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
_StickerState createState() => _StickerState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _StickerState extends State<Sticker> {
|
|
|
|
bool animated;
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return ImageBubble(
|
|
|
|
widget.event,
|
|
|
|
width: 400,
|
2021-11-19 11:02:05 +01:00
|
|
|
height: 400,
|
|
|
|
fit: BoxFit.contain,
|
2021-08-07 19:36:42 +02:00
|
|
|
onTap: () {
|
|
|
|
setState(() => animated = true);
|
|
|
|
showOkAlertDialog(
|
|
|
|
context: context,
|
|
|
|
message: widget.event.body,
|
|
|
|
okLabel: L10n.of(context).ok,
|
|
|
|
);
|
|
|
|
},
|
|
|
|
animated: animated ?? AppConfig.autoplayImages,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|