Skip to content

Commit 59be586

Browse files
Merge pull request #141 from webreinvent/feature/input-text-focus-node
Feature -> Develop | Task 7869 Input Text focus node
2 parents cfbc80e + a46c35f commit 59be586

File tree

1 file changed

+11
-5
lines changed
  • content/vaahflutter/5.directory_structure/3.vaahextendflutter/6.widgets/1.atoms

1 file changed

+11
-5
lines changed

content/vaahflutter/5.directory_structure/3.vaahextendflutter/6.widgets/1.atoms/8.input-text.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,16 @@ const InputText(
154154
),
155155
```
156156

157-
Disable border for Input text
157+
You will need to declare FocusNode first.
158+
```dart
159+
final FocusNode myFocusNode = FocusNode();
160+
```
161+
162+
Use focusNode to get focus on Button Tap
158163
```dart{3}
159-
const InputText(
164+
InputText(
160165
label: 'Test',
161-
inputBorder: InputBorderType.none,
166+
focusNode: myFocusNode,
162167
),
163168
```
164169

@@ -212,7 +217,7 @@ class InputText extends StatelessWidget {
212217
final Function()? suffixOnTap;
213218
final int? minLines;
214219
final int? maxLines;
215-
final InputBorderType inputBorder;
220+
final FocusNode? focusNode;
216221
217222
const InputText({
218223
super.key,
@@ -235,7 +240,7 @@ class InputText extends StatelessWidget {
235240
this.suffixOnTap,
236241
this.minLines,
237242
this.maxLines,
238-
this.inputBorder = InputBorderType.outline,
243+
this.focusNode,
239244
});
240245
241246
@override
@@ -308,6 +313,7 @@ class InputText extends StatelessWidget {
308313
autovalidateMode: autoValidateMode,
309314
minLines: minLines,
310315
maxLines: maxLines,
316+
focusNode: focusNode,
311317
);
312318
}
313319

0 commit comments

Comments
 (0)