Added multiple pages

This commit is contained in:
Win 2025-12-24 12:21:38 +00:00
parent aa1357aadd
commit 7f55546413
1 changed files with 20 additions and 5 deletions

View File

@ -31,11 +31,26 @@ class _Home extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: YaruWindowTitleBar(),
body: Center(
child: Text('Hello Ubuntu',
style: TextStyle(
color: Theme.of(context).primaryColor,
)),
body: YaruMasterDetailPage(
length: 2,
tileBuilder: (context, index, selected, availableWidth) {
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'),
);
}
},
));
}
}