ChuckCore constructor

ChuckCore(
  1. GlobalKey<NavigatorState>? navigatorKey, {
  2. required bool showNotification,
  3. required bool showInspectorOnShake,
  4. required bool darkTheme,
  5. required String notificationIcon,
  6. required int maxCallsCount,
  7. TextDirection? directionality,
})

Creates Chuck core instance

Implementation

ChuckCore(
  this.navigatorKey, {
  required this.showNotification,
  required this.showInspectorOnShake,
  required this.darkTheme,
  required this.notificationIcon,
  required this.maxCallsCount,
  this.directionality,
}) {
  if (showNotification) {
    _initializeNotificationsPlugin();
    _callsSubscription = callsSubject.listen((_) => _onCallsChanged());
  }
  if (showInspectorOnShake) {
    _shakeDetector = ShakeDetector.autoStart(
      onPhoneShake: () {
        navigateToCallListScreen();
      },
      shakeThresholdGravity: 5,
    );
  }
  _brightness = darkTheme ? Brightness.dark : Brightness.light;
}