mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: 状态栏图标颜色错误
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:PiliPalaX/models/common/dynamics_type.dart';
|
||||
import 'package:PiliPalaX/models/common/up_panel_position.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:PiliPalaX/utils/feed_back.dart';
|
||||
@@ -36,14 +37,14 @@ class _DynamicsPageState extends State<DynamicsPage>
|
||||
_futureBuilderFutureUp = _dynamicsController.queryFollowUp();
|
||||
// _dynamicsController.tabController =
|
||||
// TabController(vsync: this, length: DynamicsType.values.length);
|
||||
// ..addListener(() {
|
||||
// if (!_dynamicsController.tabController.indexIsChanging) {
|
||||
// // if (!mounted) return;
|
||||
// // print('indexChanging: ${_dynamicsController.tabController.index}');
|
||||
// _dynamicsController
|
||||
// .onSelectType(_dynamicsController.tabController.index);
|
||||
// }
|
||||
// });
|
||||
// ..addListener(() {
|
||||
// if (!_dynamicsController.tabController.indexIsChanging) {
|
||||
// // if (!mounted) return;
|
||||
// // print('indexChanging: ${_dynamicsController.tabController.index}');
|
||||
// _dynamicsController
|
||||
// .onSelectType(_dynamicsController.tabController.index);
|
||||
// }
|
||||
// });
|
||||
_dynamicsController.userLogin.listen((status) {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
@@ -52,8 +53,8 @@ class _DynamicsPageState extends State<DynamicsPage>
|
||||
}
|
||||
});
|
||||
upPanelPosition = UpPanelPosition.values[setting.get(
|
||||
SettingBoxKey.upPanelPosition,
|
||||
defaultValue: UpPanelPosition.leftFixed.code)];
|
||||
SettingBoxKey.upPanelPosition,
|
||||
defaultValue: UpPanelPosition.leftFixed.code)];
|
||||
print('upPanelPosition: $upPanelPosition');
|
||||
scrollController = _dynamicsController.scrollController;
|
||||
}
|
||||
@@ -70,7 +71,9 @@ class _DynamicsPageState extends State<DynamicsPage>
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||
child: Container(
|
||||
//抽屉模式增加底色
|
||||
color: upPanelPosition.code > 1? Theme.of(context).colorScheme.surface: Colors.transparent,
|
||||
color: upPanelPosition.code > 1
|
||||
? Theme.of(context).colorScheme.surface
|
||||
: Colors.transparent,
|
||||
width: 56,
|
||||
child: FutureBuilder(
|
||||
future: _futureBuilderFutureUp,
|
||||
@@ -82,8 +85,7 @@ class _DynamicsPageState extends State<DynamicsPage>
|
||||
Map data = snapshot.data;
|
||||
if (data['status']) {
|
||||
return Obx(() => UpPanel(
|
||||
_dynamicsController.upData.value,
|
||||
scrollController));
|
||||
_dynamicsController.upData.value, scrollController));
|
||||
} else {
|
||||
return const SizedBox();
|
||||
}
|
||||
@@ -97,6 +99,7 @@ class _DynamicsPageState extends State<DynamicsPage>
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
print('upPanelPosition1: $upPanelPosition');
|
||||
@@ -107,51 +110,57 @@ class _DynamicsPageState extends State<DynamicsPage>
|
||||
toolbarHeight: 50,
|
||||
elevation: 0,
|
||||
backgroundColor: Colors.transparent,
|
||||
systemOverlayStyle: SystemUiOverlayStyle(
|
||||
statusBarIconBrightness:
|
||||
Theme.of(context).brightness == Brightness.light
|
||||
? Brightness.dark
|
||||
: Brightness.light,
|
||||
),
|
||||
title: SizedBox(
|
||||
height: 50,
|
||||
child: TabBar(
|
||||
controller: _dynamicsController.tabController,
|
||||
isScrollable: true,
|
||||
dividerColor: Colors.transparent,
|
||||
dividerHeight: 0,
|
||||
tabAlignment: TabAlignment.center,
|
||||
indicatorColor: Theme.of(context).colorScheme.primary,
|
||||
labelColor: Theme.of(context).colorScheme.primary,
|
||||
unselectedLabelColor: Theme.of(context).colorScheme.onSurface,
|
||||
labelStyle: TextStyle(
|
||||
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
|
||||
),
|
||||
tabs: DynamicsType.values
|
||||
.map((e) => Tab(text: e.labels))
|
||||
.toList(),
|
||||
onTap: (index) {
|
||||
print('index: $index');
|
||||
feedBack();
|
||||
tabsConfig[_dynamicsController.tabController.index]['ctr'].animateToTop();
|
||||
// _dynamicsController.tabController
|
||||
// _dynamicsController.tabController.index = index;
|
||||
// _dynamicsController.onSelectType(index);
|
||||
// _
|
||||
}
|
||||
)),
|
||||
controller: _dynamicsController.tabController,
|
||||
isScrollable: true,
|
||||
dividerColor: Colors.transparent,
|
||||
dividerHeight: 0,
|
||||
tabAlignment: TabAlignment.center,
|
||||
indicatorColor: Theme.of(context).colorScheme.primary,
|
||||
labelColor: Theme.of(context).colorScheme.primary,
|
||||
unselectedLabelColor: Theme.of(context).colorScheme.onSurface,
|
||||
labelStyle: TextStyle(
|
||||
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
|
||||
),
|
||||
tabs: DynamicsType.values
|
||||
.map((e) => Tab(text: e.labels))
|
||||
.toList(),
|
||||
onTap: (index) {
|
||||
print('index: $index');
|
||||
feedBack();
|
||||
tabsConfig[_dynamicsController.tabController.index]['ctr']
|
||||
.animateToTop();
|
||||
// _dynamicsController.tabController
|
||||
// _dynamicsController.tabController.index = index;
|
||||
// _dynamicsController.onSelectType(index);
|
||||
// _
|
||||
})),
|
||||
),
|
||||
drawer: upPanelPosition == UpPanelPosition.leftDrawer ?
|
||||
upPanelPart(): null,
|
||||
drawer: upPanelPosition == UpPanelPosition.leftDrawer
|
||||
? upPanelPart()
|
||||
: null,
|
||||
drawerEnableOpenDragGesture: true,
|
||||
endDrawer: upPanelPosition == UpPanelPosition.rightDrawer ?
|
||||
upPanelPart(): null,
|
||||
endDrawer: upPanelPosition == UpPanelPosition.rightDrawer
|
||||
? upPanelPart()
|
||||
: null,
|
||||
endDrawerEnableOpenDragGesture: true,
|
||||
body: Row(children: [
|
||||
if (upPanelPosition == UpPanelPosition.leftFixed)
|
||||
upPanelPart(),
|
||||
if (upPanelPosition == UpPanelPosition.leftFixed) upPanelPart(),
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
controller: _dynamicsController.tabController,
|
||||
children: _dynamicsController.tabsPageList,
|
||||
)),
|
||||
if (upPanelPosition == UpPanelPosition.rightFixed)
|
||||
upPanelPart(),
|
||||
if (upPanelPosition == UpPanelPosition.rightFixed) upPanelPart(),
|
||||
]));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user