okhi_flutter 1.1.0 icon indicating copy to clipboard operation
okhi_flutter: ^1.1.0 copied to clipboard

The OkHi Flutter library will enable you to start collecting and verifying your user's addresses.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:okhi_flutter/okhi_flutter.dart';

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

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

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

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    final config = OkHiAppConfiguration(
      branchId: "<my_branch_id>",
      clientKey: "<my_client_key_id>",
      env: OkHiEnv.sandbox,
      notification: OkHiAndroidNotification(
        title: "Verification in progress",
        text: "Verifying your address",
        channelId: "okhi",
        channelName: "OkHi",
        channelDescription: "Verification alerts",
      ),
    );
    OkHi.initialize(config).then((result) {
      print(result);
    }).onError((error, stackTrace) {
      print(error);
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text("Create an address"),
        ),
        body: OkHiLocationManager(
          user: OkHiUser(phone: "+254712345678"),
          onSucess: (response) {
            response.startVerification(null);
          },
          onError: (error) {
            print(error.code);
            print(error.message);
          },
        ),
      ),
    );
  }
}
2
likes
120
pub points
79%
popularity

Publisher

verified publisher iconokhi.co

The OkHi Flutter library will enable you to start collecting and verifying your user's addresses.

Repository (GitHub)

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

flutter, http, webview_flutter

More

Packages that depend on okhi_flutter