From 7f5554641368d3e2dfc0e3fe1315999267489810 Mon Sep 17 00:00:00 2001 From: Win Date: Wed, 24 Dec 2025 12:21:38 +0000 Subject: [PATCH] Added multiple pages --- my_yaru_app/lib/main.dart | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/my_yaru_app/lib/main.dart b/my_yaru_app/lib/main.dart index f0983ce..08172e2 100644 --- a/my_yaru_app/lib/main.dart +++ b/my_yaru_app/lib/main.dart @@ -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'), + ); + } + }, )); } }