diff --git a/circle_app/lib/app/login/complete_material/view.dart b/circle_app/lib/app/login/complete_material/view.dart index c63e08f..fb439cf 100644 --- a/circle_app/lib/app/login/complete_material/view.dart +++ b/circle_app/lib/app/login/complete_material/view.dart @@ -34,9 +34,19 @@ class Complete_materialPage extends StatelessWidget { ), ), Scaffold( - appBar: const MyAppBar( + appBar: MyAppBar( centerTitle: '完善您的个人形象', isBack: true, + isDiyBack: true, + backPressed: () async { + final isBack = await Navigator.maybePop(context); + if (isBack) { + + } else { + Get.offNamed(AppRoutes.Login); + } + + } ), backgroundColor: Colors.transparent, body: GestureDetector( diff --git a/circle_app/lib/app/msg/TIMUIKitConversation/tim_uikit_conversation.dart b/circle_app/lib/app/msg/TIMUIKitConversation/tim_uikit_conversation.dart index b2ead9b..7d89586 100644 --- a/circle_app/lib/app/msg/TIMUIKitConversation/tim_uikit_conversation.dart +++ b/circle_app/lib/app/msg/TIMUIKitConversation/tim_uikit_conversation.dart @@ -450,13 +450,15 @@ class _TIMConversationState extends TIMUIKitState { var otherInfo = jsonDecode(userFullInfo! .customInfo!['Label'] .toString()); - var myInfo = jsonDecode(myuserFullInfo! + Map myInfo = jsonDecode(myuserFullInfo! .customInfo!['Label'] .toString()); - if (myInfo['city'] - .toString() - .contains(otherInfo['city'].toString())) { - isSameCity = true; + if (myInfo.containsKey('city')) { + if (myInfo['city'] + .toString() + .contains(otherInfo['city'].toString())) { + isSameCity = true; + } } } diff --git a/circle_app/lib/components/my_app_bar.dart b/circle_app/lib/components/my_app_bar.dart index 63f155e..58f7b9d 100644 --- a/circle_app/lib/components/my_app_bar.dart +++ b/circle_app/lib/components/my_app_bar.dart @@ -1,7 +1,9 @@ +import 'package:circle_app/router/app_routers.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; /// 自定义AppBar class MyAppBar extends StatelessWidget implements PreferredSizeWidget { @@ -16,6 +18,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { this.backImgColor, this.onPressed, this.isDiyBack = false, + this.backPressed, this.onCenterTitlePressed, this.superContext, this.isBack = true @@ -31,6 +34,8 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { final VoidCallback? onCenterTitlePressed; final bool isBack; final bool isDiyBack; + + final VoidCallback? backPressed; final BuildContext? superContext; @override @@ -46,9 +51,15 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { ); final Widget back = isBack ? IconButton( - onPressed: () async { + onPressed: isDiyBack ? backPressed : () async { if (isDiyBack) { - Navigator.pop(superContext!); + if (backPressed != null) { + + + } else { + Navigator.pop(superContext!); + } + } else { FocusManager.instance.primaryFocus?.unfocus(); final isBack = await Navigator.maybePop(context);