rython 0.1.3 copy "rython: ^0.1.3" to clipboard
rython: ^0.1.3 copied to clipboard

Executing Python scripts in Flutter with Rust

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:rython/rython.dart';

Future<void> main() async {
  await Rython.init();
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        home: Scaffold(
            appBar: AppBar(title: const Text('Rython')),
            body: Center(
                child: Column(children: [
              const Text('Run Python :'),
              Text('Result : ${eval(script: "print('Hello, Rython')")}'),
              Text('Result Eval : ${eval(script: "1 + 1")}'),
              Text(
                  'Result Exec : ${exec(script: "def my_function():\n    return 1 + 2\nmy_function()")}')
            ]))));
  }
}
0
likes
140
points
31
downloads

Publisher

unverified uploader

Weekly Downloads

Executing Python scripts in Flutter with Rust

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_rust_bridge, plugin_platform_interface

More

Packages that depend on rython