mirror of
https://github.com/nostrlabs-io/zap-stream-flutter.git
synced 2025-06-16 11:58:50 +00:00
52 lines
1.6 KiB
Dart
52 lines
1.6 KiB
Dart
import 'package:emoji_picker_flutter/emoji_picker_flutter.dart';
|
|
import 'package:flutter/foundation.dart' as foundation;
|
|
import 'package:flutter/widgets.dart';
|
|
import 'package:ndk/entities.dart';
|
|
import 'package:zap_stream_flutter/main.dart';
|
|
import 'package:zap_stream_flutter/theme.dart';
|
|
|
|
class ReactionWidget extends StatelessWidget {
|
|
final Nip01Event event;
|
|
|
|
const ReactionWidget({super.key, required this.event});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return EmojiPicker(
|
|
onEmojiSelected: (category, emoji) {
|
|
ndk.broadcast.broadcastReaction(
|
|
eventId: event.id,
|
|
reaction: emoji.emoji,
|
|
);
|
|
Navigator.pop(context);
|
|
},
|
|
config: Config(
|
|
height: 256,
|
|
checkPlatformCompatibility: true,
|
|
emojiViewConfig: EmojiViewConfig(
|
|
emojiSizeMax:
|
|
28 *
|
|
(foundation.defaultTargetPlatform == TargetPlatform.iOS
|
|
? 1.20
|
|
: 1.0),
|
|
backgroundColor: LAYER_1,
|
|
),
|
|
viewOrderConfig: const ViewOrderConfig(
|
|
top: EmojiPickerItem.categoryBar,
|
|
middle: EmojiPickerItem.emojiView,
|
|
bottom: EmojiPickerItem.searchBar,
|
|
),
|
|
bottomActionBarConfig: BottomActionBarConfig(
|
|
backgroundColor: LAYER_2,
|
|
buttonColor: PRIMARY_1,
|
|
),
|
|
categoryViewConfig: CategoryViewConfig(backgroundColor: LAYER_2),
|
|
searchViewConfig: SearchViewConfig(
|
|
backgroundColor: LAYER_2,
|
|
buttonIconColor: PRIMARY_1,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|