๐ŸŸ๏ธExamples

Example Usage in a React Application

AutoFetch True:

import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'dart:convert';

class OnairosApp extends StatefulWidget {
  @override
  _OnairosAppState createState() => _OnairosAppState();
}

class _OnairosAppState extends State<OnairosApp> {
  final Map<String, dynamic> requestData = {
    "Small": {
      "type": "Personality",
      "descriptions": "Insight into your Interests",
      "reward": "10% Discount",
    },
    "Medium": {
      "type": "Personality",
      "descriptions": "Insight into your Interests",
      "reward": "2 USDC",
    },
    "Large": {
      "type": "Personality",
      "descriptions": "Insight into your Interests",
      "reward": "2 USDC",
    },
  };

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Onairos Demo'),
      ),
      body: Center(
        child: OnairosButtonWrapper1(
          webpageName: 'Mobile App',
          requestData: requestData,
          returnLink: 'yourapp://returnlink',
          autoFetch: true,
          onResolved: onResolved, //Function which recieves the users Personality Data
          inferenceData: {}, // Inference data.
          proofMode: false,
          textColor: 'black', // Example color
          textLayout: 'right', // Replace with actual text layout configuration
        ),
      ),
    );
  }
}

 

AutoFetch False (Manual API Call):

Last updated