更新首页头像

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, account: controller.account,
gender: controller.gender, gender: controller.gender,
occupationName: controller.occupationName, occupationName: controller.occupationName,
occupationId: controller.occupationId,
), ),
), ),
buildTitle(context), buildTitle(context),

View File

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

View File

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

View File

@ -117,6 +117,34 @@ class Images {
width: 67.w, 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( static Widget homeBeginGray = LoadAssetImage(
'home/btn_icon_begin_gray', 'home/btn_icon_begin_gray',
height: 66.w, height: 66.w,
@ -336,7 +364,6 @@ class Images {
class _FadeInAndOut extends HookWidget { class _FadeInAndOut extends HookWidget {
const _FadeInAndOut({ const _FadeInAndOut({
super.key,
required this.child, required this.child,
}); });
@ -376,7 +403,6 @@ class _FadeInAndOut extends HookWidget {
class _UpAndDown extends HookWidget { class _UpAndDown extends HookWidget {
const _UpAndDown({ const _UpAndDown({
super.key,
required this.child, required this.child,
}); });

View File

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