refs #18: unfocus keyboard before picking attachment
This commit is contained in:
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>IDEDidComputeMac32BitWarning</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -56,13 +56,13 @@ import 'stream_channel.dart';
|
|||||||
/// The widget renders the ui based on the first ancestor of type [StreamChatTheme].
|
/// The widget renders the ui based on the first ancestor of type [StreamChatTheme].
|
||||||
/// Modify it to change the widget appearance.
|
/// Modify it to change the widget appearance.
|
||||||
class MessageInput extends StatefulWidget {
|
class MessageInput extends StatefulWidget {
|
||||||
MessageInput(
|
MessageInput({
|
||||||
{Key key,
|
Key key,
|
||||||
this.onMessageSent,
|
this.onMessageSent,
|
||||||
this.parentMessage,
|
this.parentMessage,
|
||||||
this.editMessage,
|
this.editMessage,
|
||||||
this.maxHeight = 150})
|
this.maxHeight = 150,
|
||||||
: super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
/// Message to edit
|
/// Message to edit
|
||||||
final Message editMessage;
|
final Message editMessage;
|
||||||
@@ -506,6 +506,10 @@ class _MessageInputState extends State<MessageInput> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _showAttachmentModal() {
|
void _showAttachmentModal() {
|
||||||
|
if (_focusNode.hasFocus) {
|
||||||
|
_focusNode.unfocus();
|
||||||
|
}
|
||||||
|
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
clipBehavior: Clip.hardEdge,
|
clipBehavior: Clip.hardEdge,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
@@ -548,7 +552,6 @@ class _MessageInputState extends State<MessageInput> {
|
|||||||
leading: Icon(Icons.camera_alt),
|
leading: Icon(Icons.camera_alt),
|
||||||
title: Text('Photo from camera'),
|
title: Text('Photo from camera'),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
ImagePicker.pickImage(source: ImageSource.camera);
|
|
||||||
_pickFile(FileType.image, true);
|
_pickFile(FileType.image, true);
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
},
|
},
|
||||||
@@ -587,6 +590,10 @@ class _MessageInputState extends State<MessageInput> {
|
|||||||
file = await FilePicker.getFile(type: type);
|
file = await FilePicker.getFile(type: type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (file == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final channel = StreamChannel.of(context).channel;
|
final channel = StreamChannel.of(context).channel;
|
||||||
|
|
||||||
final bytes = await file.readAsBytes();
|
final bytes = await file.readAsBytes();
|
||||||
|
|||||||
@@ -10,8 +10,6 @@ dependencies:
|
|||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
rxdart: ^0.23.1
|
rxdart: ^0.23.1
|
||||||
|
|
||||||
|
|
||||||
jiffy: ^3.0.1
|
jiffy: ^3.0.1
|
||||||
cached_network_image: ^2.0.0
|
cached_network_image: ^2.0.0
|
||||||
flutter_markdown: ^0.3.4
|
flutter_markdown: ^0.3.4
|
||||||
|
|||||||
Reference in New Issue
Block a user