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