Skip to main content
  1. The pint° programming language/
  2. Language overview/

Imports

The import keywords allows one to import an external package to a pint° program. There are, currently, two types of imports in pinto°, regular imports and Dart imports1.

Currently, there’s no support for relative imports, neither modifiers (as, show, hide, if).

Regular imports #

Regular imports depends on the packages available in your package_config.json. You can either import the main package2 file or specific files exported from the package by specifying (or not) what you want to import.

1
2
import flutter_bloc // Imports `package:flutter_bloc/flutter_bloc.dart`
import flutter/widgets // Imports `package:flutter/widgets.dart`

Dart imports #

By prefixing a @ before the identifier, you can import Dart’s SDK packages.

1
import @async // Imports `dart:async`

  1. pint° can’t import other pint° files. You have to compile them to Dart first. This will change in the future. ↩︎

  2. The main package file is the one that has the same name as the package itself. For instance, for a package named foo, it would be the same as foo/foo↩︎