Flutter Cupertino Text Field Sizing Error

Viewed 237

When a user double taps the text to bring up "Cut Copy Paste", there is a sizing error with the pop-up and the text is cut off. I can't find any questions around this that can help.

See Screenshot and code below

enter image description here

Padding(
                          padding: const EdgeInsets.only(left: 12.0),
                          child: CupertinoTextField(
                            textCapitalization: TextCapitalization.words,
                            focusNode: titleFocus,
                            autofocus: true,
                            controller: titleController,
                            keyboardType: TextInputType.multiline,
                            maxLines: null,
                            cursorColor: Theme.of(context).cursorColor,
                            onSubmitted: (text) {
                              titleFocus.unfocus();
                              FocusScope.of(context)
                                  .requestFocus(contentFocus);
                            },
                            textInputAction: TextInputAction.next,
                            style: GoogleFonts.roboto(
                              textStyle: TextStyle(
                                  //color: Color(0xff3a4759),
                                  fontSize: 20,
                                  color: Theme.of(context).accentColor,
                                  fontWeight: FontWeight.w700),
                            ),
                            placeholder: "Sermon Title",
                            placeholderStyle: TextStyle(
                                color: Colors.grey.shade400,
                                fontSize: 20,
                                fontFamily: 'Helvetica Neue',
                                fontWeight: FontWeight.w500),
                            decoration: BoxDecoration(
                              border: Border.all(
                                color: Colors.grey.withOpacity(0.0),
                              ),
                            ),
                          ),
                        ),
1 Answers

Try below code hope its help to you

Declare one Controller

  final TextEditingController _controller = new TextEditingController();

Your Widget :

     Column(
       children:[
         SizedBox(
           height:30,
         ),
         Padding(
              padding: const EdgeInsets.all( 16.0),
              child: CupertinoTextField(
                textCapitalization: TextCapitalization.words,
                autofocus: true,
                controller: _controller,
                keyboardType: TextInputType.multiline,
                maxLines: null,
                cursorColor: Theme.of(context).cursorColor,
                textInputAction: TextInputAction.next,
                placeholder: "Sermon Title",
                placeholderStyle: TextStyle(
                    color: Colors.grey.shade400,
                    fontSize: 20,
                    fontFamily: 'Helvetica Neue',
                    fontWeight: FontWeight.w500),
                decoration: BoxDecoration(
                  border: Border.all(
                    color: Colors.grey.withOpacity(0.0),
                  ),
                ),
              ),
            ),
      ],
     ),
       

Your result screen -> enter image description here

Related