mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-21 19:28:27 +08:00
@@ -39,7 +39,7 @@ class AtMeController extends CommonListController<MsgAtData, MsgAtItem> {
|
||||
@pragma('vm:notify-debugger-on-exception')
|
||||
Future<void> onRemove(Object id, int index) async {
|
||||
try {
|
||||
var res = await MsgHttp.delMsgfeed(2, id);
|
||||
final res = await MsgHttp.delMsgfeed(2, id);
|
||||
if (res.isSuccess) {
|
||||
loadingState
|
||||
..value.data!.removeAt(index)
|
||||
|
||||
@@ -84,7 +84,7 @@ class _AtMePageState extends State<AtMePage> {
|
||||
itemCount: 12,
|
||||
itemBuilder: (context, index) => const MsgFeedTopSkeleton(),
|
||||
),
|
||||
Success(:var response) =>
|
||||
Success(:final response) =>
|
||||
response != null && response.isNotEmpty
|
||||
? SliverList.separated(
|
||||
itemCount: response.length,
|
||||
@@ -175,7 +175,7 @@ class _AtMePageState extends State<AtMePage> {
|
||||
separatorBuilder: (context, index) => divider,
|
||||
)
|
||||
: HttpError(onReload: _atMeController.onReload),
|
||||
Error(:var errMsg) => HttpError(
|
||||
Error(:final errMsg) => HttpError(
|
||||
errMsg: errMsg,
|
||||
onReload: _atMeController.onReload,
|
||||
),
|
||||
|
||||
@@ -66,7 +66,7 @@ class _LikeDetailPageState extends State<LikeDetailPage> {
|
||||
itemCount: 12,
|
||||
itemBuilder: (context, index) => const MsgFeedTopSkeleton(),
|
||||
),
|
||||
Success(:var response) => SliverMainAxisGroup(
|
||||
Success(:final response) => SliverMainAxisGroup(
|
||||
slivers: [
|
||||
if (_controller.card != null) ...[
|
||||
_buildCard(_controller.card!),
|
||||
@@ -89,7 +89,7 @@ class _LikeDetailPageState extends State<LikeDetailPage> {
|
||||
),
|
||||
],
|
||||
),
|
||||
Error(:var errMsg) => HttpError(
|
||||
Error(:final errMsg) => HttpError(
|
||||
errMsg: errMsg,
|
||||
onReload: _controller.onReload,
|
||||
),
|
||||
|
||||
@@ -65,7 +65,7 @@ class LikeMeController
|
||||
|
||||
Future<void> onRemove(dynamic id, int index, bool isLatest) async {
|
||||
try {
|
||||
var res = await MsgHttp.delMsgfeed(0, id);
|
||||
final res = await MsgHttp.delMsgfeed(0, id);
|
||||
if (res.isSuccess) {
|
||||
Pair<List<MsgLikeItem>, List<MsgLikeItem>> pair =
|
||||
loadingState.value.data;
|
||||
@@ -84,7 +84,7 @@ class LikeMeController
|
||||
|
||||
Future<void> onSetNotice(MsgLikeItem item, bool isNotice) async {
|
||||
int noticeState = isNotice ? 1 : 0;
|
||||
var res = await MsgHttp.msgSetNotice(
|
||||
final res = await MsgHttp.msgSetNotice(
|
||||
id: item.id!,
|
||||
noticeState: noticeState,
|
||||
);
|
||||
|
||||
@@ -82,7 +82,7 @@ class _LikeMePageState extends State<LikeMePage> {
|
||||
itemCount: 12,
|
||||
itemBuilder: (context, index) => const MsgFeedTopSkeleton(),
|
||||
),
|
||||
Success(:var response) => Builder(
|
||||
Success(:final response) => Builder(
|
||||
builder: (context) {
|
||||
Pair<List<MsgLikeItem>, List<MsgLikeItem>> pair = response;
|
||||
List<MsgLikeItem> latest = pair.first;
|
||||
@@ -134,7 +134,7 @@ class _LikeMePageState extends State<LikeMePage> {
|
||||
return HttpError(onReload: _likeMeController.onReload);
|
||||
},
|
||||
),
|
||||
Error(:var errMsg) => HttpError(
|
||||
Error(:final errMsg) => HttpError(
|
||||
errMsg: errMsg,
|
||||
onReload: _likeMeController.onReload,
|
||||
),
|
||||
|
||||
@@ -39,7 +39,7 @@ class ReplyMeController
|
||||
|
||||
Future<void> onRemove(dynamic id, int index) async {
|
||||
try {
|
||||
var res = await MsgHttp.delMsgfeed(1, id);
|
||||
final res = await MsgHttp.delMsgfeed(1, id);
|
||||
if (res.isSuccess) {
|
||||
loadingState
|
||||
..value.data!.removeAt(index)
|
||||
|
||||
@@ -84,7 +84,7 @@ class _ReplyMePageState extends State<ReplyMePage> {
|
||||
itemCount: 12,
|
||||
itemBuilder: (context, index) => const MsgFeedTopSkeleton(),
|
||||
),
|
||||
Success(:var response) =>
|
||||
Success(:final response) =>
|
||||
response != null && response.isNotEmpty
|
||||
? SliverList.separated(
|
||||
itemCount: response.length,
|
||||
@@ -199,7 +199,7 @@ class _ReplyMePageState extends State<ReplyMePage> {
|
||||
separatorBuilder: (context, index) => divider,
|
||||
)
|
||||
: HttpError(onReload: _replyMeController.onReload),
|
||||
Error(:var errMsg) => HttpError(
|
||||
Error(:final errMsg) => HttpError(
|
||||
errMsg: errMsg,
|
||||
onReload: _replyMeController.onReload,
|
||||
),
|
||||
|
||||
@@ -36,7 +36,7 @@ class SysMsgController
|
||||
|
||||
Future<void> onRemove(dynamic id, int index) async {
|
||||
try {
|
||||
var res = await MsgHttp.delSysMsg(id);
|
||||
final res = await MsgHttp.delSysMsg(id);
|
||||
if (res.isSuccess) {
|
||||
loadingState
|
||||
..value.data!.removeAt(index)
|
||||
|
||||
@@ -70,7 +70,7 @@ class _SysMsgPageState extends State<SysMsgPage> {
|
||||
itemBuilder: (context, index) => const MsgFeedSysMsgSkeleton(),
|
||||
),
|
||||
),
|
||||
Success(:var response) =>
|
||||
Success(:final response) =>
|
||||
response != null && response.isNotEmpty
|
||||
? SliverList.separated(
|
||||
itemCount: response.length,
|
||||
@@ -125,7 +125,7 @@ class _SysMsgPageState extends State<SysMsgPage> {
|
||||
separatorBuilder: (context, index) => divider,
|
||||
)
|
||||
: HttpError(onReload: _sysMsgController.onReload),
|
||||
Error(:var errMsg) => HttpError(
|
||||
Error(:final errMsg) => HttpError(
|
||||
errMsg: errMsg,
|
||||
onReload: _sysMsgController.onReload,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user