A comprehensive Flutter scaffolding framework designed to accelerate development with a clean, modular architecture and powerful built-in services.

- Modular Architecture: Clean separation of concerns with organized module structure
- Lifecycle Management: Built-in page lifecycle handling with caching support
- Dependency Injection: Integrated with GetX for efficient service management
- Responsive Design: Adaptive UI components for mobile, tablet, and desktop
- Protocol Adapter: Type-safe HTTP client with plugin architecture
- Multiple HTTP Methods: Support for GET, POST, PUT, DELETE requests
- Plugin System: Extensible with logging, caching, retry, and loading plugins
- Error Handling: Comprehensive error management with automatic retry logic
- Type-safe Storage: Generic repositories for different data types
- Multiple Storage Types: Single object, list, and key-value storage repositories
- JSON Serialization: Automatic serialization/deserialization support
- Storage Management: Centralized storage container management
- Dynamic Theming: Runtime theme switching support
- Multiple Themes: Light, dark, and system-follow modes
- Customizable: Easy theme configuration and extension
- Multi-language Support: Built-in i18n with easy language switching
- Dynamic Translation: Runtime language changing without restart
- Extensible: Simple addition of new languages and translations
- Polling Service: Background task execution with configurable intervals
- Retry Logic: Automatic retry with exponential backoff
- Task Lifecycle: Complete task management from creation to completion
- Notification System: Beautiful, customizable in-app notifications
- Responsive Navigation: Adaptive navigation for different screen sizes
- Page Management: Advanced page caching and lifecycle management
- Local & Remote Config: Support for both local and remote configuration
- Type Safety: Strongly typed configuration with validation
- Environment Support: Multiple environment configurations
- Event Bus: Decoupled communication between modules
- Type-safe Events: Strongly typed event system
- Subscription Management: Automatic subscription lifecycle management
- ✅ Android - Full support with native optimizations
- ✅ iOS - Complete iOS integration
- ✅ Web - Progressive web app capabilities
- ✅ macOS - Native desktop experience
- ✅ Windows - Windows desktop application
- ✅ Linux - Linux desktop support
- State Management: GetX 4.7.2
- Storage: get_storage 2.1.1
- Network: dio 5.7.0, http 1.2.2
- Responsive UI: responsive_framework 1.5.1
- Navigation: sidebarx 0.17.1
- Utilities: intl, uuid, crypto, logger
- Flutter SDK 3.27.1 or higher
- Dart SDK 3.0.0 or higher
- Clone the repository
git clone <repository-url>
cd cat-zson-pro- Install dependencies
flutter pub get- Run the application
flutter runvoid main() async {
WidgetsFlutterBinding.ensureInitialized();
// Initialize Cat Framework with plugins
await CatFramework.instance.initialize(
config: const CatFrameworkConfig(
appName: 'My App',
supportedLocales: [
Locale('en', 'us'),
Locale('zh', 'cn'),
],
),
networkPlugins: [
LoggingPlugin(enableDetailLog: true),
CachePlugin(),
RetryPlugin(maxRetries: 3),
],
);
runApp(const MyApp());
}class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return CatFramework.instance.createApp(
title: 'My Cat Framework App',
home: const HomePage(),
pages: AppPages.routes,
);
}
}// Network requests
final response = await Cat.network?.request(MyApiRequest());
// Storage operations
final storage = Cat.storage.createListRepository<User>(
containerName: 'users',
key: 'user_list',
);
// Event bus
Cat.events.fire(DataRefreshEvent(dataType: 'users'));
// Notifications
Cat.notify.showSuccess(message: 'Operation completed!');
// Theme switching
Cat.theme?.enableDarkMode();
// Language switching
Cat.i18n?.changeLocale('zh', 'cn');lib/
├── app/
│ ├── core/ # Core framework components
│ │ ├── framework/ # Main framework classes
│ │ ├── network/ # Network layer & protocol adapter
│ │ ├── storage/ # Storage repositories
│ │ ├── async/ # Async task management
│ │ ├── event/ # Event bus system
│ │ ├── theme/ # Theme management
│ │ ├── i18n/ # Internationalization
│ │ ├── config/ # Configuration management
│ │ └── ui/ # UI services & components
│ ├── modules/ # Feature modules
│ │ ├── home/ # Home module
│ │ ├── auth/ # Authentication module
│ │ ├── navigation/ # Navigation module
│ │ └── settings/ # Settings module
│ ├── routes/ # Route definitions
│ └── utils/ # Utility functions
├── assets/ # Asset files
└── main.dart # Application entry point
Create assets/config/app_config.json:
{
"debug": true,
"appName": "Cat Framework",
"version": "1.0.0",
"apiBaseUrl": "https://api.example.com",
"timeout": 30,
"environment": "development",
"features": {
"enableLogging": true,
"enableCrashReporting": false,
"enableAnalytics": false
},
"ui": {
"defaultTheme": "light",
"animationDuration": 300
}
}const config = CatFrameworkConfig(
appName: 'My App',
supportedLocales: [
Locale('en', 'us'),
Locale('zh', 'cn'),
Locale('es', 'es'),
],
fallbackLocale: Locale('en', 'us'),
defaultStorageContainer: 'my_app_storage',
);class UserListRequest extends IProtocolReq<List<User>> {
@override
String get url => '/api/users';
@override
HttpMethod get method => HttpMethod.get;
@override
Map<String, dynamic> toJson() => {};
@override
ApiResponse<List<User>> decode(dynamic data) {
return ApiResponse.fromJson(
data,
(json) => (json as List).map((e) => User.fromJson(e)).toList(),
);
}
}class UserRepository {
final storage = Cat.storage.createListRepository<User>(
containerName: 'users',
key: 'user_data',
);
List<User> getAllUsers() {
return storage.readAll(fromJson: User.fromJson);
}
void saveUser(User user) {
storage.add(
item: user,
toJson: (user) => user.toJson(),
fromJson: User.fromJson,
);
}
}class UserLoginEvent extends AppEvent {
final String userId;
UserLoginEvent(this.userId) : super('user_login');
}
// Subscribe to events
Cat.events.on<UserLoginEvent>((event) {
print('User logged in: ${event.userId}');
});
// Fire events
Cat.events.fire(UserLoginEvent('user_123'));# Run all tests
flutter test
# Run tests with coverage
flutter test --coverage
# Run integration tests
flutter drive --target=test_driver/app.dartimport 'package:flutter_test/flutter_test.dart';
import 'package:cat_zson_pro/app/core/framework/cat_framework.dart';
void main() {
group('Cat Framework Tests', () {
test('Framework initialization', () async {
await CatFramework.instance.initialize();
expect(CatFramework.instance.isInitialized, isTrue);
});
});
}flutter build apk --release
flutter build appbundle --releaseflutter build ios --releaseflutter build web --releaseflutter build windows --release
flutter build macos --release
flutter build linux --release- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for your changes
- Ensure all tests pass
- Submit a pull request
Made with ❤️ by the Cat Framework Team