monikode_event_store 1.0.1 copy "monikode_event_store: ^1.0.1" to clipboard
monikode_event_store: ^1.0.1 copied to clipboard

A singleton service to log event into a Firebase Firestore database. Can also log events locally into the console with different log levels(debug, info, warning, error, trace).

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:monikode_event_store/monikode_event_store.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  final _eventStorePlugin = EventStore.getInstance();

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.spaceAround,
            children: [
              OutlinedButton(
                onPressed: () {
                  _eventStorePlugin.eventLogger.log(
                    "test_event",
                    EventLevel.info,
                    {
                      "custom_parameter": "custom_value",
                    },
                  );
                },
                child: const Text('Log Event'),
              ),
              OutlinedButton(
                onPressed: () {
                  _eventStorePlugin.localEventStore.log(
                    "test_event",
                    EventLevel.info,
                    {
                      "custom_parameter": "custom_value",
                    },
                  );
                },
                child: const Text('Log Local Event'),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
0
likes
150
points
93
downloads

Publisher

verified publishermonikode.com

Weekly Downloads

A singleton service to log event into a Firebase Firestore database. Can also log events locally into the console with different log levels(debug, info, warning, error, trace).

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

cloud_firestore, firebase_auth, firebase_database, flutter, plugin_platform_interface

More

Packages that depend on monikode_event_store