News App is a Flutter project designed to provide users with the latest news headlines. The application fetches news data from the NewsAPI and displays it in a clean, user-friendly interface. Users can browse through different news categories and read detailed articles.
- News Browsing: Users can browse through a list of news articles fetched from the NewsAPI.
- News Details: Clicking on a news article displays detailed information about it, including the title, description, source, and publication date.
- Categories: Users can filter news by categories such as business, sports, technology, and more.
- Responsive Design: The app is designed to work on both mobile and tablet devices.
Screen.Recording.2024-06-23.at.00.50.36.mov
The project uses the following packages:
- equatable: For simplifying object comparisons.
- dio: For network requests and API interactions.
- json_annotation & json_serializable: For JSON serialization and deserialization.
- google_fonts: For custom fonts.
- carousel_slider_plus: For creating image sliders.
- flutter_riverpod: For state management.
- firebase_auth, firebase_core, google_sign_in: For Firebase authentication and Google Sign-In integration.
The application's main screen displays a list of news articles fetched from the NewsAPI. Each article is presented in a card with its title, image, and a brief description. Users can tap on an article to see more details, such as the full content, source, and publication date. The app also includes category filters to help users find news on specific topics.
The project follows a MVVM (Model-View-ViewModel) architecture:
- Model: Represents the data structure and handles data manipulation.
- View: Displays the UI and responds to user interactions.
- ViewModel: Connects the model and view, handling business logic and state management.
The folder structure is organized as follows:
- lib
- feature
- model
- view_model
- views
- product
- generation
- init
- model
- service
- utility
- widget
- firebase_options.dart
- main.dart
- feature
News App is a simple yet functional application that demonstrates the use of various Flutter packages and APIs. It provides a solid foundation for building more complex news applications.
- Clone the repository.
- Run
flutter pub get
to install dependencies. - Add your NewsAPI key in the appropriate service file.
- Run the app using
flutter run
.
The application fetches data from the following API: https://newsapi.org/v2/top-headlines?country=us&category=business&apiKey=YOUR_API_KEY