hyzp_ybqx-Commit006:准备实现“账户管理”项目功能

master
WinUser01 4 years ago
parent 915e5a687c
commit e3f60ada1f

@ -9,6 +9,7 @@ import 'package:hyzp_ybqx/components/commonFun.dart';
import 'package:hyzp_ybqx/pages/Login/FaceLogin.dart'; import 'package:hyzp_ybqx/pages/Login/FaceLogin.dart';
import 'package:hyzp_ybqx/pages/Login/FaceReg.dart'; import 'package:hyzp_ybqx/pages/Login/FaceReg.dart';
import 'package:hyzp_ybqx/pages/MyMsics/05_updated/MyUpdatedNew.dart'; import 'package:hyzp_ybqx/pages/MyMsics/05_updated/MyUpdatedNew.dart';
import 'package:hyzp_ybqx/pages/tabs/page5_userManager.dart';
import 'package:hyzp_ybqx/widget/JdButton.dart'; import 'package:hyzp_ybqx/widget/JdButton.dart';
import 'package:package_info/package_info.dart'; import 'package:package_info/package_info.dart';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
@ -177,7 +178,7 @@ class _Page4_MyMsicsNewState extends State<Page4_MyMsicsNew>
_getListTile('账户管理', _getListTile('账户管理',
leadPath: 'assets/images/账户管理.png', leadPath: 'assets/images/账户管理.png',
leadColor: _deepBlueColor, leadColor: _deepBlueColor,
onTapFun: OnTap_modify_password), onTapFun: OnTap_user_manager),
//bNewVer //bNewVer
_getListTile('版本更新', _getListTile('版本更新',
leadPath: 'assets/images/版本更新.png', leadPath: 'assets/images/版本更新.png',
@ -454,6 +455,10 @@ class _Page4_MyMsicsNewState extends State<Page4_MyMsicsNew>
Navigator.of(context).push(MaterialPageRoute(builder: (context) => FaceReg())); Navigator.of(context).push(MaterialPageRoute(builder: (context) => FaceReg()));
} }
OnTap_user_manager() {
Navigator.of(context).push(MaterialPageRoute(builder: (context) => page5_userManager()));
}
OnTap_modify_password() { OnTap_modify_password() {
Navigator.of(context).push(MaterialPageRoute(builder: (context) => ModifyPassword())); Navigator.of(context).push(MaterialPageRoute(builder: (context) => ModifyPassword()));
} }

@ -0,0 +1,732 @@
import 'dart:io';
import 'package:badges/badges.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:hyzp_ybqx/components/commonFun.dart';
import 'package:hyzp_ybqx/pages/Login/FaceLogin.dart';
import 'package:hyzp_ybqx/pages/Login/FaceReg.dart';
import 'package:hyzp_ybqx/pages/MyMsics/05_updated/MyUpdatedNew.dart';
import 'package:hyzp_ybqx/pages/Works/TJXX/tj_data.dart';
import 'package:hyzp_ybqx/widget/JdButton.dart';
import 'package:package_info/package_info.dart';
import 'package:path_provider/path_provider.dart';
import '../../components/commonFun.dart';
import '../../components/customDialogF.dart';
import '../../services/Storage.dart';
//import 'package:hyzp_ybqx/widget/player_pro.dart';
import '../Login/ModifyPassword.dart';
import '../MyMsics/03_personal/PersonalData.dart';
import '../MyMsics/04_MyFeedback/MyFeedback.dart';
import '../MyMsics/07_myAbout/MyAbout.dart';
///flutterWidget 2019.08.07 15:46:08 https://www.jianshu.com/p/b16f70dd692c
//flutterWidgetStatefulWidgetStateState
// iOSflutterkeyWidgetKey
// FlutterkeyGlobalKeyLocalKeyUniqueKeyObjectKeyGlobalKeykey
// 使WidgetGlobalKeykeyWidget
//key
//GlobalKey<MyFijkPanelWidgetBuilderState> _myFijkPanelWidgetBuilderStateKey = new GlobalKey<MyFijkPanelWidgetBuilderState>();
class page5_userManager extends StatefulWidget {
page5_userManager({@required this.title, Key key}) : super(key: key);
String title = '';
@override
_page5_userManagerState createState() => _page5_userManagerState();
}
//class _Page1WorkState extends State<Page1Work> with WidgetsBindingObserver, AutomaticKeepAliveClientMixin {
class _page5_userManagerState extends State<page5_userManager>
with WidgetsBindingObserver, AutomaticKeepAliveClientMixin {
//Begin使PageViewwith AutomaticKeepAliveClientMixin
//try_setState(); //
try_setState() {
try {
setState(() {});
} catch (e) {
print('setState(() {})异常:${e}');
}
}
@override
// TODO: implement wantKeepAlive
bool get wantKeepAlive => true;
//End使PageView
// final FijkPlayer player = FijkPlayer();
// bool bFirstPlay;
@override
void initState() {
// g_userInfo.userGroupIDlist
// eventBus.on<GroupIdUpdateEvent>().listen((event) async {
// print(event.str);
// getAdminItem();
// });
getListView().then((value) {
Future.delayed(Duration(milliseconds: 500), () {
getAdminItem();
});
});
super.initState();
}
Future updateStatisData() async {
if (listZptjStatisAlone.length >= dwSum && -1 == mapStatisInfo['今日抓拍']) {
getAllSum('today', listZptjStatisAlone).then((value) {
mapStatisInfo['今日抓拍'] = value[1];
try_setState();
});
}
if (listShtjStatisAlone.length >= dwSum && -1 == mapStatisInfo['今日初审']) {
getAllSum('total', listShtjStatisAlone).then((value) {
mapStatisInfo['今日初审'] = value[1];
mapStatisInfo['今日复审'] = value[1];
try_setState();
});
getAllSum('sends', listShtjStatisAlone).then((value) {
mapStatisInfo['今日推送'] = value[1];
try_setState();
});
}
if (listClltjStatisAlone.length >= dwSum && -1 == mapStatisInfo['今日车流']) {
getAllSum('today', listClltjStatisAlone).then((value) {
mapStatisInfo['今日车流'] = value[1] ~/ 10000;
try_setState();
});
}
}
Future<void> sysPop() async {
await SystemChannels.platform.invokeMethod('SystemNavigator.pop');
}
_page5_userManagerState();
@override
void dispose() {
super.dispose();
}
//
static onNullFun() {}
Widget _getListTile(title,
{String leadPath = '',
Color leadColor,
onTapFun = onNullFun,
onLongPressFun = onNullFun,
size = 16.0,
bool bBadge = false}) {
return Column(
children: <Widget>[
ListTile(
leading: bBadge
? Badge(
position: BadgePosition.topEnd(top: -7, end: -12),
badgeContent: null,
child: Image.asset(
leadPath,
height: ScreenUtil().setHeight(78),
fit: BoxFit.fitHeight,
),
)
: Image.asset(
leadPath,
height: ScreenUtil().setHeight(78),
fit: BoxFit.fitHeight,
),
title: new Text(title, style: TextStyle(fontSize: size)),
trailing: new Icon(Icons.arrow_forward_ios),
contentPadding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 0),
enabled: true,
onTap: onTapFun,
onLongPress: onLongPressFun,
),
Divider(
height: 1.0,
),
],
);
}
List<Widget> _listViewUser = [];
List<Widget> _listViewUser_user = [];
Color _greenColor = Color.fromRGBO(36, 206, 192, 1); //绿
Color _deepBlueColor = Color.fromRGBO(79, 118, 230, 1); //
Color _deepGreyColor = Color.fromRGBO(116, 139, 161, 1); //
Color _ligthBlueColor = Color.fromRGBO(80, 159, 245, 1); //
Future getListView() async {
_listViewUser_user.clear();
// _listViewUser.add(_getListTile('个人资料',
// leadPath: 'assets/images/我的.png',
// leadColor: _ligthBlueColor,
// onTapFun: OnTap_personal_data));
// _listViewUser.add(_getListTile('意见反馈',
// leadPath: 'assets/images/意见反馈.png',
// leadColor: _ligthBlueColor,
// onTapFun: OnTap_MyFeedback));
// _listViewUser.add(_getListTile('版本更新',
// leadPath: 'assets/images/版本更新.png', leadColor: _greenColor, onTapFun: OnTap_MyUpdate));
// _listViewUser.add(_getListTile('清除缓存',
// leadPath: 'assets/images/清除缓存.png',
// leadColor: _deepBlueColor,
// onTapFun: OnTap_ClearCache));
// _listViewUser.add(_getListTile('关于',
// leadPath: 'assets/images/关于.png', leadColor: _deepBlueColor, onTapFun: OnTap_MyAbout));
_listViewUser_user = [
_getListTile('清除缓存',
leadPath: 'assets/images/清除缓存.png',
leadColor: _deepBlueColor,
onTapFun: OnTap_ClearCache),
//
// _getListTile('个人资料',
// leadPath: 'assets/images/我的.png',
// leadColor: _ligthBlueColor,
// onTapFun: OnTap_personal_data),
// _getListTile('意见反馈',
// leadPath: 'assets/images/意见反馈.png',
// leadColor: _ligthBlueColor,
// onTapFun: OnTap_MyFeedback),
_getListTile('修改密码',
leadPath: 'assets/images/修改密码.png',
leadColor: _deepBlueColor,
onTapFun: OnTap_modify_password),
//bNewVer
_getListTile('版本更新',
leadPath: 'assets/images/版本更新.png',
leadColor: _greenColor,
onTapFun: OnTap_MyUpdate,
bBadge: bNewVer),
// _getListTile('关于',
// leadPath: 'assets/images/关于.png', leadColor: _deepBlueColor, onTapFun: OnTap_MyAbout),
// _getListTile('权限测试',
// leadPath: 'assets/images/权限.png',
// leadColor: _deepGreyColor,
// onTapFun: OnTap_UserAuthority),
];
}
//0 1 1
// 0 便 1
//int alreadyFlag = 0;
Future getAdminItem() async {
_listViewUser.addAll(_listViewUser_user);
for (int group_id in g_userInfo.userGroupIDlist) {
print('group_id = $group_id');
if (26 == group_id || 31 == group_id) {
Widget _item = _getListTile('人脸注册',
leadPath: 'assets/images/人脸注册.png',
leadColor: _ligthBlueColor,
onTapFun: OnTap_FaceReg);
print('_listViewUser.length = ${_listViewUser.length}');
_listViewUser.add(_item);
break; //便
}
}
_listViewUser.add(_getListTile('关于',
leadPath: 'assets/images/关于.png', leadColor: _deepBlueColor, onTapFun: OnTap_MyAbout));
print('_listViewUser.length = ${_listViewUser.length}');
Future.delayed(Duration(milliseconds: 500), () {
try_setState();
});
}
@override
Widget build(BuildContext context) {
return WillPopScope(
child: Container(
decoration: new BoxDecoration(
color: Color.fromRGBO(244, 244, 244, 1), //
),
child: Column(
children: <Widget>[
Container(
height: ScreenUtil().setHeight(484), //530 - 46
child: Stack(
children: [
//11
Positioned(
child: Container(
height: ScreenUtil().setHeight(324), //181
alignment: Alignment.topCenter,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Color.fromRGBO(12, 186, 156, 1),
Color.fromRGBO(39, 127, 235, 1),
],
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
//crossAxisAlignment: CrossAxisAlignment.start, //
children: <Widget>[
FlatButton(
child: Container(
child: Row(
children: [
Padding(
padding: EdgeInsets.only(top: ScreenUtil().setHeight(10)),
child: Text(""),
// child: Image.asset(
// 'assets/images/形状 2.png',
// height: ScreenUtil().setHeight(45),
// ),
),
Text(" ", //" 客服热线",
style: TextStyle(fontSize: 16, color: Colors.white)),
],
),
),
onPressed: () {}
// onPressed: () => launch("tel://18784678300"),
),
SizedBox(
width: ScreenUtil().setWidth(45),
),
Expanded(
child: Text(widget.title,
style: TextStyle(fontSize: 20.0, color: Colors.white)),
),
],
),
),
),
//22
Align(
alignment: Alignment.bottomLeft,
child: Container(
alignment: Alignment(0, 1),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
//crossAxisAlignment: CrossAxisAlignment.end,
children: [
Container(
padding: EdgeInsets.only(bottom: ScreenUtil().setHeight(18)),
height: ScreenUtil().setHeight(310),
decoration: BoxDecoration(
color: Color.fromRGBO(62, 88, 231, 1),
borderRadius: BorderRadius.horizontal(right: Radius.circular(20)),
),
//color: Colors.pinkAccent,
width: ScreenUtil().setWidth(34),
alignment: Alignment.centerRight,
),
getImageWidget(),
// Container(
// alignment: Alignment(0, 0),
// height: ScreenUtil().setHeight(346),
// width: ScreenUtil().setWidth(942),
// child: Image.asset(
// 'assets/images/装饰图片10.png',
// fit: BoxFit.cover,
// ),
// ),
Container(
height: ScreenUtil().setHeight(310),
decoration: BoxDecoration(
color: Color.fromRGBO(113, 39, 203, 1),
borderRadius: BorderRadius.horizontal(left: Radius.circular(20)),
),
//color: Colors.pinkAccent,
width: ScreenUtil().setWidth(34),
alignment: Alignment.centerRight,
),
],
),
),
),
],
),
),
//33
SizedBox(height: ScreenUtil().setHeight(46)),
Expanded(
//Flutter ColumnListViewListViewExpanded
// ListView.builder 使 ListView
// child: ListView.builder(
// itemCount: listContacts.length,
// itemBuilder: this._getlistContacts),
child: _listViewUser.isEmpty
? getMoreWidget(color: Colors.black26)
: ListView(
padding: EdgeInsets.all(10),
children: _listViewUser,
),
),
Divider(
height: 20.0,
indent: 0.0,
thickness: 1.0,
color: Color.fromRGBO(80, 159, 245, 1),
),
// Center(
// child: RaisedButton(
// //padding: EdgeInsets.all(0),
// onPressed: () {
// Navigator.pushNamed(context, '/', arguments: 0);
// },
// //color: Colors.transparent,
// child: Text('退出登录'),
// ),
// ),
JdButton(
height: 126,
//JdText使ScreenUtil().setHeight(126) ScreenUtil().setHeight(126)
width: 350,
text: "退出登录",
color: Color.fromRGBO(80, 159, 245, 1),
onTop: () {
Navigator.pushNamed(context, '/', arguments: 0);
},
),
SizedBox(
height: 20.0, //
),
],
),
),
onWillPop: () {
sysPop();
},
);
}
OnTap_MyAbout() {
PackageInfo.fromPlatform().then((PackageInfo packageInfo) {
String appName = packageInfo.appName;
String packageName = packageInfo.packageName;
String version = packageInfo.version;
String buildNumber = packageInfo.buildNumber;
String buildDate =
'${buildNumber.substring(0, 4)}.${buildNumber.substring(4, 6)}.${buildNumber.substring(6, 8)}';
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) => MyAbout(ver: version, date: buildDate)));
});
}
OnTap_MyUpdate() {
PackageInfo.fromPlatform().then((PackageInfo packageInfo) async {
String appName = packageInfo.appName;
String packageName = packageInfo.packageName;
String version = packageInfo.version;
String buildNumber = packageInfo.buildNumber;
String buildDate =
'${buildNumber.substring(0, 4)}.${buildNumber.substring(4, 6)}.${buildNumber.substring(6, 8)}';
print('appName = $appName');
print('packageName = $packageName');
print('version = $version');
print('buildNumber = $buildNumber');
print('buildDate = $buildDate');
// I/flutter (30820): appName =
// I/flutter (30820): packageName = com.flutter.hyzp_ybqx
// I/flutter (30820): version = 1.3.1
// I/flutter (30820): buildNumber = 20210508
// I/flutter (30820): buildDate = 2021.05.08
//Fluttertoast.showToast(msg: '当前版本 v$version。暂无更新', gravity: ToastGravity.CENTER);
// Navigator.of(context).push(MaterialPageRoute(
// builder: (context) => MyUpdated(ver: version, date: buildDate, theContext: context)));
MyUpdatedNew m = await MyUpdatedNew(
ver: version,
date: buildDate,
theContext: context,
bStartUpdated: true,
bShowNoNewVersion: true);
});
}
Future _getTotalSizeOfFilesInDir(final FileSystemEntity file) async {
if (file is File) {
int length = await file.length();
return double.parse(length.toString());
}
if (file is Directory) {
final List children = file.listSync();
double total = 0;
if (children != null)
for (final FileSystemEntity child in children)
total += await _getTotalSizeOfFilesInDir(child);
return total;
}
return 0;
}
OnTap_FaceLogin() async {
Navigator.of(context).push(MaterialPageRoute(builder: (context) => FaceLogin()));
}
OnTap_FaceReg() async {
Navigator.of(context).push(MaterialPageRoute(builder: (context) => FaceReg()));
}
OnTap_modify_password() {
Navigator.of(context).push(MaterialPageRoute(builder: (context) => ModifyPassword()));
}
OnTap_personal_data() {
Navigator.of(context).push(MaterialPageRoute(builder: (context) => PersonalData()));
}
OnTap_MyFeedback() {
Navigator.of(context).push(MaterialPageRoute(builder: (context) => MyFeedback()));
}
OnTap_UserAuthority() async {
//1ID
//getUserAccess(user_id: 136);
//2.2
//I/flutter (15540): g_userInfo.userGroupIDlist = [32, 33]
// g_userInfo.userRulesMap.clear();
// //getUserGroup(group_id: 27);
// getUserGroupAll(user_id: 136);
//
// Future.delayed(const Duration(milliseconds: 3500), () {
// print('g_userInfo.userRulesMap = ${g_userInfo.userRulesMap.toString()}');
// });
//I/flutter (15540): g_userInfo.userRulesMap = {32: [1968, 1972, 1973, 1969, 1976, 1977, 2008, 2009, 2011, 2014, 2015, 2018, 2029, 2030, 2031, 2054, 2055, 2035, 2036, 2037, 204
// 1, 2042, 2043, 2047, 2048, 2049, 2053, 1970, 1980, 1981, 1971, 1984, 1985, 1992, 1993, 2000, 2001, 2020, 2022], 33: [1968, 1972, 1973, 1969, 1976, 1977, 2008, 2009, 2011, 201
// 4, 2015, 2018, 2029, 2030, 2031, 2054, 2055, 2035, 2036, 2037, 2041, 2042, 2043, 2047, 2048, 2049, 2053, 1970, 1980, 1981, 1971, 1984, 1985, 1992, 1993, 2000, 2001, 2019, 202
// 0, 2022]}
// getUserGroup(group_id: g_userInfo.userGroupIDlist[0]);
// print('g_userInfo.userRulesMap = ${g_userInfo.userRulesMap.toString()}');
//I/flutter (15540): g_userInfo.userRulesMap = {32: [1968, 1972, 1973, 1969, 1976, 1977, 2008, 2009, 2011,
// 2014, 2015, 2018, 2029, 2030, 2031, 2054, 2055, 2035, 2036, 2037, 2041, 2042, 2043, 2047,
// 2048, 2049, 2053, 1970, 1980, 1981, 1971, 1984, 1985, 1992, 1993, 2000, 2001, 2020, 2022]}
// g_userInfo.userRulesMap.clear();
// getUserGroupAll();
// print('g_userInfo.userGroupIDlist = ${g_userInfo.userGroupIDlist}');
// print('g_userInfo.userGroupIDlist[0] = ${g_userInfo.userGroupIDlist[0]}');
// getUserGroup(group_id: g_userInfo.userGroupIDlist[0]);
//I/flutter (15540): g_userInfo.userGroupIDlist = [31, 27]
//getUserGroup(group_id: g_userInfo.userGroupIDlist[1]);
///3 (All)
// getRecordList(api: ServicePath.getUserGroupListUrl).then((map) {
// mapUserGroupList = map;
// });
//I/flutter ( 1422): http://125.64.218.67:9904/?s=App.User_User.GetGroupList
// I/flutter ( 1422): ...
// I/flutter ( 1422): response = {"ret":200,"data":{"items":[{"id":35,"jgid":2,"type":0,"title":"局领导","level":0,"pid":0,"sort":1,"status":1,"rules":""},{"id":34,"jgid":2,"typ
// e":0,"title":"","level":0,"pid":0,"sort":1,"status":1,"rules":""},{"id":33,"jgid":2,"type":1,"title":"","level":0,"pid":0,"sort":4,"status":1,"rules":"1968,1972
// ,1973,1969,1976,1977,2008,2009,2011,2014,2015,2018,2029,2030,2031,2054,2055,2035,2036,2037,2041,2042,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,1993,2000,200
// 1,2019,2020,2022"},{"id":32,"jgid":2,"type":0,"title":"","level":0,"pid":0,"sort":3,"status":1,"rules":"1968,1972,1973,1969,1976,1977,2008,2009,2011,2014,2015,2018,20
// 29,2030,2031,2054,2055,2035,2036,2037,2041,2042,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,1993,2000,2001,2020,2022"},{"id":31,"jgid":2,"type":0,"title":"
// ","level":0,"pid":0,"sort":2,"status":1,"rules":""},{"id":30,"jgid":2,"type":0,"title":"","level":0,"pid":0,"sort":1,"status":1,"rules":"196
// I/flutter ( 1422): mapRecordList['mapRecordListRet'] = {ret: 200, data: {items: [{id: 35, jgid: 2, type: 0, title: , level: 0, pid: 0, sort: 1, status: 1, rules: }, {id
// : 34, jgid: 2, type: 0, title: , level: 0, pid: 0, sort: 1, status: 1, rules: }, {id: 33, jgid: 2, type: 1, title: , level: 0, pid: 0, sort: 4, status: 1, rules
// : 1968,1972,1973,1969,1976,1977,2008,2009,2011,2014,2015,2018,2029,2030,2031,2054,2055,2035,2036,2037,2041,2042,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,19
// 93,2000,2001,2019,2020,2022}, {id: 32, jgid: 2, type: 0, title: , level: 0, pid: 0, sort: 3, status: 1, rules: 1968,1972,1973,1969,1976,1977,2008,2009,2011,2014,2015,
// 2018,2029,2030,2031,2054,2055,2035,2036,2037,2041,2042,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,1993,2000,2001,2020,2022}, {id: 31, jgid: 2, type: 0, title
// : , level: 0, pid: 0, sort: 2, status: 1, rules: }, {id: 30, jgid: 2, type: 0, title: , level: 0, pid: 0, sort: 1, status: 1, rules: 1968
// I/flutter ( 1422): mapRecordList['listRecordList'] = []
// I/flutter ( 1422): _list1 = [{id: 35, jgid: 2, type: 0, title: , level: 0, pid: 0, sort: 1, status: 1, rules: }, {id: 34, jgid: 2, type: 0, title: , level: 0, p
// id: 0, sort: 1, status: 1, rules: }, {id: 33, jgid: 2, type: 1, title: , level: 0, pid: 0, sort: 4, status: 1, rules: 1968,1972,1973,1969,1976,1977,2008,2009,2011,2014,
// 2015,2018,2029,2030,2031,2054,2055,2035,2036,2037,2041,2042,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,1993,2000,2001,2019,2020,2022}, {id: 32, jgid: 2, type
// : 0, title: , level: 0, pid: 0, sort: 3, status: 1, rules: 1968,1972,1973,1969,1976,1977,2008,2009,2011,2014,2015,2018,2029,2030,2031,2054,2055,2035,2036,2037,2041,20
// 42,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,1993,2000,2001,2020,2022}, {id: 31, jgid: 2, type: 0, title: , level: 0, pid: 0, sort: 2, status: 1, rule
// s: }, {id: 30, jgid: 2, type: 0, title: , level: 0, pid: 0, sort: 1, status: 1, rules: 1968,1972,1973,1974,1975,1969,1976,1977,1978,1979,1970,1
// I/flutter ( 1422): mapRecordList['listRecordList'] = [{id: 35, jgid: 2, type: 0, title: , level: 0, pid: 0, sort: 1, status: 1, rules: }, {id: 34, jgid: 2, type: 0, tit
// le: , level: 0, pid: 0, sort: 1, status: 1, rules: }, {id: 33, jgid: 2, type: 1, title: , level: 0, pid: 0, sort: 4, status: 1, rules: 1968,1972,1973,1969,1976,
// 1977,2008,2009,2011,2014,2015,2018,2029,2030,2031,2054,2055,2035,2036,2037,2041,2042,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,1993,2000,2001,2019,2020,2022
// }, {id: 32, jgid: 2, type: 0, title: , level: 0, pid: 0, sort: 3, status: 1, rules: 1968,1972,1973,1969,1976,1977,2008,2009,2011,2014,2015,2018,2029,2030,2031,2054,20
// 55,2035,2036,2037,2041,2042,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,1993,2000,2001,2020,2022}, {id: 31, jgid: 2, type: 0, title: , level: 0, pid: 0,
// sort: 2, status: 1, rules: }, {id: 30, jgid: 2, type: 0, title: , level: 0, pid: 0, sort: 1, status: 1, rules: 1968,1972,1973,1974,1975,1969,1
// I/flutter ( 1422): map['page'] = 1
// I/flutter ( 1422): _counter = 8
// I/flutter ( 1422): _total = 8
///5
// getRecordList(api: ServicePath.getUserAuthListUrl).then((map) {
// mapUserAuthList = map;
// });
//I/flutter ( 3512): http://125.64.218.67:9904/?s=App.User_User.GetAuthList
// I/flutter ( 3512): ...
// I/flutter ( 3512): response = {"ret":200,"data":{"items":[{"id":2069,"jgid":2,"level":2,"pid":2067,"name":"blacksmoke2/b2tj/fenxicll/fenxi","title":"分析","type":1,"status":1
// ,"condition":"","sort":9},{"id":2068,"jgid":2,"level":2,"pid":2067,"name":"blacksmoke2/b2tj/fenxicll/view","title":"查看","type":1,"status":1,"condition":"","sort":0},{"id":2
// 067,"jgid":2,"level":1,"pid":2029,"name":"blacksmoke2/b2tj/fenxicll","title":"车流量统计","type":1,"status":1,"condition":"","sort":7},{"id":2066,"jgid":2,"level":2,"pid":206
// 4,"name":"blacksmoke2/b2tj/dwinfoview/fenxi","title":"分析","type":1,"status":1,"condition":"","sort":9},{"id":2065,"jgid":2,"level":2,"pid":2064,"name":"blacksmoke2/b2tj/dwi
// nfoview/view","title":"","type":1,"status":1,"condition":"","sort":0},{"id":2064,"jgid":2,"level":1,"pid":2029,"name":"blacksmoke2/b2tj/dwinfoview","title":"
// ","type":1,"status":1,"condition":"","sort":6},{"id":2063,"jgid":2,"level":2,"pid":2061,"name":"blacksmoke2/b2tj/dwinfo/fenxi","title":"","typ
// I/flutter ( 3512): mapRecordList['mapRecordListRet'] = {ret: 200, data: {items: [{id: 2069, jgid: 2, level: 2, pid: 2067, name: blacksmoke2/b2tj/fenxicll/fenxi, title: ,
// type: 1, status: 1, condition: , sort: 9}, {id: 2068, jgid: 2, level: 2, pid: 2067, name: blacksmoke2/b2tj/fenxicll/view, title: , type: 1, status: 1, condition: , sort:
// 0}, {id: 2067, jgid: 2, level: 1, pid: 2029, name: blacksmoke2/b2tj/fenxicll, title: , type: 1, status: 1, condition: , sort: 7}, {id: 2066, jgid: 2, level: 2, pid:
// 2064, name: blacksmoke2/b2tj/dwinfoview/fenxi, title: , type: 1, status: 1, condition: , sort: 9}, {id: 2065, jgid: 2, level: 2, pid: 2064, name: blacksmoke2/b2tj/dwinfo
// view/view, title: , type: 1, status: 1, condition: , sort: 0}, {id: 2064, jgid: 2, level: 1, pid: 2029, name: blacksmoke2/b2tj/dwinfoview, title: , type:
// 1, status: 1, condition: , sort: 6}, {id: 2063, jgid: 2, level: 2, pid: 2061, name: blacksmoke2/b2tj/dwinfo/fenxi, title: , type: 1, status: 1, c
// I/flutter ( 3512): map['page'] = 1
// I/flutter ( 3512): _counter = 20
// I/flutter ( 3512): _total = 78
// I/flutter ( 3512): 1
// I/flutter ( 3512): response = {"ret":200,"data":{"items":[{"id":2042,"jgid":2,"level":1,"pid":2029,"name":"blacksmoke2/b2tj/fenxicartime","title":"车辆轨迹查询","type":1,"sta
// tus":1,"condition":"","sort":3},{"id":2041,"jgid":2,"level":2,"pid":2036,"name":"blacksmoke2/b2tj/fenxicar/fenxi","title":"","type":1,"status":1,"condition":"","sort":9},
// {"id":2037,"jgid":2,"level":2,"pid":2036,"name":"blacksmoke2/b2tj/fenxicar/view","title":"查看","type":1,"status":1,"condition":"","sort":0},{"id":2036,"jgid":2,"level":1,"pi
// d":2029,"name":"blacksmoke2/b2tj/fenxicar","title":"","type":1,"status":1,"condition":"","sort":2},{"id":2035,"jgid":2,"level":2,"pid":2030,"name":"blacksmoke
// 2/b2tj/fenxi","title":"","type":1,"status":1,"condition":"","sort":9},{"id":2034,"jgid":2,"level":2,"pid":2030,"name":"blacksmoke2/b2tj/outxls","title":"","type":1,"s
// tatus":1,"condition":"","sort":7},{"id":2031,"jgid":2,"level":2,"pid":2030,"name":"blacksmoke2/b2tj/view","title":"","type":1,"status":1,"condit
// I/flutter ( 3512): mapRecordList['mapRecordListRet'] = {ret: 200, data: {items: [{id: 2042, jgid: 2, level: 1, pid: 2029, name: blacksmoke2/b2tj/fenxicartime, title:
// , type: 1, status: 1, condition: , sort: 3}, {id: 2041, jgid: 2, level: 2, pid: 2036, name: blacksmoke2/b2tj/fenxicar/fenxi, title: , type: 1, status: 1, condition: ,
// sort: 9}, {id: 2037, jgid: 2, level: 2, pid: 2036, name: blacksmoke2/b2tj/fenxicar/view, title: , type: 1, status: 1, condition: , sort: 0}, {id: 2036, jgid: 2, level: 1
// , pid: 2029, name: blacksmoke2/b2tj/fenxicar, title: , type: 1, status: 1, condition: , sort: 2}, {id: 2035, jgid: 2, level: 2, pid: 2030, name: blacksmoke2/b
// 2tj/fenxi, title: , type: 1, status: 1, condition: , sort: 9}, {id: 2034, jgid: 2, level: 2, pid: 2030, name: blacksmoke2/b2tj/outxls, title: , type: 1, status: 1, co
// ndition: , sort: 7}, {id: 2031, jgid: 2, level: 2, pid: 2030, name: blacksmoke2/b2tj/view, title: , type: 1, status: 1, condition: , sort: 0}, {
// I/flutter ( 3512): map['page'] = 2
// I/flutter ( 3512): _counter = 40
// I/flutter ( 3512): _total = 78
// I/flutter ( 3512): 2
// I/flutter ( 3512): response = {"ret":200,"data":{"items":[{"id":2008,"jgid":2,"level":1,"pid":1969,"name":"blacksmoke2/b2yjfsls/index","title":"历史数据","type":1,"status":1,
// "condition":"","sort":2},{"id":2007,"jgid":2,"level":2,"pid":2000,"name":"blacksmoke2/b2dwinfo/inxls","title":"导入","type":1,"status":1,"condition":"","sort":8},{"id":2006,"
// jgid":2,"level":2,"pid":2000,"name":"blacksmoke2/b2dwinfo/outxls","title":"","type":1,"status":1,"condition":"","sort":7},{"id":2005,"jgid":2,"level":2,"pid":2000,"name":
// "blacksmoke2/b2dwinfo/del","title":"删除","type":1,"status":1,"condition":"","sort":4},{"id":2004,"jgid":2,"level":2,"pid":2000,"name":"blacksmoke2/b2dwinfo/lock","title":"
// ","type":1,"status":1,"condition":"","sort":3},{"id":2003,"jgid":2,"level":2,"pid":2000,"name":"blacksmoke2/b2dwinfo/edit","title":"","type":1,"status":1,"condition":""
// ,"sort":2},{"id":2002,"jgid":2,"level":2,"pid":2000,"name":"blacksmoke2/b2dwinfo/add","title":"新增","type":1,"status":1,"condition":"","sort":1},{"id":2001
// I/flutter ( 3512): mapRecordList['mapRecordListRet'] = {ret: 200, data: {items: [{id: 2008, jgid: 2, level: 1, pid: 1969, name: blacksmoke2/b2yjfsls/index, title: , t
// ype: 1, status: 1, condition: , sort: 2}, {id: 2007, jgid: 2, level: 2, pid: 2000, name: blacksmoke2/b2dwinfo/inxls, title: , type: 1, status: 1, condition: , sort: 8}, {
// id: 2006, jgid: 2, level: 2, pid: 2000, name: blacksmoke2/b2dwinfo/outxls, title: , type: 1, status: 1, condition: , sort: 7}, {id: 2005, jgid: 2, level: 2, pid: 2000, na
// me: blacksmoke2/b2dwinfo/del, title: , type: 1, status: 1, condition: , sort: 4}, {id: 2004, jgid: 2, level: 2, pid: 2000, name: blacksmoke2/b2dwinfo/lock, title: , t
// ype: 1, status: 1, condition: , sort: 3}, {id: 2003, jgid: 2, level: 2, pid: 2000, name: blacksmoke2/b2dwinfo/edit, title: , type: 1, status: 1, condition: , sort: 2}, {i
// d: 2002, jgid: 2, level: 2, pid: 2000, name: blacksmoke2/b2dwinfo/add, title: , type: 1, status: 1, condition: , sort: 1}, {id: 2001, jgid: 2, level: 2,
// I/flutter ( 3512): map['page'] = 3
// I/flutter ( 3512): _counter = 60
// I/flutter ( 3512): _total = 78
// I/flutter ( 3512): 3
// I/flutter ( 3512): response = {"ret":200,"data":{"items":[{"id":1988,"jgid":2,"level":2,"pid":1984,"name":"blacksmoke2/b2ledxs/lock","title":"锁定","type":1,"status":1,"condi
// tion":"","sort":3},{"id":1987,"jgid":2,"level":2,"pid":1984,"name":"blacksmoke2/b2ledxs/edit","title":"","type":1,"status":1,"condition":"","sort":2},{"id":1986,"jgid":2,
// "level":2,"pid":1984,"name":"blacksmoke2/b2ledxs/add","title":"新增","type":1,"status":1,"condition":"","sort":1},{"id":1985,"jgid":2,"level":2,"pid":1984,"name":"blacksmoke2
// /b2ledxs/view","title":"","type":1,"status":1,"condition":"","sort":0},{"id":1984,"jgid":2,"level":1,"pid":1971,"name":"blacksmoke2/b2ledxs/index","title":"LED","
// type":1,"status":1,"condition":"","sort":1},{"id":1983,"jgid":2,"level":2,"pid":1980,"name":"blacksmoke2/b2ts/shenhe","title":"","type":1,"status":1,"condition":"","sort"
// :5},{"id":1981,"jgid":2,"level":2,"pid":1980,"name":"blacksmoke2/b2ts/view","title":"查看","type":1,"status":1,"condition":"","sort":0},{"id":1980,"jgid":2,
// I/flutter ( 3512): mapRecordList['mapRecordListRet'] = {ret: 200, data: {items: [{id: 1988, jgid: 2, level: 2, pid: 1984, name: blacksmoke2/b2ledxs/lock, title: , type: 1
// , status: 1, condition: , sort: 3}, {id: 1987, jgid: 2, level: 2, pid: 1984, name: blacksmoke2/b2ledxs/edit, title: , type: 1, status: 1, condition: , sort: 2}, {id: 1986
// , jgid: 2, level: 2, pid: 1984, name: blacksmoke2/b2ledxs/add, title: , type: 1, status: 1, condition: , sort: 1}, {id: 1985, jgid: 2, level: 2, pid: 1984, name: blacksmo
// ke2/b2ledxs/view, title: , type: 1, status: 1, condition: , sort: 0}, {id: 1984, jgid: 2, level: 1, pid: 1971, name: blacksmoke2/b2ledxs/index, title: LED, type:
// 1, status: 1, condition: , sort: 1}, {id: 1983, jgid: 2, level: 2, pid: 1980, name: blacksmoke2/b2ts/shenhe, title: , type: 1, status: 1, condition: , sort: 5}, {id: 1981
// , jgid: 2, level: 2, pid: 1980, name: blacksmoke2/b2ts/view, title: , type: 1, status: 1, condition: , sort: 0}, {id: 1980, jgid: 2, level: 1, pid: 1970
// I/flutter ( 3512): map['page'] = 4
// I/flutter ( 3512): _counter = 78
// I/flutter ( 3512): _total = 78
///6map便
// getRecordList(api: ServicePath.getUserAuthListUrl).then((map) {
// mapUserAuthList = map;
// getUserAuth();
// });
///7map便
// getRecordList(api: ServicePath.getUserAuthListUrl).then((map) {
// mapUserAuthList = map;
// getUserAuthMap(value: 'name');
// });
///8 rtsp://125.64.218.67:9901/rtp/gb_play_34020000001320013016_34020000001320013016
// urlnew = 'rtsp://125.64.218.67:9901/rtp/gb_play_34020000001320013016_34020000001320013016';
// Navigator.of(context).push(MaterialPageRoute(
// builder: (context) => PlayerPro(
// url: urlnew,
// title: '点位视频测试',
// )));
///9 rtmp://125.64.218.67:9901/rtp/gb_play_34020000001320013016_34020000001320013016
// urlnew = 'rtmp://125.64.218.67:9901/rtp/gb_play_34020000001320013016_34020000001320013016';
// Navigator.of(context).push(MaterialPageRoute(
// builder: (context) => PlayerPro(
// url: urlnew,
// title: '点位视频测试',
// )));
// getRecordList(api: ServicePath.getUserAuthListUrl).then((map) {
// mapUserAuthList = map;
// // var _jsonStr = json.encode(getUserAuthMap(value: 'name'));
// // List _list = json.decode(_jsonStr);
//
// Map<String, dynamic> map1 = {"name": "AllenSu", "area": "郑州", "sex": "", "age": 18};
// String _jsonStr = json.encode(map1);
// //print('_jsonStr = $_jsonStr');
// //List _list = json.decode(_jsonStr);
// // Unhandled Exception: type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'List<dynamic>'
// Map map2 = json.decode(_jsonStr);
// //print('_list = ${_list}');
//
// String str = json_print(map2, 1);
// List list = ['test', 'dsaf', 'swer'];
// //segmentPrint(str);
// //print('_jsonStr = ${json_print(map2, 1)}');
//
// print('str = ${str}');
// my_segmentPrint(str);
//
// });
}
Future<Null> loadCache() async {
Directory tempDir = await getTemporaryDirectory();
double value = await _getTotalSizeOfFilesInDir(tempDir);
print('临时目录大小: ' + value.toString());
//
delDir(tempDir);
}
//
Future<Null> delDir(FileSystemEntity file) async {
if (file is Directory) {
final List<FileSystemEntity> children = file.listSync();
for (final FileSystemEntity child in children) {
await delDir(child);
}
}
await file.delete();
}
OnTap_ClearCache() async {
Directory tempDir = await getTemporaryDirectory();
print('tempDir: ' + tempDir.path);
double SizeOfFiles = await _getTotalSizeOfFilesInDir(tempDir) / 1000000;
print('临时目录大小: ${SizeOfFiles.toString()} MB');
bool ret = await showDialog(
context: context,
builder: (context) {
myController.text = '';
return CustomDialogF(
title: "选择操作",
content: '缓存大小:${SizeOfFiles.toString()} MB是否清除',
);
});
print('ret: $ret');
if (ret) {
print('清除缓存...');
//
PaintingBinding.instance.imageCache.clear();
//
delDir(tempDir);
//SharedPreferences
Storage.clear();
}
}
}

@ -1,734 +1,280 @@
import 'dart:io'; import 'package:dio/dio.dart';
import 'package:badges/badges.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:hyzp_ybqx/components/commonFun.dart'; import 'package:fluttertoast/fluttertoast.dart';
import 'package:hyzp_ybqx/pages/Login/FaceLogin.dart';
import 'package:hyzp_ybqx/pages/Login/FaceReg.dart';
import 'package:hyzp_ybqx/pages/MyMsics/05_updated/MyUpdatedNew.dart';
import 'package:hyzp_ybqx/pages/Works/TJXX/tj_data.dart';
import 'package:hyzp_ybqx/widget/JdButton.dart';
import 'package:package_info/package_info.dart';
import 'package:path_provider/path_provider.dart';
import '../../components/EncryptUtil.dart';
import '../../components/commonFun.dart'; import '../../components/commonFun.dart';
import '../../components/customDialogF.dart'; import '../../config/service_url.dart';
import '../../services/EventBus.dart';
import '../../services/Storage.dart'; import '../../services/Storage.dart';
//import 'package:hyzp_ybqx/widget/player_pro.dart'; import '../../widget/JdButton.dart';
import '../Login/ModifyPassword.dart'; import '../../widget/JdText.dart';
import '../MyMsics/03_personal/PersonalData.dart';
import '../MyMsics/04_MyFeedback/MyFeedback.dart';
import '../MyMsics/07_myAbout/MyAbout.dart';
///flutterWidget 2019.08.07 15:46:08 https://www.jianshu.com/p/b16f70dd692c
//flutterWidgetStatefulWidgetStateState
// iOSflutterkeyWidgetKey
// FlutterkeyGlobalKeyLocalKeyUniqueKeyObjectKeyGlobalKeykey
// 使WidgetGlobalKeykeyWidget
//key
//GlobalKey<MyFijkPanelWidgetBuilderState> _myFijkPanelWidgetBuilderStateKey = new GlobalKey<MyFijkPanelWidgetBuilderState>();
class Page4_MyMsicsNew extends StatefulWidget { class page5_userManager extends StatefulWidget {
Page4_MyMsicsNew({@required this.pageType, this.title, Key key}) : super(key: key); page5_userManager({Key key}) : super(key: key);
// Page4_MyMsicsNew PageType _LoginPageState createState() => _LoginPageState();
String pageType = ''; //'my_page'
String title = '';
@override
_Page4_MyMsicsNewState createState() => _Page4_MyMsicsNewState();
} }
//class _Page1WorkState extends State<Page1Work> with WidgetsBindingObserver, AutomaticKeepAliveClientMixin { class _LoginPageState extends State<page5_userManager> {
class _Page4_MyMsicsNewState extends State<Page4_MyMsicsNew> //
with WidgetsBindingObserver, AutomaticKeepAliveClientMixin { dispose() {
//Begin使PageViewwith AutomaticKeepAliveClientMixin super.dispose();
eventBus.fire(new UserEvent('登录成功...'));
//try_setState(); //
try_setState() {
try {
setState(() {});
} catch (e) {
print('setState(() {})异常:${e}');
}
}
@override
// TODO: implement wantKeepAlive
bool get wantKeepAlive => true;
//End使PageView
// final FijkPlayer player = FijkPlayer();
// bool bFirstPlay;
@override
void initState() {
// g_userInfo.userGroupIDlist
// eventBus.on<GroupIdUpdateEvent>().listen((event) async {
// print(event.str);
// getAdminItem();
// });
getListView().then((value) {
Future.delayed(Duration(milliseconds: 500), () {
getAdminItem();
});
});
super.initState();
} }
Future updateStatisData() async { String oldPassword = '';
if (listZptjStatisAlone.length >= dwSum && -1 == mapStatisInfo['今日抓拍']) { String newPassword1 = '';
getAllSum('today', listZptjStatisAlone).then((value) { String newPassword2 = '';
mapStatisInfo['今日抓拍'] = value[1];
try_setState(); doModifyPw() async {
}); oldPassword = oldPassword.trim();
} newPassword1 = newPassword1.trim();
newPassword2 = newPassword2.trim();
if (listShtjStatisAlone.length >= dwSum && -1 == mapStatisInfo['今日初审']) {
getAllSum('total', listShtjStatisAlone).then((value) { RegExp regNewPw = RegExp(r"^[a-zA-Z0-9\?_@#\$\%\^&]+$");
mapStatisInfo['今日初审'] = value[1]; if (g_userInfo.password.isNotEmpty && oldPassword != g_userInfo.password) {
mapStatisInfo['今日复审'] = value[1]; Fluttertoast.showToast(
try_setState(); msg: '输入的旧密码错误!',
}); toastLength: Toast.LENGTH_SHORT,
getAllSum('sends', listShtjStatisAlone).then((value) { gravity: ToastGravity.CENTER,
mapStatisInfo['今日推送'] = value[1]; );
try_setState(); } else if (newPassword1 != newPassword2) {
}); Fluttertoast.showToast(
} msg: '两次输入的新密码不一致!',
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
);
} else if (oldPassword == newPassword1) {
Fluttertoast.showToast(
msg: '新旧密码不能完全一样!',
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
);
} else if (newPassword1.length < 6 || newPassword1.length > 12) {
Fluttertoast.showToast(
msg: '新密码位数不对,应在 6-12 位之间!',
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
);
} else if (!regNewPw.hasMatch(newPassword1)) {
Fluttertoast.showToast(
msg: '新密码格式不对,应该由 6-12 位英文字母、数字和特殊符号组成!',
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
);
} else {
doModifyPwDio().then((value) {
if (value) {
print(value);
//
g_userInfo.password = newPassword1;
//
Storage.setString('password', EncryptUtil.aesEncode(g_userInfo.password));
Fluttertoast.showToast(
msg: '密码修改成功!',
toastLength: Toast.LENGTH_LONG,
gravity: ToastGravity.CENTER,
);
if (listClltjStatisAlone.length >= dwSum && -1 == mapStatisInfo['今日车流']) { Navigator.pop(context); //
getAllSum('today', listClltjStatisAlone).then((value) { }
mapStatisInfo['今日车流'] = value[1] ~/ 10000;
try_setState();
}); });
} }
} }
Future<void> sysPop() async { Future doModifyPwDio() async {
await SystemChannels.platform.invokeMethod('SystemNavigator.pop'); var api = ServicePath.modifyPwUrl;
} print(api);
bool ret = false;
_Page4_MyMsicsNewState();
@override try {
void dispose() { print('开始处理修改密码请求...');
super.dispose(); print('username = ${g_userInfo.username}');
} print('password = ${g_userInfo.password}');
Response response;
// Dio dio = Dio();
static onNullFun() {}
String random = RandomBit(6); //flutter dartN
Widget _getListTile(title, response = await dio.post(api, data: {
{String leadPath = '', "username": g_userInfo.username,
Color leadColor, "oldpassword": oldPassword,
onTapFun = onNullFun, "newpassword": newPassword1,
onLongPressFun = onNullFun, "sign": GenerateMd5(APPkey + random),
size = 16.0, "random": random,
bool bBadge = false}) { });
return Column( print('response = ${response.toString()}');
children: <Widget>[ //response = {"ret":200,"data":"密码修改成功","msg":""}
ListTile( //response = {"ret":200,"data":"原密码错误","msg":""}
leading: bBadge
? Badge( if (response.statusCode == 200) {
position: BadgePosition.topEnd(top: -7, end: -12), if (response.data["data"].indexOf('成功') > 0) {
badgeContent: null, ret = true;
child: Image.asset( print('密码修改成功');
leadPath, print('response.data["data"] = ${response.data["data"]}');
height: ScreenUtil().setHeight(78), } else {
fit: BoxFit.fitHeight, print('密码修改失败:${response.data["data"]}');
), Fluttertoast.showToast(
) msg: '密码修改失败:${response.data["data"]}',
: Image.asset( toastLength: Toast.LENGTH_LONG,
leadPath, gravity: ToastGravity.CENTER,
height: ScreenUtil().setHeight(78), );
fit: BoxFit.fitHeight, }
), print('密码修改过程正常完成');
title: new Text(title, style: TextStyle(fontSize: size)), } else {
trailing: new Icon(Icons.arrow_forward_ios), throw Exception('后端接口出现异常,请检测代码和服务器情况.........');
contentPadding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 0),
enabled: true,
onTap: onTapFun,
onLongPress: onLongPressFun,
),
Divider(
height: 1.0,
),
],
);
}
List<Widget> _listViewUser = [];
List<Widget> _listViewUser_user = [];
Color _greenColor = Color.fromRGBO(36, 206, 192, 1); //绿
Color _deepBlueColor = Color.fromRGBO(79, 118, 230, 1); //
Color _deepGreyColor = Color.fromRGBO(116, 139, 161, 1); //
Color _ligthBlueColor = Color.fromRGBO(80, 159, 245, 1); //
Future getListView() async {
_listViewUser_user.clear();
// _listViewUser.add(_getListTile('个人资料',
// leadPath: 'assets/images/我的.png',
// leadColor: _ligthBlueColor,
// onTapFun: OnTap_personal_data));
// _listViewUser.add(_getListTile('意见反馈',
// leadPath: 'assets/images/意见反馈.png',
// leadColor: _ligthBlueColor,
// onTapFun: OnTap_MyFeedback));
// _listViewUser.add(_getListTile('版本更新',
// leadPath: 'assets/images/版本更新.png', leadColor: _greenColor, onTapFun: OnTap_MyUpdate));
// _listViewUser.add(_getListTile('清除缓存',
// leadPath: 'assets/images/清除缓存.png',
// leadColor: _deepBlueColor,
// onTapFun: OnTap_ClearCache));
// _listViewUser.add(_getListTile('关于',
// leadPath: 'assets/images/关于.png', leadColor: _deepBlueColor, onTapFun: OnTap_MyAbout));
_listViewUser_user = [
_getListTile('清除缓存',
leadPath: 'assets/images/清除缓存.png',
leadColor: _deepBlueColor,
onTapFun: OnTap_ClearCache),
//
// _getListTile('个人资料',
// leadPath: 'assets/images/我的.png',
// leadColor: _ligthBlueColor,
// onTapFun: OnTap_personal_data),
// _getListTile('意见反馈',
// leadPath: 'assets/images/意见反馈.png',
// leadColor: _ligthBlueColor,
// onTapFun: OnTap_MyFeedback),
_getListTile('修改密码',
leadPath: 'assets/images/修改密码.png',
leadColor: _deepBlueColor,
onTapFun: OnTap_modify_password),
//bNewVer
_getListTile('版本更新',
leadPath: 'assets/images/版本更新.png',
leadColor: _greenColor,
onTapFun: OnTap_MyUpdate,
bBadge: bNewVer),
// _getListTile('关于',
// leadPath: 'assets/images/关于.png', leadColor: _deepBlueColor, onTapFun: OnTap_MyAbout),
// _getListTile('权限测试',
// leadPath: 'assets/images/权限.png',
// leadColor: _deepGreyColor,
// onTapFun: OnTap_UserAuthority),
];
}
//0 1 1
// 0 便 1
//int alreadyFlag = 0;
Future getAdminItem() async {
_listViewUser.addAll(_listViewUser_user);
for (int group_id in g_userInfo.userGroupIDlist) {
print('group_id = $group_id');
if (26 == group_id || 31 == group_id) {
Widget _item = _getListTile('人脸注册',
leadPath: 'assets/images/人脸注册.png',
leadColor: _ligthBlueColor,
onTapFun: OnTap_FaceReg);
print('_listViewUser.length = ${_listViewUser.length}');
_listViewUser.add(_item);
break; //便
} }
} catch (e) {
print('密码修改过程异常...');
print('ERROR:======>${e}');
Fluttertoast.showToast(
msg: 'ERROR:======>${e}',
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
);
} }
_listViewUser.add(_getListTile('关于', return ret;
leadPath: 'assets/images/关于.png', leadColor: _deepBlueColor, onTapFun: OnTap_MyAbout));
print('_listViewUser.length = ${_listViewUser.length}');
Future.delayed(Duration(milliseconds: 500), () {
try_setState();
});
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return Scaffold(
child: Container( appBar: PreferredSize(
decoration: new BoxDecoration( preferredSize: Size.fromHeight(ScreenUtil().setHeight(173)), // appBar
color: Color.fromRGBO(244, 244, 244, 1), // // appBar
child: AppBar(
automaticallyImplyLeading: false,
centerTitle: true,
titleSpacing: 0.0,
//title
flexibleSpace: Container(
//SizedBox(height: ScreenUtil().statusBarHeight), //
// SizedBox(height: ScreenUtil().setHeight(10)), //
padding: EdgeInsets.only(top: ScreenUtil().statusBarHeight), //
child: Container(
//height: ScreenUtil().setHeight(173),
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Color.fromRGBO(12, 186, 156, 1),
Color.fromRGBO(39, 127, 235, 1),
],
),
),
// decoration: BoxDecoration(
// gradient: LinearGradient(colors: [
// Color(0xFF0018EB),
// Color(0xFF01C1D9),
// ], begin: Alignment.bottomCenter, end: Alignment.topCenter),
// ),
),
),
title: Padding(
padding: EdgeInsets.only(left: 0, right: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
getIconAndTextButton(
iconColor: Colors.white,
iconData: Icons.chevron_left_outlined,
onPress: () {
Navigator.pop(context);
},
),
Expanded(
child: Text("修改密码",
style: TextStyle(color: Colors.white, fontSize: 20),
textAlign: TextAlign.center,
overflow: TextOverflow.ellipsis),
),
SizedBox(width: 50),
],
),
),
), ),
child: Column( ),
body: Container(
padding: EdgeInsets.only(top: 30, bottom: 20, left: 20, right: 20),
child: ListView(
children: <Widget>[ children: <Widget>[
Container( Center(
height: ScreenUtil().setHeight(484), //530 - 46 child: Container(
child: Stack( margin: EdgeInsets.only(top: 30),
children: [ height: ScreenUtil().setWidth(160),
//11 width: ScreenUtil().setWidth(160),
Positioned( //child: Image.asset('assets/images/user.png', fit: BoxFit.cover),
child: Container( child: Image.asset('assets/images/ybsthbj.png', fit: BoxFit.fitHeight),
height: ScreenUtil().setHeight(324), //181 // child: Image.network(
alignment: Alignment.topCenter, // 'https://www.itying.com/images/flutter/list5.jpg',
decoration: BoxDecoration( // fit: BoxFit.cover),
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Color.fromRGBO(12, 186, 156, 1),
Color.fromRGBO(39, 127, 235, 1),
],
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
//crossAxisAlignment: CrossAxisAlignment.start, //
children: <Widget>[
FlatButton(
child: Container(
child: Row(
children: [
Padding(
padding: EdgeInsets.only(top: ScreenUtil().setHeight(10)),
child: Text(""),
// child: Image.asset(
// 'assets/images/形状 2.png',
// height: ScreenUtil().setHeight(45),
// ),
),
Text(" ", //" 客服热线",
style: TextStyle(fontSize: 16, color: Colors.white)),
],
),
),
onPressed: () {}
// onPressed: () => launch("tel://18784678300"),
),
SizedBox(
width: ScreenUtil().setWidth(45),
),
Expanded(
child: Text(widget.title,
style: TextStyle(fontSize: 20.0, color: Colors.white)),
),
],
),
),
),
//22
Align(
alignment: Alignment.bottomLeft,
child: Container(
alignment: Alignment(0, 1),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
//crossAxisAlignment: CrossAxisAlignment.end,
children: [
Container(
padding: EdgeInsets.only(bottom: ScreenUtil().setHeight(18)),
height: ScreenUtil().setHeight(310),
decoration: BoxDecoration(
color: Color.fromRGBO(62, 88, 231, 1),
borderRadius: BorderRadius.horizontal(right: Radius.circular(20)),
),
//color: Colors.pinkAccent,
width: ScreenUtil().setWidth(34),
alignment: Alignment.centerRight,
),
getImageWidget(),
// Container(
// alignment: Alignment(0, 0),
// height: ScreenUtil().setHeight(346),
// width: ScreenUtil().setWidth(942),
// child: Image.asset(
// 'assets/images/装饰图片10.png',
// fit: BoxFit.cover,
// ),
// ),
Container(
height: ScreenUtil().setHeight(310),
decoration: BoxDecoration(
color: Color.fromRGBO(113, 39, 203, 1),
borderRadius: BorderRadius.horizontal(left: Radius.circular(20)),
),
//color: Colors.pinkAccent,
width: ScreenUtil().setWidth(34),
alignment: Alignment.centerRight,
),
],
),
),
),
],
), ),
), ),
//33 SizedBox(height: 50),
SizedBox(height: ScreenUtil().setHeight(46)), JdText(
Expanded( height: ScreenUtil().setHeight(300),
//Flutter ColumnListViewListViewExpanded title: '旧密码:',
// ListView.builder 使 ListView text: "请输入旧密码",
// child: ListView.builder( password: true,
// itemCount: listContacts.length, onChanged: (String value) {
// itemBuilder: this._getlistContacts), // print(value);
child: _listViewUser.isEmpty oldPassword = value;
? getMoreWidget(color: Colors.black26) },
: ListView( endBtn: 'ShowHiddenBtn',
padding: EdgeInsets.all(10),
children: _listViewUser,
),
), ),
Divider( SizedBox(height: 20),
height: 20.0, JdText(
indent: 0.0, height: ScreenUtil().setHeight(300),
thickness: 1.0, title: '新密码:',
color: Color.fromRGBO(80, 159, 245, 1), text: "请输入6-12位新密码",
password: true,
onChanged: (String value) {
// print(value);
newPassword1 = value;
},
endBtn: 'ShowHiddenBtn',
), ),
// Center( SizedBox(height: 20),
// child: RaisedButton( JdText(
// //padding: EdgeInsets.all(0), height: ScreenUtil().setHeight(300),
// onPressed: () { title: '新密码:',
// Navigator.pushNamed(context, '/', arguments: 0); text: "请再次输入6-12位新密码",
// }, password: true,
// //color: Colors.transparent, onChanged: (String value) {
// child: Text('退出登录'), // print(value);
// ), newPassword2 = value;
// ),
JdButton(
height: 126,
//JdText使ScreenUtil().setHeight(126) ScreenUtil().setHeight(126)
width: 350,
text: "退出登录",
color: Color.fromRGBO(80, 159, 245, 1),
onTop: () {
Navigator.pushNamed(context, '/', arguments: 0);
}, },
endBtn: 'ShowHiddenBtn',
), ),
SizedBox( SizedBox(height: 20),
height: 20.0, // Container(
alignment: Alignment(0, 0),
height: ScreenUtil().setHeight(222),
//width: ScreenUtil().setWidth(142),
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(25), right: ScreenUtil().setWidth(25)),
decoration: new BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(4.0)),
border: new Border.all(width: 1, color: Colors.grey),
),
child: Text('新密码需要6-12位可以由大小写字母、阿拉伯数字以及英文 ?、_、、@、#、\$、%、^、& 等字符组成。',
style: TextStyle(fontSize: 15)),
), ),
SizedBox(height: 60),
JdButton(
height: ScreenUtil().setHeight(382),
//height: 126,
text: "确认",
color: Colors.blueAccent,
onTop: doModifyPw,
)
], ],
), ),
), ),
onWillPop: () {
sysPop();
},
); );
} }
OnTap_MyAbout() {
PackageInfo.fromPlatform().then((PackageInfo packageInfo) {
String appName = packageInfo.appName;
String packageName = packageInfo.packageName;
String version = packageInfo.version;
String buildNumber = packageInfo.buildNumber;
String buildDate =
'${buildNumber.substring(0, 4)}.${buildNumber.substring(4, 6)}.${buildNumber.substring(6, 8)}';
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) => MyAbout(ver: version, date: buildDate)));
});
}
OnTap_MyUpdate() {
PackageInfo.fromPlatform().then((PackageInfo packageInfo) async {
String appName = packageInfo.appName;
String packageName = packageInfo.packageName;
String version = packageInfo.version;
String buildNumber = packageInfo.buildNumber;
String buildDate =
'${buildNumber.substring(0, 4)}.${buildNumber.substring(4, 6)}.${buildNumber.substring(6, 8)}';
print('appName = $appName');
print('packageName = $packageName');
print('version = $version');
print('buildNumber = $buildNumber');
print('buildDate = $buildDate');
// I/flutter (30820): appName =
// I/flutter (30820): packageName = com.flutter.hyzp_ybqx
// I/flutter (30820): version = 1.3.1
// I/flutter (30820): buildNumber = 20210508
// I/flutter (30820): buildDate = 2021.05.08
//Fluttertoast.showToast(msg: '当前版本 v$version。暂无更新', gravity: ToastGravity.CENTER);
// Navigator.of(context).push(MaterialPageRoute(
// builder: (context) => MyUpdated(ver: version, date: buildDate, theContext: context)));
MyUpdatedNew m = await MyUpdatedNew(
ver: version,
date: buildDate,
theContext: context,
bStartUpdated: true,
bShowNoNewVersion: true);
});
}
Future _getTotalSizeOfFilesInDir(final FileSystemEntity file) async {
if (file is File) {
int length = await file.length();
return double.parse(length.toString());
}
if (file is Directory) {
final List children = file.listSync();
double total = 0;
if (children != null)
for (final FileSystemEntity child in children)
total += await _getTotalSizeOfFilesInDir(child);
return total;
}
return 0;
}
OnTap_FaceLogin() async {
Navigator.of(context).push(MaterialPageRoute(builder: (context) => FaceLogin()));
}
OnTap_FaceReg() async {
Navigator.of(context).push(MaterialPageRoute(builder: (context) => FaceReg()));
}
OnTap_modify_password() {
Navigator.of(context).push(MaterialPageRoute(builder: (context) => ModifyPassword()));
}
OnTap_personal_data() {
Navigator.of(context).push(MaterialPageRoute(builder: (context) => PersonalData()));
}
OnTap_MyFeedback() {
Navigator.of(context).push(MaterialPageRoute(builder: (context) => MyFeedback()));
}
OnTap_UserAuthority() async {
//1ID
//getUserAccess(user_id: 136);
//2.2
//I/flutter (15540): g_userInfo.userGroupIDlist = [32, 33]
// g_userInfo.userRulesMap.clear();
// //getUserGroup(group_id: 27);
// getUserGroupAll(user_id: 136);
//
// Future.delayed(const Duration(milliseconds: 3500), () {
// print('g_userInfo.userRulesMap = ${g_userInfo.userRulesMap.toString()}');
// });
//I/flutter (15540): g_userInfo.userRulesMap = {32: [1968, 1972, 1973, 1969, 1976, 1977, 2008, 2009, 2011, 2014, 2015, 2018, 2029, 2030, 2031, 2054, 2055, 2035, 2036, 2037, 204
// 1, 2042, 2043, 2047, 2048, 2049, 2053, 1970, 1980, 1981, 1971, 1984, 1985, 1992, 1993, 2000, 2001, 2020, 2022], 33: [1968, 1972, 1973, 1969, 1976, 1977, 2008, 2009, 2011, 201
// 4, 2015, 2018, 2029, 2030, 2031, 2054, 2055, 2035, 2036, 2037, 2041, 2042, 2043, 2047, 2048, 2049, 2053, 1970, 1980, 1981, 1971, 1984, 1985, 1992, 1993, 2000, 2001, 2019, 202
// 0, 2022]}
// getUserGroup(group_id: g_userInfo.userGroupIDlist[0]);
// print('g_userInfo.userRulesMap = ${g_userInfo.userRulesMap.toString()}');
//I/flutter (15540): g_userInfo.userRulesMap = {32: [1968, 1972, 1973, 1969, 1976, 1977, 2008, 2009, 2011,
// 2014, 2015, 2018, 2029, 2030, 2031, 2054, 2055, 2035, 2036, 2037, 2041, 2042, 2043, 2047,
// 2048, 2049, 2053, 1970, 1980, 1981, 1971, 1984, 1985, 1992, 1993, 2000, 2001, 2020, 2022]}
// g_userInfo.userRulesMap.clear();
// getUserGroupAll();
// print('g_userInfo.userGroupIDlist = ${g_userInfo.userGroupIDlist}');
// print('g_userInfo.userGroupIDlist[0] = ${g_userInfo.userGroupIDlist[0]}');
// getUserGroup(group_id: g_userInfo.userGroupIDlist[0]);
//I/flutter (15540): g_userInfo.userGroupIDlist = [31, 27]
//getUserGroup(group_id: g_userInfo.userGroupIDlist[1]);
///3 (All)
// getRecordList(api: ServicePath.getUserGroupListUrl).then((map) {
// mapUserGroupList = map;
// });
//I/flutter ( 1422): http://125.64.218.67:9904/?s=App.User_User.GetGroupList
// I/flutter ( 1422): ...
// I/flutter ( 1422): response = {"ret":200,"data":{"items":[{"id":35,"jgid":2,"type":0,"title":"局领导","level":0,"pid":0,"sort":1,"status":1,"rules":""},{"id":34,"jgid":2,"typ
// e":0,"title":"","level":0,"pid":0,"sort":1,"status":1,"rules":""},{"id":33,"jgid":2,"type":1,"title":"","level":0,"pid":0,"sort":4,"status":1,"rules":"1968,1972
// ,1973,1969,1976,1977,2008,2009,2011,2014,2015,2018,2029,2030,2031,2054,2055,2035,2036,2037,2041,2042,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,1993,2000,200
// 1,2019,2020,2022"},{"id":32,"jgid":2,"type":0,"title":"","level":0,"pid":0,"sort":3,"status":1,"rules":"1968,1972,1973,1969,1976,1977,2008,2009,2011,2014,2015,2018,20
// 29,2030,2031,2054,2055,2035,2036,2037,2041,2042,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,1993,2000,2001,2020,2022"},{"id":31,"jgid":2,"type":0,"title":"
// ","level":0,"pid":0,"sort":2,"status":1,"rules":""},{"id":30,"jgid":2,"type":0,"title":"","level":0,"pid":0,"sort":1,"status":1,"rules":"196
// I/flutter ( 1422): mapRecordList['mapRecordListRet'] = {ret: 200, data: {items: [{id: 35, jgid: 2, type: 0, title: , level: 0, pid: 0, sort: 1, status: 1, rules: }, {id
// : 34, jgid: 2, type: 0, title: , level: 0, pid: 0, sort: 1, status: 1, rules: }, {id: 33, jgid: 2, type: 1, title: , level: 0, pid: 0, sort: 4, status: 1, rules
// : 1968,1972,1973,1969,1976,1977,2008,2009,2011,2014,2015,2018,2029,2030,2031,2054,2055,2035,2036,2037,2041,2042,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,19
// 93,2000,2001,2019,2020,2022}, {id: 32, jgid: 2, type: 0, title: , level: 0, pid: 0, sort: 3, status: 1, rules: 1968,1972,1973,1969,1976,1977,2008,2009,2011,2014,2015,
// 2018,2029,2030,2031,2054,2055,2035,2036,2037,2041,2042,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,1993,2000,2001,2020,2022}, {id: 31, jgid: 2, type: 0, title
// : , level: 0, pid: 0, sort: 2, status: 1, rules: }, {id: 30, jgid: 2, type: 0, title: , level: 0, pid: 0, sort: 1, status: 1, rules: 1968
// I/flutter ( 1422): mapRecordList['listRecordList'] = []
// I/flutter ( 1422): _list1 = [{id: 35, jgid: 2, type: 0, title: , level: 0, pid: 0, sort: 1, status: 1, rules: }, {id: 34, jgid: 2, type: 0, title: , level: 0, p
// id: 0, sort: 1, status: 1, rules: }, {id: 33, jgid: 2, type: 1, title: , level: 0, pid: 0, sort: 4, status: 1, rules: 1968,1972,1973,1969,1976,1977,2008,2009,2011,2014,
// 2015,2018,2029,2030,2031,2054,2055,2035,2036,2037,2041,2042,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,1993,2000,2001,2019,2020,2022}, {id: 32, jgid: 2, type
// : 0, title: , level: 0, pid: 0, sort: 3, status: 1, rules: 1968,1972,1973,1969,1976,1977,2008,2009,2011,2014,2015,2018,2029,2030,2031,2054,2055,2035,2036,2037,2041,20
// 42,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,1993,2000,2001,2020,2022}, {id: 31, jgid: 2, type: 0, title: , level: 0, pid: 0, sort: 2, status: 1, rule
// s: }, {id: 30, jgid: 2, type: 0, title: , level: 0, pid: 0, sort: 1, status: 1, rules: 1968,1972,1973,1974,1975,1969,1976,1977,1978,1979,1970,1
// I/flutter ( 1422): mapRecordList['listRecordList'] = [{id: 35, jgid: 2, type: 0, title: , level: 0, pid: 0, sort: 1, status: 1, rules: }, {id: 34, jgid: 2, type: 0, tit
// le: , level: 0, pid: 0, sort: 1, status: 1, rules: }, {id: 33, jgid: 2, type: 1, title: , level: 0, pid: 0, sort: 4, status: 1, rules: 1968,1972,1973,1969,1976,
// 1977,2008,2009,2011,2014,2015,2018,2029,2030,2031,2054,2055,2035,2036,2037,2041,2042,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,1993,2000,2001,2019,2020,2022
// }, {id: 32, jgid: 2, type: 0, title: , level: 0, pid: 0, sort: 3, status: 1, rules: 1968,1972,1973,1969,1976,1977,2008,2009,2011,2014,2015,2018,2029,2030,2031,2054,20
// 55,2035,2036,2037,2041,2042,2043,2047,2048,2049,2053,1970,1980,1981,1971,1984,1985,1992,1993,2000,2001,2020,2022}, {id: 31, jgid: 2, type: 0, title: , level: 0, pid: 0,
// sort: 2, status: 1, rules: }, {id: 30, jgid: 2, type: 0, title: , level: 0, pid: 0, sort: 1, status: 1, rules: 1968,1972,1973,1974,1975,1969,1
// I/flutter ( 1422): map['page'] = 1
// I/flutter ( 1422): _counter = 8
// I/flutter ( 1422): _total = 8
///5
// getRecordList(api: ServicePath.getUserAuthListUrl).then((map) {
// mapUserAuthList = map;
// });
//I/flutter ( 3512): http://125.64.218.67:9904/?s=App.User_User.GetAuthList
// I/flutter ( 3512): ...
// I/flutter ( 3512): response = {"ret":200,"data":{"items":[{"id":2069,"jgid":2,"level":2,"pid":2067,"name":"blacksmoke2/b2tj/fenxicll/fenxi","title":"分析","type":1,"status":1
// ,"condition":"","sort":9},{"id":2068,"jgid":2,"level":2,"pid":2067,"name":"blacksmoke2/b2tj/fenxicll/view","title":"查看","type":1,"status":1,"condition":"","sort":0},{"id":2
// 067,"jgid":2,"level":1,"pid":2029,"name":"blacksmoke2/b2tj/fenxicll","title":"车流量统计","type":1,"status":1,"condition":"","sort":7},{"id":2066,"jgid":2,"level":2,"pid":206
// 4,"name":"blacksmoke2/b2tj/dwinfoview/fenxi","title":"分析","type":1,"status":1,"condition":"","sort":9},{"id":2065,"jgid":2,"level":2,"pid":2064,"name":"blacksmoke2/b2tj/dwi
// nfoview/view","title":"","type":1,"status":1,"condition":"","sort":0},{"id":2064,"jgid":2,"level":1,"pid":2029,"name":"blacksmoke2/b2tj/dwinfoview","title":"
// ","type":1,"status":1,"condition":"","sort":6},{"id":2063,"jgid":2,"level":2,"pid":2061,"name":"blacksmoke2/b2tj/dwinfo/fenxi","title":"","typ
// I/flutter ( 3512): mapRecordList['mapRecordListRet'] = {ret: 200, data: {items: [{id: 2069, jgid: 2, level: 2, pid: 2067, name: blacksmoke2/b2tj/fenxicll/fenxi, title: ,
// type: 1, status: 1, condition: , sort: 9}, {id: 2068, jgid: 2, level: 2, pid: 2067, name: blacksmoke2/b2tj/fenxicll/view, title: , type: 1, status: 1, condition: , sort:
// 0}, {id: 2067, jgid: 2, level: 1, pid: 2029, name: blacksmoke2/b2tj/fenxicll, title: , type: 1, status: 1, condition: , sort: 7}, {id: 2066, jgid: 2, level: 2, pid:
// 2064, name: blacksmoke2/b2tj/dwinfoview/fenxi, title: , type: 1, status: 1, condition: , sort: 9}, {id: 2065, jgid: 2, level: 2, pid: 2064, name: blacksmoke2/b2tj/dwinfo
// view/view, title: , type: 1, status: 1, condition: , sort: 0}, {id: 2064, jgid: 2, level: 1, pid: 2029, name: blacksmoke2/b2tj/dwinfoview, title: , type:
// 1, status: 1, condition: , sort: 6}, {id: 2063, jgid: 2, level: 2, pid: 2061, name: blacksmoke2/b2tj/dwinfo/fenxi, title: , type: 1, status: 1, c
// I/flutter ( 3512): map['page'] = 1
// I/flutter ( 3512): _counter = 20
// I/flutter ( 3512): _total = 78
// I/flutter ( 3512): 1
// I/flutter ( 3512): response = {"ret":200,"data":{"items":[{"id":2042,"jgid":2,"level":1,"pid":2029,"name":"blacksmoke2/b2tj/fenxicartime","title":"车辆轨迹查询","type":1,"sta
// tus":1,"condition":"","sort":3},{"id":2041,"jgid":2,"level":2,"pid":2036,"name":"blacksmoke2/b2tj/fenxicar/fenxi","title":"","type":1,"status":1,"condition":"","sort":9},
// {"id":2037,"jgid":2,"level":2,"pid":2036,"name":"blacksmoke2/b2tj/fenxicar/view","title":"查看","type":1,"status":1,"condition":"","sort":0},{"id":2036,"jgid":2,"level":1,"pi
// d":2029,"name":"blacksmoke2/b2tj/fenxicar","title":"","type":1,"status":1,"condition":"","sort":2},{"id":2035,"jgid":2,"level":2,"pid":2030,"name":"blacksmoke
// 2/b2tj/fenxi","title":"","type":1,"status":1,"condition":"","sort":9},{"id":2034,"jgid":2,"level":2,"pid":2030,"name":"blacksmoke2/b2tj/outxls","title":"","type":1,"s
// tatus":1,"condition":"","sort":7},{"id":2031,"jgid":2,"level":2,"pid":2030,"name":"blacksmoke2/b2tj/view","title":"","type":1,"status":1,"condit
// I/flutter ( 3512): mapRecordList['mapRecordListRet'] = {ret: 200, data: {items: [{id: 2042, jgid: 2, level: 1, pid: 2029, name: blacksmoke2/b2tj/fenxicartime, title:
// , type: 1, status: 1, condition: , sort: 3}, {id: 2041, jgid: 2, level: 2, pid: 2036, name: blacksmoke2/b2tj/fenxicar/fenxi, title: , type: 1, status: 1, condition: ,
// sort: 9}, {id: 2037, jgid: 2, level: 2, pid: 2036, name: blacksmoke2/b2tj/fenxicar/view, title: , type: 1, status: 1, condition: , sort: 0}, {id: 2036, jgid: 2, level: 1
// , pid: 2029, name: blacksmoke2/b2tj/fenxicar, title: , type: 1, status: 1, condition: , sort: 2}, {id: 2035, jgid: 2, level: 2, pid: 2030, name: blacksmoke2/b
// 2tj/fenxi, title: , type: 1, status: 1, condition: , sort: 9}, {id: 2034, jgid: 2, level: 2, pid: 2030, name: blacksmoke2/b2tj/outxls, title: , type: 1, status: 1, co
// ndition: , sort: 7}, {id: 2031, jgid: 2, level: 2, pid: 2030, name: blacksmoke2/b2tj/view, title: , type: 1, status: 1, condition: , sort: 0}, {
// I/flutter ( 3512): map['page'] = 2
// I/flutter ( 3512): _counter = 40
// I/flutter ( 3512): _total = 78
// I/flutter ( 3512): 2
// I/flutter ( 3512): response = {"ret":200,"data":{"items":[{"id":2008,"jgid":2,"level":1,"pid":1969,"name":"blacksmoke2/b2yjfsls/index","title":"历史数据","type":1,"status":1,
// "condition":"","sort":2},{"id":2007,"jgid":2,"level":2,"pid":2000,"name":"blacksmoke2/b2dwinfo/inxls","title":"导入","type":1,"status":1,"condition":"","sort":8},{"id":2006,"
// jgid":2,"level":2,"pid":2000,"name":"blacksmoke2/b2dwinfo/outxls","title":"","type":1,"status":1,"condition":"","sort":7},{"id":2005,"jgid":2,"level":2,"pid":2000,"name":
// "blacksmoke2/b2dwinfo/del","title":"删除","type":1,"status":1,"condition":"","sort":4},{"id":2004,"jgid":2,"level":2,"pid":2000,"name":"blacksmoke2/b2dwinfo/lock","title":"
// ","type":1,"status":1,"condition":"","sort":3},{"id":2003,"jgid":2,"level":2,"pid":2000,"name":"blacksmoke2/b2dwinfo/edit","title":"","type":1,"status":1,"condition":""
// ,"sort":2},{"id":2002,"jgid":2,"level":2,"pid":2000,"name":"blacksmoke2/b2dwinfo/add","title":"新增","type":1,"status":1,"condition":"","sort":1},{"id":2001
// I/flutter ( 3512): mapRecordList['mapRecordListRet'] = {ret: 200, data: {items: [{id: 2008, jgid: 2, level: 1, pid: 1969, name: blacksmoke2/b2yjfsls/index, title: , t
// ype: 1, status: 1, condition: , sort: 2}, {id: 2007, jgid: 2, level: 2, pid: 2000, name: blacksmoke2/b2dwinfo/inxls, title: , type: 1, status: 1, condition: , sort: 8}, {
// id: 2006, jgid: 2, level: 2, pid: 2000, name: blacksmoke2/b2dwinfo/outxls, title: , type: 1, status: 1, condition: , sort: 7}, {id: 2005, jgid: 2, level: 2, pid: 2000, na
// me: blacksmoke2/b2dwinfo/del, title: , type: 1, status: 1, condition: , sort: 4}, {id: 2004, jgid: 2, level: 2, pid: 2000, name: blacksmoke2/b2dwinfo/lock, title: , t
// ype: 1, status: 1, condition: , sort: 3}, {id: 2003, jgid: 2, level: 2, pid: 2000, name: blacksmoke2/b2dwinfo/edit, title: , type: 1, status: 1, condition: , sort: 2}, {i
// d: 2002, jgid: 2, level: 2, pid: 2000, name: blacksmoke2/b2dwinfo/add, title: , type: 1, status: 1, condition: , sort: 1}, {id: 2001, jgid: 2, level: 2,
// I/flutter ( 3512): map['page'] = 3
// I/flutter ( 3512): _counter = 60
// I/flutter ( 3512): _total = 78
// I/flutter ( 3512): 3
// I/flutter ( 3512): response = {"ret":200,"data":{"items":[{"id":1988,"jgid":2,"level":2,"pid":1984,"name":"blacksmoke2/b2ledxs/lock","title":"锁定","type":1,"status":1,"condi
// tion":"","sort":3},{"id":1987,"jgid":2,"level":2,"pid":1984,"name":"blacksmoke2/b2ledxs/edit","title":"","type":1,"status":1,"condition":"","sort":2},{"id":1986,"jgid":2,
// "level":2,"pid":1984,"name":"blacksmoke2/b2ledxs/add","title":"新增","type":1,"status":1,"condition":"","sort":1},{"id":1985,"jgid":2,"level":2,"pid":1984,"name":"blacksmoke2
// /b2ledxs/view","title":"","type":1,"status":1,"condition":"","sort":0},{"id":1984,"jgid":2,"level":1,"pid":1971,"name":"blacksmoke2/b2ledxs/index","title":"LED","
// type":1,"status":1,"condition":"","sort":1},{"id":1983,"jgid":2,"level":2,"pid":1980,"name":"blacksmoke2/b2ts/shenhe","title":"","type":1,"status":1,"condition":"","sort"
// :5},{"id":1981,"jgid":2,"level":2,"pid":1980,"name":"blacksmoke2/b2ts/view","title":"查看","type":1,"status":1,"condition":"","sort":0},{"id":1980,"jgid":2,
// I/flutter ( 3512): mapRecordList['mapRecordListRet'] = {ret: 200, data: {items: [{id: 1988, jgid: 2, level: 2, pid: 1984, name: blacksmoke2/b2ledxs/lock, title: , type: 1
// , status: 1, condition: , sort: 3}, {id: 1987, jgid: 2, level: 2, pid: 1984, name: blacksmoke2/b2ledxs/edit, title: , type: 1, status: 1, condition: , sort: 2}, {id: 1986
// , jgid: 2, level: 2, pid: 1984, name: blacksmoke2/b2ledxs/add, title: , type: 1, status: 1, condition: , sort: 1}, {id: 1985, jgid: 2, level: 2, pid: 1984, name: blacksmo
// ke2/b2ledxs/view, title: , type: 1, status: 1, condition: , sort: 0}, {id: 1984, jgid: 2, level: 1, pid: 1971, name: blacksmoke2/b2ledxs/index, title: LED, type:
// 1, status: 1, condition: , sort: 1}, {id: 1983, jgid: 2, level: 2, pid: 1980, name: blacksmoke2/b2ts/shenhe, title: , type: 1, status: 1, condition: , sort: 5}, {id: 1981
// , jgid: 2, level: 2, pid: 1980, name: blacksmoke2/b2ts/view, title: , type: 1, status: 1, condition: , sort: 0}, {id: 1980, jgid: 2, level: 1, pid: 1970
// I/flutter ( 3512): map['page'] = 4
// I/flutter ( 3512): _counter = 78
// I/flutter ( 3512): _total = 78
///6map便
// getRecordList(api: ServicePath.getUserAuthListUrl).then((map) {
// mapUserAuthList = map;
// getUserAuth();
// });
///7map便
// getRecordList(api: ServicePath.getUserAuthListUrl).then((map) {
// mapUserAuthList = map;
// getUserAuthMap(value: 'name');
// });
///8 rtsp://125.64.218.67:9901/rtp/gb_play_34020000001320013016_34020000001320013016
// urlnew = 'rtsp://125.64.218.67:9901/rtp/gb_play_34020000001320013016_34020000001320013016';
// Navigator.of(context).push(MaterialPageRoute(
// builder: (context) => PlayerPro(
// url: urlnew,
// title: '点位视频测试',
// )));
///9 rtmp://125.64.218.67:9901/rtp/gb_play_34020000001320013016_34020000001320013016
// urlnew = 'rtmp://125.64.218.67:9901/rtp/gb_play_34020000001320013016_34020000001320013016';
// Navigator.of(context).push(MaterialPageRoute(
// builder: (context) => PlayerPro(
// url: urlnew,
// title: '点位视频测试',
// )));
// getRecordList(api: ServicePath.getUserAuthListUrl).then((map) {
// mapUserAuthList = map;
// // var _jsonStr = json.encode(getUserAuthMap(value: 'name'));
// // List _list = json.decode(_jsonStr);
//
// Map<String, dynamic> map1 = {"name": "AllenSu", "area": "郑州", "sex": "", "age": 18};
// String _jsonStr = json.encode(map1);
// //print('_jsonStr = $_jsonStr');
// //List _list = json.decode(_jsonStr);
// // Unhandled Exception: type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'List<dynamic>'
// Map map2 = json.decode(_jsonStr);
// //print('_list = ${_list}');
//
// String str = json_print(map2, 1);
// List list = ['test', 'dsaf', 'swer'];
// //segmentPrint(str);
// //print('_jsonStr = ${json_print(map2, 1)}');
//
// print('str = ${str}');
// my_segmentPrint(str);
//
// });
}
Future<Null> loadCache() async {
Directory tempDir = await getTemporaryDirectory();
double value = await _getTotalSizeOfFilesInDir(tempDir);
print('临时目录大小: ' + value.toString());
//
delDir(tempDir);
}
//
Future<Null> delDir(FileSystemEntity file) async {
if (file is Directory) {
final List<FileSystemEntity> children = file.listSync();
for (final FileSystemEntity child in children) {
await delDir(child);
}
}
await file.delete();
}
OnTap_ClearCache() async {
Directory tempDir = await getTemporaryDirectory();
print('tempDir: ' + tempDir.path);
double SizeOfFiles = await _getTotalSizeOfFilesInDir(tempDir) / 1000000;
print('临时目录大小: ${SizeOfFiles.toString()} MB');
bool ret = await showDialog(
context: context,
builder: (context) {
myController.text = '';
return CustomDialogF(
title: "选择操作",
content: '缓存大小:${SizeOfFiles.toString()} MB是否清除',
);
});
print('ret: $ret');
if (ret) {
print('清除缓存...');
//
PaintingBinding.instance.imageCache.clear();
//
delDir(tempDir);
//SharedPreferences
Storage.clear();
}
}
} }

Loading…
Cancel
Save