mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-17 15:46:14 +08:00
@@ -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(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user