Skip to main content
This guide explains the overall structure of a Stac project. It covers where the UI is defined, how parsers are organized, and how themes and routes fit together.

Basic Structure

Key Files

default_stac_options.dart

Contains the StacOptions configuration for your project, including project name and ID.

main.dart

Entry point for the Flutter app where Stac is initialized. Custom parsers are registered here:

stac/ folder

Contains your Stac widget definitions written in Dart. Each file can contain one or more @StacScreen annotated functions.

Extended Structure

For larger projects, here’s a recommended structure:

Build Output

When you run stac build or stac deploy, the Dart files are converted to JSON and placed in stac/.build/:
The .build folder is automatically created and should typically be added to .gitignore since it’s generated from your Dart source files.

Custom Parsers

Custom widget and action parsers extend Stac’s capabilities. Place them in a dedicated folder and register them in Stac.initialize:

Theme Configuration

Themes can be configured through Stac Cloud or locally via StacApp:
You can also use JSON-based themes:

Multiple Screens Organization

For apps with many screens, organize by feature or route:
Each file uses the @StacScreen annotation: