How preritpandey/nepnews works
Main Components
• Flutter Application Core: This is the heart of the project with code in the lib folder. Inside lib, you have:
• Pages (UI screens like Home, Browse, Profile, Auth, Bookmark)
• Controllers (managing business logic such as ads, authentication, news posts, forex, theme)
• Widgets (reusable UI components like ad cards, breaking news widgets, custom text fields, etc.)
• Models (data models for ads, forex, etc.)
• Services (data service for fetching or managing data)
• Core utilities (e.g., screen size configuration and theming)
• Native Platform Layers: Directories for Android, iOS, macos, linux, windows indicate that platform-specific projects exist. These handle native configurations, manifests, and integration layers (e.g., MainActivity.kt for Android, AppDelegate.swift for iOS).
Relationships and Interactions
• UI Layer ➔ Pages & Widgets:
• Pages gather the user interactions and display data.
• Widgets are used within pages to structure the front-end.
• Controllers as an Intermediary:
• Each page typically invokes a corresponding controller (like news_post_controller or auth_controller) to perform business logic.
• Controllers interact with the services layer to fetch data and update the models.
• Data Flow:
• Data flow begins at the UI (user input) which is then passed to controllers.
• Controllers call services that may fetch data from external APIs or local sources.
• Response data is parsed into models and then rendered on UI components (pages/widgets).
• Platform-Specific Integration:
• The project uses Flutter’s cross-platform abstractions. However, native directories (android, ios, etc.) should be represented to show the integration points that allow the Flutter app to run on respective platforms.
Architectural Patterns and Technologies
• Pattern:
• The structure is similar to an MVC or MVVM pattern: with a clear separation of UI (pages/views and widgets), business logic (controllers), and data (models and services).
• Emphasis on modularity is noted by separating concerns into distinct directories.
• Technologies:
• Flutter & Dart (lib/ for core application code)
• Platform-specific languages (Kotlin for Android, Swift/Objective-C for iOS/macOS, C++/CMakeLists for Linux/Windows)
• CI/CD integration is lightly visible (in the .github/workflows directory)
• Resource management through Flutter’s assets
• At the top, the User interacts with the Flutter UI (pages/widgets).
• Below that, illustrate how controllers manage the business logic and bridge UI with the services.
• Further down, show the data flow through models and services.
• On the side or bottom, include platform-specific wrappers showing the native Android/iOS/macOS/desktop integrations.
• Finally, note external resources like online APIs or libraries if applicable (even though not detailed in README, it’s implied by features like ads and forex data).