Created
June 22, 2019 10:01
-
-
Save DaniyarGilimov/324abc2169497c26031ae3a532454227 to your computer and use it in GitHub Desktop.
Navigation with rootPages' BuildContext
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
class MainTabOrDetailPage extends StatefulWidget { | |
final BuildContext rootContext; | |
StudentMainTab({@required this.rootContext}); | |
@override | |
State<StatefulWidget> createState() { | |
return _MainTabOrDetailPage(); | |
} | |
} | |
class _MainTabOrDetailPage extends State<MainTabOrDetailPage> { | |
@override | |
Widget build(BuildContext context) { | |
return Navigator( | |
onGenerateRoute: (RouteSettings settings) { | |
return new MaterialPageRoute( | |
settings: settings, | |
builder: (BuildContext context) { | |
return Scaffold( | |
body: | |
//List | |
, | |
floatingActionButton: FloatingActionButton( | |
child: Icon, | |
onPressed: () { | |
Navigator.push( | |
widget.rootContext, | |
MaterialPageRoute( | |
builder: (context) => | |
StudentRequestPage())); | |
}, | |
)); | |
}); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment