Pal constructor

Pal({
  1. Key? key,
  2. required MaterialApp childApp,
  3. ChildAppBuilder? childAppBuilder,
  4. required String appToken,
  5. bool editorModeEnabled = true,
  6. TextDirection textDirection = TextDirection.ltr,
})

Implementation

Pal({
  Key? key,
  required MaterialApp this.childApp,
  this.childAppBuilder,
  required this.appToken,
  this.editorModeEnabled = true,
  this.textDirection = TextDirection.ltr,
})  : assert(childApp != null, 'Pal must embed a client application'),
      assert(appToken.isNotEmpty,
          'Pal application token must be provided, create one in your web dashboard'),
      assert(
          childApp.navigatorKey != null, 'Pal navigatorKey must not be null'),
      navigatorKey = childApp.navigatorKey,
      navigatorObserver = childApp.navigatorObservers!
              .firstWhere((element) => element is PalNavigatorObserver)
          as PalNavigatorObserver?,
      super(key: key) {
  assert(navigatorObserver != null,
      'your app navigatorObservers must contain PalNavigatorObserver like this: navigatorObservers: [PalNavigatorObserver.instance()]');
  _init();
}