Skip to content

A easy way to use WidgetsBind like get rect of your widget

License

Notifications You must be signed in to change notification settings

best-flutter/binding_helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

binding_helper

Helper for WidgetsBinding.It is a easy way to use WidgetsBinding, for example: Get the size of a widget after the widget is rendered.

Getting Started

Install

add

    binding_helper:

to your pubspec.yaml

Get the size of the widget

Using GetRectMinxin


class MyState extends State<MyWidget> width GetRectMinxin<MyWidget>{

    // The rect includs size and position of the widget
    @override
    void onGetRect(Rect rect) {
        ...you code
    }

}

Using RectProvider


 new RectProvider(child: myWidget,onGetRect: (Rect rect){
            /// rect is the `Rect` of myWidet
          _rect = rect;

},)

More easy way to use WidgetsBinding is coming soon.

About

A easy way to use WidgetsBind like get rect of your widget

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published