Skip to content

add CPSearchTemplate support#2

Open
sINFdorako wants to merge 1 commit intomasterfrom
task/add-fcp-search-template
Open

add CPSearchTemplate support#2
sINFdorako wants to merge 1 commit intomasterfrom
task/add-fcp-search-template

Conversation

@sINFdorako
Copy link
Copy Markdown
Collaborator

Summary

  • Add CPSearchTemplate wrapping Apple's CPSearchTemplate API for CarPlay search functionality
  • Search results use existing CPListItem — no new item types needed
  • Three delegate callbacks bridged to Dart: onSearchTextUpdated, onSearchResultSelected,
    onSearchButtonPressed

Changes

  • New: FCPSearchTemplate.swift — Swift wrapper implementing CPSearchTemplateDelegate
  • New: search_template.dart — Dart model with callback-based API
  • Modified: Plugin entry point, enums, controller, worker, and barrel export to register the new
    template across the full method channel bridge

Usage

CPSearchTemplate(
  onSearchTextUpdated: (searchText, updateResults) {
    final results = await search(searchText);
    updateResults(results.map((r) => CPListItem(text: r.title)).toList());
  },
  onSearchResultSelected: (item, complete) {
    // handle selection
    complete();
  },
  onSearchButtonPressed: () {},
)

@sINFdorako sINFdorako force-pushed the task/add-fcp-search-template branch from 3bf9e4f to 913c9da Compare April 15, 2026 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant