popModal static method

Future<bool> popModal({
  1. bool animated = true,
})

Removes a modal template. Since CPAlertTemplate and CPActionSheetTemplate are both modals, they can be removed. If animated is true, CarPlay animates the transition between templates.

Implementation

static Future<bool> popModal({bool animated = true}) async {
  FlutterCarPlayController.currentPresentTemplate = null;
  final bool? isCompleted = await _carPlayController.flutterToNativeModule(
    FCPChannelTypes.closePresent,
    animated,
  );

  return isCompleted ?? false;
}