routingStep function
Prompts for routing configuration.
Implementation
Future<RoutingConfig> routingStep() async {
// For MVP, go_router is the only option
const routerPackage = 'go_router';
final useDeepLinks = Confirm(
prompt: 'Enable deep links?',
defaultValue: false,
).interact();
List<String> schemes = [];
List<String> hosts = [];
if (useDeepLinks) {
final schemesInput = Input(
prompt: 'Deep link schemes (comma-separated, e.g. myapp,https)',
defaultValue: 'myapp',
).interact();
schemes = schemesInput.split(',').map((s) => s.trim()).where((s) => s.isNotEmpty).toList();
final hostsInput = Input(
prompt: 'Deep link hosts (comma-separated, e.g. open.example.com)',
defaultValue: 'open.example.com',
).interact();
hosts = hostsInput.split(',').map((s) => s.trim()).where((s) => s.isNotEmpty).toList();
}
return RoutingConfig(
package: routerPackage,
deepLinks: useDeepLinks,
schemes: schemes,
hosts: hosts,
);
}