get_mati_flutter 0.0.1 copy "get_mati_flutter: ^0.0.1" to clipboard
get_mati_flutter: ^0.0.1 copied to clipboard

Get Mati Flutter plugin

example/lib/main.dart

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

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

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    var result;
    // Platform messages may fail, so we use a try/catch PlatformException.
    try {
      result = await GetMatiFlutter.startVerification({
        "clientId": "CLIENT_ID",
        "flowId": "FLOW_ID",
        "buttonTitle": "Continue",
        "metadata": { // fields inside can be whatever we want.
          "userId": "userId",
        },
      });
    } on PlatformException {
      result = 'Error occured';
    }
    print('Result is $result');
    // Example: {verificationId: 60788c1793c323001b7d468c, status: success}

    if (!mounted) return;
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
            child: FlatButton(
          child: Text('Click Demo'),
          onPressed: () => initPlatformState(),
        )),
      ),
    );
  }
}
0
likes
30
pub points
0%
popularity

Publisher

unverified uploader

Get Mati Flutter plugin

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on get_mati_flutter