fluffychat/lib/pages/chat/events/sticker.dart

41 lines
943 B
Dart
Raw Normal View History

import 'package:flutter/material.dart';
2021-10-26 18:50:34 +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';
import 'image_bubble.dart';
class Sticker extends StatefulWidget {
final Event event;
2022-01-29 12:35:03 +01:00
const Sticker(this.event, {Key? key}) : super(key: key);
@override
_StickerState createState() => _StickerState();
}
class _StickerState extends State<Sticker> {
2022-01-29 12:35:03 +01:00
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,
onTap: () {
setState(() => animated = true);
showOkAlertDialog(
context: context,
message: widget.event.body,
2022-01-29 12:35:03 +01:00
okLabel: L10n.of(context)!.ok,
);
},
animated: animated ?? AppConfig.autoplayImages,
);
}
}