feat: 动态页面跳转个人主页

This commit is contained in:
guozhigq
2023-07-15 23:24:02 +08:00
parent a23103eb69
commit a0427c672b
10 changed files with 67 additions and 42 deletions

View File

@ -19,8 +19,8 @@ class MemberController extends GetxController {
super.onInit();
mid = int.parse(Get.parameters['mid']!);
ownerMid = user.get(UserBoxKey.userMid);
face = Get.arguments['face']!;
heroTag = Get.arguments['heroTag']!;
face = Get.arguments['face'] ?? '';
heroTag = Get.arguments['heroTag'] ?? '';
}
// 获取用户信息

View File

@ -50,33 +50,34 @@ class _MemberPageState extends State<MemberPage>
flexibleSpace: FlexibleSpaceBar(
background: Stack(
children: [
Positioned.fill(
bottom: 10,
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.fitWidth,
image: NetworkImage(_memberController.face!),
alignment: Alignment.topCenter,
isAntiAlias: true,
if (_memberController.face != null)
Positioned.fill(
bottom: 10,
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.fitWidth,
image: NetworkImage(_memberController.face!),
alignment: Alignment.topCenter,
isAntiAlias: true,
),
),
),
foregroundDecoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Theme.of(context)
.colorScheme
.background
.withOpacity(0.44),
Theme.of(context).colorScheme.background,
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
stops: const [0.0, 0.46],
foregroundDecoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Theme.of(context)
.colorScheme
.background
.withOpacity(0.44),
Theme.of(context).colorScheme.background,
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
stops: const [0.0, 0.46],
),
),
),
),
),
Positioned(
left: 0,
right: 0,