pop static method
It will present CPAlertTemplate modally.
- template is to present modally.
- If animated is true, CarPlay animates the presentation of the template.
! CarPlay can only present one modal template at a time.
It will present CPActionSheetTemplate modally.
- template is to present modally.
- If animated is true, CarPlay animates the presentation of the template.
! CarPlay can only present one modal template at a time.
Removes the top-most template from the navigation hierarchy.
The history will be updated accordingly to the screen lifecycle.
Implementation
/*static Future<void> showAlert({
required CPAlertTemplate template,
bool animated = true,
}) {
return _androidAutoController.methodChannel.invokeMethod(
EnumUtils.stringFromEnum(FCPChannelTypes.setAlert.toString()),
<String, dynamic>{
'rootTemplate': template.toJson(),
'animated': animated,
'onPresent': template.onPresent != null ? true : false,
},
).then((value) {
if (value) {
FlutterCarPlayController.currentPresentTemplate = template;
}
});
}*/
/// It will present [CPActionSheetTemplate] modally.
///
/// - template is to present modally.
/// - If animated is true, CarPlay animates the presentation of the template.
///
/// [!] CarPlay can only present one modal template at a time.
/* static Future<void> showActionSheet({
required CPActionSheetTemplate template,
bool animated = true,
}) {
return _androidAutoController.methodChannel.invokeMethod(
EnumUtils.stringFromEnum(FCPChannelTypes.setActionSheet.toString()),
<String, dynamic>{
'rootTemplate': template.toJson(),
'animated': animated,
},
).then((value) {
if (value) {
FlutterCarPlayController.currentPresentTemplate = template;
}
});
}*/
/// Removes the top-most template from the navigation hierarchy.
///
/// The history will be updated accordingly to the screen lifecycle.
static Future<bool> pop() async {
final bool? isCompleted =
await _androidAutoController.flutterToNativeModule(
FAAChannelTypes.popTemplate,
);
return isCompleted ?? false;
}