set_page.dart 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. import 'dart:math' as math;
  2. import 'package:bbyyy/https/url.dart';
  3. import 'package:bbyyy/my_tools/my_colors.dart';
  4. import 'package:bbyyy/my_tools/my_cookie.dart';
  5. import 'package:bbyyy/my_tools/my_tools.dart';
  6. import 'package:bbyyy/my_tools/my_views.dart';
  7. import 'package:bbyyy/paegs/login_page/login_page.dart';
  8. import 'package:bbyyy/paegs/root_page/root_page_view.dart';
  9. import 'package:flutter/cupertino.dart';
  10. import 'package:flutter/material.dart';
  11. import 'package:flutter_svg/svg.dart';
  12. import 'change_password_page.dart';
  13. class SetPage extends StatefulWidget {
  14. @override
  15. _SetPageState createState() => _SetPageState();
  16. }
  17. class _SetPageState extends State<SetPage> {
  18. @override
  19. Widget build(BuildContext context) {
  20. return Scaffold(
  21. backgroundColor: Colors.white,
  22. body: Column(
  23. children: [
  24. Container(
  25. decoration: BoxDecoration(
  26. gradient: LinearGradient(colors: MyColors.lg),
  27. ),
  28. height: 250,
  29. child: Column(
  30. children: [
  31. SafeArea(
  32. bottom: false,
  33. child: Container(
  34. height: 45,
  35. width: double.infinity,
  36. color: Colors.transparent,
  37. child: Stack(
  38. children: [
  39. Text(
  40. '设置',
  41. style: TextStyle(color: Colors.white, fontSize: 16),
  42. ),
  43. Positioned(
  44. left: 0,
  45. child: GestureDetector(
  46. onTap: () {
  47. Navigator.pop(context);
  48. },
  49. behavior: HitTestBehavior.translucent,
  50. child: Transform.rotate(
  51. angle: math.pi,
  52. child: Padding(
  53. padding: EdgeInsets.only(
  54. left: 16, right: 16, top: 8, bottom: 8),
  55. child: SvgPicture.asset(
  56. 'images/svg/箭头.svg',
  57. color: Colors.white,
  58. height: 14,
  59. ),
  60. ),
  61. ),
  62. ),
  63. ),
  64. ],
  65. alignment: Alignment.center,
  66. ),
  67. ),
  68. ),
  69. Column(
  70. children: [
  71. Container(
  72. margin: EdgeInsets.only(top: 34),
  73. decoration: BoxDecoration(
  74. color: Colors.white,
  75. borderRadius: BorderRadius.all(Radius.circular(35.5)),
  76. boxShadow: [
  77. BoxShadow(
  78. color: MyColors.c7FE1E1E1,
  79. blurRadius: 5.0,
  80. ),
  81. ]),
  82. height: 71,
  83. width: 71,
  84. child: ClipRRect(
  85. child: MyViews().netImg(
  86. imgURL(
  87. MyCookie().loginInformation.data.extra.picture),
  88. 60,
  89. 60),
  90. borderRadius: BorderRadius.all(Radius.circular(30)),
  91. ),
  92. alignment: Alignment.center,
  93. ),
  94. Container(
  95. child: Text(
  96. MyCookie().loginInformation.data.extra.name,
  97. style: TextStyle(color: Colors.white, fontSize: 14),
  98. ),
  99. margin: EdgeInsets.only(top: 14),
  100. )
  101. ],
  102. )
  103. ],
  104. ),
  105. ),
  106. GestureDetector(
  107. onTap: () {
  108. MyTools().toPage(context, ChangePasswordPage(), (then) {});
  109. },
  110. behavior: HitTestBehavior.translucent,
  111. child: Container(
  112. padding: EdgeInsets.only(left: 20, right: 20),
  113. child: Column(
  114. children: [
  115. Row(
  116. children: [
  117. Container(
  118. child: SvgPicture.asset(
  119. 'images/svg/修改密码.svg',
  120. color: MyColors.c333333,
  121. ),
  122. margin: EdgeInsets.only(right: 12, top: 15, bottom: 15),
  123. ),
  124. Expanded(
  125. child: Text(
  126. '修改密码',
  127. style: TextStyle(color: MyColors.c333333, fontSize: 15),
  128. )),
  129. SvgPicture.asset('images/svg/箭头.svg')
  130. ],
  131. ),
  132. Container(
  133. height: 1,
  134. color: MyColors.cEFEFEF,
  135. )
  136. ],
  137. ),
  138. ),
  139. ),
  140. Container(
  141. padding: EdgeInsets.only(left: 20, right: 20),
  142. child: Column(
  143. children: [
  144. Row(
  145. children: [
  146. Container(
  147. child: SvgPicture.asset(
  148. 'images/svg/收入进账提示音.svg',
  149. color: MyColors.c333333,
  150. ),
  151. margin: EdgeInsets.only(right: 12, top: 15, bottom: 15),
  152. ),
  153. Expanded(
  154. child: Text(
  155. '收入进账提示音',
  156. style: TextStyle(color: MyColors.c333333, fontSize: 15),
  157. )),
  158. CupertinoSwitch(
  159. activeColor: MyColors.cFF4233,
  160. value: MyCookie().prefs.getBool('收入进账提示音'),
  161. onChanged: (v) {
  162. MyCookie().prefs.setBool(
  163. '收入进账提示音', !MyCookie().prefs.getBool('收入进账提示音'));
  164. setState(() {});
  165. }),
  166. ],
  167. ),
  168. Container(
  169. height: 1,
  170. color: MyColors.cEFEFEF,
  171. )
  172. ],
  173. ),
  174. ),
  175. Container(
  176. padding: EdgeInsets.only(left: 20, right: 20),
  177. child: Column(
  178. children: [
  179. Row(
  180. children: [
  181. Container(
  182. child: SvgPicture.asset(
  183. 'images/svg/聊天新消息提示音.svg',
  184. color: MyColors.c333333,
  185. ),
  186. margin: EdgeInsets.only(right: 12, top: 15, bottom: 15),
  187. ),
  188. Expanded(
  189. child: Text(
  190. '聊天新消息提示音',
  191. style: TextStyle(color: MyColors.c333333, fontSize: 15),
  192. )),
  193. CupertinoSwitch(
  194. activeColor: MyColors.cFF4233,
  195. value: MyCookie().prefs.getBool('聊天新消息提示音'),
  196. onChanged: (v) {
  197. MyCookie().prefs.setBool('聊天新消息提示音',
  198. !MyCookie().prefs.getBool('聊天新消息提示音'));
  199. setState(() {});
  200. }),
  201. ],
  202. ),
  203. Container(
  204. height: 1,
  205. color: MyColors.cEFEFEF,
  206. )
  207. ],
  208. ),
  209. ),
  210. GestureDetector(
  211. onTap: () {
  212. MyCookie().prefs.clear();
  213. RootPageView().bNIndex = 0;
  214. MyTools().toPage(context, LoginPage(), (then) {}, noBack: true);
  215. },
  216. behavior: HitTestBehavior.translucent,
  217. child: Container(
  218. decoration: BoxDecoration(
  219. color: MyColors.cFF4233,
  220. borderRadius: BorderRadius.all(Radius.circular(22.5))),
  221. height: 45,
  222. margin: EdgeInsets.symmetric(vertical: 101, horizontal: 62),
  223. child: Text(
  224. '退出登录',
  225. style: TextStyle(color: Colors.white, fontSize: 15),
  226. ),
  227. alignment: Alignment.center,
  228. ),
  229. )
  230. ],
  231. ),
  232. );
  233. }
  234. }