logs_spotter 0.1.4 copy "logs_spotter: ^0.1.4" to clipboard
logs_spotter: ^0.1.4 copied to clipboard

Spotter is an open source log engine plugin for Flutter. There allow developer to see what happen whenever or remotely debug their application

example/lib/main.dart

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

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

  // Initialize Spotter with Supabase credentials (use placeholders)
  Spotter.initialize(
    'YOUR_SUPABASE_URL',
    'YOUR_SUPABASE_ANON_KEY',
  );

  // Optional: set a user label
  Spotter.set_UserLabel('user_example_001');

  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'logs_spotter example',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'logs_spotter example'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});
  final String? title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;
  static const tag = "MyHomePage";

  void _incrementCounter() {
    setState(() {
      _counter++;
    });

    // Use new API
    "incrementCounter: $_counter".f(origin: tag);
    "incrementCounter: $_counter".i(origin: tag);
    "incrementCounter: $_counter".e(origin: tag);
  }

  @override
  void initState() {
    super.initState();
    "initState".i(origin: tag);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title ?? ''),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text('You have pushed the button this many times:'),
            Text('$_counter',
                style: Theme.of(context).textTheme.headlineMedium),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ),
    );
  }
}
2
likes
140
points
218
downloads

Publisher

unverified uploader

Weekly Downloads

Spotter is an open source log engine plugin for Flutter. There allow developer to see what happen whenever or remotely debug their application

Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

MIT (license)

Dependencies

ansicolor, crypto, device_info_plus, encrypt, flutter, intl, intl_utils, package_info_plus, path_provider, supabase_flutter

More

Packages that depend on logs_spotter