show_personInfo_dia_Widget.dart 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. import 'package:flutter/material.dart';
  2. import 'package:common_project/common_project.dart';
  3. /**
  4. * des:
  5. */
  6. class ShowPersonInfoDiaWidget {
  7. static void showRoomUserInfoDia(BuildContext context, String userId) async {
  8. TimiUserInfo model = await PublicApi.getUserInfo(userId: userId);
  9. if (model.success == true && model.data != null){
  10. DialogAddWidget(
  11. context: context,
  12. gravity: Gravity.bottom,
  13. decoration: BoxDecoration(
  14. color: Colors.transparent
  15. ),
  16. borderRadius: 0.0,
  17. barrierColor: Colors.transparent,
  18. backgroundColor: Colors.transparent,
  19. widget: Container(
  20. width: Sizes.width,
  21. color: Colors.transparent,
  22. child: Column(
  23. children: [
  24. stackContent(model.data),
  25. Container(width: Sizes.width,color: Colors.red,height: 1.h,),
  26. // content([PersonApplyItem("关注",null),PersonApplyItem("私信", null),PersonApplyItem("@TA", null),PersonApplyItem("送礼物", null),PersonApplyItem("上麦", "room_icon_up")],context)
  27. ],
  28. ),
  29. )
  30. );
  31. }
  32. }
  33. Widget _sexAgewealthLevelstarLevel( int age, int sex, wealthLevel, starLevel){
  34. return Row(
  35. children: [
  36. _ageWidget(age,sex),
  37. Image.asset("assets/money_icon/label_caifu_lv${wealthLevel}.png",
  38. width: 64.w,height: 40.h,package: ModuleName.Module_project,),
  39. Image.asset("assets/money_icon/label_meili_lv${starLevel}.png",
  40. width: 64.w,height: 40.h,package: ModuleName.Module_project,)
  41. ],
  42. );
  43. }
  44. static Widget _ageWidget( int age, int userSex){
  45. return Container(
  46. height: 40.h,
  47. child: Stack(
  48. alignment: Alignment.centerRight,
  49. children: [
  50. // Image.asset(bloc.state.user!.data!.userSex! == 0?"label_gender_boy":"setting",package: ModuleName.Module_Me,width: 64.w,height: 40.h),
  51. Image.asset(userSex == 1? "assets/other_icon/label_gender_boy.png":"assets/other_icon/label_gender_gril.png",width: 64.w,height: 40.h,package: ModuleName.Module_project),
  52. Positioned(
  53. right: 8.w,
  54. child: Text("${age}",style: TextStyle(fontSize: Sizes.fs_20,color: Colors.white),))
  55. ],),
  56. );
  57. }
  58. static Widget content(List<PersonApplyItem> items, context){
  59. return Container(
  60. width: Sizes.width,
  61. color: HexColor.fromHex("#2F3243"),
  62. padding: EdgeInsets.only(left: 64.w,bottom: 80.h,top: 26.h),
  63. child: Wrap(
  64. spacing: 94.w,
  65. runSpacing: 40.h,
  66. children: items.map((e) {
  67. return InkWell(
  68. child: Container(
  69. child: e.img != null? Column(
  70. children: [
  71. ImageUtil.loadImage(ImageUtil.getImgPath(e.img!),package: ModuleName.Module_chat,width: 48.w,height: 48.w),
  72. Text("${e.title}",style: TextStyle(fontSize: Sizes.fs_32,color: Colors.white),),
  73. ],
  74. ):Text("${e.title}",style: TextStyle(fontSize: Sizes.fs_32,color: Colors.white),)
  75. ),
  76. onTap: (){
  77. DialogAddWidget(
  78. context: context,
  79. gravity: Gravity.bottom,
  80. decoration: BoxDecoration(
  81. color: Colors.transparent
  82. ),
  83. borderRadius: 0.0,
  84. barrierColor: Colors.transparent,
  85. backgroundColor: Colors.transparent,
  86. widget: Container(
  87. width: Sizes.width,
  88. height: 300.h,
  89. color: Colors.red,
  90. )
  91. );
  92. },
  93. );
  94. }).toList(),
  95. ),
  96. );
  97. }
  98. static Stack stackContent(UserInfoData model) {
  99. return Stack(
  100. alignment: Alignment.center,
  101. children: [
  102. Container(
  103. margin: EdgeInsets.only(top: 70.h),
  104. width: Sizes.width,
  105. height: 330.h,
  106. decoration: BoxDecoration(
  107. borderRadius: BorderRadius.only(topLeft: Radius.circular(30.w),topRight: Radius.circular(30.w)),
  108. color: HexColor.fromHex("#2F3243"),
  109. ),
  110. ),
  111. Container(
  112. child: Column(
  113. children: [
  114. Stack(
  115. alignment: Alignment.center,
  116. children: [
  117. Container(
  118. width: 150.w,
  119. height: 150.w,
  120. decoration: BoxDecoration(
  121. borderRadius: BorderRadius.all(Radius.circular(75.w)),
  122. color: HexColor.fromHex("#2F3243")
  123. ),
  124. ),
  125. ClipOval(child: ImageUtil.loadImage("${model.userAvatar}",width: 144.w,height: 144.w),),
  126. ],
  127. ),
  128. Container(
  129. margin: EdgeInsets.only(top: 16.h),
  130. child: Text("我是小可爱",style: TextStyle(fontSize: Sizes.fs_36,color: Colors.white),),),
  131. Container(
  132. alignment: Alignment.center,
  133. child: Row(
  134. mainAxisSize: MainAxisSize.min,
  135. crossAxisAlignment: CrossAxisAlignment.center,
  136. children: [
  137. _ageWidget(model.userAge!,model.userSex!),
  138. SizedBox(width: 10.w,),
  139. Image.asset("assets/money_icon/label_caifu_lv${model.wealthLevel}.png",
  140. width: 64.w,height: 40.h,package: ModuleName.Module_project,),
  141. SizedBox(width: 10.w,),
  142. Image.asset("assets/money_icon/label_meili_lv${model.starLevel}.png",
  143. width: 64.w,height: 40.h,package: ModuleName.Module_project,),
  144. ],),),
  145. SizedBox(height: 32.h,),
  146. Container(child: Text("ID: ${model.userId} 粉丝: ${model.followCount}",style: TextStyle(fontSize: Sizes.fs_24,color: Colors.white.withOpacity(0.5)),)
  147. ,),
  148. SizedBox(height: 10.h,),
  149. Container(
  150. margin: EdgeInsets.only(bottom: Sizes.bottomSafeHeight),
  151. child: Text("${model.userSign}",style: TextStyle(fontSize: Sizes.fs_24,color: Colors.white.withOpacity(0.5)),),),
  152. ],
  153. ),),
  154. Positioned(
  155. left: 32.w,
  156. top: 100.h,
  157. child: Text("举报",style: TextStyle(fontSize: Sizes.fs_24,color: Colors.white.withOpacity(0.5)),))
  158. ],
  159. );
  160. }
  161. }
  162. class PersonApplyItem {
  163. String? title;
  164. String? img;
  165. PersonApplyItem(this.title,this.img);
  166. }