修改导航栏组件自定义返回事件、增加完善资料返回事件
This commit is contained in:
parent
76969fa785
commit
39cc3a830f
@ -34,9 +34,19 @@ class Complete_materialPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Scaffold(
|
Scaffold(
|
||||||
appBar: const MyAppBar(
|
appBar: MyAppBar(
|
||||||
centerTitle: '完善您的个人形象',
|
centerTitle: '完善您的个人形象',
|
||||||
isBack: true,
|
isBack: true,
|
||||||
|
isDiyBack: true,
|
||||||
|
backPressed: () async {
|
||||||
|
final isBack = await Navigator.maybePop(context);
|
||||||
|
if (isBack) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Get.offNamed(AppRoutes.Login);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
),
|
),
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
body: GestureDetector(
|
body: GestureDetector(
|
||||||
|
|||||||
@ -450,13 +450,15 @@ class _TIMConversationState extends TIMUIKitState<TIMConversation> {
|
|||||||
var otherInfo = jsonDecode(userFullInfo!
|
var otherInfo = jsonDecode(userFullInfo!
|
||||||
.customInfo!['Label']
|
.customInfo!['Label']
|
||||||
.toString());
|
.toString());
|
||||||
var myInfo = jsonDecode(myuserFullInfo!
|
Map myInfo = jsonDecode(myuserFullInfo!
|
||||||
.customInfo!['Label']
|
.customInfo!['Label']
|
||||||
.toString());
|
.toString());
|
||||||
if (myInfo['city']
|
if (myInfo.containsKey('city')) {
|
||||||
.toString()
|
if (myInfo['city']
|
||||||
.contains(otherInfo['city'].toString())) {
|
.toString()
|
||||||
isSameCity = true;
|
.contains(otherInfo['city'].toString())) {
|
||||||
|
isSameCity = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
|
|
||||||
|
import 'package:circle_app/router/app_routers.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
/// 自定义AppBar
|
/// 自定义AppBar
|
||||||
class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
|
class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||||
@ -16,6 +18,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
this.backImgColor,
|
this.backImgColor,
|
||||||
this.onPressed,
|
this.onPressed,
|
||||||
this.isDiyBack = false,
|
this.isDiyBack = false,
|
||||||
|
this.backPressed,
|
||||||
this.onCenterTitlePressed,
|
this.onCenterTitlePressed,
|
||||||
this.superContext,
|
this.superContext,
|
||||||
this.isBack = true
|
this.isBack = true
|
||||||
@ -31,6 +34,8 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
final VoidCallback? onCenterTitlePressed;
|
final VoidCallback? onCenterTitlePressed;
|
||||||
final bool isBack;
|
final bool isBack;
|
||||||
final bool isDiyBack;
|
final bool isDiyBack;
|
||||||
|
|
||||||
|
final VoidCallback? backPressed;
|
||||||
final BuildContext? superContext;
|
final BuildContext? superContext;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -46,9 +51,15 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
);
|
);
|
||||||
|
|
||||||
final Widget back = isBack ? IconButton(
|
final Widget back = isBack ? IconButton(
|
||||||
onPressed: () async {
|
onPressed: isDiyBack ? backPressed : () async {
|
||||||
if (isDiyBack) {
|
if (isDiyBack) {
|
||||||
Navigator.pop(superContext!);
|
if (backPressed != null) {
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Navigator.pop(superContext!);
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
FocusManager.instance.primaryFocus?.unfocus();
|
FocusManager.instance.primaryFocus?.unfocus();
|
||||||
final isBack = await Navigator.maybePop(context);
|
final isBack = await Navigator.maybePop(context);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user