How mohamad-amen/chat-direct works
Project type and purpose
• This is a client‐only, single‐page Flutter mobile application targeting Android.
• Purpose: let users enter a phone number (with country code) and launch a WhatsApp chat via a wa.me URL without saving the contact.
File structure
• Top‐level:
• android/ – native Android host and build scripts (Gradle, manifest, Kotlin MainActivity)
• lib/ – Flutter/Dart source code, subdivided into constants, data, models, providers, screens, widgets
• pubspec.yaml(.lock) – dependencies (e.g., hive, provider, url_launcher)
• devtools_options.yaml, analysis_options.yaml – lint & debugging configs
• lib breakdown:
• constants/ – hardcoded keys & defaults
• data/local_data.dart – Hive storage wrapper
• models/phone_code_model.dart – data representation of country code
• providers/phone_code_provider.dart – state management (selected code)
• screens/main_screen.dart – single UI screen entry point
• widgets/ – reusable UI components (dialog, fields, buttons, list)
README for additional insights
• Core features: country-code dialog, local persistence via Hive, auto-selection on field input, launching wa.me URL.
• No backend or external API beyond URL launch.
Elements
• UI → Provider (events)
• Provider ↔ Hive (read/write)
• UI → URL Launcher → wa.me
• State/Business logic (green)
• Data (orange)
• Platform & external (gray)
Detail without over-fragmentation
• Flutter sub‐layer (screens vs. widgets)
• Data model (PhoneCodeModel) flowing through provider
• Assets as an input to UI
• Android host only as the Flutter engine entry point