mod: 导航栏、排行榜样式调整

This commit is contained in:
orz12
2024-03-13 20:02:30 +08:00
parent 4c23f2f961
commit ab2fb39952
3 changed files with 14 additions and 7 deletions

View File

@@ -17,11 +17,11 @@ List defaultNavigationBars = [
{ {
'id': 1, 'id': 1,
'icon': const Icon( 'icon': const Icon(
Icons.trending_up, Icons.leaderboard_outlined,
size: 21, size: 21,
), ),
'selectIcon': const Icon( 'selectIcon': const Icon(
Icons.trending_up_outlined, Icons.leaderboard,
size: 21, size: 21,
), ),
'label': "排行榜", 'label': "排行榜",

View File

@@ -153,11 +153,11 @@ class _MainAppState extends State<MainApp> with SingleTickerProviderStateMixin {
e['count'] > 0, e['count'] > 0,
child: e['icon'], child: e['icon'],
backgroundColor: backgroundColor:
Theme.of(context).colorScheme.primary, Theme.of(context).colorScheme.primary,
textColor: Theme.of(context) textColor: Theme.of(context)
.colorScheme .colorScheme
.onInverseSurface, .onInverseSurface,
), ),
), ),
selectedIcon: e['selectIcon'], selectedIcon: e['selectIcon'],
label: e['label'], label: e['label'],
@@ -171,6 +171,11 @@ class _MainAppState extends State<MainApp> with SingleTickerProviderStateMixin {
iconSize: 16, iconSize: 16,
selectedFontSize: 12, selectedFontSize: 12,
unselectedFontSize: 12, unselectedFontSize: 12,
type: BottomNavigationBarType.fixed,
// selectedItemColor:
// Theme.of(context).colorScheme.primary, // 选中项的颜色
// unselectedItemColor:
// Theme.of(context).colorScheme.onSurface,
items: [ items: [
..._mainController.navigationBars.map((e) { ..._mainController.navigationBars.map((e) {
return BottomNavigationBarItem( return BottomNavigationBarItem(
@@ -189,11 +194,11 @@ class _MainAppState extends State<MainApp> with SingleTickerProviderStateMixin {
e['count'] > 0, e['count'] > 0,
child: e['icon'], child: e['icon'],
backgroundColor: backgroundColor:
Theme.of(context).colorScheme.primary, Theme.of(context).colorScheme.primary,
textColor: Theme.of(context) textColor: Theme.of(context)
.colorScheme .colorScheme
.onInverseSurface, .onInverseSurface,
), ),
), ),
activeIcon: e['selectIcon'], activeIcon: e['selectIcon'],
label: e['label'], label: e['label'],

View File

@@ -85,15 +85,17 @@ class _RankPageState extends State<RankPage>
const SizedBox(height: 4), const SizedBox(height: 4),
SizedBox( SizedBox(
width: double.infinity, width: double.infinity,
height: 42, height: 50,
child: Align( child: Align(
alignment: Alignment.center, alignment: Alignment.center,
child: TabBar( child: TabBar(
padding: const EdgeInsets.symmetric(horizontal: 10),
controller: _rankController.tabController, controller: _rankController.tabController,
tabs: [ tabs: [
for (var i in _rankController.tabs) for (var i in _rankController.tabs)
Tab(text: i['label']) Tab(text: i['label'])
], ],
labelPadding: const EdgeInsets.symmetric(horizontal: 4),
isScrollable: true, isScrollable: true,
dividerColor: Colors.transparent, dividerColor: Colors.transparent,
enableFeedback: true, enableFeedback: true,