# Insira telas com Slots

Este guia mostra como inserir uma das suas telas entre duas telas consecutivas do SDK, sem alterar a lógica do fluxo original (Nível 2 — consulte [Modelo de personalização](/pt/getnet-toolbox/sdk-white-label/core-concept-sdk/customization-model)).

## Como funciona

O SDK conduz o usuário até a tela do slot e espera que seu aplicativo sinalize a conclusão com `resumeFlow()`. A partir daí, ele retoma o fluxo original. As telas de slot recebem `resumeFlow()` sem argumentos — a única função delas é avisar ao SDK que ele pode continuar.

Você registra os slots em `SdkUiNavigationConfig.slotScreens`, usando um valor `BrFlowSlot` como chave:

```kotlin
interface SdkFlowSlot
typealias SlotScreen = @Composable (resumeFlow: () -> Unit) -> Unit
```

## Registre um slot ao construir o SDK

```kotlin
import com.pagonxt.sdk.brazil.uxal.navigation.BrFlowSlot
import com.pagonxt.sdk.core.uxal.navigation.SdkUiNavigationConfig

val config = SdkUiNavigationConfig(
    slotScreens = mapOf(
        BrFlowSlot.AmountToProductSelection to { resumeFlow ->
            CustomConfirmationScreen(onConfirm = { resumeFlow() })
        }
    )
)

ApoloSdk.Builder(applicationContext)
    // ...
    .customizeNavigationConfig(config)
    .build()
```

## Registre um slot em tempo de execução

Aplique uma configuração depois de inicializar o SDK:

```kotlin
val apolo = ApoloSdk.getClient()

val config = SdkUiNavigationConfig(
    slotScreens = mapOf(
        BrFlowSlot.ProcessingToPaymentSuccess to { resumeFlow ->
            OfferScreen(onContinue = { resumeFlow() })
        }
    )
)

apolo.customizeNavigation(config)
```

## Slots disponíveis

Cada slot fica entre duas telas do SDK. Os retângulos são telas do SDK; o slot é inserido entre elas.

| Slot | De → Para | Contexto |
| :--- | :--- | :--- |
| `AmountToProductSelection` | Amount → ProductSelection | Venda com cartão |
| `ProductSelectionToInstallmentSelection` | ProductSelection → InstallmentSelection | Parcelamento no crédito |
| `ProductSelectionToCardReading` | ProductSelection → CardReading | Débito / crédito à vista / voucher |
| `ProductSelectionToPixQrCodeLoading` | ProductSelection → PixQrCodeLoading | Pix |
| `InstallmentSelectionToCardReading` | InstallmentSelection → CardReading | Depois de escolher as parcelas |
| `CardReadingToCardSelection` | CardReading → CardSelection | EMV multiaplicação |
| `CardReadingToProcessing` | CardReading → Processing | Autorização |
| `CardReadingToPaymentError` | CardReading → PaymentError | Falha de leitura |
| `CardSelectionToProcessing` | CardSelection → Processing | Depois da seleção |
| `CardSelectionToPaymentError` | CardSelection → PaymentError | Falha depois da seleção |
| `ProcessingToPaymentSuccess` | Processing → PaymentSuccess | Aprovado |
| `ProcessingToPaymentError` | Processing → PaymentError | Recusado |
| `PixQrCodeLoadingToPixPaymentError` | PixQrCodeLoading → PixPaymentError | Falha ao gerar o QR |
| `PixQrCodeToPixPaymentSuccess` | PixQrCode → PixPaymentSuccess | Pix aprovado |
| `PixQrCodeToPixPaymentError` | PixQrCode → PixPaymentError | Pix recusado |
| `PixPaymentRecognitionToPixPaymentSuccess` | PixPaymentRecognition → PixPaymentSuccess | Reconhecimento correto |
| `PixPaymentRecognitionToPixPaymentError` | PixPaymentRecognition → PixPaymentError | Falha de reconhecimento |
| `PixPaymentVerificationToPixPaymentSuccess` | PixPaymentVerification → PixPaymentSuccess | Verificação correta |
| `PixPaymentVerificationToPixPaymentError` | PixPaymentVerification → PixPaymentError | Falha de verificação |
| `CancelInputToSearchTransaction` | CancelInput → SearchTransaction | Início do estorno |
| `SearchTransactionToCancelPayment` | SearchTransaction → CancelPayment | Depois da busca |
| `CancelPaymentToCancelPaymentProcessing` | CancelPayment → CancelPaymentProcessing | Confirmação |
| `CancelPaymentProcessingToCancelPaymentSuccess` | CancelPaymentProcessing → CancelPaymentSuccess | Estorno concluído |
| `CancelPaymentProcessingToCancelPaymentError` | CancelPaymentProcessing → CancelPaymentError | Estorno com falha |

## Próximos passos

* [Sobrescreva telas do SDK](/pt/getnet-toolbox/sdk-white-label/how-to-guides-sdk/override-sdk-screens) — substitua a aparência de uma tela em vez de inserir uma nova.