V- Modal AI: Visual Video / Image Search - Flutter Video SDK
Dart android-sdkflutterflutter-appflutter-packageflutter-sdkflutter-videoflutter-video-editingflutter-video-playerflutter-video-sdkflutter-videosflutter-videosdkmobile-videomobile-video-editor-sdkmobile-video-sdkvideo-editingvideo-sdkvideo-searchvideo-search-enginevideo-streaming
Release Flutter SDK from 445867a02d6f0648b06dc1286b28df11200f5f1b
vmodal-release-app46ddd4a2f61b
diff --git a/RELEASE_METADATA b/RELEASE_METADATAindex cde8263..426e932 100644--- a/RELEASE_METADATA+++ b/RELEASE_METADATA@@ -1 +1 @@-Source-vmx-api: 368afc8bf10f9dacbeafba8951301618b2a97bc5+Source-vmx-api: 445867a02d6f0648b06dc1286b28df11200f5f1bdiff --git a/SOURCE_MANIFEST.sha256 b/SOURCE_MANIFEST.sha256index 8cd0c17..893bc40 100644--- a/SOURCE_MANIFEST.sha256+++ b/SOURCE_MANIFEST.sha256@@ -4,7 +4,7 @@ fbbda2e7e29bbd860539a9ca18c478f3b02de140f25a872c19a6dbecd11bc94b ./.github/work44900e7c55f6cf8e5068d7a3f169fdf8590ae63bb20602ef67941b879e70582a ./CHANGELOG.md37b7148216ac6090e36adfb699d642b8dd1e1b8ba99870e65e88733947a59fa6 ./LICENSE691400d97ff36d07087f587b8d1d65bdf4bf7dd23a06816ac550ddff8b2bb1c8 ./README.md-bd5a4f423179fb82cfc26abf09406455feb2cc2d213bff761fdea4e0140c5153 ./RELEASE_METADATA+5b9eba243ef61d72ed6acd0c6994eb86d76eac9e3e009d7351028293f669e26d ./RELEASE_METADATAdef7e4f643adff5b01b877b6a7fa5b2381612b693c0bf06bd232ee0f7197d342 ./analysis_options.yaml09a850ca6ebd5470138b7f20204d4dbe0fec89d268a205f14cf3bff0b99f365b ./build.sh4f18642680fb433554a5523d00bd99e0d650af340bcaebe628f59f63ac84e458 ./dartdoc_options.yaml@@ -12,10 +12,10 @@ def7e4f643adff5b01b877b6a7fa5b2381612b693c0bf06bd232ee0f7197d342 ./analysis_optcae6114908952cf81a908b7fcc8c0ba4ce3f866e9dbaf974303273f334e0e3f6 ./doc/release.md13bacc486006b6b6ae11ae37b2cda0dddf588b8aa8e72c1b13e570b95f36aa59 ./doc/sdk_contract.md37ba2dc3e0ebcc1441ee57b557f93dacd6a941a3549fe31bfbe06ccd14078fa3 ./doc/sdk_doc.md-da330cad4fc27776d249a5db97c1e20bf2cac015d0bbab73b781c0a9ec15b00f ./doc/search_app.md+3c7dd1e5da3a1d287e8578a83a51f7b416036d0bf4e6cc16288c11d547959181 ./doc/search_app.mde246ed229511a24a1ee7e98529c203ef90d1d352290ce8486caebe05683db3a0 ./env.shc5ce516b547327aab5b6fa27a523d4c76e66294ada3248b293c54b9595cd3a87 ./example/.metadata-87d97512b92970c2cfd412f06a91baff7afa73f0c292fc52334a9fd9461670a3 ./example/README.md+6a1b121762f656d6772c07f95252440471569426806d559868ef5647d7637863 ./example/README.mde0ea485cfdbc3e12b93efb8679a5ea73ebfe20ea4ca0c473dc594fc2fb274ed5 ./example/analysis_options.yaml807e56bf3e3fb8a082d8b802658ce8735bef5b88998ccd6f46f010955aa0081a ./example/android/app/build.gradle.kts30b0832ed8b92dfbd6ae2abfa939ccf26333d37600056b1572bd4a397a18a74b ./example/android/app/src/debug/AndroidManifest.xml@@ -75,10 +75,10 @@ fd367b6c43006d61b730f674970dd48b9f662c8f2264e52ffc1558102a2c9f2d ./example/ios/1a8d11d01d1cc92c650c9c9ed35299240052d4683a15a719a2315ef44185e074 ./example/ios/Runner/Runner-Bridging-Header.hadd68b905971dedfcc0d0b5b7118030de5925ba8c081ad9815463699e3a444ad ./example/ios/Runner/SceneDelegate.swift5e8f4908dacea6f29b2a790e4d38bf5fded69096063f9a27a2f21584d62b30c0 ./example/ios/RunnerTests/RunnerTests.swift-a9f053afcdfd007c455291dc2280d72300ee0e9b2893d878d726192b5a68cd78 ./example/lib/main.dart+b5a801d6411bbaeaca924c76dff81bb03c825d87c6d176d91f899cb53868e60c ./example/lib/main.dartc59d35f6e3b82291eff92d5c7d55d9efb18ef2375cdef091c282282930729cad ./example/pubspec.lockca703ea63f5117dea4c308af57be8ff3a65e95400862159b7e793a90dc4d3200 ./example/pubspec.yaml-f6bae8dec3f5ce5afd314198c9a107082d3172cfe0bc6e02efcbc528cabdac1a ./example/test/widget_test.dart+a3eb68137be846dd8f21470c3087c8c7f141a5d2390ffde27ccc2653e7aedb6d ./example/test/widget_test.dart23756b83470b1f25f6a7e6b5a6270f123a5224e49fd8e2eda36001358951b688 ./install.sh7becacd31a8d134fa435b39cd819798d5fbf58f89b9f30c50362e2dcf757aaed ./lib/src/adaptive_upload.dart9464fff0c519a1ce70cddefb3e3eaa95d07b97ccdaf5b8381c01d7c88767ae83 ./lib/src/api_key_provider.dart@@ -112,7 +112,7 @@ a998f548e5e7bf975222cabd530302e47e45bd7cdc21697fbd333ae7d98965c2 ./test/fakes.d0a1394c90829b91541aa01e9786e3195aae04fc49a7b92775dbf404bf2802107 ./test/fakes_test.dart14368b598ece0ce9b2e249148a10a92f2c80e38427c077013a1515826f4365bd ./test/fixtures/routes_contract.jsonfd2bad0ad87fbf2f15f7e9845b830db58408bb4c502c6ff105f39e4e7cce1905 ./test/multipart_upload_test.dart-dd59ef5794ef1a35f0f79913b5a03e46010e09c2608e2e57ef35e78a236fd59e ./test/regression_manifest_test.dart+5828c88fff50231ac71bc2e9bdf2a4795daa008c74e7abaefa28807d27bbd008 ./test/regression_manifest_test.dartec2d3ab09457fdccf30fc338585b89cf466f5d8f7fc8ce5f6c0ae52357390277 ./test/resources_models_test.dartf8a9db8ec058072c6bb13d1052306e826010331c36848024faa3e2694732ff86 ./test/shell_scripts_test.dart79e3de3c03451cd9d62327430106edf861da6aeb97b546bbac2d93a0bcbbe3d3 ./test/transport_test.dartdiff --git a/doc/search_app.md b/doc/search_app.mdindex 826d2a5..caff236 100644--- a/doc/search_app.md+++ b/doc/search_app.md@@ -1,20 +1,82 @@# Search application integrationKeep the client above individual pages so navigation does not close shared-network state. Pages await typed futures and check `mounted` before changing UI.+network state. Before searching, confirm that the selected authenticated video+collection exists and use its latest advertised LanceDB version.```dart+final groups = await client.collections.listGroups(mode: 'vid_file');+final group = groups.findGroup('agroup', mode: 'vid_file');+final version = group?.latestLancedbVersion;+if (version == null) throw StateError('Finish the image index first');+final result = await client.searches.searchVideo(- const SearchRequest(+ SearchRequest(queryText: 'red bicycle',mode: 'vid_file',groupName: 'agroup',+ streamName: 'astream',+ searchSources: const ['image'],+ versionLancedb: version,),);```-Render only safe `SdkException.toString()` output. It contains classification-and status metadata, never response bodies, URLs, keys, or identities. Cancel an-upload task when the user explicitly cancels it; do not close the application-client merely because a page was disposed.+Search hits contain stored image coordinates, not public image URLs. Convert+each usable hit into one bulk lookup record with these fields:++```text+mode vid_file+group_name selected authenticated collection+modality image+stream_name hit stream, or selected stream as fallback+filename basename of the first supported filename/path field+ts_unix_13digits normalized timestamp, when present+```++The supported filename fields, in order, are `filename`,+`filename_sanitized`, `video_filename`, `video`, `source_path`, and `path`.+Normalize timestamps from `ts_unix_13digits`, `ts_unix`, or `timestamp_ms`:+truncate values longer than 13 digits, multiply 10-digit seconds by 1000, and+left-pad other nonblank numeric values to 13 digits.++Send all candidate records in one request:++```dart+final candidates = exampleSearchCandidates(result, 'agroup', 'astream');+final resolved = candidates.isEmpty+ ? null+ : await client.images.getUrlBulk(+ candidates.map((candidate) => candidate.record).toList(),+ );+final images = resolved == null+ ? const <ExampleSearchImage>[]+ : exampleSearchImages(candidates, resolved);+```++Map each usable `url_pre_signed` back through `input_index`; do not join by+response order when an index is present. Accept numeric or parseable-string+indexes, reject negative/out-of-range values, keep the first usable duplicate,+and sort the final cards by candidate index. A missing index may use only its+bounded response-row position as a compatibility fallback.++Use a responsive `GridView.builder` with one page scroll owner. Show total+backend matches separately from resolved image count, and keep an image load+failure local to its card. A successful search may legitimately have matches+but no image-backed cards because filenames or URL records were unavailable.+Presigned image URLs are temporary capabilities. Keep them in current widget+state only, resolve fresh URLs for every search, and never log or persist them.+Download them directly with `NetworkImage`/`Image.network`; do not attach the+VModal Bearer token or identity headers to that image GET.++Capture a search generation plus the query/collection/stream snapshot before+awaiting network work. After both search and bulk resolution, check `mounted`+and that the generation/scope is still current before updating UI. Invalidate+old results when the client, query, collection, stream, or upload lifecycle+changes.++Render only safe `SdkException.toString()` output. It contains classification+and status metadata, never response bodies, URLs, keys, or identities. Cancel+an upload task when the user explicitly cancels it; do not close the shared+application client merely because a page was disposed.diff --git a/example/README.md b/example/README.mdindex 50c6d1e..1a2eda6 100644--- a/example/README.md+++ b/example/README.md@@ -8,7 +8,7 @@ iOS:3. List the existing index jobs for the selected collection.4. Reuse ready data, or upload the bundled 10-frame sample or another video.5. Create an image index when needed and wait until it is ready.-6. Search the indexed collection and inspect result fields.+6. Search the indexed collection and inspect its responsive image grid.The runnable example is intentionally simple. It keeps its UI and SDK calls in[`lib/main.dart`](lib/main.dart), so a beginner can follow the main flow in one@@ -341,8 +341,9 @@ was accepted, not that search data is ready. Use the visible refresh action or1. Leave the default query, `red`, for the bundled colored sample or enter avisual description for your chosen video.2. Tap **Search** after indexing succeeds.-3. Inspect up to five result cards showing the best available title/item ID,- source modality, timestamp, and normalized score.+3. Inspect the responsive result grid. Each card shows a square frame, the best+ available title, filename, stream, timestamp, and score. The summary keeps+ total search matches separate from images that could be resolved.Search and upload use the same **Collection** and **Stream** fields. The examplerefreshes the authenticated key's collection list before every search and@@ -364,13 +365,40 @@ final result = await client.searches.searchVideo(versionLancedb: version,),);++final candidates = exampleSearchCandidates(+ result,+ collectionName,+ streamName,+);+final resolved = candidates.isEmpty+ ? null+ : await client.images.getUrlBulk(+ candidates.map((candidate) => candidate.record).toList(),+ );+final images = resolved == null+ ? const <ExampleSearchImage>[]+ : exampleSearchImages(candidates, resolved);++for (final image in images) {+ // The real grid uses the same URL without attaching VModal auth headers.+ Image(image: NetworkImage(image.url), semanticLabel: image.title);+}```+The application code accepts the documented filename aliases, normalizes path+basenames and timestamps, omits unusable hits, and validates `input_index`+before joining a URL to a ranked hit. It sends all usable lookup records in one+`getUrlBulk` call; it does not issue one image request per result. An omitted or+failed image record reduces the displayed-image count without changing the+backend match count or hiding successfully resolved siblings.+A zero result count is still successful. Search is blocked locally when theCollection value is not returned for the current key. If the collection existsbut has no advertised LanceDB version, the example asks the user to create orfinish its image index instead of omitting `version_lancedb` and accidentally-requesting the backend's `v0` default.+requesting the backend's `v0` default. Resolved URLs are temporary: the example+keeps them only in widget state and requests fresh URLs on every search.## 12. Stop and clean up@@ -410,10 +438,12 @@ The main learning points in [`lib/main.dart`](lib/main.dart) are:- `VmodalClient` provides typed SDK resources.- `client.auth.me()` resolves the current identity.- `client.searches.searchVideo()` performs natural-language video search.+- `client.images.getUrlBulk()` resolves all usable search hits in one request.- `client.collections.videoUpload()` creates a cancellable upload task.- `openFile()` supplies an app-readable video path through `file_selector`.- `client.indexes.createIndex()` and `indexStatus()` expose background work.-- Raw search rows are rendered as compact result cards.+- Validated `input_index` values couple ranked hits to temporary image URLs.+- Search images render in a responsive grid with local loading/error states.- `rootBundle.load()` copies the bundled sample into a temporary `File`.- `SdkException` provides SDK and API error details.@@ -478,6 +508,22 @@ Check the status text at the bottom of the application. Confirm that:- the key belongs to the correct backend environment; and- the VModal service is reachable from the device.+### Matches exist but no image-backed matches are shown++The search service can return a match that has no usable filename or whose+stored image cannot be resolved. The summary still reports the backend match+count while the app displays **No image-backed matches were found.** Confirm+the collection's image index is complete and that the hit contains a supported+video filename/path field.++### `Image unavailable`++A temporary image URL may have expired, the device may be offline, or the+source frame may no longer exist. The failure stays inside that card so other+results remain visible. Restore connectivity and run the search again to obtain+fresh URLs. Do not log or persist presigned URLs, and do not attach the VModal+Bearer header when Flutter downloads them.+### `Select an app-accessible file first`The path is empty, the file does not exist on the mobile device, or the app@@ -501,7 +547,7 @@ bash build.sh pub_get## Next steps-- Read the [SDK guide](../docs/sdk_doc.md).-- Learn how to [manage API keys](../docs/manage_api_key.md).-- Follow the [search application guide](../docs/search_app.md).-- Review the [SDK contract](../docs/sdk_contract.md).+- Read the [SDK guide](../doc/sdk_doc.md).+- Learn how to [manage API keys](../doc/manage_api_key.md).+- Follow the [search application guide](../doc/search_app.md).+- Review the [SDK contract](../doc/sdk_contract.md).diff --git a/example/lib/main.dart b/example/lib/main.dartindex 4c3a4f9..4c4ec5f 100644--- a/example/lib/main.dart+++ b/example/lib/main.dart@@ -61,31 +61,177 @@ List<Map<String, Object?>> exampleSearchRows(SearchResponse response) =>(Map<Object?, Object?> row) =>row.map((Object? key, Object? value) => MapEntry('$key', value)),)- .take(5).toList();-String exampleResultTitle(Map<String, Object?> row) {- for (final key in <String>[- 'effective_title',- 'title',- 'item_id',- 'text_agg_tok',- ]) {+String exampleFirstText(Map<String, Object?> row, List<String> keys) {+ for (final key in keys) {final value = '${row[key] ?? ''}'.trim();if (value.isNotEmpty) return value;}- return 'Untitled result';+ return '';+}++String exampleFilename(String value) {+ final clean = value.trim().replaceAll('\\', '/');+ return clean.split('/').last.trim();+}++String exampleTimestamp13(Object? value) {+ final digits = '${value ?? ''}'.replaceAll(RegExp(r'[^0-9]'), '');+ if (digits.length >= 13) return digits.substring(0, 13);+ if (digits.length == 10) return '${int.parse(digits) * 1000}';+ if (digits.isNotEmpty) return digits.padLeft(13, '0');+ return '';+}++String exampleScore(Map<String, Object?> row) {+ final scoreUi = row['score_ui'];+ if (scoreUi is num && scoreUi.isFinite && scoreUi >= 0 && scoreUi <= 1) {+ return '${(scoreUi * 100).toStringAsFixed(1)}%';+ }+ for (final key in <String>[+ 'score_ui',+ 'score',+ 'similarity',+ 'image_score',+ 'text_score',+ ]) {+ final value = row[key];+ if (value is num && !value.isFinite) continue;+ final clean = '${value ?? ''}'.trim();+ if (clean.isNotEmpty) return clean;+ }+ return '';+}++class ExampleSearchCandidate {+ const ExampleSearchCandidate({+ required this.searchIndex,+ required this.row,+ required this.record,+ });++ final int searchIndex;+ final Map<String, Object?> row;+ final Map<String, Object?> record;+}++class ExampleSearchImage {+ const ExampleSearchImage({+ required this.id,+ required this.url,+ required this.title,+ required this.filename,+ required this.stream,+ required this.timestamp,+ required this.score,+ });++ final String id;+ final String url;+ final String title;+ final String filename;+ final String stream;+ final String timestamp;+ final String score;+}++List<ExampleSearchCandidate> exampleSearchCandidates(+ SearchResponse response,+ String collectionName,+ String streamName,+) {+ final rows = exampleSearchRows(response);+ final candidates = <ExampleSearchCandidate>[];+ for (var index = 0; index < rows.length; index++) {+ final row = rows[index];+ final rawName = exampleFirstText(row, const <String>[+ 'filename',+ 'filename_sanitized',+ 'video_filename',+ 'video',+ 'source_path',+ 'path',+ ]);+ final filename = exampleFilename(rawName);+ if (filename.isEmpty) continue;+ final stream = exampleFirstText(row, const <String>['stream_name']);+ final timestamp = exampleTimestamp13(+ exampleFirstText(row, const <String>[+ 'ts_unix_13digits',+ 'ts_unix',+ 'timestamp_ms',+ ]),+ );+ final record = <String, Object?>{+ 'mode': 'vid_file',+ 'group_name': collectionName.trim(),+ 'modality': 'image',+ 'stream_name': stream.isEmpty ? streamName.trim() : stream,+ 'filename': filename,+ if (timestamp.isNotEmpty) 'ts_unix_13digits': timestamp,+ };+ candidates.add(+ ExampleSearchCandidate(searchIndex: index, row: row, record: record),+ );+ }+ return candidates;}-String exampleResultDetails(Map<String, Object?> row) {- final values = <String>[];- final source = '${row['source'] ?? ''}'.trim();- final timestamp = '${row['ts_unix'] ?? ''}'.trim();- final score = row['score_ui'];- if (source.isNotEmpty) values.add(source.toUpperCase());- if (timestamp.isNotEmpty) values.add('timestamp $timestamp');- if (score is num) values.add('score ${(score * 100).toStringAsFixed(1)}%');- return values.isEmpty ? 'Search result' : values.join(' • ');+int? _exampleInputIndex(Object? value) {+ if (value is num && value.isFinite) return value.toInt();+ if (value is String) return int.tryParse(value.trim());+ return null;+}++List<ExampleSearchImage> exampleSearchImages(+ List<ExampleSearchCandidate> candidates,+ ImageUrlBulkResponse response,+) {+ final resolved = <int, ExampleSearchImage>{};+ for (var rowIndex = 0; rowIndex < response.records.length; rowIndex++) {+ final row = response.records[rowIndex];+ final rawIndex = row['input_index'];+ final inputIndex = rawIndex == null+ ? rowIndex+ : _exampleInputIndex(rawIndex);+ if (inputIndex == null ||+ inputIndex < 0 ||+ inputIndex >= candidates.length ||+ resolved.containsKey(inputIndex) ||+ row['found'] == false) {+ continue;+ }+ final url = '${row['url_pre_signed'] ?? ''}'.trim();+ if (url.isEmpty) continue;+ final candidate = candidates[inputIndex];+ final hit = candidate.row;+ final filename = '${candidate.record['filename'] ?? ''}'.trim();+ final timestamp = '${candidate.record['ts_unix_13digits'] ?? ''}'.trim();+ final stream = '${candidate.record['stream_name'] ?? ''}'.trim();+ final title = exampleFirstText(hit, const <String>[+ 'effective_title',+ 'title',+ 'text',+ 'caption',+ 'ocr',+ 'asr',+ 'description',+ 'item_id',+ 'text_agg_tok',+ ]);+ resolved[inputIndex] = ExampleSearchImage(+ id: '$inputIndex-$filename-$timestamp',+ url: url,+ title: title.isEmpty ? filename : title,+ filename: filename,+ stream: stream,+ timestamp: timestamp,+ score: exampleScore(hit),+ );+ }+ final indexes = resolved.keys.toList()..sort();+ return indexes.map((int index) => resolved[index]!).toList();}String exampleSearchNotFound(ApiException error, String collectionName) {@@ -97,6 +243,204 @@ String exampleSearchNotFound(ApiException error, String collectionName) {return 'The configured gateway does not expose the search route.';}+typedef ExampleImageProviderFactory =+ ImageProvider<Object> Function(String url);++ImageProvider<Object> exampleNetworkImageProvider(String url) =>+ NetworkImage(url);++class ExampleSearchResults extends StatelessWidget {+ const ExampleSearchResults({+ required this.images,+ required this.total,+ required this.returned,+ required this.elapsedMs,+ required this.hasSearched,+ required this.searching,+ this.imageProviderFactory = exampleNetworkImageProvider,+ super.key,+ });++ final List<ExampleSearchImage> images;+ final int total;+ final int returned;+ final double elapsedMs;+ final bool hasSearched;+ final bool searching;+ final ExampleImageProviderFactory imageProviderFactory;++ @override+ Widget build(BuildContext context) {+ if (searching) {+ return const Padding(+ padding: EdgeInsets.only(top: 8),+ child: Text('Searching and resolving images...'),+ );+ }+ if (!hasSearched) return const SizedBox.shrink();+ final elapsed = elapsedMs > 0 ? ' • ${elapsedMs.round()} ms' : '';+ final returnedText = returned < total ? ' ($returned returned)' : '';+ return Column(+ crossAxisAlignment: CrossAxisAlignment.start,+ children: <Widget>[+ Padding(+ padding: const EdgeInsets.only(top: 8, bottom: 8),+ child: Text(+ 'Showing ${images.length} images from $total matches'+ '$returnedText$elapsed',+ key: const Key('search-summary'),+ style: Theme.of(context).textTheme.titleSmall,+ ),+ ),+ if (total == 0)+ const Text('No matching results.')+ else if (images.isEmpty)+ const Text('No image-backed matches were found.')+ else+ GridView.builder(+ key: const Key('search-image-grid'),+ shrinkWrap: true,+ physics: const NeverScrollableScrollPhysics(),+ gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(+ maxCrossAxisExtent: 300,+ crossAxisSpacing: 12,+ mainAxisSpacing: 12,+ childAspectRatio: 0.58,+ ),+ itemCount: images.length,+ itemBuilder: (BuildContext context, int index) =>+ ExampleSearchImageCard(+ image: images[index],+ imageProviderFactory: imageProviderFactory,+ ),+ ),+ ],+ );+ }+}++class ExampleSearchImageCard extends StatelessWidget {+ const ExampleSearchImageCard({+ required this.image,+ this.imageProviderFactory = exampleNetworkImageProvider,+ super.key,+ });++ final ExampleSearchImage image;+ final ExampleImageProviderFactory imageProviderFactory;++ @override+ Widget build(BuildContext context) {+ final colors = Theme.of(context).colorScheme;+ final meta = <String>[+ if (image.stream.isNotEmpty) image.stream,+ if (image.timestamp.isNotEmpty) image.timestamp,+ if (image.score.isNotEmpty) image.score,+ ].join(' • ');+ return Card(+ key: Key('search-image-${image.id}'),+ margin: EdgeInsets.zero,+ clipBehavior: Clip.antiAlias,+ child: Column(+ crossAxisAlignment: CrossAxisAlignment.start,+ children: <Widget>[+ AspectRatio(+ aspectRatio: 1,+ child: Image(+ image: imageProviderFactory(image.url),+ fit: BoxFit.cover,+ semanticLabel: 'Search result image: ${image.title}',+ loadingBuilder:+ (+ BuildContext context,+ Widget child,+ ImageChunkEvent? progress,+ ) => progress == null+ ? child+ : ColoredBox(+ color: colors.surfaceContainerHighest,+ child: const Center(child: CircularProgressIndicator()),+ ),+ errorBuilder:+ (BuildContext context, Object error, StackTrace? stack) =>+ Semantics(+ label: 'Image unavailable for ${image.title}',+ child: ColoredBox(+ color: colors.errorContainer,+ child: Center(+ child: Column(+ mainAxisSize: MainAxisSize.min,+ children: <Widget>[+ Icon(+ Icons.broken_image_outlined,+ color: colors.onErrorContainer,+ ),+ const SizedBox(height: 6),+ Text(+ 'Image unavailable',+ style: TextStyle(+ color: colors.onErrorContainer,+ ),+ ),+ ],+ ),+ ),+ ),+ ),+ ),+ ),+ Expanded(+ child: Padding(+ padding: const EdgeInsets.all(10),+ child: Column(+ crossAxisAlignment: CrossAxisAlignment.start,+ children: <Widget>[+ Flexible(+ flex: 2,+ child: Text(+ image.title,+ maxLines: 2,+ overflow: TextOverflow.ellipsis,+ style: Theme.of(context).textTheme.bodyMedium,+ ),+ ),+ if (image.filename.isNotEmpty &&+ image.filename != image.title) ...<Widget>[+ const SizedBox(height: 4),+ Flexible(+ child: Text(+ image.filename,+ maxLines: 1,+ overflow: TextOverflow.ellipsis,+ style: Theme.of(context).textTheme.labelSmall?.copyWith(+ color: colors.onSurfaceVariant,+ ),+ ),+ ),+ ],+ if (meta.isNotEmpty) ...<Widget>[+ const SizedBox(height: 4),+ Flexible(+ child: Text(+ meta,+ maxLines: 2,+ overflow: TextOverflow.ellipsis,+ style: Theme.of(context).textTheme.labelSmall?.copyWith(+ color: colors.onSurfaceVariant,+ ),+ ),+ ),+ ],+ ],+ ),+ ),+ ),+ ],+ ),+ );+ }+}+void main() => runApp(const VmodalExampleApp());class VmodalExampleApp extends StatefulWidget {@@ -117,13 +461,18 @@ class _VmodalExampleAppState extends State<VmodalExampleApp> {VmodalClient? _client;UploadTask<VideoUploadResponse>? _upload;StreamSubscription<UploadProgress>? _progressSub;- List<Map<String, Object?>> _results = <Map<String, Object?>>[];+ List<ExampleSearchImage> _images = <ExampleSearchImage>[];String _jobId = '';String _indexStatus = 'not started';String _status ='Enter a runtime API key supplied by your authenticated app.';int _progress = 0;+ int _searchGeneration = 0;+ int _searchTotal = 0;+ int _searchReturned = 0;+ double _searchElapsedMs = 0;bool _busy = false;+ bool _searching = false;bool _hasSearched = false;bool _collectionsLoaded = false;List<String> _collections = <String>[];@@ -154,6 +503,7 @@ class _VmodalExampleAppState extends State<VmodalExampleApp> {_safeState(() => _status = 'A runtime API key is required.');return;}+ _safeState(_clearSearchState);_keys?.clear();await _client?.close();final keys = MutableApiKeyProvider(value);@@ -161,6 +511,7 @@ class _VmodalExampleAppState extends State<VmodalExampleApp> {_keys = keys;_client = client;_safeState(() {+ _clearSearchState();_key.clear();_collectionsLoaded = false;_collections = <String>[];@@ -274,48 +625,92 @@ class _VmodalExampleAppState extends State<VmodalExampleApp> {Future<void> _search() async {final client = _client;if (client == null) return _needClient();+ final query = _query.text.trim();+ final collection = _collection.text.trim();+ final stream = _stream.text.trim();+ _safeState(() {+ _clearSearchState();+ _searching = true;+ _status = 'Searching and resolving images...';+ });+ final generation = _searchGeneration;await _run(() async {- final groups = await client.collections.listGroups(mode: 'vid_file');- final names = exampleCollectionNames(groups);- final collection = _collection.text.trim();- final stream = _stream.text.trim();- _setCollections(names, '', selectFirst: false);- if (collection.isEmpty || stream.isEmpty) {- _needCollection();- return;- }- if (!names.contains(collection)) {- _safeState(- () => _status =- 'Collection $collection is not available for this '- 'API key. Choose a loaded collection or upload it first.',- );- return;- }- final version = groups- .findGroup(collection, mode: 'vid_file')- ?.latestLancedbVersion;- if (version == null) {- _safeState(- () => _status =- 'Collection $collection has no advertised LanceDB index '- 'version. Create or finish its image index before searching.',- );- return;- }try {- final result = await client.searches.searchVideo(- exampleSearchRequest(_query.text, collection, stream, version),- );+ final groups = await client.collections.listGroups(mode: 'vid_file');+ if (!_currentSearch(generation, query, collection, stream)) return;+ final names = exampleCollectionNames(groups);+ _setCollections(names, '', selectFirst: false);+ if (collection.isEmpty || stream.isEmpty) {+ _safeState(() {+ _searching = false;+ _status = 'Collection and stream are required.';+ });+ return;+ }+ if (!names.contains(collection)) {+ _safeState(() {+ _searching = false;+ _status =+ 'Collection $collection is not available for this '+ 'API key. Choose a loaded collection or upload it first.';+ });+ return;+ }+ final version = groups+ .findGroup(collection, mode: 'vid_file')+ ?.latestLancedbVersion;+ if (version == null) {+ _safeState(() {+ _searching = false;+ _status =+ 'Collection $collection has no advertised LanceDB index '+ 'version. Create or finish its image index before searching.';+ });+ return;+ }+ late SearchResponse result;+ try {+ result = await client.searches.searchVideo(+ exampleSearchRequest(query, collection, stream, version),+ );+ } on ApiException catch (error) {+ if (error.statusCode != 404) rethrow;+ if (_currentSearch(generation, query, collection, stream)) {+ _safeState(() {+ _clearSearchState();+ _status = exampleSearchNotFound(error, collection);+ });+ }+ return;+ }+ if (!_currentSearch(generation, query, collection, stream)) return;+ final candidates = exampleSearchCandidates(result, collection, stream);+ var images = <ExampleSearchImage>[];+ if (candidates.isNotEmpty) {+ final urls = await client.images.getUrlBulk(+ candidates+ .map((ExampleSearchCandidate item) => item.record)+ .toList(),+ );+ if (!_currentSearch(generation, query, collection, stream)) return;+ images = exampleSearchImages(candidates, urls);+ }_safeState(() {- _results = exampleSearchRows(result);+ _images = images;+ _searchTotal = result.cntTotal;+ _searchReturned = result.cntActual;+ _searchElapsedMs = result.executionTimeMs;_hasSearched = true;+ _searching = false;_status =- 'Search returned ${result.cntActual} items from $collection/$stream.';+ 'Search resolved ${images.length} images from '+ '${result.cntTotal} matches in $collection/$stream.';});- } on ApiException catch (error) {- if (error.statusCode != 404) rethrow;- _safeState(() => _status = exampleSearchNotFound(error, collection));+ } on SdkException {+ if (_currentSearch(generation, query, collection, stream)) {+ _safeState(_clearSearchState);+ }+ rethrow;}});}@@ -342,6 +737,7 @@ class _VmodalExampleAppState extends State<VmodalExampleApp> {_safeState(() => _progress = value.percent);});_safeState(() {+ _clearSearchState();_busy = true;_progress = 0;_status = 'Uploading with signed single upload...';@@ -352,8 +748,7 @@ class _VmodalExampleAppState extends State<VmodalExampleApp> {_progress = 100;_jobId = '';_indexStatus = 'not started';- _results = <Map<String, Object?>>[];- _hasSearched = false;+ _clearSearchState();_status = 'Upload complete: ${result.fileName}. Create its index next.';});} on OperationCanceled {@@ -402,30 +797,61 @@ class _VmodalExampleAppState extends State<VmodalExampleApp> {_collection.text = selected;_jobId = '';_indexStatus = 'not started';- _results = <Map<String, Object?>>[];- _hasSearched = false;+ _clearSearchState();}if (status.isNotEmpty) _status = status;});}void _scopeChanged(String _) {- if (_jobId.isEmpty && _results.isEmpty) return;+ if (_jobId.isEmpty && _images.isEmpty && !_hasSearched && !_searching) {+ return;+ }_safeState(() {_jobId = '';_indexStatus = 'not started';- _results = <Map<String, Object?>>[];- _hasSearched = false;+ _clearSearchState();_status = 'Collection changed. Upload or index this collection next.';});}+ void _searchChanged(String _) {+ if (_images.isEmpty && !_hasSearched && !_searching) return;+ _safeState(() {+ _clearSearchState();+ _status = 'Search scope changed. Run the search again.';+ });+ }++ bool _currentSearch(+ int generation,+ String query,+ String collection,+ String stream,+ ) =>+ mounted &&+ generation == _searchGeneration &&+ query == _query.text.trim() &&+ collection == _collection.text.trim() &&+ stream == _stream.text.trim();++ void _clearSearchState() {+ _searchGeneration++;+ _images = <ExampleSearchImage>[];+ _searchTotal = 0;+ _searchReturned = 0;+ _searchElapsedMs = 0;+ _hasSearched = false;+ _searching = false;+ }+void _safeState(VoidCallback change) {if (mounted) setState(change);}@overridevoid dispose() {+ _searchGeneration++;_upload?.cancel();unawaited(_progressSub?.cancel());_keys?.clear();@@ -540,21 +966,23 @@ class _VmodalExampleAppState extends State<VmodalExampleApp> {const Divider(),TextField(controller: _query,+ onChanged: _searchChanged,+ textInputAction: TextInputAction.search,+ onSubmitted: _busy ? null : (_) => _search(),decoration: const InputDecoration(labelText: 'Search query'),),FilledButton(onPressed: _busy ? null : _search,child: const Text('Search'),),- if (_hasSearched && _results.isEmpty)- const Text('No matching results.'),- for (final row in _results)- Card(- child: ListTile(- title: Text(exampleResultTitle(row)),- subtitle: Text(exampleResultDetails(row)),- ),- ),+ ExampleSearchResults(+ images: _images,+ total: _searchTotal,+ returned: _searchReturned,+ elapsedMs: _searchElapsedMs,+ hasSearched: _hasSearched,+ searching: _searching,+ ),const SizedBox(height: 16),Text(_status, key: const Key('status')),],diff --git a/example/test/widget_test.dart b/example/test/widget_test.dartindex 531a262..f19212b 100644--- a/example/test/widget_test.dart+++ b/example/test/widget_test.dart@@ -1,12 +1,77 @@+import 'dart:convert';+import 'dart:typed_data';+import 'package:flutter/material.dart';import 'package:flutter_test/flutter_test.dart';import 'package:vmodal_example/main.dart';import 'package:vmodal_sdk_flutter/vmodal_sdk_flutter.dart';+const _pixel =+ 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=';++void _log(String message) => debugPrint('[sdk_flutter example] $message');++ExampleSearchImage _image(int index, {String? title}) => ExampleSearchImage(+ id: '$index-video.mp4-0000000002000',+ url: 'https://image.test/$index',+ title: title ?? 'Result $index',+ filename: 'video_$index.mp4',+ stream: 'astream',+ timestamp: '0000000002000',+ score: '87.5%',+);++ImageProvider<Object> _memoryImage(String _) =>+ MemoryImage(base64Decode(_pixel));++ImageProvider<Object> _brokenImage(String _) =>+ MemoryImage(Uint8List.fromList(<int>[1, 2, 3]));++Widget _resultsApp(+ List<ExampleSearchImage> images, {+ int total = 2,+ int returned = 2,+ bool searched = true,+ bool searching = false,+ ExampleImageProviderFactory imageProviderFactory = _memoryImage,+ double width = 400,+ double textScale = 1,+}) => MaterialApp(+ home: MediaQuery(+ data: MediaQueryData(+ size: Size(width, 900),+ textScaler: TextScaler.linear(textScale),+ ),+ child: Scaffold(+ body: Align(+ alignment: Alignment.topLeft,+ child: SizedBox(+ width: width,+ child: SingleChildScrollView(+ child: Padding(+ padding: const EdgeInsets.all(16),+ child: ExampleSearchResults(+ images: images,+ total: total,+ returned: returned,+ elapsedMs: 146,+ hasSearched: searched,+ searching: searching,+ imageProviderFactory: imageProviderFactory,+ ),+ ),+ ),+ ),+ ),+ ),+ ),+);+void main() {- testWidgets('example requires runtime injection', (+ testWidgets('example preserves the progressive mobile workflow', (WidgetTester tester,) async {+ _log('checking auth, collection, upload, index, and search controls');await tester.pumpWidget(const VmodalExampleApp());expect(find.widgetWithText(TextField, 'Runtime API key'), findsOneWidget);expect(find.text('Configure client'), findsOneWidget);@@ -24,6 +89,7 @@ void main() {});test('search and upload share the example collection contract', () {+ _log('checking request fields shared by the progressive workflow');final request = exampleSearchRequest(' bicycle ',exampleCollectionName,@@ -42,9 +108,12 @@ void main() {expect(index.streamName, exampleStreamName);expect(index.indexType, exampleIndexType);expect(index.modality, exampleIndexType);+ expect(exampleIndexDone('completed'), isTrue);+ expect(exampleIndexDone('running'), isFalse);});- test('collection names come from the authenticated video groups', () {+ test('collection names come from authenticated video groups', () {+ _log('checking collection filtering and deterministic sorting');final names = exampleCollectionNames(GroupsResponse(<String, Object?>{'total': 3,@@ -59,6 +128,7 @@ void main() {});test('search 404 is explained without exposing the server body', () {+ _log('checking safe redaction of a missing-index response');const path = '/private/server/path/table';const error = ApiException('api request failed',@@ -70,24 +140,335 @@ void main() {expect(message, isNot(contains(path)));});- test('index states and search result fields are presentation ready', () {- expect(exampleIndexDone('completed'), isTrue);- expect(exampleIndexDone('running'), isFalse);+ test('search hits normalize to exact Android-compatible image records', () {+ _log('checking filename, stream, timestamp, title, and score fields');final response = SearchResponse(<String, Object?>{'cnt_actual': 1,- 'cnt_total': 1,+ 'cnt_total': 3,'data': <Object?>[<String, Object?>{- 'effective_title': 'Red frame',- 'item_id': 'fallback-id',- 'source': 'image',- 'ts_unix': '2000',+ 'source_path': r'folder\nested/clip.mp4',+ 'stream_name': 'custom',+ 'ts_unix': '1700000000',+ 'effective_title': 'Red bicycle','score_ui': 0.875,},],});- final row = exampleSearchRows(response).single;- expect(exampleResultTitle(row), 'Red frame');- expect(exampleResultDetails(row), 'IMAGE • timestamp 2000 • score 87.5%');+ final candidate = exampleSearchCandidates(+ response,+ ' videos ',+ ' fallback ',+ ).single;+ expect(candidate.searchIndex, 0);+ expect(candidate.record, <String, Object?>{+ 'mode': 'vid_file',+ 'group_name': 'videos',+ 'modality': 'image',+ 'stream_name': 'custom',+ 'filename': 'clip.mp4',+ 'ts_unix_13digits': '1700000000000',+ });++ final image = exampleSearchImages(+ <ExampleSearchCandidate>[candidate],+ ImageUrlBulkResponse(<String, Object?>{+ 'records': <Object?>[+ <String, Object?>{+ 'input_index': 0,+ 'found': true,+ 'url_pre_signed': ' https://image.test/frame ',+ },+ ],+ }),+ ).single;+ expect(image.title, 'Red bicycle');+ expect(image.filename, 'clip.mp4');+ expect(image.stream, 'custom');+ expect(image.timestamp, '1700000000000');+ expect(image.score, '87.5%');+ expect(image.id, isNot(contains(image.url)));+ });++ test('all filename aliases use basename and blank hits are omitted', () {+ _log('checking every documented filename alias and both path separators');+ const keys = <String>[+ 'filename',+ 'filename_sanitized',+ 'video_filename',+ 'video',+ 'source_path',+ 'path',+ ];+ for (final key in keys) {+ final response = SearchResponse(<String, Object?>{+ 'data': <Object?>[+ <String, Object?>{key: r'folder\sub/video.mp4'},+ ],+ });+ expect(+ exampleSearchCandidates(response, 'group', 'stream').single.record,+ containsPair('filename', 'video.mp4'),+ );+ }+ final blank = SearchResponse(<String, Object?>{+ 'data': <Object?>[+ <String, Object?>{'filename': ' / '},+ <String, Object?>{'title': 'No file'},+ ],+ });+ expect(exampleSearchCandidates(blank, 'group', 'stream'), isEmpty);+ });++ test('timestamps normalize to the 13-digit lookup contract', () {+ _log('checking seconds, milliseconds, long, short, formatted, and blank');+ expect(exampleTimestamp13('1700000000'), '1700000000000');+ expect(exampleTimestamp13('1700000000123'), '1700000000123');+ expect(exampleTimestamp13('170000000012345'), '1700000000123');+ expect(exampleTimestamp13('2000'), '0000000002000');+ expect(exampleTimestamp13('time=2,000ms'), '0000000002000');+ expect(exampleTimestamp13(''), '');+ });++ test(+ 'bulk mapping validates indexes, ordering, found state, and duplicates',+ () {+ _log(+ 'checking identity-safe input_index association under partial output',+ );+ final response = SearchResponse(<String, Object?>{+ 'data': List<Object?>.generate(+ 4,+ (int index) => <String, Object?>{+ 'filename': 'video_$index.mp4',+ 'title': 'Title $index',+ },+ ),+ });+ final candidates = exampleSearchCandidates(response, 'group', 'stream');+ final images = exampleSearchImages(+ candidates,+ ImageUrlBulkResponse(<String, Object?>{+ 'records': <Object?>[+ <String, Object?>{+ 'input_index': '2',+ 'url_pre_signed': 'https://image.test/2',+ },+ <String, Object?>{+ 'input_index': 0.0,+ 'url_pre_signed': 'https://image.test/0',+ },+ <String, Object?>{+ 'input_index': '2',+ 'url_pre_signed': 'https://image.test/duplicate',+ },+ <String, Object?>{+ 'input_index': -1,+ 'url_pre_signed': 'https://image.test/negative',+ },+ <String, Object?>{+ 'input_index': 9,+ 'url_pre_signed': 'https://image.test/large',+ },+ <String, Object?>{+ 'input_index': 'bad',+ 'url_pre_signed': 'https://image.test/malformed',+ },+ <String, Object?>{+ 'input_index': 1,+ 'found': false,+ 'url_pre_signed': 'https://image.test/not-found',+ },+ <String, Object?>{'input_index': 3, 'url_pre_signed': ' '},+ ],+ }),+ );+ expect(images.map((ExampleSearchImage image) => image.title), <String>[+ 'Title 0',+ 'Title 2',+ ]);+ expect(images.last.url, 'https://image.test/2');+ },+ );++ test('missing input_index uses only bounded positional fallback', () {+ _log('checking compatibility fallback without cross-hit association');+ final candidates = exampleSearchCandidates(+ SearchResponse(<String, Object?>{+ 'data': <Object?>[+ <String, Object?>{'filename': 'zero.mp4'},+ <String, Object?>{'filename': 'one.mp4'},+ ],+ }),+ 'group',+ 'stream',+ );+ final images = exampleSearchImages(+ candidates,+ ImageUrlBulkResponse(<String, Object?>{+ 'records': <Object?>[+ <String, Object?>{'url_pre_signed': 'https://image.test/zero'},+ <String, Object?>{'url_pre_signed': 'https://image.test/one'},+ <String, Object?>{'url_pre_signed': 'https://image.test/outside'},+ ],+ }),+ );+ expect(images.map((ExampleSearchImage image) => image.filename), <String>[+ 'zero.mp4',+ 'one.mp4',+ ]);+ });++ test('more than five search hits remain eligible for one bulk lookup', () {+ _log('checking removal of the old hidden five-card truncation');+ final response = SearchResponse(<String, Object?>{+ 'data': List<Object?>.generate(+ 12,+ (int index) => <String, Object?>{'filename': 'video_$index.mp4'},+ ),+ });+ expect(exampleSearchRows(response), hasLength(12));+ expect(exampleSearchCandidates(response, 'group', 'stream'), hasLength(12));+ });++ testWidgets('result area distinguishes initial, loading, and empty states', (+ WidgetTester tester,+ ) async {+ _log('checking all global result-area messages and summary counts');+ await tester.pumpWidget(+ _resultsApp(const <ExampleSearchImage>[], searched: false),+ );+ expect(find.byKey(const Key('search-summary')), findsNothing);+ expect(find.text('No matching results.'), findsNothing);++ await tester.pumpWidget(+ _resultsApp(+ const <ExampleSearchImage>[],+ searched: false,+ searching: true,+ ),+ );+ expect(find.text('Searching and resolving images...'), findsOneWidget);++ await tester.pumpWidget(+ _resultsApp(const <ExampleSearchImage>[], total: 0, returned: 0),+ );+ expect(+ find.text('Showing 0 images from 0 matches • 146 ms'),+ findsOneWidget,+ );+ expect(find.text('No matching results.'), findsOneWidget);++ await tester.pumpWidget(+ _resultsApp(const <ExampleSearchImage>[], total: 12, returned: 8),+ );+ expect(+ find.text('Showing 0 images from 12 matches (8 returned) • 146 ms'),+ findsOneWidget,+ );+ expect(find.text('No image-backed matches were found.'), findsOneWidget);+ });++ testWidgets('resolved images render metadata without duplicate filename', (+ WidgetTester tester,+ ) async {+ _log('checking image card content and conditional metadata sections');+ final images = <ExampleSearchImage>[+ _image(0),+ const ExampleSearchImage(+ id: '1-same.mp4-',+ url: 'https://image.test/1',+ title: 'same.mp4',+ filename: 'same.mp4',+ stream: '',+ timestamp: '',+ score: '',+ ),+ ];+ await tester.pumpWidget(_resultsApp(images));+ await tester.pumpAndSettle();+ expect(find.byKey(const Key('search-image-grid')), findsOneWidget);+ expect(find.byType(ExampleSearchImageCard), findsNWidgets(2));+ expect(find.text('Result 0'), findsOneWidget);+ expect(find.text('video_0.mp4'), findsOneWidget);+ expect(find.text('astream • 0000000002000 • 87.5%'), findsOneWidget);+ expect(find.text('same.mp4'), findsOneWidget);+ });++ testWidgets('one failed image stays local and preserves sibling cards', (+ WidgetTester tester,+ ) async {+ _log('checking per-card image failure without a global result error');+ await tester.pumpWidget(+ _resultsApp(+ <ExampleSearchImage>[_image(0), _image(1)],+ imageProviderFactory: (String url) =>+ url.endsWith('/0') ? _brokenImage(url) : _memoryImage(url),+ ),+ );+ await tester.pumpAndSettle();+ expect(find.text('Image unavailable'), findsOneWidget);+ expect(find.byType(ExampleSearchImageCard), findsNWidgets(2));+ expect(find.text('Result 1'), findsOneWidget);+ });++ testWidgets('grid adapts from one narrow column to multiple wide columns', (+ WidgetTester tester,+ ) async {+ _log('checking responsive max-extent layout and single scroll ownership');+ final images = List<ExampleSearchImage>.generate(4, _image);+ await tester.pumpWidget(_resultsApp(images, width: 260));+ await tester.pumpAndSettle();+ final narrow0 = tester.getTopLeft(+ find.byKey(Key('search-image-${images[0].id}')),+ );+ final narrow1 = tester.getTopLeft(+ find.byKey(Key('search-image-${images[1].id}')),+ );+ expect(narrow0.dx, narrow1.dx);+ expect(narrow1.dy, greaterThan(narrow0.dy));++ await tester.pumpWidget(_resultsApp(images, width: 700));+ await tester.pumpAndSettle();+ final wide0 = tester.getTopLeft(+ find.byKey(Key('search-image-${images[0].id}')),+ );+ final wide1 = tester.getTopLeft(+ find.byKey(Key('search-image-${images[1].id}')),+ );+ expect(wide0.dy, wide1.dy);+ expect(wide1.dx, greaterThan(wide0.dx));+ final grid = tester.widget<GridView>(+ find.byKey(const Key('search-image-grid')),+ );+ expect(grid.shrinkWrap, isTrue);+ expect(grid.physics, isA<NeverScrollableScrollPhysics>());+ expect(grid.gridDelegate, isA<SliverGridDelegateWithMaxCrossAxisExtent>());+ });++ testWidgets('long text and accessibility remain bounded at large scale', (+ WidgetTester tester,+ ) async {+ _log('checking ellipsis, large text, image semantics, and overflow safety');+ final semantics = tester.ensureSemantics();+ final image = ExampleSearchImage(+ id: 'long-video.mp4-0000000002000',+ url: 'https://image.test/long',+ title: List<String>.filled(20, 'Long searchable title').join(' '),+ filename: List<String>.filled(10, 'long_filename').join('_'),+ stream: 'astream',+ timestamp: '0000000002000',+ score: '87.5%',+ );+ await tester.pumpWidget(+ _resultsApp(<ExampleSearchImage>[image], width: 260, textScale: 1.8),+ );+ await tester.pumpAndSettle();+ expect(tester.takeException(), isNull);+ expect(+ find.bySemanticsLabel('Search result image: ${image.title}'),+ findsOneWidget,+ );+ semantics.dispose();});}diff --git a/test/regression_manifest_test.dart b/test/regression_manifest_test.dartindex 40441d9..cb39378 100644--- a/test/regression_manifest_test.dart+++ b/test/regression_manifest_test.dart@@ -146,9 +146,26 @@ void main() {'run.sh','test.sh','tool/live_test.dart',+ 'example/README.md',+ 'example/lib/main.dart',+ 'example/asset/video_10frames.mp4',+ 'doc/search_app.md',+ 'doc/sdk_doc.md',+ 'doc/manage_api_key.md',+ 'doc/sdk_contract.md',]) {expect(File('${dir.path}/$path').existsSync(), isTrue, reason: path);}+ final exampleReadme = File(+ '${dir.path}/example/README.md',+ ).readAsStringSync();+ final searchGuide = File(+ '${dir.path}/doc/search_app.md',+ ).readAsStringSync();+ expect(exampleReadme, contains('client.images.getUrlBulk'));+ expect(exampleReadme, contains('responsive result grid'));+ expect(searchGuide, contains('input_index'));+ expect(searchGuide, contains('NetworkImage'));for (final path in <String>['example/android/local.properties','example/android/gradle/wrapper/gradle-wrapper.jar',