The redirect to the “Jobs” works but the redirect to the home page isn’t happening. Please could someone point me in the right direction? (I think the route notation “/” is correct so I’m puzzled).
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
runApp(MaterialApp.router(routerConfig: router));
}
final router = GoRouter(
routes: [
GoRoute(
path: '/',
builder: (_, __) => Scaffold(
appBar: AppBar(title: const Text('Home Screen')),
),
routes: [
GoRoute(
path: 'jobs/:jobTitle', // Explicitly match job titles
builder: (_, state) => Scaffold(
appBar: AppBar(title: const Text('Jobs')),
body: Center(child: Text('Job Title: ${state.pathParameters['jobTitle']}')),
),
),
],
),
],
);