Skip to content

Commit

Permalink
v0.45.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jinyus committed Apr 3, 2024
1 parent 5b7ffae commit f0b65e6
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 3 deletions.
12 changes: 12 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -1292,6 +1292,18 @@ class _MyControllerState extends State<MyController>
}
```

## TextEditingBeacon

A beacon that wraps a `TextEditingController`. All changes to the controller are reflected in the beacon and vice versa.

```dart
final beacon = TextEditingBeacon();
final controller = beacon.controller;
controller.text = 'Hello World';
print(beacon.value.text); // Outputs: Hello World
```

## Pitfalls

When using `Beacon.future`, only beacons accessed before the async gap(`await`) will be tracked as dependencies.
Expand Down
2 changes: 1 addition & 1 deletion examples/counter/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Controller extends BeaconController {
final countControllerRef = Ref.scoped((ctx) => Controller());

void main() {
runApp(LiteRefScope(child: const MyApp()));
runApp(const LiteRefScope(child: MyApp()));
}

class MyApp extends StatelessWidget {
Expand Down
2 changes: 1 addition & 1 deletion examples/shopping_cart/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ import 'package:state_beacon/state_beacon.dart';

import 'src/app.dart';

void main() async => runApp(LiteRefScope(child: const MyApp()));
void main() async => runApp(const LiteRefScope(child: MyApp()));
9 changes: 9 additions & 0 deletions packages/state_beacon/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# 0.45.0

- [Feat] Add `ValueNotifier.toBeacon()` which converts a `ValueNotifier` to a `WritableBeacon`. All changes to the notifier are reflected in the beacon and vice versa.
- [Feat] Add `TextEditingBeacon` which is a beacon that wraps a `TextEditingController`. All changes to the controller are reflected in the beacon and vice versa.

## lite_ref (0.7.0):

- [Breaking] The `overrides` property of `LiteRefScope` is now a `Set<ScopedRef>` instead of a `List<ScopedRef>`.

# 0.44.5

- [Fix] Fix bug with `FutureBeacon`s not autosleeping
Expand Down
12 changes: 12 additions & 0 deletions packages/state_beacon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1292,6 +1292,18 @@ class _MyControllerState extends State<MyController>
}
```

## TextEditingBeacon

A beacon that wraps a `TextEditingController`. All changes to the controller are reflected in the beacon and vice versa.

```dart
final beacon = TextEditingBeacon();
final controller = beacon.controller;
controller.text = 'Hello World';
print(beacon.value.text); // Outputs: Hello World
```

## Pitfalls

When using `Beacon.future`, only beacons accessed before the async gap(`await`) will be tracked as dependencies.
Expand Down
2 changes: 1 addition & 1 deletion packages/state_beacon/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: state_beacon
description: A reactive primitive and simple state managerment solution for dart and flutter
version: 0.44.5
version: 0.45.0
repository: https://github.com/jinyus/dart_beacon

environment:
Expand Down
12 changes: 12 additions & 0 deletions packages/state_beacon_core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1292,6 +1292,18 @@ class _MyControllerState extends State<MyController>
}
```

## TextEditingBeacon

A beacon that wraps a `TextEditingController`. All changes to the controller are reflected in the beacon and vice versa.

```dart
final beacon = TextEditingBeacon();
final controller = beacon.controller;
controller.text = 'Hello World';
print(beacon.value.text); // Outputs: Hello World
```

## Pitfalls

When using `Beacon.future`, only beacons accessed before the async gap(`await`) will be tracked as dependencies.
Expand Down

0 comments on commit f0b65e6

Please sign in to comment.