Rython

Executing Python scripts in Flutter with Rust

Quick start

Installing Rust

Rust Official Doc: https://www.rust-lang.org/tools/install

Using Rython

  1. Install Flutter (you can't use a package manager such as snap).
  2. Add a dependency to the project: flutter pub add rython.
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 : ${eval(script: "1 + 1")}')
            ]))));
  }
}

Libraries

rython