lqd_my_flutter_package 0.0.9
lqd_my_flutter_package: ^0.0.9 copied to clipboard
thelqd.online License - Version 0.0.9 - April 2nd, 2024 Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation cove [...]
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:lqd_my_flutter_package/shelf.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
late EventClient _eventClient;
@override
void initState() {
super.initState();
// naming
EventClient eventClient = EventTrackingFactory.createTrackingAdapter();
eventClient.setApiKey('JyLyMTKc4s3VtbpGT6B9zkpo9958vcv3PfNoa6ef');
// eventClient.setTenantId('JyLyMTKc4s3VtbpGT6B9zkpo9958vcv3PfNoa6ef');
setState(() {
_eventClient = eventClient;
});
}
void _incrementCounter() {
IClickParams params = IClickParams(additionalData: {});
_eventClient.logClickEvent('skip-for-now_link',
params: params,
currentPopupScreen: {'name': 'my-job', 'uiKey': 'my-job-ui-key'});
setState(() {
_counter++;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headlineMedium,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: const Icon(Icons.add),
),
);
}
}