Created
May 28, 2021 06:52
-
-
Save berkanaslan/8742c7149d3554b367f3ca9f2f8508ca to your computer and use it in GitHub Desktop.
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 FirstScreen extends StatelessWidget { | |
static const route = '/first'; | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar(title: Text('First Screen')), | |
body: Center( | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: <Widget>[ | |
RaisedButton( | |
onPressed: () { | |
Navigator.of( | |
context, | |
// BottomNavigationBar ile diğer ekrana git | |
rootNavigator: false, | |
).pushNamed(PushedScreen.route); | |
}, | |
child: Text('BottomNavigationBar ile sayfaya git'), | |
), | |
RaisedButton( | |
onPressed: () { | |
Navigator.of( | |
context, | |
// BottomNavigationBar olmadan diğer ekrana git (Kök dizin) | |
rootNavigator: true, | |
).pushNamed(PushedScreen.route); | |
}, | |
child: Text('BottomNavigationBar olmadan sayfaya git'), | |
), | |
], | |
), | |
), | |
); | |
} | |
} |
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 FourthScreen extends StatelessWidget { | |
static const route = '/extra'; | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar(title: Text('Extra Screen')), | |
body: Center( | |
child: RaisedButton( | |
onPressed: () { | |
// Push with bottom navigation visible | |
Navigator.of( | |
context, | |
rootNavigator: true, | |
).pushNamed(SimpleScreen.route); | |
}, | |
child: Text('Go to Simple Page'), | |
), | |
), | |
); | |
} | |
} |
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 PushedScreen extends StatelessWidget { | |
static const route = '/first/pushed'; | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar(title: Text('Pushed Screen')), | |
body: Center( | |
child: Text('Hello world!'), | |
), | |
); | |
} | |
} |
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 SecondScreen extends StatelessWidget { | |
static const route = '/second'; | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar(title: Text('Second Screen')), | |
body: ListView.builder( | |
controller: NavigationProvider.of(context) | |
.screens[SECOND_SCREEN] | |
.scrollController, | |
itemBuilder: (context, index) { | |
return ListTile( | |
title: Text('Item: $index'), | |
); | |
}, | |
), | |
); | |
} | |
} |
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 SimpleScreen extends StatelessWidget { | |
static const route = '/extra/simple'; | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text("Simple Screen"), | |
), | |
); | |
} | |
} |
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 ThirdScreen extends StatelessWidget { | |
static const route = '/third'; | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar(title: Text('Third Screen')), | |
body: Center( | |
child: FlutterLogo( | |
size: 128, | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment