dart_monty_web
Part of dart_monty — pure Dart bindings for Monty, a restricted, sandboxed Python interpreter built in Rust.
This package is co-designed by human and AI — nearly all code is AI-generated.
Flutter plugin — web platform registration for dart_monty. Delegates to dart_monty_wasm for WASM-based Python execution in the browser.
Requires Flutter. This package is not intended for direct use. Import dart_monty instead — the federated plugin system selects this package automatically when building for web.
How It Works
DartMontyWeb registers itself as the MontyPlatform instance via Flutter's flutter_web_plugins system. All execution is delegated to MontyWasm from the dart_monty_wasm package.
Usage
This package registers itself automatically. In your Flutter app, use the public API:
import 'package:dart_monty/dart_monty.dart';
import 'package:dart_monty_platform_interface/dart_monty_platform_interface.dart';
Future<void> main() async {
// MontyPlatform.instance is set to MontyWasm on web automatically.
final monty = MontyPlatform.instance;
final result = await monty.run('2 + 2');
print(result.value); // 4
await monty.dispose();
}
See the main dart_monty repository for full documentation.
Libraries
- dart_monty_web
- Web registration shim for the dart_monty federated plugin.