NudgeProvider constructor

NudgeProvider({
  1. Key? key,
  2. required Widget child,
  3. dynamic log(
    1. String
    )?,
  4. GlobalKey<NavigatorState>? navigatorkey,
  5. required Nudge nudgeInstance,
  6. List<NudgeUi> plugins = const [],
})

Implementation

NudgeProvider({
  super.key,
  required this.child,
  this.log,
  this.navigatorkey,
  required this.nudgeInstance,
  this.plugins = const [],
}){
  if(navigatorkey!=null){
    NudgeProviderState.navigatorKey = navigatorkey!;
  }
  // else{
  //   NudgeProviderState.navigatorKey = GlobalKey<NavigatorState>();
  // }
  nudge = nudgeInstance; // Assign the instance here
}