YSSettingSystem.dart 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. import 'package:flutter/cupertino.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:flutter_wallet/base/YSBase.dart';
  4. import 'package:flutter_wallet/generated/l10n.dart';
  5. import 'package:flutter_wallet/login/view/YSHelpView.dart';
  6. import 'package:flutter_wallet/setting/YSAgreement.dart';
  7. import 'package:flutter_wallet/setting/YSSettingLanguage.dart';
  8. import 'package:flutter_wallet/setting/YSSettingThem.dart';
  9. import 'package:flutter_wallet/setting/YSSettingUnit.dart';
  10. import 'package:flutter_wallet/tools/YSAlertView.dart';
  11. import 'package:flutter_wallet/tools/YSColors.dart';
  12. import 'package:flutter_wallet/tools/YSNetWork.dart';
  13. import 'package:flutter_wallet/tools/YSSqflite.dart';
  14. import 'package:flutter_wallet/tools/YSTools.dart';
  15. import '../wallet/YSWalletRocChoose.dart';
  16. import 'YSSettingPrice.dart';
  17. class YSSettingSystem extends StatefulWidget {
  18. const YSSettingSystem({Key? key}) : super(key: key);
  19. @override
  20. YSSettingSystemState createState() => YSSettingSystemState();
  21. }
  22. class YSSettingSystemState extends State<YSSettingSystem> {
  23. @override
  24. Widget build(BuildContext context) {
  25. List _menuArray = [
  26. {'title':S.current.YUYAN,'type':1,'value':'','key':1},
  27. {'title':S.current.JIEDIANSHEZHI,'type':1,'value':'','key':2},
  28. {'title':S.current.ZHUTIMOSHI,'type':1,'value':'','key':3},
  29. {'title':S.current.HUOBIDANWEI,'type':1,'value':'','key':4},
  30. {'title':S.current.HANGQINGSHEZHI,'type':3,'value':'','key':5},
  31. {'title':S.current.ZHANGDIEFUJIZHUN,'type':1,'value':'','key':6},
  32. {'title':S.current.YINGYONGSUO,'type':2,'value':'','key':7},
  33. // {'title':S.current.YIJIANQIANYI,'type':1,'value':'','key':8},
  34. // {'title':S.current.DAPPBAIMINGDAN,'type':1,'value':'','key':9},
  35. // {'title':S.current.KAIQINOSTR,'type':2,'value':'','key':10},
  36. // {'title':S.current.KAIFAZHEMOSHI,'type':2,'value':'','key':11},
  37. // {'title':S.current.WANGLUOJIANCE,'type':1,'value':'','key':12},
  38. {'title':S.current.QINGCHUHUANCUN,'type':1,'value':'','key':13},
  39. // {'title':'日志信息','type':1,'value':'','key':14}
  40. ];
  41. return YSBase(
  42. ysTitle: S.current.XITONGSHEZHI2,
  43. ysChild: ListView.separated(
  44. itemBuilder: (context,index){
  45. Map item = _menuArray[index];
  46. return GestureDetector(
  47. onTap: () {
  48. int key = item['key'];
  49. switch(key){
  50. case 1:{
  51. Navigator.of(context).push(
  52. CupertinoPageRoute(builder: (context){
  53. return const YSSettingLanguage();
  54. })
  55. ).then((value) {
  56. setState(() {});
  57. });
  58. }
  59. break;
  60. case 2:{
  61. Navigator.of(context).push(
  62. CupertinoPageRoute(builder: (context){
  63. return const YSWalletRocChoose();
  64. })
  65. );
  66. }
  67. break;
  68. case 3:{
  69. Navigator.of(context).push(
  70. CupertinoPageRoute(builder: (context){
  71. return const YSSettingThem();
  72. })
  73. );
  74. }
  75. break;
  76. case 4:{
  77. Navigator.of(context).push(
  78. CupertinoPageRoute(builder: (context){
  79. return const YSSettingUnit();
  80. })
  81. );
  82. }
  83. break;
  84. case 5:{
  85. Navigator.of(context).push(
  86. CupertinoPageRoute(builder: (context){
  87. return const YSSettingPrice();
  88. })
  89. );
  90. }
  91. break;
  92. case 6:{}
  93. break;
  94. case 7:{}
  95. break;
  96. case 8:{}
  97. break;
  98. case 9:{}
  99. break;
  100. case 10:{}
  101. break;
  102. case 11:{}
  103. break;
  104. case 12:{}
  105. break;
  106. case 13:{
  107. ysShowCenterAlertView(context, YSTipsAlertView(valueSetter: (value) async{
  108. if(value){
  109. int status = await YSSqflite3().delete();
  110. LogUtil.d(status);
  111. ysFlutterToast(S.current.HAUNCUNYIQINGCHU);
  112. }
  113. },tipsStr: '${S.current.QINGCHUHUANCUN}?',));
  114. }
  115. break;
  116. case 14:{
  117. Navigator.of(context).push(
  118. CupertinoPageRoute(builder: (context){
  119. return const YSAgreement(type: 3);
  120. })
  121. );
  122. }
  123. break;
  124. }
  125. },
  126. behavior: HitTestBehavior.opaque,
  127. child: Container(
  128. height: hsp(45),
  129. color: YSColors.containColor(context),
  130. padding: EdgeInsets.only(left: hsp(15),right: hsp(15)),
  131. child: Row(
  132. children: [
  133. Expanded(
  134. child: Text(item['title'],style: YSColors.contentStyle(context),)
  135. ),
  136. Expanded(
  137. child: Text(item['value'],style: YSColors.contentStyle(context),)
  138. ),
  139. item['type']==2?YSSWitchView(
  140. valueSetter: (value){
  141. YSSharedPreferences.setStringValue('lock', value?'1':'0');
  142. },
  143. type: 3,
  144. ):Icon(Icons.chevron_right,size: hsp(20),color: YSColors.shadowColor(context),)
  145. ],
  146. ),
  147. ),
  148. );
  149. },
  150. separatorBuilder: (context,index){
  151. return Container(height: hsp(index==2||index==5||index==6||index==7?20:0),);
  152. },
  153. itemCount: _menuArray.length,
  154. padding: const EdgeInsets.all(0),
  155. shrinkWrap: true,
  156. physics: const NeverScrollableScrollPhysics(),
  157. ),
  158. );
  159. }
  160. }