Skip to content

Commit

Permalink
fix: Change return type of RiverpodComponentMixin.onLoad to FutureOr<…
Browse files Browse the repository at this point in the history
…void> (#2964)

This PR changes the return type of RiverpodComponentMixin.onLoad to
match that of Component.onLoad.

This resolves #2961 which describes an error preventing use of
RiverpodComponentMixin on Component subclasses that return a Future in
their implementation of onLoad due to a signature mismatch.


Closes #2961.

---------

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
  • Loading branch information
markvideon and spydon authored Jan 7, 2024
1 parent f96a2c5 commit 7ac80a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion .github/.cspell/gamedev_dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ AHSV # alpha hue saturation value
antialiasing # set of techniques to combat the problems of aliasing
ARGB # alpha red green blue
arities # plural of arity
arity # number of parameters a function takes
autofocus # auto focus event
backgrounded # moving the app to the background
backgrounding # moving the app to the background
Expand Down
3 changes: 2 additions & 1 deletion packages/flame_riverpod/lib/src/consumer.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:async';
import 'package:flame/components.dart';
import 'package:flame/game.dart';
import 'package:flame_riverpod/src/widget.dart';
Expand Down Expand Up @@ -80,7 +81,7 @@ mixin RiverpodComponentMixin on Component {

@mustCallSuper
@override
void onLoad() {
FutureOr<void> onLoad() {
ref.game = findGame()! as RiverpodGameMixin;
super.onLoad();
}
Expand Down

0 comments on commit 7ac80a7

Please sign in to comment.