Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-06-13 11:49:38 +08:00
parent f824477ddb
commit c05fbde3fa
106 changed files with 2780 additions and 3200 deletions

View File

@@ -94,50 +94,47 @@ class _PgcPageState extends CommonPageState<PgcPage, PgcController>
),
const SizedBox(width: 16),
Expanded(
child: Material(
color: Colors.transparent,
child: TabBar(
isScrollable: true,
tabAlignment: TabAlignment.start,
dividerHeight: 0,
overlayColor:
WidgetStateProperty.all(Colors.transparent),
splashFactory: NoSplash.splashFactory,
padding: const EdgeInsets.only(right: 10),
indicatorPadding: const EdgeInsets.symmetric(
horizontal: 4,
vertical: 10,
),
indicator: BoxDecoration(
color: theme.colorScheme.secondaryContainer,
borderRadius: const BorderRadius.all(
Radius.circular(20)),
),
indicatorSize: TabBarIndicatorSize.tab,
labelColor:
theme.colorScheme.onSecondaryContainer,
labelStyle: TabBarTheme.of(context)
.labelStyle
?.copyWith(fontSize: 14) ??
const TextStyle(fontSize: 14),
dividerColor: Colors.transparent,
tabs: response.map(
(item) {
return Tab(
text:
'${item.date} ${item.isToday == 1 ? '今天' : '${const [
'',
'',
'',
'',
'',
'',
'',
][item.dayOfWeek! - 1]}'}',
);
},
).toList(),
child: TabBar(
isScrollable: true,
tabAlignment: TabAlignment.start,
dividerHeight: 0,
overlayColor:
WidgetStateProperty.all(Colors.transparent),
splashFactory: NoSplash.splashFactory,
padding: const EdgeInsets.only(right: 10),
indicatorPadding: const EdgeInsets.symmetric(
horizontal: 4,
vertical: 10,
),
indicator: BoxDecoration(
color: theme.colorScheme.secondaryContainer,
borderRadius:
const BorderRadius.all(Radius.circular(20)),
),
indicatorSize: TabBarIndicatorSize.tab,
labelColor:
theme.colorScheme.onSecondaryContainer,
labelStyle: TabBarTheme.of(context)
.labelStyle
?.copyWith(fontSize: 14) ??
const TextStyle(fontSize: 14),
dividerColor: Colors.transparent,
tabs: response.map(
(item) {
return Tab(
text:
'${item.date} ${item.isToday == 1 ? '今天' : '${const [
'',
'',
'',
'',
'',
'',
'',
][item.dayOfWeek! - 1]}'}',
);
},
).toList(),
),
),
],
@@ -237,38 +234,41 @@ class _PgcPageState extends CommonPageState<PgcPage, PgcController>
appBar: AppBar(title: const Text('索引')),
body: DefaultTabController(
length: types.length,
child: Builder(builder: (context) {
return Column(
children: [
SafeArea(
top: false,
bottom: false,
child: TabBar(
tabs: titles
.map((title) => Tab(text: title))
.toList(),
onTap: (index) {
try {
if (!DefaultTabController.of(context)
.indexIsChanging) {
Get.find<PgcIndexController>(
tag: types[index].toString())
.animateToTop();
}
} catch (_) {}
},
child: Builder(
builder: (context) {
return Column(
children: [
SafeArea(
top: false,
bottom: false,
child: TabBar(
tabs: titles
.map((title) => Tab(text: title))
.toList(),
onTap: (index) {
try {
if (!DefaultTabController.of(context)
.indexIsChanging) {
Get.find<PgcIndexController>(
tag:
types[index].toString())
.animateToTop();
}
} catch (_) {}
},
),
),
),
Expanded(
child: tabBarView(
children: types
.map((type) =>
PgcIndexPage(indexType: type))
.toList()),
)
],
);
}),
Expanded(
child: tabBarView(
children: types
.map((type) =>
PgcIndexPage(indexType: type))
.toList()),
)
],
);
},
),
),
),
);