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

# Flutter SDK

{% hint style="info" %}
Остання версія: **Version** **0.0.16**
{% endhint %}

## Огляд&#x20;

Identomat Flutter SDK надає інтерфейс Flutter для запуску сесії верифікації Identomat у мобільному застосунку за допомогою ключа сесії.&#x20;

SDK відповідає за:&#x20;

* Ініціалізацію потоку верифікації Identomat&#x20;
* Запуск інтерфейсу верифікації&#x20;
* Комунікацію з нативною реалізацією Identomat&#x20;

## Початок роботи

### Додайте залежність&#x20;

Виконайте цю команду:&#x20;

```shellscript
 $ flutter pub add identomat_flutter
```

Це додасть такий рядок до `pubspec.yaml` вашого пакета (і виконає неявний `flutter pub get`):

```
dependencies:
  identomat_flutter: ^0.0.16
```

Альтернативно, ваш редактор може підтримувати `flutter pub get`. Перевірте документацію вашого редактора, щоб дізнатися більше.

### Імпортуйте його

У вашому коді Dart ви можете використати:

```
import 'package:identomat_flutter/identomat.dart';
import 'package:identomat_flutter/identomat_flutter_method_channel.dart';
import 'package:identomat_flutter/identomat_flutter_platform_interface.dart';
```

## Приклад

**example/lib/main.dart**

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

import 'package:identomat_flutter/identomat.dart';
import 'package:identomat_flutter_example/data.dart';

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

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

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

class _MyAppState extends State<MyApp> {
  final identomat = Identomat();
  TextEditingController myController = TextEditingController();
  final formKey = GlobalKey<FormState>();

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState(String sesstionKey) async {
    identomat.setCallback(
      () {
        print('===========>>> ONCALL');
      },
    );
    await identomat.setBaseUrl(data['baseUrl']);
    await identomat.setColors(data['colors']);
    await identomat.setStrings(data['strings']);
    await identomat.start(sesstionKey);
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Padding(
            padding: const EdgeInsets.all(16),
            child: Form(
              key: formKey,
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  TextFormField(
                    controller: myController,
                    decoration:
                        const InputDecoration(hintText: 'Enter session key'),
                    validator: (text) {
                      if (text == null || text.trim().isEmpty) {
                        return 'Session key is empty';
                      }
                      return null;
                    },
                  ),
                  const SizedBox(
                    height: 20,
                  ),
                  ElevatedButton(
                    onPressed: () {
                      FocusManager.instance.primaryFocus?.unfocus();
                      if (formKey.currentState!.validate()) {
                        initPlatformState(myController.text.trim());
                      }
                    },
                    child: const Text('Click'),
                  ),
                ],
              ),
            ),
          ),
        ),
      ),
    );
  }
}
```


---

# 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.identomat.com/identomat-documentation-ukr/sdks/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.
