-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Navigation between two pages using navigator
- Loading branch information
1 parent
4f15c9d
commit c66e9a7
Showing
4 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
...amples/simple_navigation/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>BuildSystemType</key> | ||
<string>Original</string> | ||
</dict> | ||
</plist> |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:simple_navigation/page2.dart'; | ||
|
||
class Page1 extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) => Scaffold( | ||
backgroundColor: Colors.blue, | ||
floatingActionButton: FloatingActionButton( | ||
onPressed: (){ | ||
Navigator.push(context, new MaterialPageRoute( | ||
builder: (context) => Page2() | ||
)); | ||
}, | ||
tooltip:'Next Page', | ||
child: IconTheme( | ||
data: new IconThemeData( | ||
color: Colors.blue, | ||
), | ||
child: new Icon(Icons.arrow_forward), | ||
), | ||
backgroundColor: Colors.white, | ||
), | ||
body: Container( | ||
child: Center( | ||
child: Text( | ||
'Page One', | ||
style: TextStyle(fontSize: 35.0, fontWeight: FontWeight.bold, color: Colors.white ), | ||
), | ||
) | ||
), | ||
); | ||
} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class Page2 extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) => Scaffold( | ||
backgroundColor: Colors.amber, | ||
floatingActionButton: FloatingActionButton( | ||
onPressed: (){ | ||
Navigator.pop(context); | ||
}, | ||
tooltip:'Next Page', | ||
child: IconTheme( | ||
data: new IconThemeData( | ||
color: Colors.blue, | ||
), | ||
child: new Icon(Icons.arrow_back), | ||
), | ||
backgroundColor: Colors.white, | ||
), | ||
body: Container( | ||
child: Center( | ||
child: Text( | ||
'Page Two', | ||
style: TextStyle(fontSize: 35.0, fontWeight: FontWeight.bold, color: Colors.white ), | ||
), | ||
) | ||
), | ||
); | ||
} | ||
|