mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-23 10:36:24 +08:00
opt account
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -6,8 +6,8 @@ import 'package:PiliPlus/models_new/dynamic/dyn_topic_feed/topic_card_list.dart'
|
||||
import 'package:PiliPlus/models_new/dynamic/dyn_topic_feed/topic_sort_by_conf.dart';
|
||||
import 'package:PiliPlus/models_new/dynamic/dyn_topic_top/top_details.dart';
|
||||
import 'package:PiliPlus/pages/common/common_list_controller.dart';
|
||||
import 'package:PiliPlus/services/account_service.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart' show Accounts;
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@@ -23,12 +23,13 @@ class DynTopicController
|
||||
double? appbarOffset;
|
||||
|
||||
// top
|
||||
final isLogin = Accounts.main.isLogin;
|
||||
Rx<bool?> isFav = Rx<bool?>(null);
|
||||
Rx<bool?> isLike = Rx<bool?>(null);
|
||||
Rx<LoadingState<TopDetails?>> topState =
|
||||
LoadingState<TopDetails?>.loading().obs;
|
||||
|
||||
AccountService accountService = Get.find<AccountService>();
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
@@ -91,7 +92,7 @@ class DynTopicController
|
||||
}
|
||||
|
||||
Future<void> onFav() async {
|
||||
if (!isLogin) {
|
||||
if (!accountService.isLogin.value) {
|
||||
SmartDialog.showToast('账号未登录');
|
||||
return;
|
||||
}
|
||||
@@ -112,7 +113,7 @@ class DynTopicController
|
||||
}
|
||||
|
||||
Future<void> onLike() async {
|
||||
if (!isLogin) {
|
||||
if (!accountService.isLogin.value) {
|
||||
SmartDialog.showToast('账号未登录');
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user