How jciterceros/desafio_flutter_lista_de_contatos works
Project type and purpose
• This is a cross-platform Flutter application (“desafio_flutter_lista_de_contatos”) for displaying a contact list on Android, Web (and potentially iOS).
• The README confirms it’s a starter Flutter project, leveraging Flutter’s SDK to target multiple platforms.
File structure
Top-level directories and their roles:
• android/ & android/app/... – native Android project wrapper, Kotlin MainActivity, resources, Gradle build scripts.
• web/ – static assets and HTML shell for the web version.
• lib/ – main Dart entrypoint (main.dart) and core application code (widgets, state management, services).
• test/ – widget_test.dart for automated UI tests.
• pubspec.yaml – Dart/Flutter dependencies, asset declarations, localization config.
README for additional insights
• Internationalization is enabled via assets/translations.
Main components
a. Platform Layer
• Android Host (MainActivity.kt → embeds Flutter)
• Web Host (index.html → loads Flutter Web bundle)
b. Flutter Engine & Framework
• Dart VM / Skia (rendering, platform channels)
c. Application Layers
1. Presentation Layer
– Widgets & Screens defined in lib/main.dart (and sub-modules)
– Internationalization (I18n) loader using JSON translations
2. State Management
– Any chosen pattern (e.g., Provider, Bloc, setState)
3. Domain / Business Logic
– Models (Contact), Services (e.g., ContactRepository)
4. Data Layer
– Remote API Client or Local Storage (if implemented later – e.g., HTTP, SQLite, SharedPreferences)
d. Assets & Resources
• JSON translation files
e. Testing
• Widget tests in test/
f. Build & CI
• Gradle Wrapper (android/gradle/wrapper)
• pubspec and pubspec.lock
Relationships and interactions
• The Platform Layer launches the Flutter Engine, which hosts the Application.
• Presentation widgets dispatch events or calls to the State Management layer.
• State Management interacts with Services in the Domain layer to fetch or mutate data.
• Services call into the Data Layer (network or local storage) and return Models.
• Data flows back up to State Management → Widgets → UI.
Architectural patterns & design principles
• Separation of concerns: Clear layering (Presentation, State, Domain, Data).
• Dependency injection for repositories/services (e.g., via Provider).
• Internationalization using JSON resource files.
• Platform abstraction via Flutter’s platform channels (if native calls are added later).
Detailed checklist before finalizing
• [ ] All major folders (android/, web/, lib/, assets/) are represented.
• [ ] pubspec.yaml calls out dependencies and asset bundles.
• [ ] Presentation, State, Domain, Data layers are stacked clearly.
• [ ] Assets & Translations shown as resource providers to the Presentation layer.