A Flutter application for browsing news articles from various sources and categories.
- Overview
- Folder Structure
- Features
- Screenshots
- Installation
- Usage
- Technologies Used
- Contributing
- License
The News App is a mobile application developed using Flutter and Dart programming languages. It leverages the News API to fetch news articles categorized by topics and sources. Users can explore different categories, search for specific articles, and view detailed information about each article.
The project follows a standard Flutter directory structure:
project_root/
│
├── lib/
│ ├── models/
│ │ ├── category_news_model.dart
│ │ ├── everything_news_model.dart
│ │ ├── news_channel_headline.dart
│ │ ├── news_model.dart
│ │ └── search_news_model.dart
│ ├── pages/
│ │ ├── category_screen.dart
│ │ ├── home_screen.dart
│ │ ├── more_information.dart
│ │ ├── search_screen.dart
│ │ └── splash_screen.dart
│ ├── repository/
│ │ ├── categories_repository.dart
│ │ ├── everything_repository.dart
│ │ ├── news_repository.dart
│ │ └── search_repository.dart
│ ├── view_model/
│ │ ├── category_news_view_model.dart
│ │ ├── everything_news_view_model.dart
│ │ ├── news_view_model.dart
│ │ └── search_news_view_model.dart
│ └── widgets/
│ ├── category_tile.dart
│ ├── drawer_tile.dart
│ ├── every_news_tile.dart
│ ├── heading.dart
│ └── loading.dart
│
├── assets/
│ └── images/
│ └── splash_screen_image.png
│
├── pubspec.yaml
└── main.dart
- lib/models/: Contains data models used throughout the app.
- lib/pages/: Screens or pages of the app.
- lib/repository/: Repository classes responsible for fetching data from APIs.
- lib/view_model/: View models that manage the state and business logic of the app.
- lib/widgets/: Reusable UI components or widgets used across different screens.
- Category Screen: Browse news articles by different categories such as business, technology, sports, etc.
- Search Screen: Search for specific news articles using keywords.
- Article Details: View detailed information about each article including images, source, date, description, and content.
- Navigation Drawer: Easy navigation through different sections of the app.
- URL Launcher Integration: Utilizes url_launcher to open article URLs in the default browser.
To get started with the News App, follow these steps:
-
Clone the repository:
git clone https://github.com/adarshpandey18/news_app.git
-
Navigate to the project directory:
cd news_app
-
Install dependencies:
flutter pub get
-
Run the app:
flutter run
-
Launching the App:
- Upon launching the app, the splash screen appears briefly.
- Afterward, the home screen displays top headlines from various news sources.
-
Navigating Categories:
- Open the drawer menu to navigate through different categories such as Business, Sports, Technology, etc.
- Selecting a category updates the news feed with headlines relevant to that category.
-
Searching for News:
- Navigate to the search screen by selecting the search option from the drawer menu.
- Enter keywords to search for specific news articles related to your interests.
-
Reading Articles:
- Tap on any article from the list to view more details.
- Details include the article's source, publication date, a brief description, and a preview of the content.
- Tap "Read More" to open the full article in a web browser for detailed reading.
- Flutter
- Dart
- HTTP package for API calls
- Cached Network Image package for image looking
- Url Launcher package
-
Fork the repository
-
Create a new branch
git checkout -b feature-branch
-
Make the changes
-
Commit the changes
git push commit -m "Add new feature"
-
Push to the branch
git push origin feature-branch
-
Create a new Pull Request
This project is licensed under the MIT License. See the LICENSE file for details.