identomat_flutter 0.0.7 copy "identomat_flutter: ^0.0.7" to clipboard
identomat_flutter: ^0.0.7 copied to clipboard

This package provides Identomat online KYC provider's Flutter SDK.

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'),
                  ),
                ],
              ),
            ),
          ),
        ),
      ),
    );
  }
}
2
likes
160
points
236
downloads

Publisher

unverified uploader

Weekly Downloads

This package provides Identomat online KYC provider's Flutter SDK.

Homepage

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on identomat_flutter

Packages that implement identomat_flutter