Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- void main() => runApp(MyApp());
- class MyApp extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return MaterialApp(
- debugShowCheckedModeBanner: false,
- home: MainPage(),
- );
- }
- }
- class MainPage extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- title: Text("Page 1"),
- ),
- body: Center(
- child: FloatingActionButton(
- onPressed: () {
- Navigator.push(context,
- MaterialPageRoute(builder: (context) => SecondPage()));
- },
- ),
- ));
- }
- }
- class SecondPage extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- title: Text("Page 2"),
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement