omniindex 1.0.18 copy "omniindex: ^1.0.18" to clipboard
omniindex: ^1.0.18 copied to clipboard

OmniIndex dart package is a library which handles commnication between OmniIndex clients and their relating data within a flutter/dart application environment

OmniIndex/omniindex dart Package #

OmniIndex Corporate logo on white background

  • 📒 OmniIndex Homomorphic Blockchain
  • 🏫 Postgres Machine Learning
  • 🏄‍♀️ Simple surface API
  • 🐦 Follow on LinkedIn

Pre-requisite #

Introduction #

The OmniIndex dart package is a library which handles commnication between OmniIndex clients and their relating data within a flutter/dart application environment.

Getting started #

Installation #

Using this package as a library

Set up your dependency;

With Dart:

dart pub add omniindex

With Flutter:

flutter add omniindex

This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):

dependencies:
  omniindex:^1.0.0

Alternatively, your editor might support dart pub get or flutter pub get. Check the docs for your editor to learn more.

Now in your Dart code, you can import and use the package:

import 'package:omniindex/omniindex.dart';

Usage #

  1. Create your constructor by providing details from an environment variable file or other secure source. Never hard code these values

    * @param String apiServer (server address)
    * @param String seedNode (seeed)
    * @param String nodeServer (node server)
    * @param String localDomain (company domain)
    
  2. Once you have these parameters you can include the omniindex package in your flutter/dart project:

    import 'package:omniindex/omniindex.dart';
    
  3. Next, use the constructor details to create an connected instance of omniindex (oidx) and act on it.

    Example:

    // Instantiate the default
    OmniIndex oidx = OmniIndex(debug: true);
    

    Sample:

    
    /// fetchInfo function takes in paramters [select] and [from] along with a Map<String, String>[details]
    /// to act on.
    Future<dynamic> fetchInfo(String select, String from, Map<String, String> details) async {
        dynamic jResponse = [];
    
        String query = "SELECT $select FROM .$from;";
    
        String body = jsonEncode(<String, dynamic>{
        "showEmptyFields": "false",
        "analyticQuery": query,
        //"showProtected": "true",
        "user": details["uid"],
        "unitName": details["email"]
        });
    
        // accept the default constructor. values are established via a configuration json file
        // see the README.md
        OmniIndex oidx = OmniIndex();
        String response = await oidx.callOmni('runanalyticqueryml', body, user);
    
        jResponse = jsonDecode(response);
        List<dynamic> res = jResponse['results'];
    
        return ((res.length == 0) ? 0 : ((select != '*') ? res.last[select] : jResponse['results']));
    }
    
    
    // set up our details
    Map<String, String> details;
    details['email'] = 'some@example.com';
    details['uid'] = 's123456789Id';
       
    // fetch the height data and store in our details Map
    await fetchInfo('height', 'profile where height != 0',  details).then((height) => details['height'] = height);
    
    // validate / act on height from details['height']
       
    - set your APICredentials accordingly
    
    If you don't have these values see [Pre-requisites above](#pre-requisite)
    you must have a valid OmniIndex API license/key to use this package
    

Development #

API

2
likes
140
points
42
downloads

Publisher

verified publisheromniindex.io

Weekly Downloads

OmniIndex dart package is a library which handles commnication between OmniIndex clients and their relating data within a flutter/dart application environment

Homepage

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

firebase_auth, flutter, google_sign_in, http, logger, postgres

More

Packages that depend on omniindex