Skip to content

Commit

Permalink
add docs to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
erayerdin committed Dec 6, 2022
1 parent 302d5c1 commit 4d3921d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,27 @@ FormBuilderTextField(
),
```

#### Stream for Real-time Form Changes

You can subscribe to the stream on [FormBuilderState.onChanged](https://pub.dev/documentation/flutter_form_builder/latest/flutter_form_builder/FormBuilderState/onChanged.html) in order to react to the changes in real-time. You can use this stream in a `StreamBuilder` widget, an example would be:

```dart
StreamBuilder(
stream: _formKey.currentState?.onChanged,
builder: (context, AsyncSnapshot<FormBuilderFields> snapshot) {
if (!snapshot.hasData) {
// if there are data, render a widget
} else {
// if there are no data, render a widget
}
},
)
```

You can see a further example in the example app.

You can also use this stream with [Bloc library](https://bloclibrary.dev).

## Support

### Contribute
Expand Down

0 comments on commit 4d3921d

Please sign in to comment.