function_tree 0.1.1

  • Installing
  • Versions
  • 49


A library for parsing and evaluating mathematical functions built from strings.


A simple usage example:

import 'package:function_tree/function_tree.dart';
import 'dart:math' show PI;

main() {
  var f = new FunctionOfX("1.5 * sin(2 * (x - PI / 3)) + 2");

  var ft = new FunctionTree(
    fromExpression: "1.5 * sin(2 * (x - PI / 3)^2) + y",
    withVariableNames: ["x", "y"]);

  print(ft({"x": 1, "y": 2}));

Features and bugs

Please file feature requests and bugs at the issue tracker.



  • Initial version, proof of concept.
  • Very little checking of input at this stage.


  • Basic numerical differentiation
  • Basic numerical integration (Simpson)
  • Basic zero-finding (Newton)

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  function_tree: "^0.1.1"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

      import 'package:function_tree/function_tree.dart';
Version Uploaded Documentation Archive
0.1.1 Oct 2, 2017 Go to the documentation of function_tree 0.1.1 Download function_tree 0.1.1 archive
0.1.0 Sep 24, 2017 Go to the documentation of function_tree 0.1.0 Download function_tree 0.1.0 archive


We analyzed this package on Jun 19, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3


Describes how popular the package is relative to other packages. [more]
1 / 100
Code health derived from static analysis. [more]
93 / 100
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
Learn more about scoring.


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:function_tree/function_tree.dart.


  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 26 hints.

    Strong-mode analysis of lib/function_tree.dart gave the following hint:

    line: 99 col: 21
    'NAN' is deprecated and shouldn't be used.

    Strong-mode analysis of lib/src/defs.dart gave the following hint:

    line: 25 col: 27
    'E' is deprecated and shouldn't be used.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use function_tree.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <2.0.0
Dev dependencies
test ^0.12.0