reclaim_flutter 0.1.32 copy "reclaim_flutter: ^0.1.32" to clipboard
reclaim_flutter: ^0.1.32 copied to clipboard

reclaim_flutter SDK provides a way to let your users import data from other websites into your app in a secure, privacy preserving manner using zero knowledge proofs right in your Flutter Application.

example/lib/main.dart

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

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

// Init a GlobalKey and pass it to ReclaimHttps widget
final httpEqualKey = GlobalKey<ReclaimHttpsState>();

class MainApp extends StatelessWidget {
  const MainApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: ListView.builder(
          itemCount: 1,
          itemBuilder: (BuildContext context, int index) {
            return Center(
              child: Column(
                children: [
                  ReclaimHttps(
                    key: httpEqualKey,
                    requestedProofs: [
                      RequestedProof(
                        url: 'https://bookface.ycombinator.com/home',
                        loginUrl: 'https://bookface.ycombinator.com/home',
                        loginCookies: ['_sso.key'],
                        responseSelections: [
                          ResponseSelection(
                            responseMatch:
                                '{&quot;id&quot;:{{YC_USER_ID}},.*?waas_admin.*?:{.*?}.*?:\\{.*?}.*?(?:full_name|first_name).*?}',
                          ),
                        ],
                      ),
                    ],
                    title: "YC Login",
                    subTitle: "Prove you have a YC Login",
                    cta: "Prove",
                    onStatusChange: (status) =>
                        print('Status changed to : $status'),
                    onSuccess: (proofs) {
                      // do something
                      print('proofs: $proofs');
                    },
                    onFail: (Exception e) {
                      // do something
                      print('Error: $e');
                    },
                    showShell: true,
                    shellStyles: BoxDecoration(
                      border: Border.all(color: Colors.red, width: 2.0),
                    ),
                  ),
                  const SizedBox(height: 20),
                  ElevatedButton(
                    child: const Text('Custom Trigger'),
                    onPressed: () {
                      //The trigger can be called from anywhere
                      httpEqualKey.currentState?.triggerOpenWebView();
                    },
                  ),
                ],
              ),
            );
          },
        ),
      ),
    );
  }
}
3
likes
85
points
65
downloads

Publisher

unverified uploader

Weekly Downloads

reclaim_flutter SDK provides a way to let your users import data from other websites into your app in a secure, privacy preserving manner using zero knowledge proofs right in your Flutter Application.

Homepage
Repository (GitHub)

Documentation

API reference

License

unknown (license)

Dependencies

convert, crypto, flutter, flutter_spinkit, fluttertoast, http, wallet, web3dart, webview_cookie_manager, webview_flutter

More

Packages that depend on reclaim_flutter