How marcos-queiroz/calculadora-imc works
Project type and purpose
• From the file tree and README, this is a cross-platform mobile application built in Flutter. Its purpose is a simple Body Mass Index (IMC) calculator. It contains:
• lib/main.dart (the Dart entrypoint and widget tree)
• android/ (Android project scaffolding)
• ios/ (iOS project scaffolding)
File structure
• Top-level:
• android/ – Gradle build scripts, platform code, AndroidManifest, resources.
• ios/ – Xcode project, native app delegate, asset catalogs, plist.
• lib/ – Dart code.
• pubspec.yaml – Flutter dependencies and assets.
• No backend or server directories—this is a purely on-device mobile client.
• No subdirectories in lib/, so it’s likely a small app with UI and simple business logic inline in main.dart.
README for additional insights
• The README is the default Flutter template. No references to external services, databases, or advanced architecture.
• This suggests simplicity: UI widgets → business logic (IMC calculation) → display result.
a. Main components
1. Presentation layer (Flutter widgets in lib/main.dart)
2. Business logic layer (IMC calculation code inside Dart)
3. Flutter Engine & Dart runtime
4. Platform adapters (Android and iOS shells)
5. OS (iOS/Android) and Device Hardware
b. Relationships & interactions
• User taps UI button → Flutter widget tree handles tap → Dart logic computes IMC → Widget state updates → Flutter Engine renders pixels via Skia → platform draws on screen.
• No network or external services.
c. Architectural patterns & principles
• Layered architecture: Presentation → Business Logic → Engine → Platform
• Single codebase for UI/business logic (DRY principle)
d. Relevant technologies
• Flutter framework (widgets, rendering via Skia)
• Dart VM / AOT compilation
• Gradle / Android SDK
• Xcode / iOS SDK
• pub.dev (dependency management)
Elements
• Clear labels: “Flutter Widgets”, “Business Logic”, “Flutter Engine”, “Android Shell”, “iOS Shell”, “Device OS”
– UI events → Widget tree → Business logic
– Business logic → Engine → Platform APIs → GPU/Screen
Detailed breakdown of components
1. Widget Layer (lib/main.dart)
– StatelessWidget / StatefulWidget classes
– TextFields, Buttons, Layouts
2. Logic Layer (inside Dart)
– IMC calculation function(s)
3. Flutter Engine + Dart Runtime
– Skia rendering
– Dart AOT/JIT execution
– Platform channel plug-ins
4. Android Shell
– MainActivity.java → FlutterActivity
– AndroidManifest.xml, resources
5. iOS Shell
– AppDelegate.m → FlutterAppDelegate
– Info.plist, Storyboards, asset catalogs
6. Device OS & Hardware
– Touch input, display, CPU/GPU
Putting it all together
[User & Touch Input]
↓
[Flutter Widget Tree (lib/main.dart)]
↓
[Business Logic (Dart IMC Calculation)]
↓
[Flutter Engine & Dart Runtime]
↓
[Platform Shells: Android / iOS]
↓
[Device OS & Hardware]
– Annotate each layer with the key files/technologies.