> For the complete documentation index, see [llms.txt](https://docs.digit.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digit.org/digit-ui/build/mobile-app-ui.md).

# Mobile App UI

## Overview

This guide explains how to build user interfaces for DIGIT using Flutter. It focuses on simple concepts, standard patterns, and reusable components so developers can quickly create consistent, scalable UI modules.

DIGIT uses Flutter because it allows us to build fast, responsive, cross-platform apps with a single codebase. The UI architecture follows a clean, layered pattern to separate **UI**, **business logic**, and **data access**.

**Key principles:**

* Use standard DIGIT UI components wherever possible.
* Follow a consistent project structure.
* Keep UI code simple — business logic stays in view-models.
* Reuse common services such as localisation, user management, and networking.

## Steps

{% stepper %}
{% step %}

### Set Up Your Environment

* Install Flutter and Dart - stable channel recommended
* Configure an IDE like Android Studio or VS Code
* Install required extensions - Dart, Flutter
* Run `flutter doctor` to confirm the setup
  {% endstep %}

{% step %}

### **Clone the Repository**

After setting up your development environment, you can run the **works\_shg\_app** on your local device. The **works\_shg\_app**  here is used for example purposes only.&#x20;

Run the following command:

```
git clone https://github.com/egovernments/DIGIT-Works.git
```

{% endstep %}

{% step %}

### Add the `.env` File

Inside the project folder `frontend/works_shg_app`, create a `.env` file.

Add the below sample config:

```
BASE_URL='https://works-dev.digit.org/'
MDMS_API_PATH='egov-mds-service/v1/_search'
GLOBAL_ASSETS='https://works-dev.digit.org/works-dev-asset/worksGlobalConfig.json'
ENV_NAME="DEV"
```

{% endstep %}

{% step %}

### Install Dependencies

Open your terminal and go to the project folder:

```
frontend/works_shg_app
```

Run:

```
flutter clean      // clears old build cache
flutter pub get    // downloads all dependencies
```

{% endstep %}

{% step %}

### Run the App

Connect a device or start an emulator/browser, then run:

```
flutter run
```

This starts the application locally.
{% endstep %}

{% step %}

### Use Flutter DevTools

A link will appear in your terminal. Open it to access debugging and performance tools.
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.digit.org/digit-ui/build/mobile-app-ui.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
