Skip to content
pubscout

a_star_algorithm

0.4.1, released 2 years ago by rafaelbarbosatec.com

A* pathfinding algorithm for integer grid with barriers

WASM-ready
$ flutter pub add a_star_algorithm
Source repository

What it does

Computes the shortest path between a start and end point on a rectangular grid using the A* algorithm. Returns an iterable of (row,column) tuples representing the path. Supports optional diagonal movement and barrier cells.

AI-written summary of version 0.4.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need simple grid‑based pathfinding without Flutter dependencies
  • The project is pure Dart and you want a lightweight solution

Skip it when

  • You require large‑scale or 3‑D pathfinding
  • You need asynchronous streaming of results or real‑time updates

Strengths

  • Pure Dart, no Flutter dependency
  • Simple, declarative API with tuple coordinates
  • Handles barriers and optional diagonal moves

Weaknesses

  • Limited to integer grid coordinates
  • No async or streaming support
  • May not scale well for very large maps

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
1
void main(){
  var result = AStar(
    rows:20,
    columns:20,
    start:(5,0),
    end:(8,19),
    barriers:[(10,5),(10,6),(10,7),(10,8)],
  ).findThePath();
  print(result);
}

Alternatives

Packages that do the same job and could replace a_star_algorithm.

Works with

Packages commonly used together with a_star_algorithm: ones it builds on, ones built on it, and its own family.