Skip to content

Deployment: Web Dashboard

This guide outlines the process for deploying the Flutter News App Web Dashboard to a production environment.

Before you can build the dashboard for production, you must configure it to connect to your live API server.

  1. Set the Production Environment

    • Open the file lib/main.dart.
    • Locate the appEnvironment constant.
    • Set its value to AppEnvironment.production.
    lib/main.dart
    // Use `AppEnvironment.production` to connect to a live backend API.
    const appEnvironment = AppEnvironment.production;
  2. Verify the API Base URL

    • Open the file lib/app/config/app_config.dart.
    • Ensure that the baseUrl for the production case points to the correct URL of your deployed API Server.

Once your configuration is ready, you can proceed with building and deploying the application. The official Flutter documentation provides a comprehensive guide that covers compiling your Dart code to JavaScript and deploying the output to various hosting services.

Following the official guide is the recommended and most reliable path to a successful deployment.

Official Guide: Build and release a web app