design: New sticker picker next to emoji picker
This commit is contained in:
parent
6c5133abfe
commit
5a6016931b
5 changed files with 118 additions and 98 deletions
|
|
@ -25,7 +25,6 @@ import 'package:fluffychat/pages/chat/chat_view.dart';
|
|||
import 'package:fluffychat/pages/chat/event_info_dialog.dart';
|
||||
import 'package:fluffychat/pages/chat/recording_dialog.dart';
|
||||
import 'package:fluffychat/pages/chat_details/chat_details.dart';
|
||||
import 'package:fluffychat/utils/adaptive_bottom_sheet.dart';
|
||||
import 'package:fluffychat/utils/error_reporter.dart';
|
||||
import 'package:fluffychat/utils/matrix_sdk_extensions/event_extension.dart';
|
||||
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
|
||||
|
|
@ -37,7 +36,6 @@ import '../../utils/localized_exception_extension.dart';
|
|||
import '../../utils/matrix_sdk_extensions/matrix_file_extension.dart';
|
||||
import 'send_file_dialog.dart';
|
||||
import 'send_location_dialog.dart';
|
||||
import 'sticker_picker_dialog.dart';
|
||||
|
||||
class ChatPage extends StatelessWidget {
|
||||
final String roomId;
|
||||
|
|
@ -594,24 +592,6 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
);
|
||||
}
|
||||
|
||||
void sendStickerAction() async {
|
||||
final sticker = await showAdaptiveBottomSheet<ImagePackImageContent>(
|
||||
context: context,
|
||||
builder: (c) => StickerPickerDialog(room: room),
|
||||
);
|
||||
if (sticker == null) return;
|
||||
final eventContent = <String, dynamic>{
|
||||
'body': sticker.body,
|
||||
if (sticker.info != null) 'info': sticker.info,
|
||||
'url': sticker.url.toString(),
|
||||
};
|
||||
// send the sticker
|
||||
await room.sendEvent(
|
||||
eventContent,
|
||||
type: EventTypes.Sticker,
|
||||
);
|
||||
}
|
||||
|
||||
void voiceMessageAction() async {
|
||||
final scaffoldMessenger = ScaffoldMessenger.of(context);
|
||||
if (PlatformInfos.isAndroid) {
|
||||
|
|
@ -668,6 +648,10 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
});
|
||||
}
|
||||
|
||||
void hideEmojiPicker() {
|
||||
setState(() => showEmojiPicker = false);
|
||||
}
|
||||
|
||||
void emojiPickerAction() {
|
||||
if (showEmojiPicker) {
|
||||
inputFocus.requestFocus();
|
||||
|
|
@ -1146,9 +1130,6 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
if (choice == 'camera-video') {
|
||||
openVideoCameraAction();
|
||||
}
|
||||
if (choice == 'sticker') {
|
||||
sendStickerAction();
|
||||
}
|
||||
if (choice == 'location') {
|
||||
sendLocationAction();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue