Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
Renamed NewComponentRef to ComponentRef. Updated Changelog. Updated p…
Browse files Browse the repository at this point in the history
…ubspec with Dart SDK version constraint suggestion.
  • Loading branch information
markvideon committed Nov 19, 2023
1 parent 20f7f0c commit 26cc086
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 5.0.0

* New API with breaking changes. Added [RiverpodAwareGameWidget], [RiverpodGameMixin], [RiverpodComponentMixin]. See the example for details.

## 4.0.0+2

* Miscellaneous format post-processing on the files.
Expand Down
10 changes: 5 additions & 5 deletions lib/src/consumer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import 'package:flame_riverpod/src/widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

class NewComponentRef implements WidgetRef {
NewComponentRef({required this.game});
class ComponentRef implements WidgetRef {
ComponentRef({required this.game});

RiverpodGameMixin? game;

Expand Down Expand Up @@ -67,16 +67,16 @@ class NewComponentRef implements WidgetRef {
}

mixin RiverpodComponentMixin on Component {
final NewComponentRef ref = NewComponentRef(game: null);
final ComponentRef ref = ComponentRef(game: null);
final List<Function()> _onBuildCallbacks = [];

/// Whether to immediately call [RiverpodAwareGameWidgetState.build] when
/// this component is mounted.
bool rebuildOnMountWhen(NewComponentRef ref) => true;
bool rebuildOnMountWhen(ComponentRef ref) => true;

/// Whether to immediately call [RiverpodAwareGameWidgetState.build] when
/// this component is removed.
bool rebuildOnRemoveWhen(NewComponentRef ref) => true;
bool rebuildOnRemoveWhen(ComponentRef ref) => true;

@mustCallSuper
@override
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Helpers for using Riverpod - a reactive caching and data-binding fr
version: 5.0.0
homepage: https://github.com/markvideon/flame_riverpod
environment:
sdk: '>=2.18.5 <3.0.0'
sdk: '>=2.18.5 <4.0.0'
flutter: ">=1.17.0"
dependencies:
flame: ^1.10.1
Expand Down

0 comments on commit 26cc086

Please sign in to comment.