Skip to content

How can I do? #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lavara123 opened this issue Feb 8, 2023 · 1 comment
Open

How can I do? #37

lavara123 opened this issue Feb 8, 2023 · 1 comment

Comments

@lavara123
Copy link

Let's say I have a simple but long js code, how can I run it in the most minimal and fastest way, can you give an example without mixing only dart and flutter code?

@ekibun

@Matthiee
Copy link

Matthiee commented Feb 9, 2023

@lavara123 This is the most basic example, using only Dart.

test('run script', () {
  const script = '''
function add(a, b) {
   return a + b;
}

add(1, 2);
''';
  final _qjs = FlutterQjs();
  final result = _qjs.evaluate(script);
  expect(result, 3);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants