Created
May 10, 2023 11:19
-
-
Save rubywai/0b720c420847b5f752da926773638d54 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter_ui_lesson/screens/third_screen.dart'; | |
class SecondScreen extends StatelessWidget { | |
const SecondScreen({Key? key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar(title: const Text('Second Screen'),), | |
body: Center( | |
child: Column( | |
children: [ | |
ElevatedButton( | |
child: const Text('Go to Third screen'), | |
onPressed: (){ | |
Navigator.push(context, | |
MaterialPageRoute(builder: (_) => const ThirdScreen())); | |
}, | |
), | |
ElevatedButton( | |
child: const Text('Go back first screen'), | |
onPressed: (){ | |
Navigator.pop(context); | |
}, | |
), | |
], | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment