evently 0.1.0
evently: ^0.1.0 copied to clipboard
A Flutter SDK to track user events and analytics.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:evently/evently.dart';
void main() {
// 1. Initialize Evently
Evently().initialize(serverUrl: 'https://my-analytics-server.com');
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Evently Example'),
),
body: Center(
child: ElevatedButton(
onPressed: () {
// 2. Log an event
Evently().logEvent(
'button_tapped',
screenName: 'MainScreen',
description: 'User tapped the example button',
);
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Event logged! Check console.')),
);
},
child: const Text('Log Event'),
),
),
),
);
}
}