one_target_mobile_sdk 0.0.9 one_target_mobile_sdk: ^0.0.9 copied to clipboard
G1 tracking's plugin
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:one_target_mobile_sdk/one_target_mobile_sdk.dart';
import 'package:one_target_mobile_sdk_example/common/constant.dart';
import 'package:one_target_mobile_sdk_example/screens/tracking/advancedTracking/search_flight_screen.dart';
import 'package:one_target_mobile_sdk_example/screens/tracking/simpleTracking/simple_tracking_screen.dart';
import 'common/utils.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
var result = Constant.setEnv(Constant.ENV_DEV);
// var result = Constant.setEnv(Constant.ENV_STAG);
// var result = Constant.setEnv(Constant.ENV_PROD);
Utils.log("initState>>> result $result");
}
@override
Widget build(BuildContext context) {
return GetMaterialApp(
enableLog: true,
debugShowCheckedModeBanner: true,
defaultTransition: Transition.cupertino,
home: Scaffold(
appBar: AppBar(
leading: IconButton(
icon: const Icon(Icons.arrow_back_ios, color: Colors.white),
onPressed: () {
exit(0);
},
),
centerTitle: true,
title: const Text('OneTargetMobileSDK'),
),
body: Container(
padding: const EdgeInsets.all(16.0),
child: ListView(
physics: const BouncingScrollPhysics(),
children: [
SampleButton(
text: "Simple tracking",
onPressed: () {
Get.to(() => const SimpleTrackingScreen());
},
),
SampleButton(
text: "Advanced tracking",
onPressed: () {
Get.to(() => const SearchFlightScreen());
},
),
// SampleButton(
// text: "IAM Sample",
// onPressed: () {
// Get.to(() => const IAMScreen());
// },
// ),
],
),
),
),
);
}
}