Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-12-27 20:54:41 +08:00
parent 25acf3a9bb
commit b51c646415
227 changed files with 768 additions and 764 deletions

View File

@@ -40,7 +40,7 @@ class DynTopicController
Future<void> queryTop() async {
topState.value = await DynamicsHttp.topicTop(topicId: topicId);
if (topState.value.isSuccess) {
var topicItem = topState.value.data!.topicItem!;
final topicItem = topState.value.data!.topicItem!;
topicName = topicItem.name;
isFav.value = topicItem.isFav;
isLike.value = topicItem.isLike;
@@ -97,7 +97,7 @@ class DynTopicController
return;
}
bool isFav = this.isFav.value ?? false;
var res = isFav
final res = isFav
? await FavHttp.delFavTopic(topicId)
: await FavHttp.addFavTopic(topicId);
if (res.isSuccess) {
@@ -118,7 +118,7 @@ class DynTopicController
return;
}
bool isLike = this.isLike.value ?? false;
var res = await FavHttp.likeTopic(topicId, isLike);
final res = await FavHttp.likeTopic(topicId, isLike);
if (res.isSuccess) {
if (isLike) {
topState.value.data!.topicItem!.like -= 1;

View File

@@ -158,7 +158,7 @@ class _DynTopicPageState extends State<DynTopicPage> with DynMixin {
) {
return switch (topState) {
Loading() => const SliverAppBar(),
Success(:var response) when (topState.dataOrNull != null) =>
Success(:final response) when (topState.dataOrNull != null) =>
DynamicSliverAppBarMedium(
pinned: true,
afterCalc: (value) =>
@@ -347,7 +347,7 @@ class _DynTopicPageState extends State<DynTopicPage> with DynMixin {
Widget _buildBody(LoadingState<List<TopicCardItem>?> loadingState) {
return switch (loadingState) {
Loading() => dynSkeleton,
Success(:var response) =>
Success(:final response) =>
response != null && response.isNotEmpty
? GlobalData().dynamicsWaterfallFlow
? SliverWaterfallFlow(
@@ -389,7 +389,7 @@ class _DynTopicPageState extends State<DynTopicPage> with DynMixin {
itemCount: response.length,
)
: HttpError(onReload: _controller.onReload),
Error(:var errMsg) => HttpError(
Error(:final errMsg) => HttpError(
errMsg: errMsg,
onReload: _controller.onReload,
),