Commit b4e6d074ad8d0df86293450fd8338ad124784563

Authored by 常守达
1 parent 5e2e7395

fix(login):添加好友页粘贴,跳转完成页

... ... @@ -137,11 +137,7 @@ class BindPartnerController extends GetxController {
break;
case AppSuccess(data: final friendItem):
_platformHostApi.refreshWatchAppAndWidgets();
if (isShowAppBarBack) {
Get.back();
} else {
Get.to(_BindSuccessPage(friendItem));
}
Get.to(_BindSuccessPage(friendItem, isShowAppBarBack));
ta.track('success_add_doubelfeel_friend');
break;
}
... ... @@ -172,8 +168,9 @@ class BindPartnerController extends GetxController {
}
class _BindSuccessPage extends StatelessWidget {
const _BindSuccessPage(this.friendItem);
const _BindSuccessPage(this.friendItem, this.isShowAppBarBack);
final FriendItem friendItem;
final bool isShowAppBarBack;
@override
Widget build(BuildContext context) {
final l10n = context.l10n;
... ... @@ -181,11 +178,21 @@ class _BindSuccessPage extends StatelessWidget {
final preferences = userPrefs.preferences.value;
final me = preferences.meUserInfo;
return GuideCommonScaffold(
onBackPressed: () => Get.back(),
onBackPressed: () {
Get.back();
if (isShowAppBarBack) {
Get.back();
}
},
bottom: OnboardingBottomButton(
label: l10n.continueButton,
enabled: true,
onPressed: () async {
if (isShowAppBarBack) {
Get.back();
Get.back();
return;
}
final userStateService = Get.find<UserStateService>();
if (!userStateService.isVip) {
Get.offNamed(
... ...
... ... @@ -321,6 +321,20 @@ class BindPartnerView extends GetView<BindPartnerController> {
controller: controller.partnerIdController,
textAlign: TextAlign.center,
textAlignVertical: TextAlignVertical.center,
contextMenuBuilder: (BuildContext context,
EditableTextState editableTextState) {
// 获取默认的菜单项列表
List<ContextMenuButtonItem> buttonItems =
editableTextState.contextMenuButtonItems;
// 例如:只保留“粘贴” (Paste)
buttonItems.removeWhere(
(item) => item.type != ContextMenuButtonType.paste);
return AdaptiveTextSelectionToolbar.buttonItems(
anchors: editableTextState.contextMenuAnchors,
buttonItems: buttonItems,
);
},
style: TextStyle(
fontSize: 32,
fontWeight: FontWeight.w400,
... ...