https://github.com/best-flutter/binding_helper
A easy way to use WidgetsBind like get rect of your widget
https://github.com/best-flutter/binding_helper
Last synced: 12 months ago
JSON representation
A easy way to use WidgetsBind like get rect of your widget
- Host: GitHub
- URL: https://github.com/best-flutter/binding_helper
- Owner: best-flutter
- License: other
- Created: 2018-08-30T10:17:40.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-01-11T11:09:21.000Z (over 7 years ago)
- Last Synced: 2025-04-21T15:25:22.764Z (about 1 year ago)
- Language: Dart
- Size: 110 KB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 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 width GetRectMinxin{
// 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.