mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 11:08:03 +08:00
opt: LoadingState (#1776)
This commit is contained in:
committed by
GitHub
parent
3741fe54ff
commit
17883eb77e
@@ -2,8 +2,8 @@ import 'dart:io' show File;
|
||||
|
||||
import 'package:PiliPlus/common/widgets/loading_widget/loading_widget.dart';
|
||||
import 'package:PiliPlus/http/fav.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/http/msg.dart';
|
||||
import 'package:PiliPlus/models_new/fav/fav_folder/list.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/fav_utils.dart';
|
||||
import 'package:PiliPlus/utils/image_utils.dart';
|
||||
@@ -46,15 +46,14 @@ class _CreateFavPageState extends State<CreateFavPage> {
|
||||
void _getFolderInfo() {
|
||||
_errMsg = null;
|
||||
FavHttp.favFolderInfo(mediaId: _mediaId).then((res) {
|
||||
if (res['status']) {
|
||||
FavFolderInfo data = res['data'];
|
||||
_titleController.text = data.title;
|
||||
_introController.text = data.intro ?? '';
|
||||
_isPublic = FavUtils.isPublicFav(data.attr);
|
||||
_cover = data.cover;
|
||||
_attr = data.attr;
|
||||
if (res case Success(:final response)) {
|
||||
_titleController.text = response.title;
|
||||
_introController.text = response.intro ?? '';
|
||||
_isPublic = FavUtils.isPublicFav(response.attr);
|
||||
_cover = response.cover;
|
||||
_attr = response.attr;
|
||||
} else {
|
||||
_errMsg = res['msg'];
|
||||
_errMsg = res.toString();
|
||||
}
|
||||
setState(() {});
|
||||
});
|
||||
@@ -88,11 +87,11 @@ class _CreateFavPageState extends State<CreateFavPage> {
|
||||
cover: _cover ?? '',
|
||||
intro: _introController.text,
|
||||
).then((res) {
|
||||
if (res['status']) {
|
||||
Get.back(result: res['data']);
|
||||
if (res case Success(:final response)) {
|
||||
Get.back(result: response);
|
||||
SmartDialog.showToast('${_mediaId != null ? '编辑' : '创建'}成功');
|
||||
} else {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
res.toast();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user