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.

Reclaim Flutter SDK #

Reclaim Logo

Use the reclaim_flutter SDK to enable your users import data securely from other websites into your Flutter application in a privacy-preserving manner using zero-knowledge proofs.

πŸ“š Table of Contents #

  1. Installation
  2. Usage
  3. Example

πŸ’» Installation #

You can add reclaim_flutter to your Flutter project using Dart or Flutter.

Dart #

Run the following command in your terminal:

$ dart pub add reclaim_flutter

Flutter #

Alternatively, you can use Flutter to install the package:

$ flutter pub add reclaim_flutter

Running the command will add this line to your pubspec.yaml:

dependencies:
  reclaim_flutter: any

After installation, you can import the package in your Dart code:

import 'package:reclaim_flutter/reclaim_flutter.dart';

πŸš€ Usage #

Once the package is installed, you can start using ReclaimHttps and ReclaimSwiggy in your application.

For using Https, following is the example implementation:

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, // Only one item
          itemBuilder: (BuildContext context, int index) {
            return Center(
              child: 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),
                ),
              ),
            );
          },
        ),
      ),
    );
  }
}

In order to trigger the claim creation without showing the shell, run the following:

httpEqualKey.currentState?.triggerOpenWebView();

For using Swiggy, following is the example implementation:

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
  home: Scaffold(

    body: ListView.builder( 
      itemCount: 1, // Only one item
      itemBuilder: (BuildContext context, int index) {
        return Center(
          child: ReclaimSwiggy(
  requestedProofs: [
    SwiggyRequestedProof(
      url: 'https://www.swiggy.com/dapi/order/all?order_id=',
      loginUrl: 'https://www.swiggy.com/auth',
      loginCookies: ['_session_tid'],
    ),
  ],
  title: "Swiggy",
  subTitle: "Prove that you are a swiggy user",
  cta: "Prove",
  onSuccess: (proofs) {
    // do something with proofs
    print('proofs: $proofs');
  },
  onFail: (Exception e) {
    // handle exception
    print('Error: $e');
  },
),
        );
      },
    ),
  ),
);
  }
}

πŸ“ Example #

We have included an example project in the root directory to implement a https provider. You can find this here.

Running this example will showcase how reclaim_flutter can be implemented in a Flutter project. Simply clone the repository, navigate to the example folder, install the dependencies, and run the project.

3
likes
85
points
61
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