This commit is contained in:
2022-10-28 17:37:38 +08:00
parent 6f03482cd8
commit 2e9d8c1e0a
5 changed files with 28 additions and 13 deletions

View File

@@ -3,8 +3,11 @@ import 'package:chat/controllers/private_controller.dart';
import 'package:chat/models/im/search_user_model.dart';
import 'package:chat/providers/user_provider.dart';
import 'package:chat/routes/contact_routes.dart';
import 'package:chat/routes/user_routes.dart';
import 'package:chat/services/auth_service.dart';
import 'package:chat/services/tim/apply_service.dart';
import 'package:chat/services/tim/friend_service.dart';
import 'package:chat/utils/convert.dart';
import 'package:chat/widgets/custom_avatar.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@@ -34,7 +37,7 @@ class _ImFriendRequestState extends State<ContactFriendRequestPage> {
title: const Text('新的朋友'),
bottom: _Search(
onChanged: (String e) async {
if (e.length < 3) {
if (e.isEmpty) {
setState(() {
searchList = null;
});
@@ -232,7 +235,7 @@ class _Search extends StatelessWidget implements PreferredSizeWidget {
child: TextField(
keyboardType: TextInputType.phone,
decoration: InputDecoration(
hintText: '请输入对方手机号',
hintText: '请输入对方的区块链地址',
hintStyle: const TextStyle(
fontSize: 14,
color: AppColors.unactive,
@@ -266,19 +269,24 @@ class _Search extends StatelessWidget implements PreferredSizeWidget {
),
child: InkWell(
onTap: () {
Get.toNamed(ContactRoutes.friendProfile);
Get.toNamed(UserRoutes.qrCode);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: const [
children: [
Text(
'我的二维码: ',
style: TextStyle(
'我的地址: ' +
Convert.hideCenterStr(
AuthService.to.userInfo.value.address!,
start: 4,
end: 4,
),
style: const TextStyle(
color: AppColors.unactive,
),
),
SizedBox(width: 8),
Icon(
const SizedBox(width: 8),
const Icon(
Icons.qr_code,
size: 18,
color: AppColors.unactive,

View File

@@ -27,7 +27,10 @@ class HomePage extends StatelessWidget {
child: GetX<TimConversationService>(
builder: (_) {
return _.conversationList.isEmpty
? CustomEasyRefresh.empty(text: '')
? ConstrainedBox(
constraints: BoxConstraints(minHeight: Get.height / 2),
child: CustomEasyRefresh.empty(text: '暂无消息'),
)
: ListView.separated(
shrinkWrap: true,
physics: const ClampingScrollPhysics(),
@@ -68,7 +71,7 @@ class HomePage extends StatelessWidget {
Get.toNamed(ContactRoutes.groupCreate);
break;
case 'C':
Get.toNamed(ContactRoutes.friendSearch);
Get.toNamed(ContactRoutes.friendRequest);
break;
case 'D':
Permission.camera.request().isGranted.then((value) {