是否可以从火焰引擎游戏小部件导航到其他 Flutter 小部件?
下面的应用程序会立即加载游戏小部件。如何在 Game 小部件之外导航到另一个 Flutter 小部件?
Flutter 版本:2.2.3
Dart 版本:2.13.4
Flame Engine 版本:flame-1.0.0-rc8
主要.dart
import 'package:flame/flame.dart';
import 'package:flame/game.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:my_game.dart';
void main() {
runApp(
GameWidget(
game: MyGame(),
),
);
}
my_game.dart
import 'package:flame/extensions.dart';
import 'package:flame/game.dart';
import 'package:flame/gestures.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
class MyGame extends BaseGame with TapDetector {
@override
void update(double dt) { /* TODO */ }
@override
void render(Canvas canvas) { /* TODO */ }
@override
void onTapUp(TapUpDetails details) {
// How to navigate outside of the game widget?
}
}