Skip to content

Getting Started

albertoodev edited this page Jul 21, 2026 · 5 revisions

Getting Started

Requirements

  • Dart SDK ≥ 3.9 / Flutter ≥ 3.3

Installation

Use SPM as a Git dependency from a Flutter project:

dev_dependencies:
  spm:
    git:
      url: https://github.com/albertoodev/spm.git

Then fetch dependencies:

flutter pub get

To work on SPM itself, from the repo root:

dart pub get

A first end-to-end run

The three core commands form a pipeline. A typical session:

# 1. Static analysis: one JSONL record per State subclass
dart run bin/spm.dart analyze --output results.jsonl /path/to/flutter/project

# 2a. Inject instrumentation and run in one step (recommended; always --profile)
dart run bin/spm.dart run --jsonl results.jsonl --flutter run

#     …or do the two steps separately:
# 2b. Inject the SpmState base class into target State classes
dart run bin/spm.dart inject --jsonl results.jsonl /path/to/flutter/project

# 3. Restore the original source when you're done
dart run bin/spm.dart inject --jsonl results.jsonl --mode remove /path/to/flutter/project

Two commands stand outside the main pipeline:

# Extract rebuild scopes into standalone, compilable widgets
dart run bin/spm.dart isolate --output-dir ./isolated_widgets /path/to/flutter/project

# Statically check that a mutation is a clean structural variant of a base file
dart run bin/spm.dart validate --base base.dart --mutation mutation.dart

Where to next

Clone this wiki locally