Added multiple pages
This commit is contained in:
parent
aa1357aadd
commit
7f55546413
|
|
@ -31,11 +31,26 @@ class _Home extends StatelessWidget {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: YaruWindowTitleBar(),
|
appBar: YaruWindowTitleBar(),
|
||||||
body: Center(
|
body: YaruMasterDetailPage(
|
||||||
child: Text('Hello Ubuntu',
|
length: 2,
|
||||||
style: TextStyle(
|
tileBuilder: (context, index, selected, availableWidth) {
|
||||||
color: Theme.of(context).primaryColor,
|
if (index == 0) {
|
||||||
)),
|
return YaruMasterTile(title: Text('Page 1'));
|
||||||
|
} else {
|
||||||
|
return YaruMasterTile(title: Text('Page 2'));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
pageBuilder: (context, index) {
|
||||||
|
if (index == 0) {
|
||||||
|
return Center(
|
||||||
|
child: Text('Hello Ubuntu'),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return Center(
|
||||||
|
child: Text('Hello Yaru'),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue