To handle the routing, create a GoRouter object in the main.dart file:

    
 import 'package:flutter/material.dart';
 import 'package:go_router/go_router.dart';

 void main() => runApp(MaterialApp.router(routerConfig: router));

 /// This handles '/' and '/details'.
 final router = GoRouter(
   routes: [
     GoRoute(
       path: '/',
       builder: (_, __) => Scaffold(
         appBar: AppBar(title: const Text('Home Screen')),
       ),
       routes: [
         GoRoute(
           path: 'details',
           builder: (_, __) => Scaffold(
             appBar: AppBar(title: const Text('Details Screen')),
           ),
         ),
       ],
     ),
   ],
 );

2. Modify AndroidManifest.xml

Open the Flutter project with Android Studio or VSCode.