UI Customization (PitelUIConfig)
🎨 UI Customization (PitelUIConfig)
Customize the native call screen colors, labels, and action buttons anytime at runtime using client.setUIConfig(uiConfig).
Recommended: Decoupled UI Configuration (setUIConfig)
Call setUIConfig() independently whenever your app initializes or when the user switches languages/themes. This decouples UI presentation completely from SIP registration:
// Call at app startup or when switching language/theme:
await client.setUIConfig(PitelUIConfig(
colors: PitelUIColors(
background: '#6C7BF4',
textPrimary: '#1A1F36',
hangupButtonBackground: '#E53935',
),
texts: PitelUITexts(
incoming: 'Cuộc gọi đến...',
outgoing: 'Cuộc gọi đi...',
connected: 'Đang đàm thoại',
connecting: 'Đang kết nối...',
mute: 'Tắt mic',
unmute: 'Bật mic',
speaker: 'Loa ngoài',
hold: 'Giữ máy',
unhold: 'Bỏ giữ',
endCall: 'Gác máy',
),
visibility: PitelUIVisibility(showHoldButton: true),
));
The SDK automatically caches uiConfig locally. autoLogin() restores this custom configuration on app restart, and runtime updates take effect immediately without requiring SIP re-registration.
(Optional / Backward compatibility): You can still provide uiConfig inside PitelSettings when calling client.login(PitelSettings(..., uiConfig: uiConfig)).
Values in PitelUIColors and PitelUITexts are nullable overrides. If omitted, the native platform preset is used; the Dart model does not define a single cross-platform default. The snippet shows sample overrides.
UI Config Parameters Reference
Colors (PitelUIColors)
Color strings use #RRGGBB or #AARRGGBB (alpha first). For example, #806C7BF4 is the blue #6C7BF4 at 50% opacity. Six-digit colors are treated as fully opaque. Invalid values fall back to native presets.
| Dart field | Android effect | iOS effect | Example value |
|---|---|---|---|
background | Call screen background | Call screen background | #6C7BF4 |
cardBackground | Action card background | Action card background | #FFFFFF |
dialPadBackground | Not mapped | Dial-pad screen background | #FFFFFF |
textPrimary | Caller and action-label text | Caller name | #1A1F36 |
textSecondary | Not mapped | Timer and secondary/dial-pad hint text | #4A5568 |
textStatus | Not mapped | Call status label | #FFFFFF |
buttonIconActive, buttonIconInactive | Action icons and labels | Action icons and labels | #6C7BF4, #1A1F36 |
buttonBackgroundActive, buttonBackgroundInactive | Action button backgrounds | Action button backgrounds; active background also affects dial-pad keys | #806C7BF4, #26000000 |
hangupButtonBackground | Hangup and decline buttons | Hangup and dial-pad action button | #FFE53935 |
hangupButtonIcon | Not mapped | Hangup/dial-pad action icon | #FFFFFFFF |
dialPadNumber, dialPadLetters, dialPadButtonBackground | Not mapped | Dial-pad digits, letters and key background | #FF1A1F36, #FF718096, #00000000 |
actionButtonGradient | Not mapped | Transfer action gradient | ['#FF2E7D32', '#FF1B5E20'] |
Texts (PitelUITexts)
| Dart fields | Android effect | iOS effect |
|---|---|---|
incoming, outgoing, connecting | Call screen / incoming notification text | SDK call screen status |
connected, endCall | Active/disconnected call status | Accepted by the bridge/config model, but not currently rendered by the iOS call view |
transferCallTitle, keypadTitle | Ongoing-call notification title/body; these do not title the transfer or keypad screen | Accepted by the bridge/config model, but not currently rendered by the iOS call or dial-pad view |
accept, decline | Incoming-call action labels | Not mapped; system CallKit labels are controlled by iOS |
unknownCaller, mute, unmute, speaker, hold, unhold, keypad, transfer, enterNumber | Not mapped | Used in SDK-controlled call/dial-pad UI |
Visibility (PitelUIVisibility)
| Dart fields | Android effect | iOS effect |
|---|---|---|
showKeypadByDefault, showTransferButton, showHoldButton, showMuteButton, showSpeakerButton | Controls corresponding SDK call-screen controls | Not applied by the current Flutter iOS plugin |
A field listed as accepted but not rendered has no visible effect at that location in the current native UI. UI customization only affects SDK-controlled screens; it cannot rename controls in the system CallKit interface. Verify every field you rely on on each target platform because native presets and layouts differ.