flutlock 1.0.0
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.
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 librarycli_examples.md
- Comprehensive CLI usage examplesflutter_project_setup/
- Complete Flutter project setup examplearchitecture_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 useflutlock: ^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:
-
Install FlutLock:
dart pub global activate flutlock
-
Clone or create a Flutter project:
flutter create example_app cd example_app
-
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!