opt pages

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-31 11:22:11 +08:00
parent 132a7e15de
commit 4ac05caa28
14 changed files with 236 additions and 240 deletions

View File

@@ -31,49 +31,44 @@ class _HomePageState extends State<HomePage>
Widget build(BuildContext context) {
super.build(context);
final theme = Theme.of(context);
return Scaffold(
appBar: AppBar(toolbarHeight: 0),
body: Column(
children: [
if (!_homeController.useSideBar &&
context.orientation == Orientation.portrait)
customAppBar(theme),
if (_homeController.tabs.length > 1)
Material(
color: theme.colorScheme.surface,
child: Container(
height: 42,
padding: const EdgeInsets.only(top: 4),
child: TabBar(
controller: _homeController.tabController,
tabs: [
for (var i in _homeController.tabs) Tab(text: i.label)
],
isScrollable: true,
dividerColor: Colors.transparent,
dividerHeight: 0,
enableFeedback: true,
splashBorderRadius: StyleString.mdRadius,
tabAlignment: TabAlignment.center,
onTap: (value) {
feedBack();
if (!_homeController.tabController.indexIsChanging) {
_homeController.animateToTop();
}
},
),
return Column(
children: [
if (!_homeController.useSideBar &&
context.orientation == Orientation.portrait)
customAppBar(theme),
if (_homeController.tabs.length > 1)
Material(
color: theme.colorScheme.surface,
child: Container(
height: 42,
padding: const EdgeInsets.only(top: 4),
child: TabBar(
controller: _homeController.tabController,
tabs: [for (var i in _homeController.tabs) Tab(text: i.label)],
isScrollable: true,
dividerColor: Colors.transparent,
dividerHeight: 0,
enableFeedback: true,
splashBorderRadius: StyleString.mdRadius,
tabAlignment: TabAlignment.center,
onTap: (value) {
feedBack();
if (!_homeController.tabController.indexIsChanging) {
_homeController.animateToTop();
}
},
),
)
else
const SizedBox(height: 6),
Expanded(
child: tabBarView(
controller: _homeController.tabController,
children: _homeController.tabs.map((e) => e.page).toList(),
),
)
else
const SizedBox(height: 6),
Expanded(
child: tabBarView(
controller: _homeController.tabController,
children: _homeController.tabs.map((e) => e.page).toList(),
),
],
),
),
],
);
}