From 2e9d8c1e0a54b5b8cb86378a27f5a3cfe17f809a Mon Sep 17 00:00:00 2001 From: Jason Date: Fri, 28 Oct 2022 17:37:38 +0800 Subject: [PATCH] update --- lib/configs/themes.dart | 2 ++ lib/main.dart | 4 ++-- .../contact/firend/request/index_page.dart | 24 ++++++++++++------- lib/views/home/index_page.dart | 7 ++++-- lib/widgets/custom_easy_refresh.dart | 4 +++- 5 files changed, 28 insertions(+), 13 deletions(-) diff --git a/lib/configs/themes.dart b/lib/configs/themes.dart index ae9c294..0091e5e 100644 --- a/lib/configs/themes.dart +++ b/lib/configs/themes.dart @@ -1,5 +1,6 @@ import 'package:chat/configs/app_colors.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; class Themes { static final ThemeData light = ThemeData( @@ -12,6 +13,7 @@ class Themes { color: AppColors.active, ), foregroundColor: AppColors.active, + systemOverlayStyle: SystemUiOverlayStyle.dark, ), /// 主色调 diff --git a/lib/main.dart b/lib/main.dart index 1de486b..d5f37c6 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -19,8 +19,8 @@ import 'package:get_storage/get_storage.dart'; Future main() async { /// 设置状态栏样式,透明 SystemUiOverlayStyle style = const SystemUiOverlayStyle( - statusBarColor: AppColors.transparent, - systemNavigationBarColor: AppColors.nav, + statusBarColor: AppColors.transparent, // 顶部状态栏 + systemNavigationBarColor: AppColors.nav, // 底部多出来那块 ); SystemChrome.setSystemUIOverlayStyle(style); diff --git a/lib/views/contact/firend/request/index_page.dart b/lib/views/contact/firend/request/index_page.dart index edf58ac..869fc0f 100644 --- a/lib/views/contact/firend/request/index_page.dart +++ b/lib/views/contact/firend/request/index_page.dart @@ -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 { 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, diff --git a/lib/views/home/index_page.dart b/lib/views/home/index_page.dart index ab80425..e11a7af 100644 --- a/lib/views/home/index_page.dart +++ b/lib/views/home/index_page.dart @@ -27,7 +27,10 @@ class HomePage extends StatelessWidget { child: GetX( 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) { diff --git a/lib/widgets/custom_easy_refresh.dart b/lib/widgets/custom_easy_refresh.dart index 8aa04e5..da069bd 100644 --- a/lib/widgets/custom_easy_refresh.dart +++ b/lib/widgets/custom_easy_refresh.dart @@ -35,7 +35,6 @@ class CustomEasyRefresh { double size = 156.0, }) { return Column( - mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ @@ -43,6 +42,9 @@ class CustomEasyRefresh { 'assets/images/empty/im_emptyIcon_2.png', width: size, ), + const SizedBox( + height: 16, + ), Text( text, style: const TextStyle(