cx_flutter_plugin 0.21.0
cx_flutter_plugin: ^0.21.0 copied to clipboard
The Coralogix SDK for Flutter is designed to support various Flutter targets by leveraging the numerous platforms supported by Coralogix's native SDKs.
example/lib/main.dart
import 'dart:ui';
import 'package:cx_flutter_plugin/cx_session_replay_masking.dart';
import 'package:flutter/material.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'app/demo_app.dart';
import 'features/home/presentation/exception_dialog.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
// Registers the masking handler. Masking behaviour (maskAllTexts /
// maskAllImages / textsToMask) is configured via CXSessionReplayOptions
// when session replay is initialised — not here.
SessionReplayMasking.initialize();
// Installed before initSdk so the SDK chains to it: the SDK reports the
// error, then this handler shows it on screen.
PlatformDispatcher.instance.onError = (error, stackTrace) {
showGlobalExceptionDialog(
label: 'Uncaught error',
error: error,
stackTrace: stackTrace,
);
return false;
};
await dotenv.load();
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) => const DemoApp();
}