|
|
@@ -37,45 +37,54 @@ class ProfilePage extends BasePage<ProfileController> {
|
|
|
return Stack(
|
|
|
children: [
|
|
|
SafeArea(
|
|
|
+ child: Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ _buildTitle(),
|
|
|
|
|
|
- child: CustomScrollView(
|
|
|
- slivers: [
|
|
|
- SliverToBoxAdapter(
|
|
|
- child: Column(
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- children: [_buildTitle(), SizedBox(height: 26.h)],
|
|
|
- ),
|
|
|
- ),
|
|
|
- // 键盘列表
|
|
|
- Obx(() {
|
|
|
- if (controller.customKeyboardInfoList.isEmpty) {
|
|
|
- return SliverToBoxAdapter(child: _buildKeyboardListItem(
|
|
|
- keyboardInfo: null,
|
|
|
- isChosen: false,
|
|
|
- hasKeyboard: false,
|
|
|
- ));
|
|
|
- }
|
|
|
- return SliverList(
|
|
|
- delegate: SliverChildBuilderDelegate((context, index) {
|
|
|
- KeyboardInfo keyboardInfo =
|
|
|
- controller.customKeyboardInfoList[index];
|
|
|
- return Obx(() {
|
|
|
- return _buildKeyboardListItem(
|
|
|
- keyboardInfo: keyboardInfo,
|
|
|
- isChosen: keyboardInfo.id == controller.currentCustomKeyboardInfo.id,
|
|
|
- hasKeyboard: true,
|
|
|
- );
|
|
|
- });
|
|
|
- }, childCount: controller.customKeyboardInfoList.length),
|
|
|
- );
|
|
|
- }),
|
|
|
+ SizedBox(height: 16.w),
|
|
|
+
|
|
|
+ Expanded(
|
|
|
+ child: Obx(() {
|
|
|
+ final list = controller.customKeyboardInfoList;
|
|
|
+ return CustomScrollView(
|
|
|
+ physics: const ScrollPhysics(),
|
|
|
+ slivers: [
|
|
|
+ SliverToBoxAdapter(child: Container(height: 10.h)),
|
|
|
+ if (list.isEmpty)
|
|
|
+ SliverToBoxAdapter(
|
|
|
+ child: _buildKeyboardListItem(
|
|
|
+ keyboardInfo: null,
|
|
|
+ isChosen: false,
|
|
|
+ hasKeyboard: false,
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ else
|
|
|
+ SliverList(
|
|
|
+ delegate: SliverChildBuilderDelegate((context,
|
|
|
+ index,) {
|
|
|
|
|
|
- SliverToBoxAdapter(
|
|
|
- child: SizedBox(height: 110.h),
|
|
|
+ return Obx(() {
|
|
|
+ final keyboardInfo = list[index];
|
|
|
+ final isChosen =
|
|
|
+ keyboardInfo.id ==
|
|
|
+ controller.currentCustomKeyboardInfo.id;
|
|
|
+ return _buildKeyboardListItem(
|
|
|
+ keyboardInfo: keyboardInfo,
|
|
|
+ isChosen: isChosen,
|
|
|
+ hasKeyboard: true,
|
|
|
+ );
|
|
|
+ });
|
|
|
+ }, childCount: list.length),
|
|
|
+ ),
|
|
|
+
|
|
|
+ SliverToBoxAdapter(child: SizedBox(height: 110.h)),
|
|
|
+ ],
|
|
|
+ );
|
|
|
+ }),
|
|
|
),
|
|
|
],
|
|
|
-
|
|
|
- )
|
|
|
+ ),
|
|
|
),
|
|
|
Positioned(
|
|
|
bottom: 20.h,
|
|
|
@@ -102,8 +111,6 @@ class ProfilePage extends BasePage<ProfileController> {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
// 爱心
|
|
|
_buildLoveIndex(int? intimacy) {
|
|
|
return Container(
|
|
|
@@ -117,45 +124,50 @@ class ProfilePage extends BasePage<ProfileController> {
|
|
|
SizedBox(height: 45.h),
|
|
|
Row(
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- children: [Container(
|
|
|
- padding: EdgeInsets.only(left: 8.w,right: 8.w),
|
|
|
+ children: [
|
|
|
+ Container(
|
|
|
+ padding: EdgeInsets.only(left: 8.w, right: 8.w),
|
|
|
|
|
|
- decoration: ShapeDecoration(
|
|
|
- color: Colors.white,
|
|
|
- shape: RoundedRectangleBorder(
|
|
|
- side: BorderSide(width: 1.18.w, color: const Color(0xFFFD649B)),
|
|
|
- borderRadius: BorderRadius.circular(12.36.r),
|
|
|
- ),
|
|
|
- ),
|
|
|
- child:
|
|
|
- (intimacy != null)
|
|
|
- ? Center(
|
|
|
- child: Text(
|
|
|
- IntimacyUtil.getIntimacyName(intimacy),
|
|
|
- style: TextStyle(
|
|
|
- color: const Color(0xFFFF73E0),
|
|
|
- fontSize: 11.sp,
|
|
|
- fontWeight: FontWeight.w500,
|
|
|
+ decoration: ShapeDecoration(
|
|
|
+ color: Colors.white,
|
|
|
+ shape: RoundedRectangleBorder(
|
|
|
+ side: BorderSide(
|
|
|
+ width: 1.18.w,
|
|
|
+ color: const Color(0xFFFD649B),
|
|
|
+ ),
|
|
|
+ borderRadius: BorderRadius.circular(12.36.r),
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
- )
|
|
|
- : Center(
|
|
|
- child: Text(
|
|
|
- "?",
|
|
|
- style: TextStyle(
|
|
|
- color: const Color(0xFFFF73E0),
|
|
|
- fontSize: 11.sp,
|
|
|
- fontWeight: FontWeight.w500,
|
|
|
+ child:
|
|
|
+ (intimacy != null)
|
|
|
+ ? Center(
|
|
|
+ child: Text(
|
|
|
+ IntimacyUtil.getIntimacyName(intimacy),
|
|
|
+ style: TextStyle(
|
|
|
+ color: const Color(0xFFFF73E0),
|
|
|
+ fontSize: 11.sp,
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ : Center(
|
|
|
+ child: Text(
|
|
|
+ "?",
|
|
|
+ style: TextStyle(
|
|
|
+ color: const Color(0xFFFF73E0),
|
|
|
+ fontSize: 11.sp,
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
),
|
|
|
),
|
|
|
- ),
|
|
|
- ),],)
|
|
|
+ ],
|
|
|
+ ),
|
|
|
],
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
_buildTitle() {
|
|
|
return Container(
|
|
|
alignment: Alignment.centerLeft,
|
|
|
@@ -185,6 +197,7 @@ class ProfilePage extends BasePage<ProfileController> {
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
Widget _buildKeyboardListItem({
|
|
|
KeyboardInfo? keyboardInfo,
|
|
|
bool isChosen = false,
|
|
|
@@ -196,11 +209,15 @@ class ProfilePage extends BasePage<ProfileController> {
|
|
|
final int gender = hasKeyboard ? (keyboardInfo?.gender ?? 1) : 1;
|
|
|
|
|
|
return GestureDetector(
|
|
|
- onTap: hasKeyboard ? () => controller.clickOnChangeKeyboard(keyboardInfo!) : null,
|
|
|
+ onTap:
|
|
|
+ hasKeyboard
|
|
|
+ ? () => controller.clickOnChangeKeyboard(keyboardInfo!)
|
|
|
+ : null,
|
|
|
child: Container(
|
|
|
height: 164.h,
|
|
|
margin: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 12.h),
|
|
|
- decoration: isChosen
|
|
|
+ decoration:
|
|
|
+ isChosen
|
|
|
? ShapeDecoration(
|
|
|
gradient: LinearGradient(
|
|
|
begin: Alignment(0.02, 0.04),
|
|
|
@@ -261,7 +278,13 @@ class ProfilePage extends BasePage<ProfileController> {
|
|
|
),
|
|
|
Expanded(
|
|
|
child: Container(
|
|
|
- margin: isChosen ? EdgeInsets.symmetric(horizontal: 4.w, vertical: 4.w) : EdgeInsets.zero,
|
|
|
+ margin:
|
|
|
+ isChosen
|
|
|
+ ? EdgeInsets.symmetric(
|
|
|
+ horizontal: 4.w,
|
|
|
+ vertical: 4.w,
|
|
|
+ )
|
|
|
+ : EdgeInsets.zero,
|
|
|
decoration: ShapeDecoration(
|
|
|
color: Colors.white,
|
|
|
shape: RoundedRectangleBorder(
|
|
|
@@ -292,7 +315,12 @@ class ProfilePage extends BasePage<ProfileController> {
|
|
|
? _buildProfileAvatar(
|
|
|
imageUrl: keyboardAvatar,
|
|
|
gender: gender,
|
|
|
- onTap: () => controller.clickAvatar(isUser: false,keyboardInfo:keyboardInfo),
|
|
|
+ onTap:
|
|
|
+ () =>
|
|
|
+ controller.clickAvatar(
|
|
|
+ isUser: false,
|
|
|
+ keyboardInfo: keyboardInfo,
|
|
|
+ ),
|
|
|
genderIconAlignment: Alignment.topLeft,
|
|
|
)
|
|
|
: _buildKeyboardListEmptyAvatar(
|
|
|
@@ -309,6 +337,7 @@ class ProfilePage extends BasePage<ProfileController> {
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
// 头像
|
|
|
Widget _buildProfileAvatar({
|
|
|
required String? imageUrl,
|
|
|
@@ -406,7 +435,6 @@ class ProfilePage extends BasePage<ProfileController> {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// 没有Keyboard时
|
|
|
_buildKeyboardListEmptyAvatar({required VoidCallback? onTap}) {
|
|
|
return GestureDetector(
|
|
|
@@ -418,7 +446,7 @@ class ProfilePage extends BasePage<ProfileController> {
|
|
|
margin: EdgeInsets.only(bottom: 10.h),
|
|
|
width: 78.w,
|
|
|
height: 78.w,
|
|
|
- child: DottedBorder(
|
|
|
+ child: DottedBorder(
|
|
|
color: const Color(0xFFA595C8),
|
|
|
strokeWidth: 1.0.w,
|
|
|
borderType: BorderType.Circle,
|
|
|
@@ -448,13 +476,10 @@ class ProfilePage extends BasePage<ProfileController> {
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
- )
|
|
|
+ ),
|
|
|
),
|
|
|
-
|
|
|
],
|
|
|
),
|
|
|
);
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
}
|