flutter_remote_logger 0.3.5 copy "flutter_remote_logger: ^0.3.5" to clipboard
flutter_remote_logger: ^0.3.5 copied to clipboard

A comprehensive remote logging and profiling package for Flutter. Captures sessions, device info, and uploads logs to Firebase or custom backends.

example/lib/main.dart

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

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  // Initialize Firebase (Assuming you have generated options)
  // await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
  // For this example to compile without generated options, we comment it out or use a dummy.
  // In a real app, this is crucial.
  // await Firebase.initializeApp();

  // Initialize the logger
  // Passing null uses default FileLogStorage and FirebaseLogUploader
  // Note: FirebaseLogUploader needs Firebase to be initialized.
  await RemoteLogger().initialize();

  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('Remote Logger Example')),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              ElevatedButton(
                onPressed: () {
                  RemoteLogger().log('Button clicked', level: 'UserAction');
                },
                child: const Text('Log Action'),
              ),
              const SizedBox(height: 20),
              ElevatedButton(
                onPressed: () {
                  RemoteLogger().identifyUser('example_user_id');
                },
                child: const Text('Identify User'),
              ),
              const SizedBox(height: 20),
              ElevatedButton(
                onPressed: () async {
                  await RemoteLogger().uploadCurrentSession();
                  if (context.mounted) {
                    ScaffoldMessenger.of(context).showSnackBar(
                      const SnackBar(content: Text('Upload triggered')),
                    );
                  }
                },
                child: const Text('Force Upload'),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
0
likes
160
points
431
downloads

Publisher

unverified uploader

Weekly Downloads

A comprehensive remote logging and profiling package for Flutter. Captures sessions, device info, and uploads logs to Firebase or custom backends.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

cloud_firestore, device_info_plus, firebase_core, firebase_storage, flutter, flutter_secure_storage, path_provider, supabase_flutter, uuid

More

Packages that depend on flutter_remote_logger