First, use it in your MaterialApp Widget like this,
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
home: LoginScreen(),
routes: {
'/log': (context) => const LoginScreen(),
'/reg': (context) => const SignupScreen(),
},
);
}
}
Then, You can use it, like this
onTap: (() {
Navigator.pushNamed(context, '/reg');
}
Comments
Post a Comment