1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-09 14:28:51 +00:00

Reformats platform_design to match repo conventions, fixes missing icon (#89)

This commit is contained in:
Andrew Brogdon
2019-06-11 08:53:53 -07:00
committed by GitHub
parent 325c5a5d2b
commit 938ef8682c
9 changed files with 271 additions and 69 deletions

View File

@@ -46,7 +46,8 @@ class MyAdaptingApp extends StatelessWidget {
// depending on the app and content.
class PlatformAdaptingHomePage extends StatefulWidget {
@override
_PlatformAdaptingHomePageState createState() => _PlatformAdaptingHomePageState();
_PlatformAdaptingHomePageState createState() =>
_PlatformAdaptingHomePageState();
}
class _PlatformAdaptingHomePageState extends State<PlatformAdaptingHomePage> {
@@ -80,9 +81,12 @@ class _PlatformAdaptingHomePageState extends State<PlatformAdaptingHomePage> {
return CupertinoTabScaffold(
tabBar: CupertinoTabBar(
items: [
BottomNavigationBarItem(title: Text(SongsTab.title), icon: SongsTab.iosIcon),
BottomNavigationBarItem(title: Text(NewsTab.title), icon: NewsTab.iosIcon),
BottomNavigationBarItem(title: Text(ProfileTab.title), icon: ProfileTab.iosIcon),
BottomNavigationBarItem(
title: Text(SongsTab.title), icon: SongsTab.iosIcon),
BottomNavigationBarItem(
title: Text(NewsTab.title), icon: NewsTab.iosIcon),
BottomNavigationBarItem(
title: Text(ProfileTab.title), icon: ProfileTab.iosIcon),
],
),
tabBuilder: (context, index) {
@@ -149,9 +153,8 @@ class _AndroidDrawer extends StatelessWidget {
title: Text(NewsTab.title),
onTap: () {
Navigator.pop(context);
Navigator.push(context, MaterialPageRoute(
builder: (context) => NewsTab()
));
Navigator.push(
context, MaterialPageRoute(builder: (context) => NewsTab()));
},
),
ListTile(
@@ -159,9 +162,8 @@ class _AndroidDrawer extends StatelessWidget {
title: Text(ProfileTab.title),
onTap: () {
Navigator.pop(context);
Navigator.push(context, MaterialPageRoute(
builder: (context) => ProfileTab()
));
Navigator.push(context,
MaterialPageRoute(builder: (context) => ProfileTab()));
},
),
// Long drawer contents are often segmented.
@@ -174,9 +176,8 @@ class _AndroidDrawer extends StatelessWidget {
title: Text(SettingsTab.title),
onTap: () {
Navigator.pop(context);
Navigator.push(context, MaterialPageRoute(
builder: (context) => SettingsTab()
));
Navigator.push(context,
MaterialPageRoute(builder: (context) => SettingsTab()));
},
),
],