63 lines
1.5 KiB
Dart
63 lines
1.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:yaru/yaru.dart';
|
|
|
|
Future<void> main() async {
|
|
await YaruWindowTitleBar.ensureInitialized();
|
|
runApp(const MyApp());
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
const MyApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return YaruTheme(builder: (context, yaru, child) {
|
|
return MaterialApp(
|
|
debugShowCheckedModeBanner: false,
|
|
theme: yaru.theme,
|
|
darkTheme: yaru.darkTheme,
|
|
home: _Home(),
|
|
);
|
|
});
|
|
}
|
|
}
|
|
|
|
class _Home extends StatelessWidget {
|
|
const _Home({
|
|
super.key,
|
|
});
|
|
|
|
@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'),
|
|
);
|
|
}
|
|
},
|
|
));
|
|
}
|
|
}
|