Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 增加focusNode prop,实现焦点可控 #328

Merged
merged 1 commit into from
Sep 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import 'package:flutter/services.dart';
///
// ignore: must_be_immutable
class BrnTextInputFormItem extends StatefulWidget {
/// 录入项的焦点控制对象,主要用于控制焦点
final FocusNode? focusNode;

/// 录入项的唯一标识,主要用于录入类型页面框架中
final String? label;

Expand Down Expand Up @@ -95,6 +98,7 @@ class BrnTextInputFormItem extends StatefulWidget {
this.title = "",
this.subTitle,
this.tipLabel,
this.focusNode,
this.prefixIconType = BrnPrefixIconType.normal,
this.error = "",
this.isEdit = true,
Expand Down Expand Up @@ -185,6 +189,7 @@ class BrnTextInputFormItemState extends State<BrnTextInputFormItem> {
Expanded(
child: TextField(
autofocus: widget.autofocus,
focusNode: widget.focusNode,
keyboardType: BrnFormUtil.getInputType(widget.inputType),
enabled: widget.isEdit,
maxLines: 1,
Expand Down