Components for developing Dart client-side applications based on Spine.
- JDK 1.8.
- Dart SDK or Flutter SDK.
pub is a Dart package manager that is used by both Dart itself and Flutter.
In order to be able to compile Protobuf messages into Dart code, one must
configure the Dart Protoc plugin available for install via pub
.
Please follow the steps below to configure the plugin.
If you're using Dart SDK, please execute the following steps to configure your local Path environment variable if not yet configured.
In the snippets it is assumed that you have the Dart SDK installed at the
~/.dart
folder.
-
Define
DART_HOME
environment variable as follows:export DART_HOME="~/.dart" export PATH="$DART_HOME/bin:$PATH"
-
Define
PUB_CACHE
environment variable as follows:The Pub cache may be available either in the user home directory or in the Dart SDK home directory.
export PUB_CACHE="~/.dart/.pub_cache" export PATH="$PUB_CACHE/bin:$PATH"
You may want to add the above snippet to your .bashrc
or .zshrc
files
in order to have the Dart in available all the time.
-
Activate Dart Protoc plugin by running the following command.
pub global activate protoc_plugin
If you're using Flutter SDK, please execute the following steps to configure your local Path environment variable if not yet configured.
In the snippets it is assumed that you have the Flutter SDK installed at the
~/.flutter
folder.
-
Define
FLUTTER_HOME
environment variable as follows:export FLUTTER_HOME="~/.flutter" export PATH="$FLUTTER_HOME/bin:$PATH"
-
Define
PUB_CACHE
environment variable as follows:The Pub cache may be available either in the user home directory or in the Dart SDK home directory.
export PUB_CACHE="~/.flutter/.pub_cache" export PATH="$PUB_CACHE/bin:$PATH"
-
Create
pub
alias.By default, flutter provides its own
pub
reference available withflutter pub
command, but the tooling is expectingpub
to be available.alias pub="flutter pub"
On Windows, you may create a
pub.bat
script with the following content and store it under${FLUTTER_HOME}/bin
folder:@ECHO OFF echo. flutter pub %*
You may want to add the above snippets to your .bashrc
or .zshrc
files
in order to have the Dart in available all the time.
-
Activate Dart Protoc plugin by running the following command.
flutter pub global activate protoc_plugin