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

Hint Text not aligned at center in DropdownButtonFormField (3.22.0) #148532

Closed
dheerajverma009 opened this issue May 17, 2024 · 2 comments
Closed
Labels
r: duplicate Issue is closed as a duplicate of an existing issue

Comments

@dheerajverma009
Copy link

Hint Text not aligned at center in DropdownButtonFormField.
But when any item selected from dropdown, the selected item is shown in center as expected.

Screenshots

When showing hint text. No item selected from dropdown.

When item selected from drop down

Code sample

class _DropdownExample extends StatelessWidget {
  const _DropdownExample({
    super.key,
  });

  static const List<String> _itemList = [
    'Item 1',
    'Item 2',
    'Item 3',
    'Item 4',
    'Item 5',
  ];

  @override
  Widget build(BuildContext context) {
    return DropdownButtonFormField(
      decoration: const InputDecoration(
        hintText: 'Select Item',
        focusedBorder: OutlineInputBorder(
          borderRadius: BorderRadius.all(
            Radius.circular(10),
          ),
          borderSide: BorderSide(
            color: Colors.grey,
            width: 1.66,
          ),
        ),
        enabledBorder: OutlineInputBorder(
          borderRadius: BorderRadius.all(Radius.circular(10)),
          borderSide: BorderSide(
            color: Colors.grey,
            width: 1.66,
          ),
        ),
      ),
      onChanged: (_) {},
      icon: const Icon(
        Icons.keyboard_arrow_down_rounded,
      ),
      items: _itemList.map<DropdownMenuItem<String>>((String value) {
        return DropdownMenuItem<String>(
          value: value,
          child: Text(
            value,
          ),
        );
      }).toList(),
    );
  }
} 
@dheerajverma009 dheerajverma009 changed the title Hint Text not aligned at center in DropdownButtonFormField Hint Text not aligned at center in DropdownButtonFormField (3.22.0) May 17, 2024
@darshankawar darshankawar added the in triage Presently being triaged by the triage team label May 17, 2024
@darshankawar
Copy link
Member

Closing as duplicate of #111958

@darshankawar darshankawar closed this as not planned Won't fix, can't repro, duplicate, stale May 17, 2024
@darshankawar darshankawar added r: duplicate Issue is closed as a duplicate of an existing issue and removed in triage Presently being triaged by the triage team labels May 17, 2024
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
r: duplicate Issue is closed as a duplicate of an existing issue
Projects
None yet
Development

No branches or pull requests

2 participants