An embeddable interpreter for scripting Flutter applications

Overview

flutterscript

CircleCI

An embeddable interpreter for Flutter applications

Demo of FlutterScript

Getting Started

"Hello World" }">
import "package:flutterscript/flutterscript.dart";

main() async {
  FlutterScript interpreter = await FlutterScript.create();
  await interpreter.eval('"Hello World"'); //> "Hello World"
}

You can embed dart functions into the interpreter using the defn method:

"HELLO WORLD!";">
  await interpreter.defn("loud", (DartArguments arguments) {
    String input = arguments.positional.first.toString();
    return "${input.toUpperCase()}!";
  });

  await interpreter.eval('(loud "Hello World")'); //> "HELLO WORLD!";

To embed a class into the interpreter, you use the defClass method where you give it a constructor function, and a list of methods on that class.

Text(args[0]), { "data": (text, __) => text.data, "toString": (text, __) => "Text(${text.data})" }) await interpreter.eval('(setq text (Text "Hello World"))'); await interpreter.eval('(-> text data)') //> "Hello World"; await interpreter.eval('(-> text toString)') //> "Text(Hello World)";">
  await interpreter.defClass("Text", (DartArguments args) => Text(args[0]), {
    "data": (text, __) => text.data,
    "toString": (text, __) => "Text(${text.data})"
  })

  await interpreter.eval('(setq text (Text "Hello World"))');
  await interpreter.eval('(-> text data)') //> "Hello World";
  await interpreter.eval('(-> text toString)') //> "Text(Hello World)";

The door swings boths ways as well. Not only can you embed dart functions into FlutterScript and call them from FlutterScript code, but you can also bring FlutterScript functions into Dart and call them from Dart code:

FlutterScriptFn add = await interpreter.eval('(=> (x y) (+ x y))');
add([10, 7]); //=> 17

Development

$ flutter packages get
$ flutter test
You might also like...

Build installers for your Flutter applications with Squirrel

squirrel A new Flutter package project. Getting Started This project is a starting point for a Dart package, a library module containing code that can

Dec 28, 2022

A comprehensive guide on learning how to code cross platform mobile applications with the Flutter framework, from the ground up.

A comprehensive guide on learning how to code cross platform mobile applications with the Flutter framework, from the ground up.

✳️ The Ultimate Guide to App Development with Flutter ✳️ A complete and comprehensive guide to learning Flutter with explanations, screenshots, tips,

Jan 1, 2023

Flutter starter template for production applications with a REST backend

Flutter starter template for production applications with a REST backend

Flutter Boilerplate My Flutter starter template for production applications with a REST backend. The main aim of this template is to get you up and ru

Apr 13, 2022

A fancy easy to use Folding Menu for Flutter Applications

A fancy easy to use Folding Menu for Flutter Applications

Folding Menu This is an easy to use package for adding Folding Menu to your Flutter Applications Demo Usage To Use, simply add Folding Menu to your St

Nov 26, 2022

List of open source Flutter applications

List of open source Flutter applications

Open source flutter apps Flutter is Google's UI toolkit for building beautiful, natively compiled applications for mobile, web, desktop, and embedded

Jan 6, 2023

A CLI to help with using FlutterFire in your Flutter applications.

A CLI to help with using FlutterFire in your Flutter applications.

FlutterFire CLI Documentation • License A CLI to help with using FlutterFire in your Flutter applications. Local development setup To setup and use th

Dec 12, 2022

An MVP framework for flutter applications

mvp_core An MVP (model/view/presenter) framework for applications written in dart. This package gives specific support to the flutter framework. Getti

Jan 4, 2021

Another way to build Flutter applications for mobile, web and desktop using the powerful of MVC Design Pattern.

Another way to build Flutter applications for mobile, web and desktop using the powerful of MVC Design Pattern.

Karee Another way to build Flutter applications for mobile, web and desktop using the powerful of MVC Design Pattern. + = About Karee Karee is a frame

Sep 29, 2022
Owner
Isac Canedo
Software Engineering Specialist | Full Stack Developer | Open-source Enthusiast | Fluent in Flutter | High performance JVM for Fintec 👋
Isac Canedo
A framework for scripting Battlefield Portal

Battlefield Portal Builder This is a Dart framework/builder for scripting Battlefield Portal without the official Blockly Editor from EA. Have a look

Jake Esser 5 Jan 4, 2022
Receipt app to list items on a receipt with AI receipt-interpreter. Made with Flutter by Futhark AS

Receipt Recognizer Summary Extracts data from an image of a receipt, storing it in a structured format. The application is created using Flutter and t

Futhark 2 Dec 15, 2022
🇮🇪 A generic programming language interpreter, linter, formatter, and all that jazz, written in Dart.

Irishman ???? A generic programming language interpreter, linter, formatter, and all that jazz, written in Dart. Installation To install this package

Fairfield Programming Association 2 Oct 8, 2022
This is a repository for Flutter Focused Menu, an easy to implement package for adding Focused Long Press Menu to Flutter Applications

Focused Menu This is an easy to implement package for adding Focused Long Press Menu to Flutter Applications Current Features Add Focused Menu to Any

Paras Jain 160 Dec 26, 2022
This is an easy to use Flutter Package for adding Fancy Foldable Sidebar to your Flutter Applications.

Foldable Sidebar An easy to implement Foldable Sidebar Navigation Drawer for Flutter Applications. Current Features Initial Release for Foldable Navig

Paras Jain 87 Nov 26, 2022
Emanuel Braz 27 Dec 22, 2022
CloseSea-Flutter - CloseSea is Flutter UI of OpenSea NFT's Applications

flutter_closesea_nft Onboarding Page Home Page Font use in this App Concept : (f

Bagas Satria 5 Aug 31, 2022
Now UI Flutter is a fully coded app template built for Flutter which will allow you to create powerful and beautiful e-commerce mobile applications

Now UI Flutter is a fully coded app template built for Flutter which will allow you to create powerful and beautiful e-commerce mobile applications. We have redesigned all the usual components to make it look like our Now UI Design, minimalistic and easy to use.

null 12 Oct 9, 2022
This is tool to create 3D Models which can be used in Flutter Applications. Tool is developed completely using Flutter.

three_d_model_tool A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you start

Shubham Yeole 2 Nov 8, 2022