My Rakamin Profile : https://www.rakamin.com/profile/samuel-christy-angie-sihotang-5p7emngha7n1tz5b
This Flutter application fetches news articles from an API and displays them in a user-friendly interface. Below is a breakdown of the code structure and its functionalities:
The Mandiri News App allows users to stay updated with the latest news. It fetches data from the News API, presenting top headlines and everything news articles. The app utilizes Flutter and Provider package for state management.
- Dio: A powerful HTTP client for Dart, used for making network requests.
- Intl: Provides internationalization and localization support, used for date formatting.
- lib/main.dart: Entry point of the application. Sets up the main UI and initializes the Provider for managing news data.
- lib/utils/const.dart: Contains constant values like API base URL and API key.
- lib/providers/news.provider.dart: Defines a Provider class to manage news data fetching and state.
- lib/pages/articles_details_page.dart: Displays details of a selected news article.
- lib/models/topNews.model.dart: Defines data models for news articles and sources.
- lib/helpers/api.dart: Contains a function for making API requests using Dio.
- lib/components/customListTile.dart: Widget for displaying individual top news articles with a custom design.
- lib/components/everythingList.dart: Widget for displaying individual everything news articles with a custom design.
To run the Mandiri News App:
- Clone this repository to your local machine.
- Ensure you have Flutter installed on your machine.
- Navigate to the project directory and run
flutter pub get
to install dependencies. - Run the app using
flutter run
. - Build the app to be apk using
flutter build apk
.