如何对齐复制,将工具提示粘贴到TypeAheadFormField中

时间:2020-05-30 07:22:47

标签: flutter flutter-layout

我使用过具有enableInteractiveSelection为true的TypeAheadFormField。我尝试键入多行文本,然后尝试选择并复制,我得到了复制,将工具提示粘贴到屏幕顶部。我无法控制工具提示的对齐方式。我怎样才能解决这个问题? 在这里,我已经附上了屏幕以及代码。

Expanded(
             child: Container(
              child: ConstrainedBox(
                            constraints: BoxConstraints(
                              minHeight: 25,
                              maxHeight: 100.0,
                            ),
                            child: SingleChildScrollView(
                              scrollDirection: Axis.vertical,
                                child: Padding(
                                padding: const EdgeInsets.only(
                                    left: 5, bottom: 3),
                                child: TypeAheadFormField(
                                  direction: AxisDirection.up,
                                  textFieldConfiguration:
                                      TextFieldConfiguration(
                                    enableInteractiveSelection: true,
                                    controller: txtController,
                                    focusNode: txtFocus,
                                    textInputAction:
                                        TextInputAction.newline,
                                    keyboardType: TextInputType.multiline,
                                    maxLines: null,
                                    decoration: InputDecoration.collapsed(
                                      hintText: "Type a message",
                                    ),

                                  ),
                                  validator: (value) {
                                    if (value.isEmpty) {
                                      return 'Please enter the message';
                                    }
                                    return null;
                                  },
                                ),

                              ),
                            ),
                          ),
                        ),
                      ),

enter image description here

0 个答案:

没有答案