|
1 | 1 | import 'package:collection/collection.dart' show IterableExtension;
|
2 | 2 | import 'package:flutter/material.dart';
|
3 |
| - |
4 | 3 | import 'package:flutter_form_builder/flutter_form_builder.dart';
|
5 | 4 |
|
6 | 5 | /// Field for Dropdown button
|
@@ -194,8 +193,40 @@ class FormBuilderDropdown<T> extends FormBuilderField<T> {
|
194 | 193 |
|
195 | 194 | final bool shouldRequestFocus;
|
196 | 195 |
|
| 196 | + /// Whether detected gestures should provide acoustic and/or haptic feedback. |
| 197 | + /// |
| 198 | + /// For example, on Android a tap will produce a clicking sound and a |
| 199 | + /// long-press will produce a short vibration, when feedback is enabled. |
| 200 | + /// |
| 201 | + /// By default, platform-specific feedback is enabled. |
| 202 | + /// |
| 203 | + /// See also: |
| 204 | + /// |
| 205 | + /// * [Feedback] for providing platform-specific feedback to certain actions. |
| 206 | + final bool? enableFeedback; |
| 207 | + |
| 208 | + /// Defines how the hint or the selected item is positioned within the button. |
| 209 | + /// |
| 210 | + /// This property must not be null. It defaults to [AlignmentDirectional.centerStart]. |
| 211 | + /// |
| 212 | + /// See also: |
| 213 | + /// |
| 214 | + /// * [Alignment], a class with convenient constants typically used to |
| 215 | + /// specify an [AlignmentGeometry]. |
| 216 | + /// * [AlignmentDirectional], like [Alignment] for specifying alignments |
| 217 | + /// relative to text direction. |
| 218 | + final AlignmentGeometry alignment; |
| 219 | + |
| 220 | + /// Defines the corner radii of the menu's rounded rectangle shape. |
| 221 | + /// |
| 222 | + /// The radii of the first menu item's top left and right corners are |
| 223 | + /// defined by the corresponding properties of the [borderRadius]. |
| 224 | + /// Similarly, the radii of the last menu item's bottom and right corners |
| 225 | + /// are defined by the corresponding properties of the [borderRadius]. |
| 226 | + final BorderRadius? borderRadius; |
| 227 | + |
197 | 228 | /// Creates field for Dropdown button
|
198 |
| - FormBuilderDropdown({ |
| 229 | + FormBuilderDropdown( { |
199 | 230 | Key? key,
|
200 | 231 | //From Super
|
201 | 232 | required String name,
|
@@ -230,6 +261,9 @@ class FormBuilderDropdown<T> extends FormBuilderField<T> {
|
230 | 261 | this.itemHeight = kMinInteractiveDimension,
|
231 | 262 | this.selectedItemBuilder,
|
232 | 263 | this.menuMaxHeight,
|
| 264 | + this.enableFeedback, |
| 265 | + this.borderRadius, |
| 266 | + this.alignment = AlignmentDirectional.centerStart, |
233 | 267 | }) : /*: assert(allowClear == true || clearIcon != null)*/ super(
|
234 | 268 | key: key,
|
235 | 269 | initialValue: initialValue,
|
@@ -296,6 +330,9 @@ class FormBuilderDropdown<T> extends FormBuilderField<T> {
|
296 | 330 | itemHeight: itemHeight,
|
297 | 331 | selectedItemBuilder: selectedItemBuilder,
|
298 | 332 | menuMaxHeight: menuMaxHeight,
|
| 333 | + borderRadius: borderRadius, |
| 334 | + enableFeedback: enableFeedback, |
| 335 | + alignment: alignment, |
299 | 336 | ),
|
300 | 337 | ),
|
301 | 338 | ),
|
|
0 commit comments