A Flutter news application powered by NewsAPI that delivers top headlines and category-based news browsing.
- Browse top headlines from multiple countries
- Filter news by categories: Business, Entertainment, General, Health, Science, Sports, Technology
- Read full articles in an in-app WebView
- Cached network images for smooth scrolling
- Clean Material Design UI
- Flutter 3.10 or higher
- Dart 3.0 or higher
- A free API key from NewsAPI.org
- Clone the repository:
git clone https://github.com/theindianappguy/FlutterNewsApp.git
cd FlutterNewsApp- Add your NewsAPI key in
lib/secret.dart:
const String apiKey = 'YOUR_API_KEY_HERE';- Install dependencies:
flutter pub get- Run the app:
flutter runlib/
main.dart - App entry point and MaterialApp setup
secret.dart - API key configuration
models/
article.dart - Article data model
categorie_model.dart - Category data model
helper/
data.dart - Category data provider
news.dart - News API service (top headlines & category news)
widgets.dart - Reusable widgets (AppBar, NewsTile)
views/
homepage.dart - Home page with categories and top headlines
categorie_news.dart - Category-filtered news page
article_view.dart - In-app article WebView
Watch the tutorial on how to build this Flutter news app with NewsAPI: YouTube Tutorial
Sanskar Tiwari (@theindianappguy) (YouTube)
If you found this project helpful or you learned something from the source code and want to thank me, consider checking out what I am building at MagicSlides.app, MagicForm.app & SheetAI.app
Copyright 2020 Sanskar Tiwari
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
