Page changing on tabs
This commit is contained in:
parent
6883acfff5
commit
b7ae3c05c8
|
|
@ -30,33 +30,43 @@ class _Home extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: YaruWindowTitleBar(),
|
|
||||||
body: YaruMasterDetailPage(
|
body: YaruMasterDetailPage(
|
||||||
length: 2,
|
length: 2,
|
||||||
tileBuilder: (context, index, selected, availableWidth) {
|
appBar: const YaruWindowTitleBar(),
|
||||||
if (index == 0) {
|
tileBuilder: (context, index, selected, availableWidth) {
|
||||||
return YaruMasterTile(
|
if (index == 0) {
|
||||||
title: Text('Home'),
|
return const YaruMasterTile(
|
||||||
leading: Icon(YaruIcons.home),
|
title: Text('Home'),
|
||||||
);
|
leading: Icon(YaruIcons.home),
|
||||||
} else {
|
);
|
||||||
return YaruMasterTile(
|
} else {
|
||||||
title: Text('Page 2'),
|
return const YaruMasterTile(
|
||||||
leading: Icon(YaruIcons.video_filled),
|
title: Text('Video'),
|
||||||
);
|
leading: Icon(YaruIcons.video_filled),
|
||||||
}
|
);
|
||||||
},
|
}
|
||||||
pageBuilder: (context, index) {
|
},
|
||||||
if (index == 0) {
|
pageBuilder: (context, index) {
|
||||||
return Center(
|
if (index == 0) {
|
||||||
child: Text('Hello Ubuntu'),
|
return const YaruDetailPage(
|
||||||
);
|
appBar: YaruWindowTitleBar(
|
||||||
} else {
|
title: Text('Home'),
|
||||||
return Center(
|
),
|
||||||
child: Text('Hello Yaru'),
|
body: Center(
|
||||||
);
|
child: Text('Hello Ubuntu'),
|
||||||
}
|
),
|
||||||
},
|
);
|
||||||
));
|
} else {
|
||||||
|
return const YaruDetailPage(
|
||||||
|
appBar: YaruWindowTitleBar(
|
||||||
|
title: Text('Video'),
|
||||||
|
),
|
||||||
|
body: Center(
|
||||||
|
child: Text('Hello Yaru'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue