runScrollToCli function
CLI adapter for fdb scroll-to. Accepts --text, --key, --type, --index.
Output contract:
SCROLLED_TO=widgetType X=x Y=y (success) ERROR: Provide --text, --key, or --type (no selector) ERROR: fdb_helper not detected in running app. ... (no helper) ERROR: Unexpected response from ext.fdb.scrollTo: missing x or y (missing coords) ERROR: message (relayed error / generic) ERROR: Unexpected response from ext.fdb.scrollTo: raw (unexpected response) (AppDiedException rethrown for dispatcher's _formatAppDied)
Implementation
Future<int> runScrollToCli(List<String> args) {
final parser = ArgParser()
..addOption('text', help: 'Match widget by text content')
..addOption('key', help: 'Match widget by ValueKey label')
..addOption('type', help: 'Match widget by type name')
..addOption('index', help: 'When multiple widgets match, pick the Nth (0-based)');
return runCliAdapter(parser, args, _execute);
}