lzhuor / auto_size_text_field

Flutter TextField widget that automatically resizes text field to fit perfectly within its bounds.
https://pub.dev/packages/auto_size_text_field
MIT License
52 stars 35 forks source link

Adding suffixStyle cause spaces to appears #18

Open rfm4j opened 3 years ago

rfm4j commented 3 years ago

Consider the following piece of code:

AutoSizeTextField(
              controller: this.testController,
                expands: false,
                maxLines: 1,
                fullwidth: false,
                textAlign: TextAlign.left,
                style: TextStyle(
                  fontFamily: 'RobotoMono',
                  fontSize: 17,
                ),
                decoration: InputDecoration(
                    contentPadding: EdgeInsets.all(0),
                    isDense: true,
                    isCollapsed: false,
                    border: InputBorder.none,
                    focusedBorder: InputBorder.none,
                    enabledBorder: InputBorder.none,
                    errorBorder: InputBorder.none,
                    disabledBorder: InputBorder.none,
                    suffixText: "sufitText  ",
                  suffixStyle: TextStyle(
                  fontFamily: 'RobotoMono',
                  //fontWeight: FontWeight.bold,
                  fontSize: 13,
                ),
                ),),

This simple example will result in some strange whitespaces between the end of the text and the suffix text: image

However, when removing this suffixStyle, the problem disappears:

AutoSizeTextField(
                controller: this.testController,
                expands: false,
                maxLines: 1,
                fullwidth: false,
                textAlign: TextAlign.left,
                style: TextStyle(
                  fontFamily: 'RobotoMono',
                  fontSize: 17,
                ),
                decoration: InputDecoration(
                    contentPadding: EdgeInsets.all(0),
                    isDense: true,
                    isCollapsed: false,
                    border: InputBorder.none,
                    focusedBorder: InputBorder.none,
                    enabledBorder: InputBorder.none,
                    errorBorder: InputBorder.none,
                    disabledBorder: InputBorder.none,
                    suffixText: "sufitText  ",
                ),),

image