littlefish_core 1.0.14 copy "littlefish_core: ^1.0.14" to clipboard
littlefish_core: ^1.0.14 copied to clipboard

The littlefish_core library used for common functionality in all littlefish mobile applications.

littlefish Core #

littlefish_core is the foundational library for the LittleFish ecosystem. It provides core functionalities such as logging, monitoring, configuration management, and analytics, facilitating streamlined development for various applications.

Features

•	Logging: Centralized logging mechanism to capture and handle log messages at various levels (debug, info, warning, error).
•	Monitoring: Tools to monitor application performance and usage.
•	Configuration Management: Manage and load application settings dynamically.
•	Analytics: Custom event tracking and analytics services to gather insights on app usage.

Getting Started

Installation

To install littlefish_core, add it to your pubspec.yaml file:

dependencies: littlefish_core: latest_version

Then, run:

flutter pub get

Usage

  1. Logging

The DefaultLogger class in littlefish_core provides logging functionality for tracking messages at different levels: debug, info, warn, and error.

Example:

import 'package:littlefish_core/logging/default_logger.dart';

final logger = DefaultLogger();

// Log a debug message logger.debug(this, 'Debug message');

// Log an error with additional info logger.error(this, 'Error occurred', error: 'Error details', stackTrace: StackTrace.current);

•	debug(), info(), warn(), and error() methods allow detailed logging of app behavior.
•	Supports extra data and stack traces for easier debugging.
  1. Configuration Management

The ConfigService class allows for dynamic configuration management. You can load configuration settings at runtime and retrieve various values like booleans or strings.

Example:

import 'package:littlefish_core/configuration/config_service.dart';

final configService = ConfigService();

// Initialize configuration await configService.initialise(settings: ConfigSettings(filePath: 'config.json'));

// Retrieve a boolean value bool isFeatureEnabled = configService.getBoolValue(key: 'feature_enabled', defaultValue: false);

// Retrieve a string value String apiUrl = configService.getStringValue(key: 'api_url');

•	initialise() method loads configuration settings.
•	getBoolValue() and getStringValue() provide easy access to configuration data.
  1. Monitoring

The monitoring module provides tools to track and monitor app performance, including custom events, error reports, and general health metrics. This module helps developers stay informed about app health and performance.

Usage of monitoring services depends on custom implementation, typically using models and services that you can extend to suit your application’s needs.

  1. Analytics

The AnalyticsService class is used to track and log custom events within your application, helping gather insights into user interactions and behaviors.

Example:

import 'package:littlefish_core/analytics/services/analytics_service.dart';

final analyticsService = AnalyticsService();

// Log a custom event analyticsService.logEvent('user_signup', parameters: { 'method': 'email', 'time': DateTime.now().toString(), });

•	logEvent() is used to log custom events along with parameters (e.g., user actions, signup methods).
•	Supports additional metadata for enhanced tracking.

Core Modules

•	Core: Contains the base utilities and shared functionality for littlefish_core.
•	Logging: Provides customizable logging services to track app behavior and issues.
•	Configuration: Handles the dynamic management of configuration settings, making it easy to adjust app behavior without redeploying.
•	Monitoring: Enables performance monitoring and error tracking for ensuring app reliability.
•	Analytics: Tracks custom events for deeper insights into user activity.

Testing

To run tests for the littlefish_core package, use:

flutter test

Contributing

We welcome contributions! To contribute, follow these steps:

1.	Fork the repository.
2.	Create a new branch (git checkout -b feature/your-feature).
3.	Commit your changes (git commit -m 'Add some feature').
4.	Push to the branch (git push origin feature/your-feature).
5.	Open a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

This README provides a more comprehensive overview of each feature and shows how to work with the logging, configuration, monitoring, and analytics functionalities. Let me know if you need further refinement! 

0
likes
90
points
660
downloads

Publisher

verified publisherlittlefishapp.com

Weekly Downloads

The littlefish_core library used for common functionality in all littlefish mobile applications.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (license)

Dependencies

crypto, dio, dio_brotli_transformer, flutter, get_it, uuid

More

Packages that depend on littlefish_core