更新首页头像

This commit is contained in:
yuanjunyao 2023-11-30 15:21:27 +08:00
parent e32cd247dd
commit caa65c6ecf
9 changed files with 43 additions and 4 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -36,6 +36,7 @@ class ExploreView extends GetView<HomeController> {
account: controller.account,
gender: controller.gender,
occupationName: controller.occupationName,
occupationId: controller.occupationId,
),
),
buildTitle(context),

View File

@ -114,6 +114,7 @@ class HomeView extends GetView<HomeController> {
account: controller.account,
gender: controller.gender,
occupationName: controller.occupationName,
occupationId: controller.occupationId,
),
),
controller.prompt.value

View File

@ -9,10 +9,12 @@ class UserWidget extends GetView {
required this.account,
required this.gender,
required this.occupationName,
required this.occupationId,
});
final String account;
final int gender;
final String occupationName;
final int occupationId;
@override
Widget build(BuildContext context) {
@ -28,7 +30,16 @@ class UserWidget extends GetView {
padding: REdgeInsets.only(left: 2.0, top: 1.0, bottom: 1.0),
child: Row(
children: [
Images.homeAvatar,
switch(gender) {
2 => switch(occupationId) {
5 => Images.homeAvatarPainterMale,
_ => Images.homeAvatarAcademicianMale,
},
_ => switch(occupationId) {
5 => Images.homeAvatarPainterFemale,
_ => Images.homeAvatarAcademicianFemale,
},
},
Container(
padding: REdgeInsets.all(6.0),
child: Column(

View File

@ -117,6 +117,34 @@ class Images {
width: 67.w,
);
static Widget homeAvatarAcademicianFemale = LoadAssetImage(
'home/pic_avatar_academician_female',
format: ImageFormat.jpg,
height: 67.w,
width: 67.w,
);
static Widget homeAvatarAcademicianMale = LoadAssetImage(
'home/pic_avatar_academician_male',
format: ImageFormat.jpg,
height: 67.w,
width: 67.w,
);
static Widget homeAvatarPainterFemale = LoadAssetImage(
'home/pic_avatar_painter_female',
format: ImageFormat.jpg,
height: 67.w,
width: 67.w,
);
static Widget homeAvatarPainterMale = LoadAssetImage(
'home/pic_avatar_painter_male',
format: ImageFormat.jpg,
height: 67.w,
width: 67.w,
);
static Widget homeBeginGray = LoadAssetImage(
'home/btn_icon_begin_gray',
height: 66.w,
@ -336,7 +364,6 @@ class Images {
class _FadeInAndOut extends HookWidget {
const _FadeInAndOut({
super.key,
required this.child,
});
@ -376,7 +403,6 @@ class _FadeInAndOut extends HookWidget {
class _UpAndDown extends HookWidget {
const _UpAndDown({
super.key,
required this.child,
});

View File

@ -3,7 +3,7 @@ version: 0.1.1
publish_to: none
description: Dream Pad.
environment:
sdk: '>=2.18.5 <3.0.0'
sdk: '>=3.0.0 <4.0.0'
dependencies:
cupertino_icons: ^1.0.6