> For the complete documentation index, see [llms.txt](https://docs.abtasty.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.abtasty.com/server-side/sdks/flutter/flutter/flutter-quick-start-beta.md).

# Quick-Start

### Installation

You will find all instructions in [installation](/server-side/sdks/flutter/flutter/flutter-installation-beta.md) topic

### Flagship Usage

#### Start SDK

The first call you should make is to start the SDK by calling `start` method through the Flagship class.

```groovy
import 'package:flagship/flagship.dart';

// Step 1 - Start the Flagship sdk with default configuration.
await Flagship.start("_ENV_ID_", "_API_KEY_");
```

In *step 1* The SDK needs to start the `environmentId` and `apiKey`. By default the Flagship start with `Decision Mode` for more details on custom configuration go to [Advanced Configuration](/server-side/sdks/flutter/flutter/flutter-reference-beta.md#advanced-configuration).// Fix url

{% hint style="info" %}
📘 API Key & Environment ID required

*You can find your apiKey and your environmentId on your Flagship account, in Parameters > Environment & Security.*
{% endhint %}

#### Create Visitor

The second step after starting the SDK is [visitor](/server-side/sdks/flutter/flutter/flutter-reference-beta.md#visitor-class) creation. This object allows you to manage visitor's context, experiments, and track events.

```groovy
// Step 2 - Create visitor with context "isVip" : true
var visitor = Flagship.newVisitor(visitorId: "visitorId", hasConsented: true)
        .withContext({"isVip": true}).build();
```

In *Step 2* We create a visitor providing his [consent](/server-side/sdks/flutter/flutter/flutter-reference-beta.md#setconsent-method) and his [context](/server-side/sdks/flutter/flutter/flutter-reference-beta.md#updatecontext-method). Go to[ builder methods](/server-side/sdks/flutter/flutter/flutter-reference-beta.md#visitor-builder-methods) to learn more about visitor creation.

#### Getting flags

Once we have created our visitor instance we need to fetch flags. Go to [Flag](/server-side/sdks/flutter/flutter/flutter-reference-beta.md#flag-class) to learn more about.

```groovy
// Step 3 - Fetch flags
    visitor.fetchFlags().whenComplete(() {
      // Step 4 - Get Flag key
      var flag = v.getFlag("flagKey");
      // Step 5 - Read Flag value
      var value = flag.value("defaultValue");
    });
```

When flag fetching completes in step 3 its inner code block is executed. In step 4, we are ready to process visitor's flags and read their [values](/server-side/sdks/flutter/flutter/flutter-reference-beta.md#value-method) in step 5.

Note: SDK will [report exposition](/server-side/sdks/flutter/flutter/flutter-reference-beta.md#value-method) by default when reading a Flag value.

#### Tracking hits

Then sending events tracking will allows you to validate objectives in your campaign reporting.

```groovy
// Step 6 - Send Event
visitor.sendHit( Event(action: "event_action", category: EventCategory.Action_Tracking));
```

{% hint style="info" %}
📘

In order to see your events in your campaign reporting you must define objectives kpis beforehand in the campaign configuration. For more details [Set up your KPIs](/server-side/glossary.md#kpi).
{% endhint %}

In *step 6* Flagship is on charge of sending the *event\_action* event through the function `sendHit`. Go to [tracking](/server-side/sdks/flutter/flutter/flutter-reference-beta.md#hit-tracking) for more information.

You should see your hit using [hitStream](/flagship-deprecated/reporting/verifying-your-hit-setup.md) feature, then on your campaign [report](/flagship-deprecated/reporting/verifying-your-hit-setup.md).


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.abtasty.com/server-side/sdks/flutter/flutter/flutter-quick-start-beta.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
