2021-11-13 10:20:09 +01:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
import 'package:emoji_picker_flutter/emoji_picker_flutter.dart';
|
|
|
|
|
2022-07-14 16:04:24 +02:00
|
|
|
import 'package:fluffychat/utils/fluffy_emoji_picker.dart';
|
2021-11-13 10:20:09 +01:00
|
|
|
import 'chat.dart';
|
|
|
|
|
|
|
|
class ChatEmojiPicker extends StatelessWidget {
|
|
|
|
final ChatController controller;
|
2021-12-13 09:40:53 +01:00
|
|
|
const ChatEmojiPicker(this.controller, {Key? key}) : super(key: key);
|
2021-11-13 10:20:09 +01:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return AnimatedContainer(
|
|
|
|
duration: const Duration(milliseconds: 300),
|
|
|
|
height: controller.showEmojiPicker
|
|
|
|
? MediaQuery.of(context).size.height / 2
|
|
|
|
: 0,
|
|
|
|
child: controller.showEmojiPicker
|
|
|
|
? EmojiPicker(
|
|
|
|
onEmojiSelected: controller.onEmojiSelected,
|
2022-02-14 13:49:46 +01:00
|
|
|
onBackspacePressed: controller.emojiPickerBackspace,
|
2022-07-14 16:04:24 +02:00
|
|
|
customWidget: (c, s) => FluffyEmojiPickerView(c, s),
|
2021-11-13 10:20:09 +01:00
|
|
|
)
|
|
|
|
: null,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|