Local Setup
This guide will walk you through setting up and running the Flutter News App Web Dashboard on your local machine.
-
Prerequisites
Before you begin, you must have the Flutter SDK installed on your system. To ensure you are using the most up-to-date and accurate installation instructions, we recommend following the official guide directly from the Flutter team.
- Flutter SDK: Please follow the Official Flutter Installation Guide for your specific operating system.
-
Clone the Repository
Open your terminal and clone the web dashboard repository:
Terminal window git clone https://github.com/flutter-news-app-full-source-code/flutter-news-app-web-dashboard-full-source-code.gitcd flutter-news-app-web-dashboard-full-source-code -
Install Dependencies
Fetch all the required Dart and Flutter packages for the project:
Terminal window flutter pub get -
Configure the Environment
The dashboard can be run in different environments, allowing you to connect it to a live API, a local API, or run it with mock data for UI development.
- Open the file
lib/main.dart
. - Locate the
appEnvironment
constant. - Set its value to one of the following:
AppEnvironment.demo
: (Recommended for UI development) Runs the dashboard with in-memory mock data. No backend API is required, making it perfect for focusing on UI changes and component testing.AppEnvironment.development
: Connects the dashboard to a locally running instance of the API server (typically athttp://localhost:8080
).AppEnvironment.production
: Connects the dashboard to your live, deployed backend API.
lib/main.dart // Use `AppEnvironment.demo` to run with in-memory data (no API needed).// Use `AppEnvironment.development` to connect to a local backend API.// Use `AppEnvironment.production` to connect to a live backend API.const appEnvironment = AppEnvironment.demo; - Open the file
-
Run the Development Server
Start the Flutter development server, targeting the Chrome browser:
Terminal window flutter run -d chromeThe web dashboard will now be running and accessible in your Chrome browser.