index.dart 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_screenutil/flutter_screenutil.dart';
  3. import 'package:fluttertoast/fluttertoast.dart';
  4. import 'package:get/get.dart';
  5. class UserInfo extends StatefulWidget {
  6. const UserInfo({Key? key}) : super(key: key);
  7. @override
  8. _UserInfo createState() => _UserInfo();
  9. }
  10. class _UserInfo extends State<UserInfo> {
  11. String name = '';
  12. @override
  13. Widget build(BuildContext context) {
  14. return Scaffold(
  15. appBar: AppBar(
  16. elevation: 0,
  17. centerTitle: true,
  18. backgroundColor: Colors.white,
  19. title: Text(
  20. '个人信息',
  21. style: TextStyle(
  22. color: Colors.black,
  23. fontSize: 17.sp,
  24. letterSpacing: 2,
  25. fontWeight: FontWeight.bold),
  26. ),
  27. ),
  28. body: Container(
  29. color: Color(0xFFffffff),
  30. padding: EdgeInsets.all(15.w),
  31. child: Column(
  32. crossAxisAlignment: CrossAxisAlignment.start,
  33. children: [
  34. Container(
  35. margin: EdgeInsets.fromLTRB(0, 0, 0, 40.h),
  36. padding: EdgeInsets.symmetric(vertical: 15.h, horizontal: 0),
  37. decoration: BoxDecoration(
  38. color: const Color(0xFFFFFFFF),
  39. boxShadow: [
  40. BoxShadow(
  41. color: const Color(0x1F000000),
  42. offset: Offset(0, 1.w),
  43. blurRadius: 0,
  44. ),
  45. ],
  46. ),
  47. child: Row(
  48. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  49. children: [
  50. Image.asset(
  51. 'images/userMoren.png',
  52. width: 62.w,
  53. height: 62.w,
  54. ),
  55. Text(
  56. '更换头像',
  57. style: TextStyle(
  58. fontSize: 17.sp,
  59. color: Color(0xFF333333),
  60. letterSpacing: 2,
  61. fontWeight: FontWeight.w500),
  62. ),
  63. ]),
  64. ),
  65. Text(
  66. '姓名:',
  67. style: TextStyle(
  68. color: const Color(0xFF333333),
  69. fontSize: 17.sp,
  70. letterSpacing: 2,
  71. fontWeight: FontWeight.bold),
  72. ),
  73. Container(
  74. margin: EdgeInsets.fromLTRB(0, 20.h, 0, 40.h),
  75. padding: EdgeInsets.symmetric(vertical: 19.h, horizontal: 0),
  76. decoration: BoxDecoration(
  77. color: const Color(0xFFFFFFFF),
  78. boxShadow: [
  79. BoxShadow(
  80. color: const Color(0x1F000000),
  81. offset: Offset(0, 1.w),
  82. blurRadius: 0,
  83. ),
  84. ],
  85. ),
  86. child: Column(
  87. children: [
  88. Row(
  89. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  90. children: [
  91. Container(
  92. width: 200.w,
  93. child: TextFormField(
  94. initialValue: name,
  95. style: TextStyle(
  96. color: Color(0xFF333333),
  97. fontSize: 17.sp,
  98. letterSpacing: 2,
  99. fontWeight: FontWeight.bold),
  100. decoration: const InputDecoration(
  101. isCollapsed: true,
  102. hintText: '请输入您的姓名',
  103. border: InputBorder.none,
  104. counterText: '', //去掉计数
  105. floatingLabelBehavior:
  106. FloatingLabelBehavior.never,
  107. ),
  108. onChanged: (e) {},
  109. ),
  110. ),
  111. Image.asset(
  112. 'images/icons/cancel.png',
  113. width: 18.w,
  114. height: 18.w,
  115. )
  116. ]),
  117. ],
  118. )),
  119. ],
  120. ),
  121. ),
  122. );
  123. }
  124. }