Skip to content

Instantly share code, notes, and snippets.

@anmolseth06
Created October 17, 2019 15:44
Show Gist options
  • Save anmolseth06/66216666a2db0dc5bce17341fdb2c0c1 to your computer and use it in GitHub Desktop.
Save anmolseth06/66216666a2db0dc5bce17341fdb2c0c1 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
void main(){
runApp(MaterialApp(home: FirstPage(),));
}
class FirstPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(title: Text("hello"),),
body: Center(
child: RaisedButton(
child: Text("click"),
onPressed: (){
Navigator.push(context, MaterialPageRoute(builder: (context)=>SecondPage()));
},
),
),
),
);
}
}
class SecondPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.red,
title: Text("Second Page"),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment