In the main.dart file, change from
return MaterialApp(
title: 'Flutter Demo',
routes: {
"/": (context) => const DemoScreen(),
'/Screen1': (context) => Screen1(),
'/Screen2': (context) => Screen2(),
},
);
To the below.
import 'package:vwo_insights_flutter_sdk/vwo_insights_flutter_sdk.dart';
return MaterialApp(
title: 'Flutter Demo',
routes: {
"/": (context) => const DemoScreen(),
'/Screen1': (context) => Screen1(),
'/Screen2': (context) => Screen2(),
},
navigatorObservers: [
VwoNavigatorObserver(),
YourNavigatorObserverIfNeeded(),
],
);