> For the complete documentation index, see [llms.txt](https://docs.conscent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.conscent.ai/loyalty-system/flutter-sdk.md).

# Flutter SDK

This project is a starting point for a Flutter [plug-in package](https://flutter.dev/developing-packages/), a specialized package that includes platform-specific implementation code for Android and/or iOS.

For help getting started with Flutter development, view the [online documentation](https://flutter.dev/docs), which offers tutorials, samples, guidance on mobile development, and a full API reference.

```dart
import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:purplepro/purplepro.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String _platformVersion = 'Unknown';
  final _purpleproPlugin = Purplepro();

  @override
  void initState() {
    super.initState();
    initPurpleProPlugin();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPurpleProPlugin() async {
    _purpleproPlugin.setPartnerIdAndUserId(partnerId: "77010207011", userId: "5842918d-7d0f-4091-ab8b-4a6abfb5bf22");
  }

  Future<void> startPurplepro() async {
    _purpleproPlugin.startBluePine(darkMode: false);
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
            children: <Widget>[
              ElevatedButton(
                onPressed: () {
                  startPurplepro();
                },
                child: const Text('Enabled'),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
```

**Installation Steps:**

### Use this package as a library

#### Depend on it

Run this command:

With Flutter:

```shell
 $ flutter pub add purplepro
```

This will add a line like this to your package's pubspec.yaml (and run an implicit `flutter pub get`):

```dart
dependencies:
purplepro: ^0.0.1
```

Alternatively, your editor might support `flutter pub get`. Check the docs for your editor to learn more.

#### Import it

Now in your Dart code, you can use:

```dart
import 'package:purplepro/purplepro.dart';
```

[API reference](https://pub.dev/documentation/purplepro/latest/)

[flutter](https://api.flutter.dev/), [plugin\_platform\_interface](https://pub.dev/packages/plugin_platform_interface)

[<mark style="color:blue;">Packages that depend on c</mark>](https://pub.dev/packages?q=dependency%3Apurplepro)<mark style="color:blue;">onscent.ai</mark>


---

# 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.conscent.ai/loyalty-system/flutter-sdk.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.
