发现页面

This commit is contained in:
2022-10-27 10:43:44 +08:00
parent 93f41b091f
commit aa30a11af2
6 changed files with 31 additions and 24 deletions

View File

@@ -1,5 +1,6 @@
import 'package:chat/configs/app_colors.dart';
import 'package:chat/routes/moments_routes.dart';
import 'package:chat/services/auth_service.dart';
import 'package:chat/services/tabbar_service.dart';
import 'package:chat/widgets/custom_avatar.dart';
import 'package:flutter/material.dart';
@@ -79,7 +80,7 @@ class _HeaderBackground extends StatelessWidget {
bottom: 32,
child: GestureDetector(
child: Image.asset(
'assets/backgrounds/moment_3.jpg',
'assets/images/login_bg.png',
fit: BoxFit.cover,
),
),
@@ -94,9 +95,9 @@ class _HeaderBackground extends StatelessWidget {
SizedBox(
height: 52,
child: Obx(() {
return const Text(
"UserController.to.userInfo.value?.nickname ?? ''",
style: TextStyle(
return Text(
AuthService.to.userInfo.value.nickname ?? '',
style: const TextStyle(
color: AppColors.white,
fontWeight: FontWeight.bold,
fontSize: 16,
@@ -109,7 +110,7 @@ class _HeaderBackground extends StatelessWidget {
return GestureDetector(
onTap: () => TabbarService.to.index = 4,
child: CustomAvatar(
'',
AuthService.to.userInfo.value.avatar,
size: 64,
),
);

View File

@@ -2,6 +2,7 @@ import 'package:chat/configs/app_colors.dart';
import 'package:chat/services/tabbar_service.dart';
import 'package:chat/views/contact/index/index_page.dart';
import 'package:chat/views/home/index_page.dart';
import 'package:chat/views/moments/index/index_page.dart';
import 'package:chat/views/user/index/index_page.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@@ -13,7 +14,7 @@ class AppPage extends StatelessWidget {
final List<IndexedStackChild> _tabBarPageList = [
IndexedStackChild(child: const HomePage()),
IndexedStackChild(child: const ContactPage()),
// IndexedStackChild(child: const MomentsPage()),
IndexedStackChild(child: const MomentsPage()),
IndexedStackChild(child: const UserPage()),
];
@@ -28,11 +29,11 @@ class AppPage extends StatelessWidget {
'active_icon': Icons.contact_page,
'label': '通讯录',
},
// {
// 'icon': Icons.explore_outlined,
// 'active_icon': Icons.explore,
// 'label': '发现',
// },
{
'icon': Icons.explore_outlined,
'active_icon': Icons.explore,
'label': '发现',
},
{
'icon': Icons.person_outline,
'active_icon': Icons.person,

View File

@@ -34,6 +34,7 @@ class _UserInfoPageState extends State<UserInfoPage> {
Get.context!,
pickerConfig: const AssetPickerConfig(
maxAssets: 1,
textDelegate: AssetPickerTextDelegate(),
requestType: RequestType.image,
),
);
@@ -77,12 +78,12 @@ class _UserInfoPageState extends State<UserInfoPage> {
sourcePath: imagePath,
maxHeight: 128,
maxWidth: 128,
compressQuality: 70,
compressQuality: 100,
aspectRatio: const CropAspectRatio(
ratioX: 1,
ratioY: 1,
),
compressFormat: ImageCompressFormat.png,
compressFormat: ImageCompressFormat.jpg,
uiSettings: [
IOSUiSettings(
title: '头像剪裁',