I want to open the particular screen of my app when I click on the email link. I have given the scheme and host in the android manifest file like below.
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host="aaaa.com" />
<data android:scheme="aaaa" />
</intent-filter>
So when I click on the link, it is redirecting to my app. But it is not opening the specific screen which I want. I have tried the below code. But it keeps opening the screen which is already open.
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp.router(
title: 'MyApp',
theme: ThemeData(
useMaterial3: true,
colorScheme: ColorScheme.fromSeed(
seedColor: const Color.fromRGBO(26, 49, 60, 1),
),
),
routerConfig: router,
);
}
}
GoRouter router = GoRouter(
routes: [
GoRoute(
path: '/',
name: 'email_screen',
pageBuilder: (context, state) {
return MaterialPage(child: EmailScreen(
));
}
),
GoRoute(
path: '/',
name: 'reset_screen',
pageBuilder: (context, state) {
return MaterialPage(child: ResetScreen(
));
}
),
],
);
I want to open the reset_screen. But it is not working. I am new to flutter. Please someone help me to solve this issue. Thanks in advance.