mirror of
https://github.com/Iconica-Development/flutter_input_library.git
synced 2025-05-18 17:03:45 +02:00
feat: add FlutterFormInputDropdown
This commit is contained in:
parent
fbc64dcc23
commit
d74c702fa7
4 changed files with 104 additions and 1 deletions
|
@ -84,3 +84,6 @@
|
|||
|
||||
## 3.3.1
|
||||
* Loosened the dependen on intl to be more compatible with several Flutter versions
|
||||
|
||||
## 3.4.0
|
||||
* Added `FlutterFormInputDropdown`
|
||||
|
|
99
lib/src/inputs/dropdown/dropdown.dart
Normal file
99
lib/src/inputs/dropdown/dropdown.dart
Normal file
|
@ -0,0 +1,99 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class FlutterFormInputDropdown extends StatelessWidget {
|
||||
const FlutterFormInputDropdown({
|
||||
this.alignment = AlignmentDirectional.centerStart,
|
||||
this.autofocus = false,
|
||||
this.isExpanded = false,
|
||||
this.isDense = true,
|
||||
this.iconSize = 24,
|
||||
this.elevation = 8,
|
||||
this.items,
|
||||
this.selectedItemBuilder,
|
||||
this.value,
|
||||
this.hint,
|
||||
this.disabledHint,
|
||||
this.onChanged,
|
||||
this.onTap,
|
||||
this.style,
|
||||
this.icon,
|
||||
this.iconDisabledColor,
|
||||
this.iconEnabledColor,
|
||||
this.itemHeight,
|
||||
this.focusColor,
|
||||
this.focusNode,
|
||||
this.dropdownColor,
|
||||
this.decoration,
|
||||
this.onSaved,
|
||||
this.validator,
|
||||
this.autovalidateMode,
|
||||
this.menuMaxHeight,
|
||||
this.enableFeedback,
|
||||
this.borderRadius,
|
||||
this.padding,
|
||||
super.key,
|
||||
});
|
||||
|
||||
final List<DropdownMenuItem<Object?>>? items;
|
||||
final List<Widget> Function(BuildContext)? selectedItemBuilder;
|
||||
final Object? value;
|
||||
final Widget? hint;
|
||||
final Widget? disabledHint;
|
||||
final void Function(Object?)? onChanged;
|
||||
final void Function()? onTap;
|
||||
final int elevation;
|
||||
final TextStyle? style;
|
||||
final Widget? icon;
|
||||
final Color? iconDisabledColor;
|
||||
final Color? iconEnabledColor;
|
||||
final double iconSize;
|
||||
final bool isDense;
|
||||
final bool isExpanded;
|
||||
final double? itemHeight;
|
||||
final Color? focusColor;
|
||||
final FocusNode? focusNode;
|
||||
final bool autofocus;
|
||||
final Color? dropdownColor;
|
||||
final InputDecoration? decoration;
|
||||
final void Function(Object?)? onSaved;
|
||||
final String? Function(Object?)? validator;
|
||||
final AutovalidateMode? autovalidateMode;
|
||||
final double? menuMaxHeight;
|
||||
final bool? enableFeedback;
|
||||
final AlignmentGeometry alignment;
|
||||
final BorderRadius? borderRadius;
|
||||
final EdgeInsetsGeometry? padding;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => DropdownButtonFormField(
|
||||
items: items,
|
||||
selectedItemBuilder: selectedItemBuilder,
|
||||
value: value,
|
||||
hint: hint,
|
||||
disabledHint: disabledHint,
|
||||
onChanged: (value) => onChanged?.call(value),
|
||||
onTap: () => onTap?.call(),
|
||||
elevation: elevation,
|
||||
style: style,
|
||||
icon: icon,
|
||||
iconDisabledColor: iconDisabledColor,
|
||||
iconEnabledColor: iconEnabledColor,
|
||||
iconSize: iconSize,
|
||||
isDense: isDense,
|
||||
isExpanded: isExpanded,
|
||||
itemHeight: itemHeight,
|
||||
focusColor: focusColor,
|
||||
focusNode: focusNode,
|
||||
autofocus: autofocus,
|
||||
dropdownColor: dropdownColor,
|
||||
decoration: decoration,
|
||||
onSaved: (value) => onSaved?.call(value),
|
||||
validator: (value) => validator?.call(value),
|
||||
autovalidateMode: autovalidateMode,
|
||||
menuMaxHeight: menuMaxHeight,
|
||||
enableFeedback: enableFeedback,
|
||||
alignment: alignment,
|
||||
borderRadius: borderRadius,
|
||||
padding: padding,
|
||||
);
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
export 'bool/bool.dart';
|
||||
export 'carousel/carousel.dart';
|
||||
export 'date_picker/date_picker.dart';
|
||||
export 'dropdown/dropdown.dart';
|
||||
export 'number_picker/number_picker.dart';
|
||||
export 'phone/countries.dart';
|
||||
export 'phone/phone.dart';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name: flutter_input_library
|
||||
description: A new Flutter package project.
|
||||
version: 3.3.1
|
||||
version: 3.4.0
|
||||
repository: https://github.com/Iconica-Development/flutter_input_library
|
||||
|
||||
environment:
|
||||
|
|
Loading…
Reference in a new issue