focus_widget 1.0.5+2 copy "focus_widget: ^1.0.5+2" to clipboard
focus_widget: ^1.0.5+2 copied to clipboard

When tap outside of the widget, let the FocusNode lose focus.

Flutter Focus Widget #

一个可以让FocusNode失去焦点的Widget #

A focusable and blurable widget of based on the FocusNode. #

  • 新增的参数:

    • bool showFocusArea

      使用一个半透明的红色方框显示焦点区域,主要用于调试。

    • void Function(Widget widget, FocusNode focusNode) onLostFocus

      失去焦点后会调用这个function。

  • New Parameters:

    • bool showFocusArea

      Display a translucent red box to show the focus area, it's for debug.

    • void Function(Widget widget, FocusNode focusNode) onLostFocus

      When lost focus invoke this function.

  • 当FocusWidget获得焦点后

    在FocusWidget区域外点击

    会调用FocusNode.unfocus()并且触发FocusNode的listener

  • When the FocusWidget had focus

    Tap outside the FocusWidget area

    Will call the FocusNode's unfocus method and trigger the FocusNode's listener

GIF #

gif

20
likes
140
pub points
76%
popularity

Publisher

unverified uploader

When tap outside of the widget, let the FocusNode lose focus.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on focus_widget