Directory Structure
Relevant source files
The following files were used as context for generating this wiki page:
The fikak_app project follows a modular, flavor-based Flutter architecture, likely based on the Very Good Ventures (VGV) template. The structure is designed to support multiple environment configurations (Development, Staging, and Production) while maintaining a clean separation between core application logic, feature-specific code, and localization resources.
The codebase organizes logic into a central lib directory, utilizing a feature-first approach where components like the counter are isolated into their own subdirectories. This promotes scalability and testability across the different platforms supported by the Flutter framework.
Sources: README.md:1, pubspec.yaml:1-5, lib/main_production.dart:1-10
Root Directory Configuration
The root of the project contains essential configuration files for dependency management, environment setup, and metadata.
Key Configuration Files
- pubspec.yaml: The manifest file for Flutter, defining the project name (
fikak_app), versioning, and environment constraints. It lists dependencies such asflutter_localizationsandblocfor state management. - Analysis Options: Configures linting rules to ensure code quality across the repository.
Sources: pubspec.yaml:1-35
Workspace Layout
The following diagram illustrates the high-level organization of the project workspace:
The tree structure demonstrates the separation of environment-specific entry points from the shared application logic located in subfolders.
Sources: lib/main_production.dart:1-12, pubspec.yaml:1-10
The lib Directory
The lib directory is the heart of the application, containing all Dart source code. It is structured to handle bootstrapping, global application widgets, and localized strings.
Environment Entry Points
The application uses distinct entry points for different stages of the development lifecycle. Each entry point calls a shared bootstrap function, which initializes logging and error handling.
main_development.dart: Used for local development.main_staging.dart: Used for QA and staging environments.main_production.dart: Used for the final release version.
Sources: lib/main_production.dart:3-10, lib/bootstrap.dart:1-5
Core Components
| Folder/File | Purpose | Key Components |
|---|---|---|
app/ | Global application shell and routing. | App widget, MaterialApp configuration. |
l10n/ | Internationalization and localization. | AppLocalizations extension, arb files. |
counter/ | Feature-specific logic (Example feature). | Counter blocs, views, and widgets. |
bootstrap.dart | Shared initialization logic. | bootstrap() function, error observers. |
Sources: lib/app/view/app.dart:5-15, lib/l10n/l10n.dart:1-10, lib/bootstrap.dart:1-15
Application Flow and Initialization
The initialization process flows from a flavor-specific main file through a centralized bootstrap mechanism before launching the root App widget.
Initialization Sequence
- Entry Point:
main_production.dart(or other flavors) is executed. - Bootstrap: The
bootstrapfunction is called with a builder that returns theAppwidget. - App Setup: The
Appwidget configures global themes and localization delegates.
This sequence ensures that every flavor of the app undergoes the same rigorous initialization and logging setup defined in the bootstrap process.
Sources: lib/main_production.dart:5-10, lib/bootstrap.dart:10-20, lib/app/view/app.dart:7-22
Localization Structure (l10n)
The lib/l10n directory handles the application's multi-language support. It utilizes the flutter_localizations package and defines an extension on BuildContext to simplify access to translated strings.
// Example of localization usage defined in lib/l10n/l10n.dart
extension AppLocalizationsX on BuildContext {
AppLocalizations get l10n => AppLocalizations.of(this);
}
Sources: lib/l10n/l10n.dart:7-10, pubspec.yaml:26-28
Summary
The fikak_app directory structure is optimized for professional Flutter development, emphasizing flavor management and feature isolation. By separating the environment-specific entry points (main_*.dart) from the core application (lib/app/) and specific features (lib/counter/), the project maintains a clear hierarchy that facilitates testing and localized content delivery.
Sources: lib/main_production.dart:1-12, lib/app/view/app.dart:1-25