index.dart 7.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter/src/widgets/framework.dart';
  3. import 'package:flutter_easyloading/flutter_easyloading.dart';
  4. import 'package:flutter_screenutil/flutter_screenutil.dart';
  5. import 'package:farmer_client/widgets/layout/BasicPage.dart';
  6. import 'package:farmer_client/utils/timer.dart';
  7. import 'package:farmer_client/widgets/DefaultButton.dart';
  8. class ResetPassword extends BasicPage {
  9. ResetPassword({Key? key}) : super(key: key) {
  10. naviTitle = '修改密码';
  11. }
  12. @override
  13. Widget builder(BuildContext context) {
  14. return Container(
  15. padding: EdgeInsets.all(15.w),
  16. decoration: const BoxDecoration(color: Colors.white),
  17. child: Column(
  18. children: [
  19. Expanded(
  20. flex: 1,
  21. child: ListView(
  22. children: [
  23. Container(
  24. width: 345.w,
  25. alignment: Alignment.centerLeft,
  26. margin: EdgeInsets.only(top: 40.h),
  27. decoration: BoxDecoration(
  28. color: Colors.white,
  29. boxShadow: [
  30. BoxShadow(
  31. color: const Color(0x1f000000),
  32. offset: Offset(0, 1.w))
  33. ],
  34. ),
  35. child: Column(
  36. crossAxisAlignment: CrossAxisAlignment.start,
  37. children: [
  38. Text(
  39. '原始密码:',
  40. style: TextStyle(
  41. color: const Color(0xFF333333),
  42. fontSize: 17.sp,
  43. fontWeight: FontWeight.bold,
  44. letterSpacing: 2),
  45. ),
  46. Container(
  47. height: 54.h,
  48. alignment: Alignment.centerLeft,
  49. child: Row(
  50. children: [
  51. Expanded(
  52. flex: 1,
  53. child: TextField(
  54. style: TextStyle(
  55. fontSize: 17.sp,
  56. fontWeight: FontWeight.bold,
  57. color: const Color(0xff333333)),
  58. decoration: const InputDecoration(
  59. isCollapsed: true,
  60. hintText: '请输入原始密码',
  61. counterText: '', //去掉右下角的东西
  62. border: InputBorder.none,
  63. floatingLabelBehavior:
  64. FloatingLabelBehavior.never,
  65. ),
  66. onChanged: (val) {
  67. },
  68. ),
  69. ),
  70. GestureDetector(
  71. behavior: HitTestBehavior.opaque,
  72. onTap: () {},
  73. child: Container(
  74. width: 50.w,
  75. alignment: Alignment.center,
  76. child: Image.asset(
  77. 'images/icons/cancel.png',
  78. width: 18.w,
  79. ),
  80. ),
  81. )
  82. ],
  83. ),
  84. ),
  85. ],
  86. ),
  87. ),
  88. Container(
  89. width: 345.w,
  90. alignment: Alignment.centerLeft,
  91. margin: EdgeInsets.only(top: 40.h),
  92. decoration: BoxDecoration(
  93. color: Colors.white,
  94. boxShadow: [
  95. BoxShadow(
  96. color: Color(0x1f000000), offset: Offset(0, 1.w))
  97. ],
  98. ),
  99. child: Column(
  100. crossAxisAlignment: CrossAxisAlignment.start,
  101. children: [
  102. Text(
  103. '新密码:',
  104. style: TextStyle(
  105. color: const Color(0xFF333333),
  106. letterSpacing: 2,
  107. fontSize: 17.sp,
  108. fontWeight: FontWeight.bold),
  109. ),
  110. Container(
  111. height: 54.h,
  112. alignment: Alignment.centerLeft,
  113. child: Row(
  114. children: [
  115. Expanded(
  116. flex: 1,
  117. child: TextField(
  118. //赋初值
  119. maxLength: 11,
  120. keyboardType: TextInputType.number,
  121. style: TextStyle(
  122. fontSize: 17.sp,
  123. fontWeight: FontWeight.bold,
  124. color: const Color(0xff333333)),
  125. decoration: const InputDecoration(
  126. isCollapsed: true,
  127. hintText: '请输入新密码',
  128. counterText: '', //去掉右下角的东西
  129. border: InputBorder.none,
  130. floatingLabelBehavior:
  131. FloatingLabelBehavior.never,
  132. ),
  133. onChanged: (val) {
  134. },
  135. ),
  136. ),
  137. GestureDetector(
  138. behavior: HitTestBehavior.opaque,
  139. onTap: () {
  140. },
  141. child: Container(
  142. width: 50.w,
  143. alignment: Alignment.center,
  144. child: Image.asset(
  145. 'images/icons/cancel.png',
  146. width: 18.w,
  147. ),
  148. ),
  149. ),
  150. ],
  151. ),
  152. ),
  153. ],
  154. ),
  155. ),
  156. ],
  157. ),
  158. ),
  159. Padding(
  160. padding: EdgeInsets.only(bottom: 15.w),
  161. child: DefaultButton(
  162. text: '保存',
  163. color: const Color(0xffffffff),
  164. backColor: const Color(0xFFFF703B),
  165. width: 345.w,
  166. height: 49.h,
  167. onPressed: () {
  168. EasyLoading.show(status: '请稍候...');
  169. setTimeout(() {
  170. EasyLoading.showToast("网络超时, 请稍后再试");
  171. setTimeout(() {
  172. EasyLoading.dismiss();
  173. }, 1500);
  174. }, 3000);
  175. },
  176. margin: const EdgeInsets.all(0),
  177. fontSize: 20.sp,
  178. radius: 24.5.w,
  179. ),
  180. ),
  181. ],
  182. ),
  183. );
  184. }
  185. }