flutlock 1.0.0 copy "flutlock: ^1.0.0" to clipboard
flutlock: ^1.0.0 copied to clipboard

A high-performance command-line tool to automate Android app signing for Flutter applications with 8 architecture patterns, keystore management, and CI/CD support.

example/README.md

FlutLock Examples #

This directory contains examples demonstrating how to use FlutLock both as a CLI tool and as a Dart library.

πŸ“ Examples Overview #

  • basic_usage.dart - Basic programmatic usage of FlutLock library
  • cli_examples.md - Comprehensive CLI usage examples
  • flutter_project_setup/ - Complete Flutter project setup example
  • architecture_generation.dart - Architecture pattern generation examples

πŸš€ Quick Start #

Note: This example directory uses a local path dependency (path: ../) for development. After FlutLock is published to pub.flutter-io.cn, you can use flutlock: ^1.0.0 instead.

1. CLI Usage #

# Install FlutLock globally (after pub.flutter-io.cn publication)
dart pub global activate flutlock

# Create a new Flutter project
flutter create my_app
cd my_app

# Setup project with Feature Wise Clean Architecture
flutlock --setup-project --architecture feature-clean

# Generate keystore and sign the app
flutlock --keystore-path android/app/keystore.jks

2. Programmatic Usage #

import 'package:flutlock/flutlock.dart';

void main() async {
  // Initialize FlutLock
  final flutlock = FlutLockCLI();

  // Setup project with architecture
  await flutlock.setupProject(
    architecture: 'feature-clean',
    projectPath: './my_flutter_app',
  );

  // Generate keystore
  await flutlock.generateKeystore(
    keystorePath: 'android/app/keystore.jks',
    keyAlias: 'my-app-key',
  );
}

πŸ“– Detailed Examples #

Architecture Generation #

FlutLock supports 8 different Flutter architecture patterns:

# List all available architectures
flutlock --list-architectures

# Generate with specific architecture
flutlock --setup-project --architecture feature-clean
flutlock --setup-project --architecture bloc
flutlock --setup-project --architecture clean

CI/CD Integration #

# Non-interactive mode for CI/CD
export KEYSTORE_PASSWORD="your-secure-password"
export KEY_PASSWORD="your-key-password"

flutlock --non-interactive \
  --keystore-path android/app/keystore.jks \
  --key-alias release-key \
  --build-apk

Advanced Configuration #

# Create configuration template
flutlock --create-config-template environment

# Use configuration file
flutlock --config flutlock_config.json

# Validate project structure
flutlock --check-structure --fix-structure

πŸ”§ Development Setup #

To run these examples:

  1. Install FlutLock:

    dart pub global activate flutlock
    
  2. Clone or create a Flutter project:

    flutter create example_app
    cd example_app
    
  3. Run the examples:

    # Run Dart examples
    dart run example/basic_usage.dart
    dart run example/architecture_generation.dart
    
    # Follow CLI examples
    cat example/cli_examples.md
    

πŸ“š Additional Resources #

🀝 Contributing #

Found an issue with these examples? Please open an issue or submit a pull request!

2
likes
150
points
21
downloads

Publisher

unverified uploader

Weekly Downloads

A high-performance command-line tool to automate Android app signing for Flutter applications with 8 architecture patterns, keystore management, and CI/CD support.

Repository (GitHub)
View/report issues

Topics

#flutter #android #signing #automation #cli

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

args, json_schema, logging, meta, path, yaml

More

Packages that depend on flutlock