UserInfo.dart 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_screenutil/flutter_screenutil.dart';
  3. import 'package:get/get.dart';
  4. import '../../../../../models/app.dart';
  5. class UserInfo extends StatelessWidget {
  6. AppController userInfo = AppController.t;
  7. UserInfo({Key? key}) : super(key: key);
  8. @override
  9. Widget build(BuildContext context) {
  10. print(userInfo.user().phone);
  11. return Container(
  12. margin: EdgeInsets.only(top: 20.0, bottom: 0.0),
  13. alignment: Alignment.center,
  14. height: 173.w,
  15. width: 345.w,
  16. decoration: BoxDecoration(
  17. image: const DecorationImage(
  18. image: AssetImage("images/mineBack.png"),
  19. fit: BoxFit.cover,
  20. ),
  21. borderRadius: BorderRadius.circular(10),
  22. ),
  23. child: Stack(
  24. fit: StackFit.expand,
  25. children: [
  26. Positioned(
  27. top: 0,
  28. right: 0,
  29. child: Container(
  30. alignment: Alignment.center,
  31. height: 24.w,
  32. width: 93.w,
  33. decoration: const BoxDecoration(
  34. borderRadius: BorderRadius.only(
  35. bottomLeft: Radius.circular(20),
  36. topRight: Radius.circular(20)),
  37. color: Color(0x30000000),
  38. ),
  39. child: GestureDetector(
  40. child: const Text(
  41. '修改个人信息',
  42. style: TextStyle(color: Colors.white, fontSize: 14),
  43. ),
  44. onTap: () {
  45. Get.toNamed('/userInfo');
  46. },
  47. )),
  48. ),
  49. Row(
  50. children: [
  51. Column(
  52. mainAxisAlignment: MainAxisAlignment.center,
  53. children: [
  54. Container(
  55. width: 63.w,
  56. height: 63.w,
  57. decoration: BoxDecoration(
  58. shape: BoxShape.circle,
  59. image: userInfo.user().avatar != null
  60. ? DecorationImage(
  61. image: NetworkImage(
  62. userInfo.user().avatar.toString()),
  63. fit: BoxFit.cover,
  64. )
  65. : DecorationImage(
  66. image: AssetImage('images/userMoren.png')),
  67. border: Border.all(
  68. color: Colors.white,
  69. width: 2,
  70. ),
  71. ),
  72. margin: EdgeInsets.fromLTRB(30, 0, 15, 0),
  73. ),
  74. ],
  75. ),
  76. Container(
  77. child: Column(
  78. mainAxisAlignment: MainAxisAlignment.center,
  79. crossAxisAlignment: CrossAxisAlignment.start,
  80. children: [
  81. Container(
  82. margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
  83. child: Text(
  84. userInfo.user().nickName != null
  85. ? userInfo.user().nickName.toString()
  86. : '请修改个人信息!',
  87. style: TextStyle(
  88. color: Colors.white,
  89. fontSize: 17,
  90. ),
  91. ),
  92. ),
  93. Container(
  94. margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
  95. child: Text(
  96. userInfo.user().phone != null
  97. ? userInfo.user().phone.toString()
  98. : '请修改手机号!',
  99. style: TextStyle(
  100. color: Colors.white,
  101. fontSize: 17,
  102. ),
  103. ),
  104. ),
  105. // const Text(
  106. // '点击登陆',
  107. // style: TextStyle(
  108. // color: Colors.white,
  109. // fontSize: 17,
  110. // ),
  111. // ),
  112. ],
  113. ),
  114. ),
  115. ],
  116. ),
  117. ],
  118. ),
  119. );
  120. }
  121. }