KaaShiv Infotech

Inplant training in chennai | Internship in chennai

Page Navigation code in flutter programming


 

import ‘package:flutter/material.dart’;

import ‘package:stateful_project/Page2.dart’;

class Page1 extends StatelessWidget

{

@override

Widget build(BuildContext context)

{

return Scaffold

(

floatingActionButton: FloatingActionButton

(

child: Icon(Icons.add_box),

onPressed: ()

{

Navigator.push

(

context, MaterialPageRoute

(

builder: (context)

{

return Page2();

}

)

);

}

),

);

 


 

import ‘package:flutter/material.dart’;

import ‘package:stateful_project/Page1.dart’;

class Page2 extends StatelessWidget

{

@override

Widget build(BuildContext context)

{

return Scaffold

(

floatingActionButton: FloatingActionButton

(

child: Icon(Icons.add_box),

onPressed: ()

{

Navigator.push

(

context, MaterialPageRoute

(

builder: (context)

{

return Page1();

}

)

);

}

),

);

}

}

}

}

KaaShiv InfoTech Rated 5 / 5 based on 99,988 reviews.
× How can I help you?