native style

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2022-08-20 19:57:16 +08:00
parent 4faf0a3d35
commit a10487c840
10 changed files with 603 additions and 376 deletions

View File

@@ -30,30 +30,35 @@ class _DesktopTabPageState extends State<DesktopTabPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
children: [
DesktopTabBar(
tabs: tabs,
dark: isDarkTheme(),
mainTab: true,
onAddSetting: onAddSetting,
),
Obx((() => Expanded(
child: PageView(
controller: DesktopTabBar.controller.value,
children: tabs.map((tab) {
switch (tab.label) {
case kTabLabelHomePage:
return DesktopHomePage(key: ValueKey(tab.label));
case kTabLabelSettingPage:
return DesktopSettingPage(key: ValueKey(tab.label));
default:
return Container();
}
}).toList()),
))),
],
return Container(
decoration: BoxDecoration(
border: Border.all(color: MyTheme.color(context).border!)),
child: Scaffold(
backgroundColor: MyTheme.color(context).bg,
body: Column(
children: [
DesktopTabBar(
tabs: tabs,
dark: isDarkTheme(),
mainTab: true,
onAddSetting: onAddSetting,
),
Obx((() => Expanded(
child: PageView(
controller: DesktopTabBar.controller.value,
children: tabs.map((tab) {
switch (tab.label) {
case kTabLabelHomePage:
return DesktopHomePage(key: ValueKey(tab.label));
case kTabLabelSettingPage:
return DesktopSettingPage(key: ValueKey(tab.label));
default:
return Container();
}
}).toList()),
))),
],
),
),
);
}