Skip to main content

adgydeplugin 4.2.4 copy "adgydeplugin: ^4.2.4" to clipboard
adgydeplugin: ^4.2.4 copied to clipboard

discontinued

AdGyde Flutter plugin is used for integration of AdGyde SDk in Android and Ios.

example/lib/main.dart

import 'dart:collection';
import 'package:flutter/material.dart';
import 'dart:async';
//import 'package:flutter/services.dart';
import 'package:adgydeplugin/adgydeplugin.dart';
import 'package:adgydeplugin_example/countingevent.dart';
import 'package:adgydeplugin_example/uniqueevent.dart';
import 'package:adgydeplugin_example/UserDetails.dart';
import 'package:adgydeplugin_example/UserProfile.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.red,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {

  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  Adgydeplugin adgydesinstance= new Adgydeplugin();

  @override
  void initState() {
    adgydesinstance.init("GB01443549308701","Organic");
    adgydesinstance.setCurrentScreen("HomePage");
    print("initDart");
    super.initState();

  }
  @override
  Widget build(BuildContext context) {

    int number=0;
    return new Scaffold(
        appBar: new AppBar(
          title: new Text("AdGyde Sdk Example"),
        ),
        body:
        new Center(
            child: new Column(
              children: <Widget>[
                new RaisedButton(
                  textColor: Colors.white,
                  color: Colors.blue,
                  onPressed: _simpleButtonClick,
                  child: new Text("SimpleEvent"),
                ),
                new RaisedButton(
                  textColor: Colors.white,
                  color: Colors.blue,
                  //padding: const EdgeInsets.all(8.0),
                  onPressed:(){Navigator.push(context, MaterialPageRoute(builder: (context) => CountingEvent()),);
                  print("onPressCounting");},
                  child: new Text("CountingEvent"),
                ),
                new RaisedButton(
                  textColor: Colors.white,
                  color: Colors.blue,
                  //padding: const EdgeInsets.all(8.0),
                  onPressed:_computingButtonClick,
                  child: new Text("ComputingEvent"),
                ),
                new RaisedButton(
                  textColor: Colors.white,
                  color: Colors.blue,
                  //padding: const EdgeInsets.all(8.0),
                  onPressed:() {Navigator.push(context, MaterialPageRoute(builder: (context) => UniqueEvent()),);
                  print("onPressUnique");},
                  child: new Text("Unique Event"),
                ),
                new RaisedButton(
                  textColor: Colors.white,
                  color: Colors.blue,
                  onPressed:_revenueButtonClick,
                  child: new Text("Revenue"),
                ),
                new RaisedButton(
                  textColor: Colors.white,
                  color: Colors.blue,
                  onPressed:_AddScreen1,
                  child: new Text("AddScreen1"),
                ),
                new RaisedButton(
                  textColor: Colors.white,
                  color: Colors.blue,
                  onPressed:_removeScreen1,
                  child: new Text("RemoveScreen1"),
                ),
                new RaisedButton(
                  textColor: Colors.white,
                  color: Colors.blue,
                  onPressed:(){Navigator.push(context, MaterialPageRoute(builder: (context) => UserDetails()),);},
                  child: new Text("UserDetail"),
                ),
                new RaisedButton(
                  textColor: Colors.white,
                  color: Colors.blue,
                  onPressed:(){Navigator.push(context, MaterialPageRoute(builder: (context) => UserProfile()),);},
                  child: new Text("UserProfile"),
                ),
              ],
            )
        )
    );
  }


  void _simpleButtonClick(){
    adgydesinstance.simpleEvent("registration");

  }

  void _computingButtonClick(){
    Map map =Map<String, dynamic>();
// First parameter is event name and second is value name which will be accumulated.
    map={"offerlist":"50%Off"};
// Second parameter is the value for its value name. Value must be integer type.
    map={"50%off":"1000rs"};
// Trigger event where first parameter is event_id
    adgydesinstance.computingEvent("computing_event", map);

  }

  void _revenueButtonClick(){
    adgydesinstance.revenueEvent(70);
  }

  void _AddScreen1() {
    adgydesinstance.setCurrentScreen("AddScreen1");
  }

  void _removeScreen1(){
    adgydesinstance.removeCurrentScreen("AddScreen1");
  }




}
0
likes
25
points
53
downloads

Publisher

unverified uploader

Weekly Downloads

AdGyde Flutter plugin is used for integration of AdGyde SDk in Android and Ios.

Homepage

License

unknown (license)

Dependencies

flutter

More

Packages that depend on adgydeplugin

Packages that implement adgydeplugin