Pal constructor
Pal({
- Key? key,
- required MaterialApp childApp,
- ChildAppBuilder? childAppBuilder,
- required String appToken,
- bool editorModeEnabled = true,
- 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();
}