11import 'package:flutter/material.dart' ;
22import 'package:flutter_tabler_icons/flutter_tabler_icons.dart' ;
33import 'package:hooks_riverpod/hooks_riverpod.dart' ;
4+ import 'package:moekey/widgets/mk_card.dart' ;
5+ import 'package:moekey/widgets/mk_image.dart' ;
46import 'package:moekey/widgets/mk_input.dart' ;
57import 'package:moekey/widgets/mk_scaffold.dart' ;
68
@@ -31,6 +33,7 @@ class SettingsProfile extends HookConsumerWidget {
3133 mainAxisAlignment: MainAxisAlignment .start,
3234 crossAxisAlignment: CrossAxisAlignment .start,
3335 children: [
36+ _ProfileMemberCard (),
3437 MkFormItem (
3538 label: "昵称" ,
3639 child: MkInput (
@@ -42,8 +45,8 @@ class SettingsProfile extends HookConsumerWidget {
4245 label: "个人简介" ,
4346 helperText: "你可以在个人简介中包含一些#标签。" ,
4447 child: MkInput (
45- maxLines: 3 ,
4648 value: meDetail.description,
49+ minLines: 3 ,
4750 ),
4851 ),
4952 MkFormItem (
@@ -95,3 +98,75 @@ class MkFormItem extends HookConsumerWidget {
9598 );
9699 }
97100}
101+
102+ class _ProfileMemberCard extends HookConsumerWidget {
103+ const _ProfileMemberCard ({super .key});
104+
105+ @override
106+ Widget build (BuildContext context, WidgetRef ref) {
107+ var meDetail = ref.watch (currentMeDetailedProvider).valueOrNull;
108+ return SizedBox (
109+ height: 216 ,
110+ child: MkCard (
111+ padding: EdgeInsets .zero,
112+ child: SizedBox (
113+ height: 130 ,
114+ child: Stack (
115+ children: [
116+ Positioned (
117+ top: 0 ,
118+ left: 0 ,
119+ right: 0 ,
120+ child: [
121+ if (meDetail? .bannerUrl != null )
122+ MkImage (
123+ meDetail! .bannerUrl! ,
124+ fit: BoxFit .cover,
125+ blurHash: meDetail.bannerBlurhash,
126+ width: double .infinity,
127+ height: 130 ,
128+ )
129+ else
130+ Container (
131+ color: const Color .fromARGB (40 , 0 , 0 , 0 ),
132+ height: 130 ,
133+ ),
134+ ][0 ],
135+ ),
136+ Positioned (
137+ right: 10 ,
138+ top: 10 ,
139+ child: FilledButton (
140+ onPressed: () {},
141+ child: const Text (
142+ "修改横幅" ,
143+ style: TextStyle (fontWeight: FontWeight .w600, fontSize: 13 ),
144+ ),
145+ ),
146+ ),
147+ Positioned (
148+ bottom: 16 ,
149+ left: 0 ,
150+ right: 0 ,
151+ child: Column (
152+ mainAxisAlignment: MainAxisAlignment .center,
153+ spacing: 16 ,
154+ children: [
155+ MkImage (
156+ meDetail? .avatarUrl ?? "" ,
157+ width: 72 ,
158+ height: 72 ,
159+ shape: BoxShape .circle,
160+ fit: BoxFit .cover,
161+ ),
162+ FilledButton (onPressed: () {}, child: Text ("修改头像" )),
163+ ],
164+ ),
165+ )
166+ ],
167+ ),
168+ ),
169+ ),
170+ );
171+ }
172+ }
0 commit comments