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.
-
Download the Latest Release
Download the source code of the latest release from the GitHub releases page for the Web Dashboard:
- Web Dashboard: https://github.com/flutter-news-app-full-source-code/flutter-news-app-web-dashboard-full-source-code/releases/latest
After downloading and extracting the archive, navigate into the project directory.
-
Install Dependencies
Fetch all the required Dart and Flutter packages for the project:
Terminal window flutter pub get -
Configure the Environment
The web dashboard uses compile-time variables to configure its environment. This allows you to easily switch between mock data, a local API, or a live production API without changing the code.
You can specify the environment by passing a
--dart-defineflag to theflutter runcommand.- Demo (Default): Runs the dashboard with in-memory mock data. No backend API is required, making it perfect for focusing on UI changes and component testing.
Terminal window flutter run -d chrome - Development: Connects the dashboard to a locally running instance of the API server.
Terminal window flutter run -d chrome --dart-define=APP_ENVIRONMENT=development - Production: Connects the dashboard to your live, deployed backend API. You must also provide the base URL for your API.
Terminal window flutter run -d chrome --dart-define=APP_ENVIRONMENT=production --dart-define=BASE_URL=https://your.api.com
- Demo (Default): Runs the dashboard with in-memory mock data. No backend API is required, making it perfect for focusing on UI changes and component testing.
-
Run the Development Server
Start the application using one of the commands from the previous step, targeting the Chrome browser.
For example, to run in
demomode:Terminal window flutter run -d chromeThe web dashboard will now be running and accessible in your Chrome browser. The
<Aside>about connecting from a physical device has been removed as it is not relevant for a web-only dashboard.