Reference

Flutter SDK reference

Every public class, what it is for, and the one thing about it that surprises people.

The whole public API. Everything else in the package is private on purpose — if you find yourself importing from src/, tell us what you needed and we will export it properly.

Full generated dartdoc lands on pub.dev with the first published release. This page is the map.

Rendel

The facade. One init per app run.

MemberSignatureNotes
initFuture<void> init({required String appKey, RendelTheme? theme, List<RendelAction> actions, RendelConfig config})Awaited. A key that does not start with rd_pk_ asserts in debug and reports through onLog in release, then disables the copilot for the run — a typo used to cost a silent afternoon.
openFuture<void> open(BuildContext context)Presents the thread as a full-height sheet. Returns without presenting when the copilot is disabled.
closevoid close(BuildContext context)—
resetvoid reset()Call on logout. Clears the thread and the user, so the next turn is anonymous. Safe to call while the sheet is up.
registerActionvoid registerAction(RendelAction action)Re-syncs the manifest.
addContextProvidervoid addContextProvider(String key, Future<Map<String, dynamic>> Function() provider)Called per turn, with a timeout. A slow provider costs its own context, never the turn.
identifyFuture<void> identify({required String userId, Map<String, dynamic>? traits, String? userHmac})See Context.
refreshConfigFuture<void> refreshConfig()Re-reads the published appearance. The SDK does not hook the app lifecycle itself; call this on foreground if you want a publish to land without a relaunch.
eventsStream<RendelEvent>Broadcast.
theme / configRendelTheme / RendelConfigThe effective values, after any published config is layered over yours.
configRevisionValueNotifier<int>Ticks when a published config lands and changes what is on screen.
isEnabledboolFalse when you turned it off in code or the console published a kill switch.
isInitializedbool—
deviceIdString?The anonymous per-install id this run is sending. Null before init completes. It is what Support asks for.

RendelConfig

Everything that is your choice rather than the protocol's. Every field is also the floor for anything published from the console.

FieldDefaultNotes
apiBaseUrlhttps://api.rendel.ai—
requestTimeout30 sNon-streaming calls.
streamIdleTimeout45 sHow long a turn may go without a single server event. Server pings every 15 s, and the SDK counts them.
sdkVersionflutter/0.1.0Sent as client.sdk.
languages[]The languages this app is willing to be answered in, in preference order — ['tr', 'en', 'ru']. The device picks from among them; one speaking none of them gets the first, so the order is a decision. Empty hands the choice to the list published from the console, and absent that the copilot answers in whatever it is addressed in. Different from locale, which is one device's setting.
localedevice's ownBCP-47 (tr, pt-BR). The language the copilot answers in, and the one confirmTemplates is matched on. A message written in another language is still answered in that one. See Locales.
assistantNameAssistantThe name in the thread header.
launcherLabelAskThe word on the launcher.
answerPagestrueEach answer is a page of its own: the question is written over the screen and the answer drawn from the top, with back and forward between pages. false keeps the thread, a conversation of bubbles. Since 0.34.0 the default.
suggestions[]Opening prompts. Name things this app can do, in the user's words.
emptyStateTitlenullThe headline on an empty thread, in your own words. Null keeps the SDK's, translated into the language the copilot answers in. Publishable from Appearance.
emptyStateBodynullThe line under the empty thread's headline.
enabledtrueThe kill switch in code. Setting it false wins over anything published. Not a security control — the API enforces suspension server-side.
remoteConfigtrueFalse pins the copilot to exactly what this object says.
configStorenullWhere the last good published config is kept between launches.
deviceIdStorenullWhere the device id is kept between launches. Use a different key from configStore — both sides read and write one string.
onPickAttachmentbuilt inReturns an RendelAttachment (bytes, name, media type) from your own picker, replacing the SDK's Photos, Camera and Files; the "+" then opens yours directly. Null uses the built-in. RendelAttachIcon.off removes the control.
onStopDictatingnullEnds a dictation when the user presses the microphone again. Without it the control cannot be pressed mid-session and the recogniser ends the session itself.
onDictatebuilt inReturns recognised speech as text from your own recogniser, replacing the SDK's speech_to_text; it is handed an onPartial callback to feed the composer while somebody is still speaking. Return null when nobody spoke and throw when the recogniser failed: the SDK words the two differently and logs the error. Null uses the built-in. RendelVoiceIcon.off removes the control.
onOpenUrlnullNull opens a card's link in an in-app browser, so the user comes back to the conversation when they close it. Set it to route links yourself, for example to your own product screen.
stringsby localeEvery word the SDK puts on screen that is not your app's or the model's. Null takes them from locale — Türkçe, Deutsch, Français, Español, العربية, English elsewhere. Set it and you own them: RendelStrings.forLocale('tr').copyWith(confirm: '…') changes one and keeps the rest.
onLognullPoint it at your crash reporter.

RendelAction

What the copilot is allowed to do.

FieldTypeNotes
nameStringsnake_case, asserted. One camelCase name used to reject the entire manifest.
descriptionStringThe model reads this to decide when to call it. Write it for a colleague, not for a compiler.
paramsRendelSchemaValidated server-side before an invocation exists.
riskRendelRiskread runs silently; write and destructive get a server-built confirmation card.
handlerRendelHandler?Future<RendelResult> Function(Map<String, dynamic> params)
onInvokeRendelInvocationHandler?Future<RendelResult> Function(RendelInvocation) — the same thing plus the invocation's id and risk, for idempotency on your side.
confirmTemplateString?Overrides the server's sentence on the confirm card.
timeoutDurationDefault 15 s, capped at 120 s.
sandboxResultMap<String, dynamic>?Returned instead of running the handler on a test key.

RendelSchema

Parameter shapes, without hand-writing JSON Schema.

RendelSchema.object({
  'order_id': RendelSchema.string(description: 'The order number'),
  'reason': RendelSchema.enumOf(['damaged', 'wrong_item', 'other']).optional,
  'quantity': RendelSchema.integer().optional,
  'tags': RendelSchema.list(RendelSchema.string()),
})

string, number, integer, boolean, enumOf, list, object, and raw for anything the helpers do not cover. .optional (or .orAbsent) on any of them.

RendelResult

RendelResult.ok(Map<String, dynamic> data) or RendelResult.fail(String error). The failure string reaches the model, so write it as something the model can act on: "no order with that number" beats "404".

RendelRisk

read, write, destructive. See Actions and risk levels.

RendelInvocation

id, name, params, risk. The id is stable across a retry of the same turn, so it is the natural idempotency key for whatever your handler does.

RendelLauncher

RendelLauncher({String? label}). Draws nothing when the copilot is uninitialised or disabled, so you can leave it in the tree unconditionally.

RendelTheme

See Theming. Built with RendelTheme.fromTokens(...), which derives readable text and border roles from your four colours rather than trusting them — a themeable SDK that does not do this ships unreadable badges.

RendelConfigStore

abstract class RendelConfigStore {
  Future<String?> read();
  Future<void> write(String value);
}

One interface, two uses: RendelConfig.configStore and RendelConfig.deviceIdStore. The package takes no storage dependency — a plugin in an SDK is a plugin in every host's build — so this is the seam. RendelMemoryConfigStore is the default and survives a reset(), not a relaunch.

RendelLogRecord, RendelLogLevel, RendelLog

Where the SDK reports what it could not tell you any other way.

codeWhen
invalid_keyappKey does not start with rd_pk_ (or nc_pk_, a key made before the rename).
handler_failedAn action handler threw.
handler_timeoutA handler passed its timeout.
context_provider_timeoutA context provider missed its 300 ms budget.
context_provider_failedA context provider threw.
manifest_sync_failedThe server rejected the manifest. The message carries the field and the reason.
transport_failedA network call failed.
config_unreadableA published config could not be parsed, or was not legible on this device.
config_cache_write_failedThe config store threw on write.
device_id_ephemeralNo deviceIdStore is set, so the device id is new each launch. Debug level, once.
device_id_store_failedThe store threw or hung.
usage_description_missingInfo.plist lacks NSMicrophoneUsageDescription or NSSpeechRecognitionUsageDescription, so the built-in microphone is not drawn, or NSCameraUsageDescription, so the "+" offers no Camera. iOS would close the app the first time either was used.
user_store_failedThe signed-in user could not be stored or read back, so a relaunch starts signed out until the next identify.

code is stable and safe to switch on; message is for humans and may be reworded.

RendelEvent

opened, closed, messageSent, actionExecuted. For your own analytics.

Rendering your own component

ComponentRegistry.register(String type, ComponentBuilder builder) puts a widget of yours in the catalog's place. RendelTurn, RendelActionButton, RendelChip, RendelControlShell, RendelOverline, RendelPressable, RendelPulse and RendelSwap are exported so it presses, encloses and breathes like a built-in rather than like Material.