From 0ce77d421f77976a799add0211fa5ec404bd251b Mon Sep 17 00:00:00 2001 From: guozhigq Date: Fri, 25 Oct 2024 23:07:50 +0800 Subject: [PATCH] feat: up uid copy --- lib/pages/member/view.dart | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/lib/pages/member/view.dart b/lib/pages/member/view.dart index 4ebc6153..84ad255c 100644 --- a/lib/pages/member/view.dart +++ b/lib/pages/member/view.dart @@ -1,5 +1,6 @@ import 'dart:async'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:get/get.dart'; @@ -7,6 +8,7 @@ import 'package:pilipala/common/constants.dart'; import 'package:pilipala/common/widgets/network_img_layer.dart'; import 'package:pilipala/models/member/info.dart'; import 'package:pilipala/pages/member/index.dart'; +import 'package:pilipala/utils/feed_back.dart'; import 'package:pilipala/utils/utils.dart'; import 'widgets/commen_widget.dart'; import 'widgets/conis.dart'; @@ -318,6 +320,7 @@ class _MemberPageState extends State Rx memberInfo = _memberController.memberInfo; return Obx( () => Column( + mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ ProfilePanel(ctr: _memberController), @@ -376,7 +379,7 @@ class _MemberPageState extends State .value.vip!.label!['img_label_uri_hans_static'], height: 20, ), - ] + ], ], ), if (memberInfo.value.official!['title'] != '') ...[ @@ -393,6 +396,39 @@ class _MemberPageState extends State ), ], const SizedBox(height: 6), + InkWell( + onTap: () { + feedBack(); + Clipboard.setData(ClipboardData( + text: memberInfo.value.mid.toString())); + SmartDialog.showToast('uid复制成功'); + }, + borderRadius: BorderRadius.circular(10), + child: Ink( + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.surfaceVariant, + borderRadius: BorderRadius.circular(20), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 4), + child: SizedBox( + height: 16, + child: Text( + 'uid: ${memberInfo.value.mid}', + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: Theme.of(context) + .colorScheme + .onSurfaceVariant, + fontSize: 12, + ), + ), + ), + ), + ), + ), + const SizedBox(height: 6), SelectableText(memberInfo.value.sign ?? ''), ], ),