Skip to content

Commit 5f26eb8

Browse files
committed
chore: use new InstabugWidget inside example app
1 parent ad8e549 commit 5f26eb8

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

example/lib/main.dart

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import 'dart:convert';
55

66
import 'package:flutter/material.dart';
77
import 'package:instabug_flutter/instabug_flutter.dart';
8+
import 'package:instabug_flutter/src/utils/instabug_widget.dart';
89
import 'package:instabug_flutter_example/src/components/apm_switch.dart';
910
import 'package:instabug_http_client/instabug_http_client.dart';
1011
import 'package:instabug_flutter_example/src/app_routes.dart';
@@ -43,24 +44,19 @@ part 'src/components/traces_content.dart';
4344
part 'src/components/flows_content.dart';
4445

4546
void main() {
46-
runZonedGuarded(
47-
() {
48-
WidgetsFlutterBinding.ensureInitialized();
47+
WidgetsFlutterBinding.ensureInitialized();
4948

5049
Instabug.init(
5150
token: 'ed6f659591566da19b67857e1b9d40ab',
5251
invocationEvents: [InvocationEvent.floatingButton],
5352
debugLogsLevel: LogLevel.verbose,
5453
);
5554

56-
FlutterError.onError = (FlutterErrorDetails details) {
57-
Zone.current.handleUncaughtError(details.exception, details.stack!);
58-
};
59-
60-
runApp(const MyApp());
61-
},
62-
CrashReporting.reportCrash,
55+
final app = InstabugWidget(
56+
child: const MyApp(),
6357
);
58+
59+
runApp(app);
6460
}
6561

6662
class MyApp extends StatelessWidget {

0 commit comments

Comments
 (0)