flutter_sqlite_scaffold 0.1.5 copy "flutter_sqlite_scaffold: ^0.1.5" to clipboard
flutter_sqlite_scaffold: ^0.1.5 copied to clipboard

A Dart CLI generator that scaffolds Flutter SQLite CRUD apps from SQL schema files.

Flutter SQLite Scaffold #

flutter_sqlite_scaffold is a Dart CLI generator for creating editable Flutter SQLite CRUD projects from a simple schema.sql.

Current documented version: 0.1.4.

It generates a real Flutter project structure: typed models, SQLite services, controllers, routes, CRUD list/form/detail screens, validators, optional auth, optional SMTP email screens, image picker support, and starter tests.

Install #

During local development:

dart pub get
dart run bin/fss.dart --schema schema.sql

To test the global command before publishing:

dart pub global activate --source path .
fss --schema schema.sql

If a stale local snapshot prints an old version after path activation, run the executable through Pub once to force a rebuild:

dart pub global run flutter_sqlite_scaffold:fss --version

After publishing:

dart pub global activate flutter_sqlite_scaffold
fss --schema schema.sql

If fss is not found after activation, add Pub's global executable directory to your user PATH. On Windows, this package includes a helper command that can do that once:

dart pub global run flutter_sqlite_scaffold:fss_setup_path

Then open a new terminal and run:

fss --help
fss --version
fss doctor
fss init-schema

Manual Windows PowerShell setup:

$pubCacheBin = "$env:LOCALAPPDATA\Pub\Cache\bin"
$userPath = [Environment]::GetEnvironmentVariable('Path', 'User')
if (($userPath -split ';') -notcontains $pubCacheBin) {
  [Environment]::SetEnvironmentVariable('Path', "$userPath;$pubCacheBin", 'User')
}

macOS/Linux:

echo 'export PATH="$PATH:$HOME/.pub-cache/bin"' >> ~/.zshrc
source ~/.zshrc

Usage #

fss \
  --schema schema.sql \
  --no-email \
  --ui-style 2

The published package also keeps the longer flutter_sqlite_scaffold command for compatibility.

If you run fss in an empty project without an existing schema.sql, the tool creates a starter schema.sql from schema.example.sql and generates from it. Edit schema.sql and run fss again when you want your own tables.

To create only the starter schema without generating the app yet:

fss init-schema

By default, the generator writes into the current directory and reads the package name from the current pubspec.yaml. To generate into another folder:

fss --schema schema.sql --project my_app

When running interactively, omitted feature flags are asked as quick y/n questions, including email, auth, standalone email screen, splash screen, and profile screen, and home dashboard. Pass the flags below to skip prompts in scripts.

Useful options:

  • --schema, -s: Path to the SQL schema file.
  • --project, -p: Flutter project directory to generate into.
  • --out, -o: Alias for --project.
  • --in-place, --current, --here: Explicit aliases for the default current directory.
  • --name, -n: Dart package name for the generated app.
  • --with-email / --no-email: Include or skip SMTP email files.
  • --with-email-screen / --no-email-screen: Include or skip the standalone send-email screen. This does not disable auth emails for registration or forgot-password when email support is enabled.
  • --with-auth / --no-auth: Include or skip login/register/session files.
  • --with-splash / --no-splash: Include or skip the generated splash screen.
  • --with-profile / --no-profile: Include or skip the generated profile screen. Profile requires auth.
  • --with-home / --no-home: Include the dashboard home with CRUD modules, or skip module screens/models/services/controllers/tests and generate a minimal success home after login.
  • --forgot-password local|email: Choose local password reset or email-based reset. Email mode requires --with-email and sends a temporary password.
  • --ui-style 1|2|3|classic|ocean|graphite: Choose the generated app's visual style. 1/classic keeps the existing light blue UI, 2/ocean uses a brighter teal/blue UI, and 3/graphite generates a dark UI.

Email-enabled projects generate a blank local lib/config/email_config.dart and a safe lib/config/email_config.example.dart. Fill the local config with the Gmail sender and Gmail app password before using email features; the local config is ignored by git so real SMTP credentials are not committed.

Schema Example #

CREATE TABLE students (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  fullName TEXT NOT NULL,
  email TEXT NOT NULL UNIQUE,
  gender TEXT NOT NULL CHECK(gender IN ('Male', 'Female', 'Other')),
  birthday TEXT,
  avatarPath TEXT
);

The generator maps schema metadata to Flutter widgets and validators. For example, email becomes an email field, birthday becomes a date picker with a realistic birth date validator, CHECK(field IN (...)) becomes radio/dropdown input, and avatarPath becomes an image picker.

Status #

This is a beta scaffold generator. It is practical for local CRUD apps, learning projects, and internal tooling. For production apps, review generated auth/session/email code and move sensitive email or auth operations to a backend.

Publish #

Before publishing, update version and CHANGELOG.md, then run:

dart analyze
dart run test/generator_smoke_test.dart
dart pub publish --dry-run

If the dry run is clean, publish:

dart pub publish

After pub.dev finishes publishing, users can install the command with:

dart pub global activate flutter_sqlite_scaffold
fss --schema schema.sql
0
likes
0
points
466
downloads

Publisher

unverified uploader

Weekly Downloads

A Dart CLI generator that scaffolds Flutter SQLite CRUD apps from SQL schema files.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on flutter_sqlite_scaffold