replace isReadyForScene with hasViewer stream and update version number/CHANGELOG

This commit is contained in:
Nick Fisher
2023-10-17 08:57:00 +08:00
parent 7f9c5a0f2d
commit 2553d854e9
6 changed files with 55 additions and 43 deletions

View File

@@ -42,7 +42,6 @@ class ExampleWidget extends StatefulWidget {
class _ExampleWidgetState extends State<ExampleWidget> {
FilamentController? _filamentController;
FilamentEntity? _shapes;
FilamentEntity? _flightHelmet;
List<String>? _animations;
@@ -65,10 +64,13 @@ class _ExampleWidgetState extends State<ExampleWidget> {
bool _coneHidden = false;
bool _frustumCulling = true;
StreamSubscription? _hasViewerListener;
@override
void dispose() {
super.dispose();
_pickResultListener?.cancel();
_hasViewerListener?.cancel();
}
Widget _item(void Function() onTap, String text) {
@@ -92,9 +94,10 @@ class _ExampleWidgetState extends State<ExampleWidget> {
picked = _filamentController!.getNameForEntity(entityId!);
});
});
_filamentController!.isReadyForScene.then((readyForScene) {
_hasViewerListener =
_filamentController!.hasViewer.listen((bool hasViewer) {
setState(() {
_readyForScene = readyForScene;
_readyForScene = hasViewer;
});
});
}