Skip to content

Commit 0a873bd

Browse files
authored
Update selection_dialog.dart
add isFocused property in textfield
1 parent fbc4d9e commit 0a873bd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/src/selection_dialog.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class SelectionDialog extends StatefulWidget {
99
final bool? showCountryOnly;
1010
final InputDecoration searchDecoration;
1111
final TextStyle? searchStyle;
12+
final bool? isFocused;
1213
final TextStyle? textStyle;
1314
final TextStyle headerTextStyle;
1415
final BoxDecoration? boxDecoration;
@@ -49,6 +50,7 @@ class SelectionDialog extends StatefulWidget {
4950
required this.headerTextStyle,
5051
InputDecoration searchDecoration = const InputDecoration(),
5152
this.searchStyle,
53+
this.isFocused,
5254
this.textStyle,
5355
required this.topBarPadding,
5456
this.headerText,
@@ -125,6 +127,7 @@ class _SelectionDialogState extends State<SelectionDialog> {
125127
Padding(
126128
padding: widget.searchPadding,
127129
child: TextField(
130+
autofocus: widget.isFocused ?? false,
128131
style: widget.searchStyle,
129132
decoration: widget.searchDecoration,
130133
onChanged: _filterElements,

0 commit comments

Comments
 (0)