|
|
//import '../../../widget/player_pro.dart';
|
|
|
|
|
|
import 'package:cached_network_image/cached_network_image.dart';
|
|
|
import 'package:flustars/flustars.dart'
|
|
|
as flustars; //该组件中有ScreenUtil,// 获取网络图片尺寸flustars.WidgetUtil
|
|
|
import 'package:flutter/material.dart';
|
|
|
import 'package:flutter_drag_scale/flutter_drag_scale.dart';
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
import 'package:hyzp_ybqx511528_xingwen/widget/my_superplayer.dart';
|
|
|
import 'package:keyboard_avoider/keyboard_avoider.dart';
|
|
|
|
|
|
//
|
|
|
import '../../../components/commonFun.dart';
|
|
|
//import 'package:hyzp_ybqx511528_xingwen/widget/player_pro_new.dart';
|
|
|
import '../../../components/dioFun.dart';
|
|
|
import '../../../components/doJSON.dart';
|
|
|
import '../../../components/hyxx_data_handle.dart';
|
|
|
|
|
|
class FhycxContentNew extends StatefulWidget {
|
|
|
FhycxContentNew({
|
|
|
@required this.hyshlx,
|
|
|
@required this.title,
|
|
|
this.indexRecord,
|
|
|
this.id,
|
|
|
Key key,
|
|
|
}) : super(key: key);
|
|
|
String title;
|
|
|
int indexRecord = 0;
|
|
|
int id = -1;
|
|
|
String hyshlx;
|
|
|
|
|
|
_FhycxPageState createState() => _FhycxPageState();
|
|
|
}
|
|
|
|
|
|
//用TabController实现顶部tab切换
|
|
|
class _FhycxPageState extends State<FhycxContentNew> {
|
|
|
//try_setState(); //避免如下异常报错
|
|
|
try_setState() {
|
|
|
try {
|
|
|
setState(() {});
|
|
|
} catch (e) {
|
|
|
print('setState(() {})异常:${e}');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
dispose() {
|
|
|
super.dispose();
|
|
|
}
|
|
|
|
|
|
BuildContext _context;
|
|
|
String _title = '';
|
|
|
|
|
|
//flutter_screenUtil 4.x 用法,ScreenUtil.screenWidth (sdk>=2.6 : 1.sw) //设备宽度
|
|
|
double _screenWidth = 1.sw;
|
|
|
|
|
|
double _marginLeft = 25;
|
|
|
double _marginCenter = 20;
|
|
|
double _fontSize = 16;
|
|
|
double _widthLeft = 40; // = _screenWidth / 3;
|
|
|
double _iconSize = 18;
|
|
|
double _stampSize = 100;
|
|
|
double _listTileHeight = 30;
|
|
|
Color _iconColor = Colors.blue;
|
|
|
double _marginVer = 10;
|
|
|
|
|
|
Map _mapTsjjGetTsStatus = {};
|
|
|
|
|
|
void initState() {
|
|
|
super.initState();
|
|
|
|
|
|
_context = context;
|
|
|
_widthLeft = _screenWidth / 2.6;
|
|
|
getListFlields();
|
|
|
}
|
|
|
|
|
|
Map _mapGetTsjjGetData = {
|
|
|
"ret": 200,
|
|
|
"data": {
|
|
|
"id": 1203,
|
|
|
"plate_id": "川QS9661",
|
|
|
"plate_color": "蓝色",
|
|
|
"zpsj": 1612770967,
|
|
|
"yjxx_id": "1379",
|
|
|
"workflow": 2,
|
|
|
"video_url": "video/9_6063_20210208_155607_川QS9661.mp4",
|
|
|
"pic_url": "/wwwroot/admin/Api/wwwroot/public/uploads/926f5168f1fe109a9b8ec88dcac7ac2c.jpg",
|
|
|
"clfl": "皮卡车",
|
|
|
"dwip": "172.16.3.9",
|
|
|
"dwms": "宜长路出城方向",
|
|
|
"lgmzs": 3,
|
|
|
"jczxd": "863",
|
|
|
"sfhy": "黑烟车"
|
|
|
},
|
|
|
"msg": ""
|
|
|
};
|
|
|
double _radioImage = 9 / 16;
|
|
|
|
|
|
getListFlields() async {
|
|
|
_mapGetTsjjGetData = await getWzxxItemData(widget.id); //获取指定id的违章信息返回 _mapGetTsjjGetData
|
|
|
print('_mapGetTsjjGetData = ${_mapGetTsjjGetData}');
|
|
|
await getShenheData(widget.id); //获取指定id的审核信息存入 listGetShenheData
|
|
|
await getMapGetShenheData(); //从listGetShenheData中取出数据分别存入mapGetHycsShenheData、mapGetHyfhShenheData
|
|
|
|
|
|
// 获取推送交警状态信息
|
|
|
// tsjjGetTsStatus返回字段 类型 说明
|
|
|
// id 整型 违章记录ID
|
|
|
// checkid 整型 推送的抓拍记录ID
|
|
|
// tszt 整型 推送状态:0-未推送 | 1-推送失败 | 3-推送成功
|
|
|
// ts_time 字符串 推送时间
|
|
|
//Future tsjjGetTsStatus(int _wzxxID)
|
|
|
_mapTsjjGetTsStatus = await tsjjGetTsStatus(widget.id);
|
|
|
|
|
|
// 获取网络图片尺寸
|
|
|
flustars.WidgetUtil.getImageWH(url: getMediaUrl(_mapGetTsjjGetData['pic_url'])).then((rect) {
|
|
|
if (null != rect) {
|
|
|
_radioImage = rect.height / rect.width;
|
|
|
}
|
|
|
});
|
|
|
|
|
|
imageWztp = getWztp(); //得到违章图片
|
|
|
|
|
|
//下面读取的是全局数据,该模块不需要修改
|
|
|
// 川Q565H4
|
|
|
try {
|
|
|
//_title = '${widget.title}(${(widget.indexRecord + 1).toString()} / ${listHycsGetList2.length})id:${listHycsGetList2[widget.indexRecord]['id']}';
|
|
|
//_title = '${widget.title}(${(widget.indexRecord + 1).toString()} / ${listHycsGetList2.length}):${listHycsGetList2[widget.indexRecord]["plate_id"]}(${listHycsGetList2[widget.indexRecord]["plate_color"]})';
|
|
|
_title =
|
|
|
'${widget.title}(${(widget.indexRecord + 1).toString()} / ${listHycsGetList2.length})';
|
|
|
setState(() {});
|
|
|
} catch (e) {}
|
|
|
}
|
|
|
|
|
|
// 使用 cached_network_image 插件实现网络图片缓存
|
|
|
// 使用 flutter_drag_scale 实现可缩放可拖拽双击放大的图片功能。PhotoView插件不好用,有问题
|
|
|
Widget getNetworkImage(String url) {
|
|
|
return CachedNetworkImage(
|
|
|
imageUrl: url,
|
|
|
alignment: Alignment.topCenter,
|
|
|
imageBuilder: (context, imageProvider) => DragScaleContainer(
|
|
|
doubleTapStillScale: true, child: Image(image: imageProvider)
|
|
|
// child: Image(
|
|
|
// image: NetworkImage(
|
|
|
// 'http://h.hiphotos.baidu.com/zhidao/wh%3D450%2C600/sign=0d023672312ac65c67506e77cec29e27/9f2f070828381f30dea167bbad014c086e06f06c.jpg'),
|
|
|
// ),
|
|
|
),
|
|
|
// imageBuilder: (context, imageProvider) => PhotoView(
|
|
|
// imageProvider: imageProvider,
|
|
|
// ),
|
|
|
//placeholder: (context, url) => CircularProgressIndicator(),
|
|
|
placeholder: (context, url) =>
|
|
|
getMoreWidget(color: Colors.black38, size: 20.0, strokeWidth: 2.0),
|
|
|
errorWidget: (context, url, error) => Icon(Icons.error),
|
|
|
);
|
|
|
}
|
|
|
|
|
|
// 167 50 3.34
|
|
|
Widget getLgmzs(int lgmzs, {double width = 127, double height = 127}) {
|
|
|
int _rgb = (255 * (5 - lgmzs)) ~/ 5;
|
|
|
return Stack(
|
|
|
children: [
|
|
|
Container(
|
|
|
width: ScreenUtil().setWidth(width),
|
|
|
height: ScreenUtil().setHeight(height),
|
|
|
padding: EdgeInsets.only(
|
|
|
right: ScreenUtil().setWidth(6), left: ScreenUtil().setWidth(6), top: 0, bottom: 4),
|
|
|
child: Column(
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
children: [
|
|
|
Text('$lgmzs级${lgmzs * 20}%', style: TextStyle(fontSize: 10)),
|
|
|
//SizedBox(height: 0),
|
|
|
Container(
|
|
|
width: ScreenUtil().setWidth(66),
|
|
|
height: ScreenUtil().setHeight(66),
|
|
|
decoration: BoxDecoration(
|
|
|
border: Border.all(color: Colors.grey),
|
|
|
color: Color.fromRGBO(_rgb, _rgb, _rgb, 1.0),
|
|
|
borderRadius: new BorderRadius.circular(0),
|
|
|
),
|
|
|
)
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
Positioned(
|
|
|
top: ScreenUtil().setHeight(4),
|
|
|
child: Container(
|
|
|
width: ScreenUtil().setWidth(width),
|
|
|
height: ScreenUtil().setHeight(height - 8),
|
|
|
padding: EdgeInsets.only(
|
|
|
right: ScreenUtil().setWidth(6), left: ScreenUtil().setWidth(6), top: 0, bottom: 0),
|
|
|
decoration: BoxDecoration(
|
|
|
border: Border.all(
|
|
|
color: (lgmzs == _mapGetTsjjGetData['lgmzs'])
|
|
|
? Colors.red
|
|
|
: Color.fromRGBO(244, 244, 244, 1),
|
|
|
width: 2),
|
|
|
//color: Colors.lightBlue,
|
|
|
borderRadius: new BorderRadius.circular(3.0),
|
|
|
),
|
|
|
),
|
|
|
)
|
|
|
],
|
|
|
);
|
|
|
}
|
|
|
|
|
|
//得到tsjj页面组件
|
|
|
//1、得到格林曼黑度标准和视频播放按钮组件
|
|
|
Widget getHdAndPlay() {
|
|
|
return Row(
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
children: <Widget>[
|
|
|
getLgmzs(0),
|
|
|
getLgmzs(1),
|
|
|
getLgmzs(2),
|
|
|
getLgmzs(3),
|
|
|
getLgmzs(4),
|
|
|
getLgmzs(5, width: 153),
|
|
|
getIconBtnSizeX(
|
|
|
height: 104,
|
|
|
//getIconBtnSizeX 中已经使用ScreenUtil().setHeight(126),此处不能传 ScreenUtil().setHeight(126) ,否则严重错位
|
|
|
width: 168,
|
|
|
text: "视频",
|
|
|
textSize: 12,
|
|
|
circular: 4,
|
|
|
color: Color.fromRGBO(52, 157, 237, 1),
|
|
|
onTop: () async {
|
|
|
if (Playing) {
|
|
|
//禁止同时启动两次播放器
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
Playing = true; //禁止同时启动两次播放器
|
|
|
urlnew = getMediaUrl(_mapGetTsjjGetData['video_url']);
|
|
|
|
|
|
//获取视频地址失败
|
|
|
if (!isVideoUrl(urlnew)) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
Navigator.of(_context).push(MaterialPageRoute(
|
|
|
builder: (context) => SuperPlayerPage(
|
|
|
loop: 0, //设置播放循环,默认播放器的循环次数是1, 即不循环播放。如果设置循环次数0,表示无限循环。
|
|
|
url: urlnew,
|
|
|
title:
|
|
|
'违章视频: ${_mapGetTsjjGetData["plate_id"]}\n${_mapGetTsjjGetData['dwms']}')));
|
|
|
|
|
|
// Navigator.of(_context).push(MaterialPageRoute(
|
|
|
// builder: (context) => PlayerProNew(
|
|
|
// loop: 0, //设置播放循环,默认播放器的循环次数是1, 即不循环播放。如果设置循环次数0,表示无限循环。
|
|
|
// url: urlnew,
|
|
|
// title:
|
|
|
// '违章视频: ${_mapGetTsjjGetData["plate_id"]}\n${_mapGetTsjjGetData['dwms']}')));
|
|
|
},
|
|
|
),
|
|
|
SizedBox(width: ScreenUtil().setWidth(15)),
|
|
|
],
|
|
|
);
|
|
|
}
|
|
|
|
|
|
Widget imageWztp;
|
|
|
|
|
|
//2、得到违章图片组件
|
|
|
Widget getWztp() {
|
|
|
//ratioList[index] = 0.5714285714285714
|
|
|
return Stack(
|
|
|
children: [
|
|
|
Container(
|
|
|
width: ScreenUtil().setWidth(1022),
|
|
|
//height: ScreenUtil().setHeight(639),
|
|
|
//height: ScreenUtil().setHeight(22 + 1022 * _radioImage),
|
|
|
height: ScreenUtil().setHeight(30 + 1022 * _radioImage),
|
|
|
decoration: BoxDecoration(
|
|
|
//color: Colors.white,
|
|
|
borderRadius: BorderRadius.all(
|
|
|
Radius.circular(12),
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
Positioned(
|
|
|
//left: ScreenUtil().setWidth(_marginLeft),
|
|
|
top: ScreenUtil().setHeight(_marginLeft),
|
|
|
child: Container(
|
|
|
width: ScreenUtil().setWidth(1022),
|
|
|
height: ScreenUtil().setHeight(30 + 1022 * _radioImage),
|
|
|
child: getNetworkImage(getMediaUrl(_mapGetTsjjGetData['pic_url'])),
|
|
|
),
|
|
|
)
|
|
|
],
|
|
|
);
|
|
|
}
|
|
|
|
|
|
// void printScreenInformation() {
|
|
|
// print('Device width dp:${1.sw}dp');
|
|
|
// print('Device height dp:${1.sh}dp');
|
|
|
// print('Device pixel density:${ScreenUtil().pixelRatio}');
|
|
|
// print('Bottom safe zone distance dp:${ScreenUtil().bottomBarHeight}dp');
|
|
|
// print('Status bar height dp:${ScreenUtil().statusBarHeight}dp');
|
|
|
// print('The ratio of actual width to UI design:${ScreenUtil().scaleWidth}');
|
|
|
// print(
|
|
|
// 'The ratio of actual height to UI design:${ScreenUtil().scaleHeight}');
|
|
|
// print('System font scaling:${ScreenUtil().textScaleFactor}');
|
|
|
// print('0.5 times the screen width:${0.5.sw}dp');
|
|
|
// print('0.5 times the screen height:${0.5.sh}dp');
|
|
|
// }
|
|
|
|
|
|
void printScreenInformation() {
|
|
|
print('ScreenUtil().screenWidth = ${ScreenUtil().screenWidth}');
|
|
|
print('设备宽度:${1.sw}dp');
|
|
|
print('"1.w" = ${1.w}');
|
|
|
print('"1.sw" = ${1.sw}');
|
|
|
print('设备高度:${1.sh}dp');
|
|
|
print('设备的像素密度:${ScreenUtil().pixelRatio}');
|
|
|
print('底部安全区距离:${ScreenUtil().bottomBarHeight}dp');
|
|
|
print('状态栏高度:${ScreenUtil().statusBarHeight}dp');
|
|
|
print('实际宽度的dp与设计稿px的比例:${ScreenUtil().scaleWidth}');
|
|
|
print('实际高度的dp与设计稿px的比例:${ScreenUtil().scaleHeight}');
|
|
|
print('宽度和字体相对于设计稿放大的比例:${ScreenUtil().scaleWidth * ScreenUtil().pixelRatio}');
|
|
|
print('高度相对于设计稿放大的比例:${ScreenUtil().scaleHeight * ScreenUtil().pixelRatio}');
|
|
|
print('系统的字体缩放比例:${ScreenUtil().textScaleFactor}');
|
|
|
print('屏幕宽度的0.5:${0.5.sw}dp');
|
|
|
print('屏幕高度的0.5:${0.5.sh}dp');
|
|
|
}
|
|
|
|
|
|
//3、得到违章图片说明信息组件
|
|
|
Widget getWztpSmxx() {
|
|
|
return Container(
|
|
|
width: ScreenUtil().setWidth(1022),
|
|
|
height: ScreenUtil().setHeight(280),
|
|
|
decoration: BoxDecoration(
|
|
|
color: Colors.white,
|
|
|
borderRadius: BorderRadius.all(
|
|
|
Radius.circular(12),
|
|
|
),
|
|
|
),
|
|
|
child: Column(
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
children: [
|
|
|
getWzxxPart1(),
|
|
|
getWzxxPart2(),
|
|
|
getWzxxPart3(),
|
|
|
],
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
|
|
|
// I/flutter (22989): ScreenUtil().screenWidth = 360.0
|
|
|
// I/flutter (22989): 设备宽度:360.0dp
|
|
|
// I/flutter (22989): "1.w" = 0.3333333333333333
|
|
|
// I/flutter (22989): "1.sw" = 360.0
|
|
|
// I/flutter (22989): 设备高度:640.0dp
|
|
|
// I/flutter (22989): 设备的像素密度:3.0
|
|
|
// I/flutter (22989): 底部安全区距离:0.0dp
|
|
|
// I/flutter (22989): 状态栏高度:24.0dp
|
|
|
// I/flutter (22989): 实际宽度的dp与设计稿px的比例:0.3333333333333333
|
|
|
// I/flutter (22989): 实际高度的dp与设计稿px的比例:0.3333333333333333
|
|
|
// I/flutter (22989): 宽度和字体相对于设计稿放大的比例:1.0
|
|
|
// I/flutter (22989): 高度相对于设计稿放大的比例:1.0
|
|
|
// I/flutter (22989): 系统的字体缩放比例:1.0
|
|
|
// I/flutter (22989): 屏幕宽度的0.5:180.0dp
|
|
|
// I/flutter (22989): 屏幕高度的0.5:320.0dp
|
|
|
|
|
|
//3、得到违章信息组件1:车牌号码、车牌颜色
|
|
|
//车牌颜色Map cpysMap = {
|
|
|
// '蓝色': cpysItem(
|
|
|
// cpysText: '蓝色',
|
|
|
// cpysBackground: Colors.blue,
|
|
|
// cpysFont: Colors.white,
|
|
|
// cpysBorder: Colors.orange),
|
|
|
// }
|
|
|
Widget getWzxxPart1() {
|
|
|
//printScreenInformation();
|
|
|
return Row(
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
children: <Widget>[
|
|
|
SizedBox(width: ScreenUtil().setWidth(_marginLeft)),
|
|
|
getTitleText('车牌号码:'),
|
|
|
getBoderText(_mapGetTsjjGetData['plate_id'].toString(),
|
|
|
width: ScreenUtil().setWidth(1022 / 3.2)),
|
|
|
SizedBox(width: ScreenUtil().setWidth(_marginCenter)),
|
|
|
getTitleText('颜色:'),
|
|
|
getBoderText(_mapGetTsjjGetData['plate_color'], width: ScreenUtil().setWidth(1022 / 4.8)),
|
|
|
],
|
|
|
);
|
|
|
}
|
|
|
|
|
|
Widget getTitleText(String text, {double fontSize = 16}) {
|
|
|
return Text(text,
|
|
|
style: TextStyle(fontSize: fontSize),
|
|
|
textAlign: TextAlign.left,
|
|
|
overflow: TextOverflow.ellipsis);
|
|
|
}
|
|
|
|
|
|
Widget getTrailText(String text, {double fontSize = 16, double off = 0}) {
|
|
|
return Container(
|
|
|
width: _screenWidth - _widthLeft - off - (2 * ScreenUtil().setWidth(_marginLeft)),
|
|
|
child: Text(text,
|
|
|
style: TextStyle(fontSize: fontSize),
|
|
|
textAlign: TextAlign.left,
|
|
|
overflow: TextOverflow.ellipsis),
|
|
|
);
|
|
|
}
|
|
|
|
|
|
Widget getBoderText(String text, {double width = 40}) {
|
|
|
cpysItem _cpysItem = cpysMap[_mapGetTsjjGetData['plate_color']];
|
|
|
|
|
|
return Container(
|
|
|
//color: _cpysItem.cpysBackground,
|
|
|
alignment: Alignment(0, -1),
|
|
|
width: width,
|
|
|
decoration: BoxDecoration(
|
|
|
border: Border.all(color: _cpysItem.cpysBorder, width: 2),
|
|
|
color: _cpysItem.cpysBackground,
|
|
|
borderRadius: BorderRadius.circular(3),
|
|
|
),
|
|
|
child: Padding(
|
|
|
padding: EdgeInsets.only(bottom: 3),
|
|
|
child: Text(text,
|
|
|
style: TextStyle(fontSize: _fontSize, color: _cpysItem.cpysFont),
|
|
|
textAlign: TextAlign.left,
|
|
|
overflow: TextOverflow.ellipsis),
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
|
|
|
//I/flutter (17555): _mapGetTsjjGetData = {
|
|
|
// id: 1222, plate_id: 川Q736X2, plate_color: 蓝色, zpsj: 1612857077, yjxx_id: 1399, workflow: 999,
|
|
|
// video_url: video/9_6063_20210209_155117_川Q736X2.mp4,
|
|
|
// pic_url: /wwwroot/admin/Api/wwwroot/public/uploads/9d2f45fd24b41f2b94abe42b30970d75.jpg,
|
|
|
// clfl: 集装箱卡车, dwip: 172.16.3.9, dwms: 宜长路出城方向, lgmzs: 3, jczxd: 994, sfhy: 黑烟车
|
|
|
// }
|
|
|
|
|
|
Widget getIcon(IconData _iconData) {
|
|
|
return Container(
|
|
|
width: _iconSize - 2,
|
|
|
height: _iconSize,
|
|
|
child: Padding(
|
|
|
padding: EdgeInsets.only(top: 2),
|
|
|
child: Icon(_iconData, size: _iconSize, color: _iconColor),
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
|
|
|
//4、得到违章信息组件2:抓拍时间组件
|
|
|
Widget getWzxxPart2() {
|
|
|
return Row(
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
children: <Widget>[
|
|
|
SizedBox(width: ScreenUtil().setWidth(_marginLeft)),
|
|
|
Container(
|
|
|
alignment: Alignment(-1, 0),
|
|
|
width: ScreenUtil().setWidth(1022) - ScreenUtil().setWidth(_marginLeft),
|
|
|
child: getTitleText(
|
|
|
'抓拍时间:' +
|
|
|
getDate(
|
|
|
(_mapGetTsjjGetData['zpsj'] is int)
|
|
|
? _mapGetTsjjGetData['zpsj']
|
|
|
: int.parse(_mapGetTsjjGetData['zpsj']),
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
],
|
|
|
);
|
|
|
}
|
|
|
|
|
|
Widget getWzxxPart3() {
|
|
|
return Row(
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
children: <Widget>[
|
|
|
SizedBox(width: ScreenUtil().setWidth(_marginLeft)),
|
|
|
Container(
|
|
|
alignment: Alignment(-1, 0),
|
|
|
width: ScreenUtil().setWidth(1022) - ScreenUtil().setWidth(_marginLeft),
|
|
|
child: getTitleText('抓拍地点:' + _mapGetTsjjGetData['dwms']),
|
|
|
),
|
|
|
],
|
|
|
);
|
|
|
}
|
|
|
|
|
|
//6、得到审核信息组件4:违章类型、格林曼黑度组件
|
|
|
Widget getWzxxPart4() {
|
|
|
return Row(
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
children: <Widget>[
|
|
|
SizedBox(width: ScreenUtil().setWidth(_marginLeft)),
|
|
|
Container(
|
|
|
alignment: Alignment(-1, 0),
|
|
|
width: _widthLeft,
|
|
|
child: getTitleText('违章类型:' + _mapGetTsjjGetData['sfhy']),
|
|
|
),
|
|
|
SizedBox(width: ScreenUtil().setWidth(_marginLeft)),
|
|
|
//getIcon(Icons.location_on_outlined),
|
|
|
Container(
|
|
|
width: _iconSize,
|
|
|
height: _iconSize,
|
|
|
decoration: BoxDecoration(
|
|
|
//color: Colors.white,
|
|
|
image: DecorationImage(image: AssetImage("assets/images/hyc.png"), fit: BoxFit.contain),
|
|
|
),
|
|
|
alignment: Alignment.center,
|
|
|
//child:
|
|
|
),
|
|
|
getTrailText(':' + _mapGetTsjjGetData['lgmzs'].toString(), off: _iconSize),
|
|
|
],
|
|
|
);
|
|
|
}
|
|
|
|
|
|
//从listGetShenheData中取出数据分别存入mapGetHycsShenheData、mapGetHyfhShenheData
|
|
|
//7、得到审核信息组件5:初审人员,初审时间
|
|
|
Widget getWzxxPart5() {
|
|
|
return Row(
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
children: <Widget>[
|
|
|
SizedBox(width: ScreenUtil().setWidth(_marginLeft)),
|
|
|
Container(
|
|
|
alignment: Alignment(-1, 0),
|
|
|
width: _widthLeft,
|
|
|
child: getTitleText('初审人员:' + mapGetHycsShenheData['uname']),
|
|
|
),
|
|
|
SizedBox(width: ScreenUtil().setWidth(_marginLeft)),
|
|
|
getIcon(Icons.query_builder),
|
|
|
getTrailText(':' + mapGetHycsShenheData['addtime'], off: _iconSize),
|
|
|
],
|
|
|
);
|
|
|
}
|
|
|
|
|
|
//8、得到审核信息组件6:复审人员,复审时间
|
|
|
Widget getWzxxPart6() {
|
|
|
return Row(
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
children: <Widget>[
|
|
|
SizedBox(width: ScreenUtil().setWidth(_marginLeft)),
|
|
|
Container(
|
|
|
alignment: Alignment(-1, 0),
|
|
|
width: _widthLeft,
|
|
|
child: getTitleText('复审人员:' + mapGetHyfhShenheData['uname']),
|
|
|
),
|
|
|
SizedBox(width: ScreenUtil().setWidth(_marginLeft)),
|
|
|
getIcon(Icons.query_builder),
|
|
|
getTrailText(':' + mapGetHyfhShenheData['addtime'], off: _iconSize),
|
|
|
],
|
|
|
);
|
|
|
}
|
|
|
|
|
|
//5、得到黑烟初审'hycsInfo'、或者黑烟'hyfhInfo'複核信息组件
|
|
|
//style: TextStyle(fontSize: _fontSize),
|
|
|
Widget getHyshInfo(String _hyshInfo) {
|
|
|
String _hyshlx = '初审';
|
|
|
Map _hyshMap = mapGetHycsShenheData;
|
|
|
if (_hyshInfo == 'hyfhInfo') {
|
|
|
_hyshlx = '复审';
|
|
|
if (mapGetHyfhShenheData.isNotEmpty) {
|
|
|
_hyshMap = mapGetHyfhShenheData;
|
|
|
} else {
|
|
|
//保留_hyshMap所有字段,但遍历清空所有字段的值
|
|
|
_hyshMap.forEach((var key, var value) {
|
|
|
_hyshMap[key] = '';
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
double _radio = 2.2;
|
|
|
return Container(
|
|
|
width: ScreenUtil().setWidth(1022),
|
|
|
height: ScreenUtil().setHeight(161),
|
|
|
decoration: BoxDecoration(
|
|
|
color: Colors.white,
|
|
|
borderRadius: BorderRadius.all(
|
|
|
Radius.circular(12),
|
|
|
),
|
|
|
),
|
|
|
child: Column(
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
children: [
|
|
|
Row(
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
children: <Widget>[
|
|
|
Container(
|
|
|
alignment: Alignment(-1, 0),
|
|
|
width: ScreenUtil().setWidth(1022) / _radio,
|
|
|
child: Row(
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
children: <Widget>[
|
|
|
SizedBox(width: ScreenUtil().setWidth(_marginLeft)),
|
|
|
Text('$_hyshlx结果:' + _hyshMap['title'],
|
|
|
textAlign: TextAlign.left, overflow: TextOverflow.ellipsis),
|
|
|
SizedBox(width: ScreenUtil().setWidth(6)),
|
|
|
Container(
|
|
|
width: my_iconSize,
|
|
|
height: my_iconSize,
|
|
|
decoration: _hyshMap['title'] == ''
|
|
|
? null
|
|
|
: BoxDecoration(
|
|
|
//color: Colors.white,
|
|
|
image: DecorationImage(
|
|
|
image: AssetImage(_hyshMap['title'] == "黑烟车"
|
|
|
? "assets/images/hyc.png"
|
|
|
: "assets/images/fhyc.png"),
|
|
|
fit: BoxFit.contain),
|
|
|
),
|
|
|
alignment: Alignment.center,
|
|
|
//child:
|
|
|
),
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
SizedBox(width: ScreenUtil().setWidth(_marginLeft)),
|
|
|
Expanded(
|
|
|
child: Text('意见:' + _hyshMap['shuoming'],
|
|
|
textAlign: TextAlign.left, overflow: TextOverflow.ellipsis),
|
|
|
),
|
|
|
],
|
|
|
),
|
|
|
Row(
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
children: <Widget>[
|
|
|
Container(
|
|
|
alignment: Alignment(-1, 0),
|
|
|
width: ScreenUtil().setWidth(1022) / _radio,
|
|
|
child: Row(mainAxisAlignment: MainAxisAlignment.start, children: <Widget>[
|
|
|
SizedBox(width: ScreenUtil().setWidth(_marginLeft)),
|
|
|
Text('$_hyshlx用户:' + _hyshMap['uname'],
|
|
|
textAlign: TextAlign.left, overflow: TextOverflow.ellipsis),
|
|
|
]),
|
|
|
),
|
|
|
SizedBox(width: ScreenUtil().setWidth(_marginLeft)),
|
|
|
Expanded(
|
|
|
child: Text('时间:' + _hyshMap['addtime'],
|
|
|
textAlign: TextAlign.left, overflow: TextOverflow.ellipsis),
|
|
|
),
|
|
|
],
|
|
|
),
|
|
|
],
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
|
|
|
//9、得到推送交警状态信息组件7:推送状态
|
|
|
// tszt 整型 推送状态:0-未推送 | 1-推送失败 | 3-推送成功
|
|
|
//_mapTsjjGetTsStatus['tszt']
|
|
|
Widget getWzxxPart7() {
|
|
|
return Row(
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
children: <Widget>[
|
|
|
SizedBox(width: ScreenUtil().setWidth(_marginLeft)),
|
|
|
Container(
|
|
|
alignment: Alignment(-1, 0),
|
|
|
width: _screenWidth - ScreenUtil().setWidth(_marginLeft),
|
|
|
child: getTitleText('推送状态:' + mapTsztText[_mapTsjjGetTsStatus['tszt']]),
|
|
|
),
|
|
|
],
|
|
|
);
|
|
|
}
|
|
|
|
|
|
//10、得到推送交警确认组件
|
|
|
Widget getTsjjQr() {
|
|
|
return Row(
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
children: <Widget>[
|
|
|
getBtnSizeX(
|
|
|
text: "返回",
|
|
|
onPressedFun: () async {
|
|
|
Navigator.pop(context);
|
|
|
},
|
|
|
width: 90.0),
|
|
|
],
|
|
|
);
|
|
|
}
|
|
|
|
|
|
bool showMoreWidget = false;
|
|
|
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
return Scaffold(
|
|
|
//resizeToAvoidBottomPadding: false,
|
|
|
appBar: PreferredSize(
|
|
|
preferredSize: Size.fromHeight(ScreenUtil().setHeight(173)), // 设置appBar高度
|
|
|
// 设置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: showMoreWidget
|
|
|
? null
|
|
|
: () {
|
|
|
Navigator.pop(context);
|
|
|
},
|
|
|
),
|
|
|
Expanded(
|
|
|
child: Text(_title,
|
|
|
style: TextStyle(color: Colors.white, fontSize: 20),
|
|
|
textAlign: TextAlign.center,
|
|
|
overflow: TextOverflow.ellipsis),
|
|
|
),
|
|
|
SizedBox(width: 30),
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
body: null == imageWztp
|
|
|
// 显示加载中的圈圈
|
|
|
? getMoreWidget(color: Colors.black38, size: 20.0, strokeWidth: 2.0)
|
|
|
: Stack(
|
|
|
children: [
|
|
|
//SizedBox.shrink() 创建父类允许最小尺寸的约束Box
|
|
|
showMoreWidget
|
|
|
? Align(
|
|
|
alignment: Alignment(0, 0.8),
|
|
|
child: Container(
|
|
|
height: 200,
|
|
|
width: 200,
|
|
|
child: getMoreWidget2(
|
|
|
text: '推送中...',
|
|
|
color: Colors.red,
|
|
|
size: 40.0,
|
|
|
strokeWidth: 3.0), //显示加载中的圈圈,
|
|
|
),
|
|
|
)
|
|
|
: SizedBox.shrink(),
|
|
|
KeyboardAvoider(
|
|
|
autoScroll: true,
|
|
|
child: Container(
|
|
|
color: Color.fromRGBO(244, 244, 244, 1),
|
|
|
child: Column(
|
|
|
children: <Widget>[
|
|
|
//1、得到格林曼黑度标准和视频播放按钮组件
|
|
|
getHdAndPlay(),
|
|
|
//2、得到违章图片组件
|
|
|
imageWztp,
|
|
|
SizedBox(height: ScreenUtil().setHeight(_marginVer)),
|
|
|
//3、得到违章图片说明信息组件
|
|
|
getWztpSmxx(),
|
|
|
SizedBox(height: ScreenUtil().setHeight(_marginVer)),
|
|
|
//7、得到黑烟初审信息组件
|
|
|
getHyshInfo('hycsInfo'),
|
|
|
SizedBox(height: ScreenUtil().setHeight(_marginVer)),
|
|
|
//8、得到黑烟复审信息组件
|
|
|
getHyshInfo('hyfhInfo'),
|
|
|
SizedBox(height: ScreenUtil().setHeight(_marginVer)),
|
|
|
// //7、得到审核信息组件5:初审人员,初审时间
|
|
|
// getWzxxPart5(),
|
|
|
// //8、得到审核信息组件6:复审人员,复审时间
|
|
|
// getWzxxPart6(),
|
|
|
// SizedBox(height: 6),
|
|
|
// Divider(height: 1.0, color: Colors.blue),
|
|
|
// SizedBox(height: 6),
|
|
|
//6、得到推送交警状态信息组件7:推送状态
|
|
|
//getWzxxPart7(),
|
|
|
// SizedBox(height: 8),
|
|
|
// Divider(height: 1.0, color: Colors.blue),
|
|
|
SizedBox(height: 18),
|
|
|
//9、得到推送交警确认组件
|
|
|
getTsjjQr(),
|
|
|
SizedBox(height: 10),
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
Positioned(
|
|
|
//alignment: Alignment(0.9, 0.35),
|
|
|
//alignment: Alignment(0.8, 0.45),
|
|
|
right: ScreenUtil().setWidth(80),
|
|
|
top: ScreenUtil().setHeight(1045),
|
|
|
child: Container(
|
|
|
//alignment: Alignment(0.5, -0.5),
|
|
|
width: _stampSize,
|
|
|
height: _stampSize,
|
|
|
//color: Colors.black12,
|
|
|
decoration: BoxDecoration(
|
|
|
//color: Colors.white,
|
|
|
image: DecorationImage(
|
|
|
//image: AssetImage("assets/images/jkzx_stamp.png"), fit: BoxFit.contain),
|
|
|
image: AssetImage("assets/images/fhyc.png"),
|
|
|
fit: BoxFit.contain),
|
|
|
),
|
|
|
//child:
|
|
|
),
|
|
|
),
|
|
|
],
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
|
|
|
Widget getBtnSizeX({@required text, width = 70.0, height = 35.0, onPressedFun}) {
|
|
|
return Container(
|
|
|
color: Colors.white12, //onPressedFun为null时无效
|
|
|
width: width,
|
|
|
height: height,
|
|
|
child: RaisedButton(
|
|
|
padding: EdgeInsets.all(0),
|
|
|
textColor: Colors.black,
|
|
|
child: Text(text),
|
|
|
onPressed: onPressedFun,
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
}
|