Add bidirectional host bridge

This commit is contained in:
gem
2026-06-09 16:26:37 +08:00
parent 7b3c5cb0f5
commit 0d4fbd030c
17 changed files with 632 additions and 3 deletions

View File

@@ -11,7 +11,7 @@ import 'package:flutter_test/flutter_test.dart';
void main() {
group('FlameLuaGame diagnostics debug access', () {
test('exposes diagnostics entries, dump text and debug json', () {
test('exposes diagnostics entries, dump text and debug json', () async {
final diagnostics = RuntimeDiagnostics()
..record(
type: RuntimeDiagnosticType.commandError,
@@ -29,6 +29,8 @@ void main() {
expect(game.diagnosticsDumpText(), contains('command failed'));
expect(game.diagnosticsDebugJson()['count'], 1);
expect(game.resourcesDebugJson(), {'initialized': false});
expect(game.notifyLua('host.ready'), isFalse);
await expectLater(game.callLua('host.ready'), throwsA(isA<StateError>()));
});
});
}