fix: null safe

This commit is contained in:
bggRGjQaUbCoE
2024-08-27 11:03:44 +08:00
parent 0e332ce080
commit 24458c106f
3 changed files with 11 additions and 11 deletions

View File

@@ -16,8 +16,8 @@ class FollowController extends GetxController with GetTickerProviderStateMixin {
int ps = 20;
int total = 0;
RxList<FollowItemModel> followList = <FollowItemModel>[].obs;
late int mid;
late String name;
late int? mid;
late String? name;
var userInfo;
RxString loadingText = '加载中...'.obs;
RxBool isOwner = false.obs;
@@ -30,9 +30,9 @@ class FollowController extends GetxController with GetTickerProviderStateMixin {
userInfo = userInfoCache.get('userInfoCache');
mid = Get.parameters['mid'] != null
? int.parse(Get.parameters['mid']!)
: userInfo.mid;
isOwner.value = mid == userInfo.mid;
name = Get.parameters['name'] ?? userInfo.uname;
: userInfo?.mid;
isOwner.value = mid == userInfo?.mid;
name = Get.parameters['name'] ?? userInfo?.uname;
}
Future queryFollowings(type) async {

View File

@@ -20,7 +20,7 @@ class OwnerFollowList extends StatefulWidget {
class _OwnerFollowListState extends State<OwnerFollowList>
with AutomaticKeepAliveClientMixin {
late int mid;
late int? mid;
late Future _futureBuilderFuture;
final ScrollController scrollController = ScrollController();
int pn = 1;