Search packages, repositories and app categories

Package detailsv0.4.1

a_star_algorithm

Package that uses the A * algorithm to find a way to the destination through the barriers.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
1.8K
Likes
23
Pub points
160

Install package

flutter pub add a_star_algorithm

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter/Dart package implementing the A* algorithm for pathfinding, enabling efficient navigation from a start point to a destination while avoiding obstacles. It is designed for use in applications requiring intelligent route calculation, such as games, robotics simulations, or map-based tools. The algorithm balances accuracy and performance by using heuristic estimation to guide search direction. The package supports multiple platforms, making it versatile for cross-platform development. It provides a clean API for defining grids, barriers, and target points.

Use cases

  • Game development with dynamic pathfinding
  • Robotics and autonomous navigation simulation
  • Map-based applications with obstacle avoidance
  • Interactive puzzle or maze solvers
  • Route planning in grid-based environments

Key features

  • Efficient A* pathfinding algorithm
  • Support for custom grid layouts
  • Heuristic-driven search optimization
  • Cross-platform compatibility
  • Simple API for grid and barrier configuration
  • Real-time path recalculations

Suitable for

  • Developers building 2D games with AI movement
  • Applications requiring real-time route planning
  • Educational projects on algorithms and search
  • Tools for visualizing pathfinding logic
  • Cross-platform apps needing consistent pathfinding

Considerations

  • Performance may vary with large grid sizes
  • Requires manual grid representation setup
  • Not optimized for non-grid-based continuous spaces
  • Limited to 2D grid environments
  • Heuristic choice affects path quality and speed

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

pub package Code Quality

a_star_algorithm

A* algorithm

Usage

To use this package, add a_star_algorithm as a dependency in your pubspec.yaml file.

Example

void main() {
  Iterable<(int, int)> result = AStar(
    rows: 20,
    columns: 20,
    start: (5,0),
    end: (8,19),
    barriers: [
      (10,5),
      (10,6),
      (10,7),
      (10,8),
    ],
  ).findThePath();
}

Demo Online

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package