set_page.dart 8.6 KB

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