feat: Added file picker section space
This commit is contained in:
+21
-34
@@ -172,6 +172,7 @@ class MessageInputState extends State<MessageInput> {
|
||||
Command _chosenCommand;
|
||||
bool _actionsShrunk = false;
|
||||
bool _sendAsDm = false;
|
||||
bool _openFilePickerSection = false;
|
||||
|
||||
/// The editing controller passed to the input TextField
|
||||
TextEditingController textEditingController;
|
||||
@@ -197,6 +198,8 @@ class MessageInputState extends State<MessageInput> {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: _buildDmCheckbox(),
|
||||
),
|
||||
if(_openFilePickerSection)
|
||||
_buildFilePickerSection(),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -420,40 +423,6 @@ class MessageInputState extends State<MessageInput> {
|
||||
);
|
||||
}
|
||||
|
||||
Positioned _buildBorder(BuildContext context) {
|
||||
return Positioned.fill(
|
||||
child: Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
padding: EdgeInsets.all(2),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
gradient: _getGradient(context),
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: StreamChatTheme.of(context)
|
||||
.channelTheme
|
||||
.inputBackground
|
||||
.withAlpha(255),
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: StreamChatTheme.of(context).channelTheme.inputBackground,
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
border: Border.all(
|
||||
color: _typingStarted
|
||||
? Colors.transparent
|
||||
: Theme.of(context).brightness == Brightness.dark
|
||||
? Colors.white.withOpacity(.2)
|
||||
: Colors.black.withOpacity(.2)),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
OverlayEntry _buildCommandsOverlayEntry() {
|
||||
final text = textEditingController.text;
|
||||
final commands = StreamChannel.of(context)
|
||||
@@ -566,6 +535,12 @@ class MessageInputState extends State<MessageInput> {
|
||||
});
|
||||
}
|
||||
|
||||
Widget _buildFilePickerSection() {
|
||||
return Container(
|
||||
height: 200.0,
|
||||
);
|
||||
}
|
||||
|
||||
OverlayEntry _buildMentionsOverlayEntry() {
|
||||
final splits = textEditingController.text
|
||||
.substring(0, textEditingController.value.selection.start)
|
||||
@@ -839,7 +814,13 @@ class MessageInputState extends State<MessageInput> {
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
if(_openFilePickerSection) {
|
||||
setState(() {
|
||||
_openFilePickerSection = false;
|
||||
});
|
||||
} else {
|
||||
showAttachmentModal();
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
@@ -851,6 +832,11 @@ class MessageInputState extends State<MessageInput> {
|
||||
_focusNode.unfocus();
|
||||
}
|
||||
|
||||
if(!kIsWeb) {
|
||||
setState(() {
|
||||
_openFilePickerSection = true;
|
||||
});
|
||||
} else {
|
||||
showModalBottomSheet(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
shape: RoundedRectangleBorder(
|
||||
@@ -919,6 +905,7 @@ class MessageInputState extends State<MessageInput> {
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// Add an attachment to the sending message
|
||||
/// Use this to add custom type attachments
|
||||
|
||||
Reference in New Issue
Block a user