How alihassan20/akhbary works
Project type and purpose
• This is a Flutter-based mobile application (“akhbary”) for Android and iOS.
• It presents news fetched from an external API, organized into categories via bottom navigation and a drawer.
File structure
• android/, ios/
– Platform-specific wrappers (Gradle, Xcode) for building the Flutter engine and Dart code.
• lib/
– main.dart: App entry point.
– core/
· model/: ArticleModel, ListOfArticle – data representations.
· server/: NewsAPI – network client for fetching JSON.
– feature/
· screen/: Splash, HomePage, Details.
· bottom_screen/: Widgets for News categories (artist, health, politics, sports).
· drawer_screen/: Widgets for additional categories (general, health, technology).
– animation/: Custom animations for splash, transitions.
• test/: Basic widget test.
• pubspec.yaml: Declares Flutter SDK, HTTP and other dependencies.
README for additional insights
• Confirms the app is a “News Application with API.”
• Includes sample UI screenshots (splash, list, details).
Main components
a. Mobile Client (Flutter App)
• Presentation Layer
– Splash & animation (animation_splash.dart, raindrop_animation, HolePainter)
– UI Screens (home_page, details, bottom nav, drawer nav)
• Data Layer
– Models (ArticleModel, ListOfArticle)
– Network Service (NewsAPI: HTTP client, JSON parsing)
• Navigation & State
– BottomNavigationBar, DrawerWidget (no external state management library, state held in StatefulWidgets)
b. External Services
• News API Provider (third-party REST API)
• (Optional) Platform Services
– Android/iOS native storage or caching (not used in this version)
Relationships and interactions
• App launches → Splash animation → main.dart initializes → HomePage()
• HomePage requests NewsAPI.getArticles(category) → HTTP call → JSON response → parse into ArticleModel
• Data flows back to the UI → ListView.builder displays articles
• User taps an article → navigation to Details screen → UI renders ArticleModel details
Architectural patterns and design principles
• Layered architecture (Presentation → Domain/Models → Data/Network).
• Single responsibility: each Dart file handles one screen, model, or service.
• Widget composition for UI and animations.
• Separation of concerns: core/ for generic models & API, feature/ for UI.