This repository has been archived by the owner on Apr 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pruned the API. Moved RiverpodGameWidget out of the library and into …
…the example definition.
- Loading branch information
1 parent
a1714cb
commit 12fddeb
Showing
6 changed files
with
54 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
import 'package:flame_riverpod/src/riverpod_aware_game.dart'; | ||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
|
||
/// Simple provider that returns a [RiverpodAwareGame] instance. | ||
import 'component_ref.dart'; | ||
|
||
/// Simple provider that returns a Riverpod-Aware Game instance. | ||
final riverpodAwareGameProvider = | ||
StateNotifierProvider<RiverpodAwareGameNotifier, HasComponentReference?>( | ||
StateNotifierProvider<RiverpodAwareGameNotifier, HasComponentRef?>( | ||
(ref) { | ||
return RiverpodAwareGameNotifier(); | ||
}); | ||
|
||
/// Simple [StateNotifier] that holds the current [RiverpodAwareGame] instance. | ||
class RiverpodAwareGameNotifier extends StateNotifier<HasComponentReference?> { | ||
class RiverpodAwareGameNotifier extends StateNotifier<HasComponentRef?> { | ||
RiverpodAwareGameNotifier() : super(null); | ||
|
||
set(HasComponentReference candidate) { | ||
set(HasComponentRef candidate) { | ||
state = candidate; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.