persona_flutter 1.0.5 copy "persona_flutter: ^1.0.5" to clipboard
persona_flutter: ^1.0.5 copied to clipboard

outdated

Persona Inquiry for Flutter. Integrates the native iOS and Android SDKs.

example/lib/main.dart

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

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

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

class _MyAppState extends State<MyApp> {
  Inquiry _inquiry;

  @override
  void initState() {
    super.initState();

    _inquiry = Inquiry(
      templateId: "TEMPLATE_ID",
      environment: PersonaEnvironment.sandbox,
      onSuccess: (String inquiryId, InquiryAttributes attributes, InquiryRelationships relationships) {
        print("onSuccess");
        print("- inquiryId: $inquiryId");
      },
      onCancelled: () {
        print("onCancelled");
      },
      onFailed: (String inquiryId, InquiryAttributes attributes, InquiryRelationships relationships) {
        print("onFailed");
        print("- inquiryId: $inquiryId");
      },
      onError: (String error) {
        print("onError");
        print("- $error");
      },
    );
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Container(
          color: Colors.lightBlue,
          child: Center(
            child: RaisedButton(
              onPressed: () {
                _inquiry.start();
              },
              child: Text("Start Inquiry"),
            ),
          ),
        ),
      ),
    );
  }
}
17
likes
0
pub points
86%
popularity

Publisher

unverified uploader

Persona Inquiry for Flutter. Integrates the native iOS and Android SDKs.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on persona_flutter