connecto_flutter 0.0.7 copy "connecto_flutter: ^0.0.7" to clipboard
connecto_flutter: ^0.0.7 copied to clipboard

This plugin is used for Connecto project copyright by Girnarsoft Pvt Ltd. This is an analytics sdk to track user events and user journey.

example/lib/main.dart

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

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  Connecto analytics = new Connecto(
      writeKey: "xxxxxxxxxxx",
      userId: "xxxxxxxxx",
      applicationName: "connectoSample",
      isDebugModeEnable: true,
      packageName: "com.example.connecto");

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Connecto Example'),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              InkWell(
                onTap: () {
                  Map<String, dynamic> map = {
                    "platform": "Android",
                    "language": "English (India)",
                    "country": "India",
                    "vehicle": "car"
                  };
                  analytics.trackScreen(
                      screenName: "Main Screen Plugin", properties: map);
                },
                child: Container(
                  margin: EdgeInsets.only(top: 10),
                  padding: EdgeInsets.all(15),
                  color: Colors.grey[300],
                  child: Text("Send Screen Request"),
                ),
              ),
              InkWell(
                onTap: () {
                  Map<String, dynamic> map = {
                    "platform": "Android",
                    "language": "English (India)",
                    "country": "India",
                    "vehicle": "car"
                  };
                  analytics.trackEvent(event: "Button Click", properties: map);
                },
                child: Container(
                    margin: EdgeInsets.only(top: 10),
                    padding: EdgeInsets.all(15),
                    color: Colors.grey[300],
                    child: Text("Send Event Request")),
              ),
              InkWell(
                onTap: () {
                  Map<String, dynamic> map = {
                    "name": "XYZ",
                    "mobile": "1111111111",
                    "email": "xyz@gamil.com"
                  };
                  analytics.identify(traits: map);
                },
                child: Container(
                    margin: EdgeInsets.only(top: 10),
                    padding: EdgeInsets.all(15),
                    color: Colors.grey[300],
                    child: Text("Send identify request")),
              ),
              InkWell(
                onTap: () {
                  analytics.trackFcmToken(
                      "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
                },
                child: Container(
                    margin: EdgeInsets.only(top: 10),
                    padding: EdgeInsets.all(15),
                    color: Colors.grey[300],
                    child: Text("Send Token request")),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
3
likes
20
pub points
0%
popularity

Publisher

unverified uploader

This plugin is used for Connecto project copyright by Girnarsoft Pvt Ltd. This is an analytics sdk to track user events and user journey.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

device_info, flutter, http, intl, package_info, uuid

More

Packages that depend on connecto_flutter