jocaaguraarchetype 4.0.0
jocaaguraarchetype: ^4.0.0 copied to clipboard
Starter archetype for Flutter apps with Jocaagura Clean Architecture, cross-cutting BLoCs, theming, and navigation setup.
JocaaguraArchetype #
⚠️ Heads-up: Documentation is in progress. We’re migrating cross-cutting concerns to
jocaagura_domain.
This archetype stays available as a UI shell and app scaffold. Expect incremental updates.
Quick start #
import 'package:flutter/material.dart';
import 'package:jocaaguraarchetype/jocaaguraarchetype.dart';
void main() {
// Dev profile: in-memory gateways, fake services, and debug flags on.
final AppConfig config = AppConfig.dev();
// Minimal page registry
final PageRegistry registry = PageRegistry(
routes: <String, WidgetBuilder>{
'/': (_) => const MyDemoHomePage(),
'/onboarding': (_) => const OnboardingPage(steps: <Widget>[], onFinish: null),
},
notFoundBuilder: (_) => const Page404Widget(),
);
runApp(
JocaaguraApp.dev(
config: config,
registry: registry,
),
);
}
Toggle theme (example) #
void main() async{
// Somewhere in the UI:
final AppManager app = AppManagerProvider.of(context);
// App-level actions via ThemeUsecases:
await app.themeUsecases.toggleMaterial3();
await app.themeUsecases.setSeedColor(const Color(0xFF6750A4));
await app.themeUsecases.setMode(ThemeMode.dark);
}
Architecture #
We follow Clean Architecture aligned with jocaagura_domain:
UI → AppManager → Bloc → UseCase → Repository → Gateway → Service
- BLoCs use
BlocGeneral<T>fromjocaagura_domain. - Theme:
ThemeUsecases+RepositoryTheme+GatewayTheme+ServiceJocaaguraArchetypeTheme.
Refer to the structure guide: https://github.com/grupo-jocaagura/jocaagura_domain/raw/refs/heads/develop/README_STRUCTURE.md
Lints and style #
We adopt the shared rules: https://github.com/grupo-jocaagura/jocaagura_domain/raw/refs/heads/develop/analysis_options.yaml
- Prefer explicit types in locals (
final List<T> items = <T>[];). - Avoid
print/debugPrintin production code; use an injected logger.
Contributing & CI #
Branch strategy:
developfor day-to-day work (PR-only).masterfor releases (merge fromdevelop).
Recommended workflows:
- Validate PR to develop: https://github.com/grupo-jocaagura/jocaagura_domain/raw/refs/heads/develop/.github/workflows/validate_pr.yaml
- Validate PR to master: https://github.com/grupo-jocaagura/jocaagura_domain/raw/refs/heads/develop/.github/workflows/validate_pr_master.yaml
Security & quality:
- CodeQL for
developandmaster. - Signed commits enforced (GitHub bot setup).
Full docs are being completed. We’ll expand with more samples (routing, PageBuilder, responsive widgets) soon.
Documentation #
License #
MIT (c) Jocaagura