scout_sdk 0.1.0 copy "scout_sdk: ^0.1.0" to clipboard
scout_sdk: ^0.1.0 copied to clipboard

Flutter wrapper for Scout — an iOS analytics framework providing logging, metrics, crash reporting, and session tracking backed by Apple's CloudKit.

example/lib/main.dart

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

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

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

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

class _MyAppState extends State<MyApp> {
  static const _containerId = 'iCloud.com.example.app';
  bool _isSetup = false;
  String _status = 'Not initialized';

  Future<void> _setup() async {
    try {
      await Scout.setup(containerId: _containerId);
      setState(() {
        _isSetup = true;
        _status = 'Scout initialized';
      });
    } catch (e) {
      setState(() => _status = 'Setup failed: $e');
    }
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Scout Example')),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text(_status),
              const SizedBox(height: 24),
              ElevatedButton(
                onPressed: _setup,
                child: const Text('Initialize Scout'),
              ),
              const SizedBox(height: 12),
              ElevatedButton(
                onPressed: _isSetup
                    ? () {
                        const logger = Logger('Example');
                        logger.info('Button tapped');
                      }
                    : null,
                child: const Text('Log Message'),
              ),
              const SizedBox(height: 12),
              ElevatedButton(
                onPressed: _isSetup
                    ? () => const Counter('taps').increment()
                    : null,
                child: const Text('Increment Counter'),
              ),
              const SizedBox(height: 12),
              ElevatedButton(
                onPressed: _isSetup
                    ? () => Scout.showDashboard(containerId: _containerId)
                    : null,
                child: const Text('Show Dashboard'),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
0
likes
160
points
50
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Flutter wrapper for Scout — an iOS analytics framework providing logging, metrics, crash reporting, and session tracking backed by Apple's CloudKit.

Repository (GitHub)
View/report issues

Topics

#analytics #cloudkit #ios

License

MIT (license)

Dependencies

flutter, plugin_platform_interface, swift_log_bridge, swift_metrics_bridge

More

Packages that depend on scout_sdk

Packages that implement scout_sdk