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-08-07 19:36:42 +02:00
|
|
|
import 'image_bubble.dart';
|
|
|
|
|
2023-05-27 21:56:27 +02:00
|
|
|
class Sticker extends StatelessWidget {
|
2021-08-07 19:36:42 +02:00
|
|
|
final Event event;
|
2023-05-27 21:56:27 +02:00
|
|
|
final Color watermarkColor;
|
2021-08-07 19:36:42 +02:00
|
|
|
|
2023-05-27 21:56:27 +02:00
|
|
|
const Sticker(this.event, {Key? key, required this.watermarkColor})
|
|
|
|
: super(key: key);
|
2021-08-07 19:36:42 +02:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return ImageBubble(
|
2023-05-27 21:56:27 +02:00
|
|
|
event,
|
2021-08-07 19:36:42 +02:00
|
|
|
width: 400,
|
2021-11-19 11:02:05 +01:00
|
|
|
height: 400,
|
|
|
|
fit: BoxFit.contain,
|
2021-08-07 19:36:42 +02:00
|
|
|
onTap: () {
|
|
|
|
showOkAlertDialog(
|
|
|
|
context: context,
|
2023-05-27 21:56:27 +02:00
|
|
|
message: event.body,
|
2022-01-29 12:35:03 +01:00
|
|
|
okLabel: L10n.of(context)!.ok,
|
2021-08-07 19:36:42 +02:00
|
|
|
);
|
|
|
|
},
|
2023-05-27 21:56:27 +02:00
|
|
|
watermarkColor: watermarkColor,
|
2021-08-07 19:36:42 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|