Skip to content

Instantly share code, notes, and snippets.

@rubywai
Created May 10, 2023 11:18
Show Gist options
  • Save rubywai/2dc0b2ef2a1ce6e435218c69b61af4d1 to your computer and use it in GitHub Desktop.
Save rubywai/2dc0b2ef2a1ce6e435218c69b61af4d1 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
import 'package:flutter_ui_lesson/screens/second_screen.dart';
class FirstScreen extends StatelessWidget {
const FirstScreen({Key? key}) : super(key: key);
//
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('First Screen'),),
body: Center(
child: ElevatedButton(
child: const Text('Go to second screen'),
onPressed: (){
Navigator.push(context,
MaterialPageRoute(builder: (context) => const SecondScreen()));
},
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment