Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text to big and overflowing #173

Closed
bermanapps opened this issue Aug 3, 2023 · 7 comments
Closed

Text to big and overflowing #173

bermanapps opened this issue Aug 3, 2023 · 7 comments
Labels
enhancement New feature or request guidance Question that needs advice or information.

Comments

@bermanapps
Copy link

bermanapps commented Aug 3, 2023

Hi,
Im using this library, but on some devices when the text is bigger, the writing doesnt all show up, and the widget doesnt expand to fill all the text.
Attached is a screen shot.
Screenshot 2023-08-03 at 8 08 23 PM
The full text is "This apointment is urgent", and the second option is "This apointment can wait a day or two". But as you see, its not showing the full text.
Here is my full code of the widget.

  DropdownButtonFormField2(
                decoration: InputDecoration(
                  isDense: true,
                  contentPadding: EdgeInsets.zero,
                  border: OutlineInputBorder(
                    borderSide: BorderSide(color: Colors.blue, width: 0.0),
                    borderRadius: BorderRadius.circular(15),
                  ),
                  // label: Text('Gender'),
                  //Add more decoration as you want here
                  //Add label If you want but add hint outside the decoration to be aligned in the button perfectly.
                ),
                isExpanded: true,
                hint: Text(
                  'Priority',
                  style: TextStyle(fontSize: 20),
                ),
                items: priorityDropDownList
                    .map((item) => DropdownMenuItem<String>(
                  value: item,
                  child: Text(
                    item,
                    style: TextStyle(
                      fontSize: 20,
                    ),
                  ),
                ))
                    .toList(),
                validator: (value) {
                  if (value == null) {
                    return 'Priority';
                  }
                  return null;
                },
                // value: selectedValue == 'NONE' ? null : selectedValue,
                onChanged: (value) {
                  //Do something when changing the item if you want.
                  // ref.read(intValueProvider.notifier).state = getIntFromStringValue(value!);
                  selectedPriority = value!;
                },
                onSaved: (value) {
                  // selectedValue = value.toString();
                },
                buttonStyleData: const ButtonStyleData(
                  height: 60,
                  padding: EdgeInsets.only(left: 0, right: 10),
                ),
                iconStyleData: const IconStyleData(
                  icon: Icon(
                    Icons.arrow_drop_down,
                    color: Colors.black45,
                  ),
                  iconSize: 30,
                ),
                dropdownStyleData: DropdownStyleData(
                  decoration: BoxDecoration(
                    borderRadius: BorderRadius.circular(15),
                  ),
                ),
              ),

@AhmedLSayed9
Copy link
Owner

Duplicate of #163

@AhmedLSayed9 AhmedLSayed9 marked this as a duplicate of #163 Aug 3, 2023
@AhmedLSayed9 AhmedLSayed9 added the duplicate This issue or pull request already exists label Aug 3, 2023
@AhmedLSayed9
Copy link
Owner

Wait, are you referring to the height not the width?

@bermanapps
Copy link
Author

bermanapps commented Aug 3, 2023

Height, I see that issue you referenced is refering to width

@AhmedLSayed9 AhmedLSayed9 removed the duplicate This issue or pull request already exists label Aug 3, 2023
@AhmedLSayed9 AhmedLSayed9 marked this as not a duplicate of #163 Aug 3, 2023
@AhmedLSayed9
Copy link
Owner

Set isDense to false and you can increase itemHeight using menuItemStyleData.height.

@AhmedLSayed9
Copy link
Owner

Hint: Predefine the maximum lines you might need and set proper itemHeight for that. Then you can set maxLines and text overflow for your items text.

@AhmedLSayed9 AhmedLSayed9 added the guidance Question that needs advice or information. label Aug 3, 2023
@bermanapps
Copy link
Author

So there is no way that the height will automatically adjust based on how many lines is needed for the text?

@AhmedLSayed9
Copy link
Owner

AhmedLSayed9 commented Aug 4, 2023

So there is no way that the height will automatically adjust based on how many lines is needed for the text?

Currently, no. That's because the menu scroll offset is being calculated based on items heights.

Anyway, this is relevant to #111.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

2 participants