|
|
@ -444,13 +444,29 @@ class InputBar extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: TypeAheadField<Map<String, String?>>(
|
|
|
|
child: TypeAheadField<Map<String, String?>>(
|
|
|
|
direction: AxisDirection.up,
|
|
|
|
direction: VerticalDirection.up,
|
|
|
|
hideOnEmpty: true,
|
|
|
|
hideOnEmpty: true,
|
|
|
|
hideOnLoading: true,
|
|
|
|
hideOnLoading: true,
|
|
|
|
keepSuggestionsOnSuggestionSelected: true,
|
|
|
|
controller: controller,
|
|
|
|
|
|
|
|
focusNode: focusNode,
|
|
|
|
|
|
|
|
hideOnSelect: false,
|
|
|
|
debounceDuration: const Duration(milliseconds: 50),
|
|
|
|
debounceDuration: const Duration(milliseconds: 50),
|
|
|
|
// show suggestions after 50ms idle time (default is 300)
|
|
|
|
// show suggestions after 50ms idle time (default is 300)
|
|
|
|
textFieldConfiguration: TextFieldConfiguration(
|
|
|
|
builder: (context, controller, focusNode) => TextField(
|
|
|
|
|
|
|
|
controller: controller,
|
|
|
|
|
|
|
|
focusNode: focusNode,
|
|
|
|
|
|
|
|
contentInsertionConfiguration: ContentInsertionConfiguration(
|
|
|
|
|
|
|
|
onContentInserted: (KeyboardInsertedContent content) {
|
|
|
|
|
|
|
|
final data = content.data;
|
|
|
|
|
|
|
|
if (data == null) return;
|
|
|
|
|
|
|
|
final file = MatrixFile(
|
|
|
|
|
|
|
|
mimeType: content.mimeType,
|
|
|
|
|
|
|
|
bytes: data,
|
|
|
|
|
|
|
|
name: 'content-insertion',
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
room.sendFileEvent(file, shrinkImageMaxDimension: 1600);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
minLines: minLines,
|
|
|
|
minLines: minLines,
|
|
|
|
maxLines: maxLines,
|
|
|
|
maxLines: maxLines,
|
|
|
|
keyboardType: keyboardType!,
|
|
|
|
keyboardType: keyboardType!,
|
|
|
@ -461,9 +477,7 @@ class InputBar extends StatelessWidget {
|
|
|
|
// it sets the types for the callback incorrectly
|
|
|
|
// it sets the types for the callback incorrectly
|
|
|
|
onSubmitted!(text);
|
|
|
|
onSubmitted!(text);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
controller: controller,
|
|
|
|
|
|
|
|
decoration: decoration!,
|
|
|
|
decoration: decoration!,
|
|
|
|
focusNode: focusNode,
|
|
|
|
|
|
|
|
onChanged: (text) {
|
|
|
|
onChanged: (text) {
|
|
|
|
// fix for the library for now
|
|
|
|
// fix for the library for now
|
|
|
|
// it sets the types for the callback incorrectly
|
|
|
|
// it sets the types for the callback incorrectly
|
|
|
@ -474,13 +488,13 @@ class InputBar extends StatelessWidget {
|
|
|
|
suggestionsCallback: getSuggestions,
|
|
|
|
suggestionsCallback: getSuggestions,
|
|
|
|
itemBuilder: (c, s) =>
|
|
|
|
itemBuilder: (c, s) =>
|
|
|
|
buildSuggestion(c, s, Matrix.of(context).client),
|
|
|
|
buildSuggestion(c, s, Matrix.of(context).client),
|
|
|
|
onSuggestionSelected: (Map<String, String?> suggestion) =>
|
|
|
|
onSelected: (Map<String, String?> suggestion) =>
|
|
|
|
insertSuggestion(context, suggestion),
|
|
|
|
insertSuggestion(context, suggestion),
|
|
|
|
errorBuilder: (BuildContext context, Object? error) =>
|
|
|
|
errorBuilder: (BuildContext context, Object? error) =>
|
|
|
|
const SizedBox.shrink(),
|
|
|
|
const SizedBox.shrink(),
|
|
|
|
loadingBuilder: (BuildContext context) => const SizedBox.shrink(),
|
|
|
|
loadingBuilder: (BuildContext context) => const SizedBox.shrink(),
|
|
|
|
// fix loading briefly flickering a dark box
|
|
|
|
// fix loading briefly flickering a dark box
|
|
|
|
noItemsFoundBuilder: (BuildContext context) => const SizedBox
|
|
|
|
emptyBuilder: (BuildContext context) => const SizedBox
|
|
|
|
.shrink(), // fix loading briefly showing no suggestions
|
|
|
|
.shrink(), // fix loading briefly showing no suggestions
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|