test_package_ashish

Creator: coderz1093

Last updated:

0 purchases

TODO
Add to Cart

Description:

test package ashish

Test Package SDK #
Introduction #
Flutter SDK is a powerful framework developed by Google for building cross-platform mobile applications with a focus on providing a secure development environment. With its robust security features, Flutter ensures that your application data and user information remain protected from potential threats and vulnerabilities.
Installation #
To install the Test Package SDK in your Flutter project, follow these simple steps:

Open your project's pubspec.yaml file.
Add the following dependency under the dependencies section:

dependencies:
test_package_sdk: ^1.0.0
copied to clipboard
Make sure to replace ^1.0.0 with the latest version of the Test Package SDK.


Save the pubspec.yaml file.


Run the following command in your terminal:


flutter pub get
copied to clipboard
This command will fetch and download the Test Package SDK package into your project.
Import the Test Package SDK in your Dart code:
import 'package:test_package_sdk/test_package_sdk.dart';
copied to clipboard
You're now ready to start using the Test Package SDK in your application.

Note: Ensure that your Flutter SDK is up to date and compatible with the version of Test Package SDK you are installing. For more detailed installation instructions or troubleshooting, refer to the official documentation or reach out to the Test support team.

Usage #
Implementation
To implement Test Package SDK in your main.dart file, use the following code:
@override
void initState() {
initPlatformState();
if (Platform.isAndroid) {
TestPackage.configure(
"your secret key");
} else if (Platform.isIOS) {
TestPackage
.configure(" your iOS secret key ");
}
super.initState();
}
copied to clipboard
Request Token
To fetch the request token for login, use the following method:
TestPackage.getRequestTokenForLogin();
copied to clipboard
Event Monitoring: #
1. Application Event
TestPackage manages application events itself. If, somehow, the app event is not getting generated, you can use the following method:
TestPackage.trackAppEvent(appstate);
copied to clipboard
2. Screen Change Event
To track screen change events, add the following line to your code:
navigatorObservers: [TestPackage.trackScreenChangeEvent()],
copied to clipboard
Example:
class MyApp extends StatelessWidget {
const MyApp({super.key});

@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
navigatorObservers: [TestPackage.trackScreenChangeEvent()],
home: const MainScreen(),
routes: {
'main': (context) => const MainScreen(),
'login': (context) => const LoginScreen(),
'register': (context) => const RegisterScreen(),
'location': (context) => const LocationPage(),
'click_event': (context) => const ClickEventTestPage(),
'screen_one': (context) => const ScreenOne(),
'screen_two': (context) => const ScreenTwo(),
'screen_three': (context) => const ScreenThree(),
'screen_four': (context) => const ScreenFour(),
},
);
}
}

copied to clipboard
If your project doesn’t support navigatorObservers then you can use custom below method.
TestPackage.trackScreenChangeEvent(currentScreenName);

copied to clipboard
3. Click Event
To track click events, use the following method:
TestPackage.trackClickEvent(context,position);
copied to clipboard
Example:
import 'package:test_package/test_package.dart';
import 'package:flutter/material.dart';


class ClickEventTestPage extends StatefulWidget {
const ClickEventTestPage({Key? key}) : super(key: key);

@override
State<ClickEventTestPage> createState() => _ClickEventTestPageState();
}

class _ClickEventTestPageState extends State<ClickEventTestPage> {
@override
Widget build(BuildContext context) {
return GestureDetector(
onTapDown: (position) {
setState(() {
TestPackage.trackClickEvent(context,position);
});
},

child: Scaffold(
appBar: AppBar(
title: const Text('Click Event Test Page'),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const SizedBox(height: 16.0),
const Text(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
style: TextStyle(fontSize: 18.0),
),
const SizedBox(height: 32.0),
ElevatedButton(
onPressed: () {},
child: const Text('Button 1'),
),
const SizedBox(height: 16.0),
ElevatedButton(
onPressed: () {},
child: const Text('Button 2'),
)]
);
}
}
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.