flutter_basics 0.0.4 copy "flutter_basics: ^0.0.4" to clipboard
flutter_basics: ^0.0.4 copied to clipboard

A lightweight Flutter package providing production-safe logging and in-app update utilities.

Here is a complete README.md for your package flutter_basics, including logging, file write, and upload logs. You can copy-paste this directly into your repository.

flutter_basics

A lightweight, production-safe utility package for Flutter applications providing structured logging, file-based log storage, and manual log upload support.

Designed and maintained by Mobigic Technology.

โœจ Features

โœ… Production-safe logger (MobigicLogger)

๐Ÿงพ Supports log levels: trace, debug, info, warning, error, fatal

๐Ÿšซ Automatically disables console logs in release mode

๐Ÿ’พ Persistent file-based logging using LogService

โ˜๏ธ Manual log upload support

๐Ÿงน Clear logs after successful upload

๐Ÿ“ฑ Works with Flutter mobile apps (Android & iOS)

๐Ÿ”„ Useful for crash tracking & in-app update debugging

๐Ÿ“ฆ Installation

Add the dependency in pubspec.yaml:

dependencies: flutter_basics: ^latest

Run:

flutter pub get

๐Ÿ“ฅ Import import 'package:flutter_basics/flutter_basics.dart';

๐Ÿš€ Usage Console Logging (MobigicLogger) MobigicLogger.debug("Debug message"); MobigicLogger.info("Info message"); MobigicLogger.warning("Warning message"); MobigicLogger.error("Error message");

Log objects easily:

MobigicLogger.info({ "status": "success", "version": 1, });

๐Ÿงฑ Log Levels MobigicLogger.trace("Trace log"); MobigicLogger.debug("Debug log"); MobigicLogger.info("Info log"); MobigicLogger.warning("Warning log"); MobigicLogger.error("Error log"); MobigicLogger.fatal( "Fatal error", error: error, stackTrace: stackTrace, );

๐Ÿ”’ Production Safety

โœ… Logs print only in debug/profile

๐Ÿšซ No console logs in release builds

โš™๏ธ No manual flags required

๐Ÿ’พ File-Based Logging (LogService)

LogService allows you to persist logs into a local file for later upload or debugging.

Write Logs to File await LogService.writeLog("Home screen opened"); await LogService.writeLog("User clicked submit button"); await LogService.writeLog("CRASH ERROR: API failed");

Each entry is saved with a timestamp:

2025-12-16T10:30:15.432 -> Home screen opened

โ˜๏ธ Upload Logs

Useful for Report Issue, Support, or Crash Recovery flows.

Future

try { await LogService.writeLog("Manual log upload initiated by user");

await MobigicHelper.uploadFile(file);

// Clear logs after successful upload
await file.writeAsString("");

MobigicLogger.info("Logs uploaded & cleared successfully");

} catch (e) { await LogService.writeLog("Upload failed: $e"); MobigicLogger.error("Log upload failed", error: e); } }

๐Ÿ“‚ Log File Location

This file can be:

Uploaded to backend

Shared with support teams

Attached to crash reports

โœ… Recommended Usage Purpose Tool Debug / Development logs MobigicLogger Production persistent logs LogService Manual issue reporting Log upload Crash diagnostics File logs ๐Ÿงฉ Configuration (Advanced)

You can customize logger behavior if needed:

var logger = Logger( printer: PrettyPrinter( methodCount: 2, lineLength: 120, colors: true, printEmojis: true, ), );

๐Ÿค Contributing

Contributions are welcome!

Open issues for bugs or suggestions

Submit pull requests for improvements

๐Ÿ† Acknowledgments

This package was originally created and enhanced by Tejeshvi Jagtap, focusing on real-world production debugging needs and scalable Flutter architecture.

๐Ÿ“œ License

MIT License ยฉ Mobigic Technology

0
likes
160
points
41
downloads

Documentation

API reference

Publisher

verified publishermobigic.com

Weekly Downloads

A lightweight Flutter package providing production-safe logging and in-app update utilities.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

dio, flutter, flutter_logs, flutter_upgrade_version, http, logger, open_file, path, path_provider

More

Packages that depend on flutter_basics