refactor: GlobalDataCache

This commit is contained in:
guozhigq
2024-11-19 23:50:45 +08:00
parent 606a3ad495
commit 16fa467742
22 changed files with 79 additions and 84 deletions

View File

@ -169,8 +169,8 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
owner = widget.videoDetail!.owner;
enableAi = setting.get(SettingBoxKey.enableAi, defaultValue: true);
_expandableCtr = ExpandableController(
initialExpanded: GlobalDataCache().enableAutoExpand);
_expandableCtr =
ExpandableController(initialExpanded: GlobalDataCache.enableAutoExpand);
}
// 收藏
@ -556,7 +556,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
}
Widget actionGrid(BuildContext context, videoIntroController) {
final actionTypeSort = GlobalDataCache().actionTypeSort;
final actionTypeSort = GlobalDataCache.actionTypeSort;
Map<String, Widget> menuListWidgets = {
'like': Obx(

View File

@ -52,7 +52,7 @@ class ReplyItem extends StatelessWidget {
@override
Widget build(BuildContext context) {
final bool isOwner = int.parse(replyItem!.member!.mid!) ==
(GlobalDataCache().userInfo?.mid ?? -1);
(GlobalDataCache.userInfo?.mid ?? -1);
return Material(
child: InkWell(
// 点击整个评论区 评论详情/回复
@ -415,7 +415,7 @@ class ReplyItemRow extends StatelessWidget {
onLongPress: () {
feedBack();
final bool isOwner = int.parse(replyItem!.member!.mid!) ==
(GlobalDataCache().userInfo?.mid ?? -1);
(GlobalDataCache.userInfo?.mid ?? -1);
showModalBottomSheet(
context: context,
useRootNavigator: true,

View File

@ -18,7 +18,7 @@ class AiDetail extends StatelessWidget {
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.only(left: 16, right: 16),
height: GlobalDataCache().sheetHeight,
height: GlobalDataCache.sheetHeight,
child: Column(
children: [
_buildHeader(context),