leiratech_trackzero 0.3.0 copy "leiratech_trackzero: ^0.3.0" to clipboard
leiratech_trackzero: ^0.3.0 copied to clipboard

TrackZero is a full analytics platform that allows you to track what is happening in your system in real time.

example/main.dart

import 'package:leiratech_trackzero/leiratech_trackzero.dart';

void main() {
  //--------------- TrackZero Client ---------------//

  //Create an instance of TrackZero
  TrackZeroClient instance = new TrackZeroClient("API-KEY");

  //After Creating the instance, you could get the instance anywhere by
  instance = TrackZeroClient.getInstance();

  //--------------- Entity ---------------//

  //Create an Entity
  Entity user = new Entity("User", 1)
      .addAttribute("Name", "Sam Smith")
      //Make Sure the date string is in ISO8601 format
      .addAttribute(
          "Date Of Birth", DateTime.utc(1990, 12, 23).toIso8601String())
      .addEntityReferencedAttribute("Location", "Country", "US");

  //Creates/Updates the entity
  setEntity() async {
    Response res = await instance.upsertEntity(user);
    print(res.toString());
  }

  setEntity();

  //Delete an Entity
  deleteEntity() async {
    Response res = await instance.deleteEntity("User", 1);
    print(res.toString());
  }

  deleteEntity();

  //--------------- Event ---------------//

  //Create an Event
  Event checked = new Event("User", 1, "Checked Out", "EVT-1234")
      .addAttribute("Cart Total", 99.95)
      .addEntityReferencedAttribute("Item", "Product", "SKU-1234")
      .addImpactedTarget("Warehouse", "WH-BLVD-652");

  //Creates/Updates the entity
  setEvent() async {
    Response res = await instance.upsertEvent(checked);
    print(res.toString());
  }

  setEvent();

  //Delete an Event
  deleteEvent() async {
    Response res = await instance.deleteEvent("Checked Out", "EVT-1234");
    print(res.toString());
  }

  deleteEvent();

  //--------------- Smart Configuration ---------------//

  //After setting up your custom configurations on TrackZero Portal
  //Get your GroupId from the "Smart Connfiguration" Page in the portal
  queryConfig() async {
    Response res = await instance.queryConfiguration("groupId", "identifier");
    print(res.toString());
  }

  queryConfig();
}
0
likes
140
points
16
downloads

Documentation

Documentation
API reference

Publisher

verified publishertrackzero.io

Weekly Downloads

TrackZero is a full analytics platform that allows you to track what is happening in your system in real time.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, http

More

Packages that depend on leiratech_trackzero