Adding Screens
Creating Screen Files
Adding a new screen can be done in a couple of steps
Create a new folder, say
new_screenand place it under/lib/views/.Create a new file
new_screen.dartwithin this folder.
class NewScreen extends StatelessWidget {
. . .
. . .
}Update Routes file
Open the
/lib/constants/routes.dartAdd a new line like below
static const String newRoute = "new_route_name";Update Router file
Open the file
/lib/config/router.dartimportnewly created Screen into the Router
Last updated
Was this helpful?