[FormBuilderDropdown]: i can't align the hintText center
TroubleChenC opened this issue · comments
TroubleChenC commented
Is there an existing issue for this?
- I have searched the existing issues
Package/Plugin version
9.0.0
Platforms
- Android
- iOS
- Linux
- MacOS
- Web
- Windows
Flutter doctor
Flutter doctor
[√] Flutter (Channel stable, 3.10.5, on Microsoft Windows [版本
10.0.22621.2428], locale zh-CN)
• Flutter version 3.10.5 on channel stable at
C:\work\sdk\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 796c8ef792 (4 months ago), 2023-06-13
15:51:02 -0700
• Engine revision 45f6e00911
• Dart version 3.0.5
• DevTools version 2.23.1
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn
[√] Windows Version (Installed version of Windows is version 10 or
higher)
[√] Android toolchain - develop for Android devices (Android SDK
version 34.0.0)
• Android SDK at C:\Users\chenc\AppData\Local\Android\sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: C:\Program Files\Android\Android
Studio\jbr\bin\java
• Java version OpenJDK Runtime Environment (build
17.0.6+0-b2043.56-9586694)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program
Files\Google\Chrome\Application\chrome.exe
[X] Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows
development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload,
including all of its default components
[√] Android Studio (version 2022.2)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build
17.0.6+0-b2043.56-9586694)
[√] VS Code (version 1.83.0)
• VS Code at C:\Users\chenc\AppData\Local\Programs\Microsoft VS
Code
• Flutter extension version 3.72.0
[√] Connected device (4 available)
• sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64
• Android 14 (API 34) (emulator)
• Windows (desktop) • windows • windows-x64
• Microsoft Windows [版本 10.0.22621.2428]
• Chrome (web) • chrome • web-javascript
• Google Chrome 118.0.5993.71
• Edge (web) • edge • web-javascript
• Microsoft Edge 117.0.2045.60
[√] Network resources
• All expected network resources are available.
Minimal code example
Code sample
class _FormTestState extends State<FormTest> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Form')),
body: Center(
child: FormBuilder(
child: Column(
children: [
FormBuilderDropdown(
name: 'name',
decoration: const InputDecoration(
// labelText: 'Gender',
hintText: 'hint',
),
alignment: AlignmentDirectional.center,
// initialValue: 2,
items: const [1, 2, 3]
.map(
(e) => DropdownMenuItem(
alignment: AlignmentDirectional.center,
value: e,
child: Text(
e.toString(),
textAlign: TextAlign.center,
),
),
)
.toList(),
),
FormBuilderTextField(
name: '2',
decoration: const InputDecoration(hintText: 'hint'),
textAlign: TextAlign.center,
),
],
),
),
),
);
}
}
Current Behavior
the document show:
{AlignmentGeometry alignment = AlignmentDirectional.centerStart}
Type: AlignmentGeometry
Defines how the hint or the selected item is positioned within the button.
This property must not be null. It defaults to AlignmentDirectional.centerStart.
i set the alignment: AlignmentDirectional.center, but i not wok!
Expected Behavior
i want the hintText align center like FormBuilderTextField below !
Steps To Reproduce
easy to reproduce!
Aditional information
No response