okhi_flutter 1.0.2 copy "okhi_flutter: ^1.0.2" to clipboard
okhi_flutter: ^1.0.2 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
0
pub points
80%
popularity

Publisher

verified publisherokhi.co

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

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, http, webview_flutter

More

Packages that depend on okhi_flutter