mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-03 20:36:31 +08:00
fix: Ambiguation is not needed in render box anymore (#2711)
Since we are requiring a SDK higher than when the instance could be null we don't need to do the ambiguate call anymore.
This commit is contained in:
@ -131,11 +131,11 @@ class GameRenderBox extends RenderBox with WidgetsBindingObserver {
|
||||
}
|
||||
|
||||
void _bindLifecycleListener() {
|
||||
_ambiguate(WidgetsBinding.instance)!.addObserver(this);
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
}
|
||||
|
||||
void _unbindLifecycleListener() {
|
||||
_ambiguate(WidgetsBinding.instance)!.removeObserver(this);
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@ -143,13 +143,3 @@ class GameRenderBox extends RenderBox with WidgetsBindingObserver {
|
||||
game.lifecycleStateChange(state);
|
||||
}
|
||||
}
|
||||
|
||||
/// This allows a value of type T or T?
|
||||
/// to be treated as a value of type T?.
|
||||
///
|
||||
/// We use this so that APIs that have become
|
||||
/// non-nullable can still be used with `!` and `?`
|
||||
/// to support older versions of the API as well.
|
||||
///
|
||||
/// See more: https://docs.flutter.dev/development/tools/sdk/release-notes/release-notes-3.0.0
|
||||
T? _ambiguate<T>(T? value) => value;
|
||||
|
||||
Reference in New Issue
Block a user