hyzp_ybqx-Commit148:优化今日统计详情页面的布局,在一个页面中就能显示完,避免滚动

master
WinUser01 4 years ago
parent 05fc688d4b
commit e16c970b9a

@ -1,6 +1,7 @@
//import '../../../widget/player_pro.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flustars/flustars.dart' as flustars; //ScreenUtil
import 'package:flutter/material.dart';
import 'package:flutter_drag_scale/flutter_drag_scale.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -11,7 +12,6 @@ import 'package:keyboard_avoider/keyboard_avoider.dart';
import '../../../components/commonFun.dart';
import '../../../components/doJSON.dart';
import '../../../components/hyxx_data_handle.dart';
import 'package:flustars/flustars.dart' as flustars; //ScreenUtil
// "today": {
// "total": 4,
@ -520,6 +520,35 @@ class _TodayListZpjlPageState extends State<TodayListZpjlContentNew> {
);
}
Widget getUserAndTime(String user, String time, {Color color}) {
return Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Container(
alignment: Alignment(-1, 0),
width: ScreenUtil().setWidth(1022 - 2 * _marginLeft),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
SizedBox(width: ScreenUtil().setWidth(_marginLeft)),
Text(user,
textAlign: TextAlign.left,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: color)),
SizedBox(width: ScreenUtil().setWidth(_marginCenter)),
// Flutter Text
Expanded(
child: Text(time,
textAlign: TextAlign.left,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: color)))
],
),
),
],
);
}
Widget getText2(String text1, String text2, String text3, {Color color}) {
return Row(
mainAxisAlignment: MainAxisAlignment.start,
@ -553,7 +582,9 @@ class _TodayListZpjlPageState extends State<TodayListZpjlContentNew> {
String _hyshJg = (_hyshInfo == 'hycsInfo' ? 'cs_tile' : 'fs_tile'); //
String _hyshYj = (_hyshInfo == 'hycsInfo' ? 'cs_shuoming' : 'fs_shuoming'); //
double _height = _hyshInfo == 'hyfhInfo' && widget.hyshlx == 'tsjj' ? 315 : 265;
// double _height = _hyshInfo == 'hyfhInfo' && widget.hyshlx == 'tsjj' ? 315 : 265;
double _height = _hyshInfo == 'hyfhInfo' && widget.hyshlx == 'tsjj' ? 285 : 215;
return Column(
children: [
Container(
@ -603,8 +634,10 @@ class _TodayListZpjlPageState extends State<TodayListZpjlContentNew> {
],
),
getText('${_hyshLx}意见:' + mapZpjl[_hyshYj]),
getText('${_hyshLx}用户:' + mapZpjl[_hyshYh]),
getText('${_hyshLx}时间:' + mapZpjl[_hyshSj]),
// getText('${_hyshLx}用户:' + mapZpjl[_hyshYh]),
// getText('${_hyshLx}时间:' + mapZpjl[_hyshSj]),
getUserAndTime(
'${_hyshLx}用户:' + mapZpjl[_hyshYh], '${_hyshLx}时间:' + mapZpjl[_hyshSj]),
_hyshInfo == 'hyfhInfo' && widget.hyshlx == 'tsjj'
? (getText2('推送状态:', widget.tsztText, ' (${getDate(mapZpjl['ts_time'])})',
color:

@ -0,0 +1,873 @@
//import '../../../widget/player_pro.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_drag_scale/flutter_drag_scale.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:hyzp_ybqx/widget/my_superplayer.dart';
import 'package:keyboard_avoider/keyboard_avoider.dart';
//
import '../../../components/commonFun.dart';
import '../../../components/doJSON.dart';
import '../../../components/hyxx_data_handle.dart';
import 'package:flustars/flustars.dart' as flustars; //ScreenUtil
// "today": {
// "total": 4,
// "data": [
// {
// "id": 428549,
// "car_number": "川15A2563",
// "cpys": "绿色",
// "zpsj": "2021-04-04 11:31:11",
// "dwip": "172.16.3.3",
// "dwms": "岷江南路森林小区附近",
// "cplx": "农用车",
// "lgmzs": 3,
// "pic_url": "/wwwroot/admin/Api/wwwroot/public/uploads/e936524e92f90541cbaeca3b092c95be.jpg",
// "video_url": "video/3_6063_20210404_113111_川15A2563.mp4"
// },
class TodayListZpjlContentNew extends StatefulWidget {
TodayListZpjlContentNew({
@required this.hyshlx,
@required this.index,
// @required this.num,
@required this.text,
// @required this.mapZpjl,
this.tsztText = '',
Key key,
}) : super(key: key);
String hyshlx;
// String num;
int index;
String text;
// Map mapZpjl;
String tsztText;
_TodayListZpjlPageState createState() => _TodayListZpjlPageState();
}
//TabControllertab
class _TodayListZpjlPageState extends State<TodayListZpjlContentNew> {
//try_setState(); //
try_setState() {
try {
if (mounted) {
setState(() {});
}
} catch (e) {
print('setState(() {})异常:${e}');
}
}
dispose() {
super.dispose();
}
BuildContext _context;
//flutter_screenUtil 4.x ScreenUtil.screenWidth (sdk>=2.6 : 1.sw) //
double _screenWidth = 1.sw;
double _marginLeft = 25;
double _marginCenter = 35;
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 = {};
Map mapName = {};
int listLen = 0;
String num;
Map mapZpjl;
@override
void initState() {
_context = context;
_widthLeft = _screenWidth / 2.6;
//getListFlields();
//
mapName['plate_id'] = widget.hyshlx == 'jrzp' ? 'car_number' : 'plate_id';
mapName['plate_color'] = widget.hyshlx == 'jrzp' ? 'cpys' : 'plate_color';
getZpjlData(); // index
super.initState();
}
getZpjlData() async {
listLen = listTodayList.length;
num = '${widget.index + 1}/${listLen}';
mapZpjl = listTodayList[widget.index];
// getMediaUrl(_mapGetTsjjGetData['pic_url'])
await flustars.WidgetUtil.getImageWH(url: getMediaUrl(mapZpjl['pic_url'])).then((rect) {
if (null != rect) {
_radioImage = rect.height / rect.width;
print("rect = $rect_radioImage = $_radioImage");
// rect = Rect.fromLTRB(0.0, 0.0, 0.0, 0.0)_radioImage = NaN
// rect = Rect.fromLTRB(0.0, 0.0, 4096.0, 3360.0)_radioImage = 0.8203125
}
});
imageWztp = getWztp(); //
getPreBtn_NextBtn();
try_setState();
}
double _radioImage = 9 / 16;
// 使 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, fit: BoxFit.fill)
// 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 == mapZpjl['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(mapZpjl['video_url']);
//
if (!isVideoUrl(urlnew)) {
return;
}
Navigator.of(_context).push(MaterialPageRoute(
builder: (context) => SuperPlayerPage(
loop: 0, //1 0
url: urlnew,
title:
'${widget.text}视频${num}\n${mapZpjl[mapName['plate_id']]}${getDwmc(mapZpjl['dwip'])}')));
// Navigator.of(_context).push(MaterialPageRoute(
// builder: (context) => PlayerProNew(
// loop: 0, //1 0
// url: urlnew,
// title:
// '${widget.text}视频${num}\n${mapZpjl[mapName['plate_id']]}${getDwmc(mapZpjl['dwip'])}')));
},
),
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 * g_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),
height: ScreenUtil().setHeight(30 + 1022 * g_radioImage),
child: getNetworkImage(getMediaUrl(mapZpjl['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(390),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(12),
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
//1
getWzxxPart1(),
//2
getWzxxText('抓拍时间:' + mapZpjl['zpsj']),
//3 +
getWzxxPart3(),
//4()
getWzxxText('抓拍地点:' + getDwmc(mapZpjl['dwip']) + ' (简称)'),
//5
getWzxxText('抓拍地点:' + mapZpjl['dwms']),
],
),
);
}
// 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
//31
//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(mapZpjl[mapName['plate_id']].toString(),
width: ScreenUtil().setWidth(1022 / 3.2)),
Expanded(child: SizedBox.shrink()),
getTitleText('颜色:'),
getBoderText(mapZpjl[mapName['plate_color']], width: ScreenUtil().setWidth(1022 / 4.8)),
SizedBox(width: ScreenUtil().setWidth(_marginLeft)),
],
);
}
Widget getTitleRichText(String text1, {String text2 = '', double fontSize = 16}) {
return RichText(
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left,
text: TextSpan(
text: text1,
style: TextStyle(fontSize: fontSize, color: Colors.black),
children: [
TextSpan(
text: text2,
style: TextStyle(fontSize: fontSize, color: Colors.blue, fontWeight: FontWeight.w500),
),
],
),
);
}
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[mapZpjl[mapName['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): mapZpjl = {
// 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),
),
);
}
Widget getWzxxText(String _text, {double fontSize = 16}) {
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: Text(_text,
style: TextStyle(fontSize: fontSize),
textAlign: TextAlign.left,
overflow: TextOverflow.ellipsis),
),
],
);
}
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('车牌类型:' + mapZpjl['cplx']),
),
Expanded(child: SizedBox.shrink()),
//getTitleText('黑度: ${mapZpjl['lgmzs']}'),
getTitleRichText('黑度:', text2: '${mapZpjl['lgmzs']} '),
SizedBox(width: ScreenUtil().setWidth(_marginLeft)),
],
);
}
Widget getText(String text, {Color color}) {
return Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Container(
alignment: Alignment(-1, 0),
width: ScreenUtil().setWidth(1022 - 2 * _marginLeft),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
SizedBox(width: ScreenUtil().setWidth(_marginLeft)),
// Flutter Text
Expanded(
child: Text(text,
textAlign: TextAlign.left,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: color)))
],
),
),
],
);
}
Widget getText2(String text1, String text2, String text3, {Color color}) {
return Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Container(
alignment: Alignment(-1, 0),
width: ScreenUtil().setWidth(1022 - 2 * _marginLeft),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
SizedBox(width: ScreenUtil().setWidth(_marginLeft)),
Text(text1, textAlign: TextAlign.left),
Text(text2,
textAlign: TextAlign.left,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: color, fontWeight: FontWeight.w500)),
Text(text3, textAlign: TextAlign.left),
],
),
),
],
);
}
//5'hycsInfo''hyfhInfo'
//style: TextStyle(fontSize: _fontSize),
Widget getHyshInfo(String _hyshInfo) {
String _hyshLx = (_hyshInfo == 'hycsInfo' ? '初审' : '复审'); //
String _hyshYh = (_hyshInfo == 'hycsInfo' ? 'cs_username' : 'fs_username'); //
String _hyshSj = (_hyshInfo == 'hycsInfo' ? 'cs_time' : 'fs_time'); //
String _hyshJg = (_hyshInfo == 'hycsInfo' ? 'cs_tile' : 'fs_tile'); //
String _hyshYj = (_hyshInfo == 'hycsInfo' ? 'cs_shuoming' : 'fs_shuoming'); //
double _height = _hyshInfo == 'hyfhInfo' && widget.hyshlx == 'tsjj' ? 315 : 265;
return Column(
children: [
Container(
width: ScreenUtil().setWidth(1022),
height: ScreenUtil().setHeight(_height),
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 - 2 * _marginLeft),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
SizedBox(width: ScreenUtil().setWidth(_marginLeft)),
Text('${_hyshLx}结果:' + mapZpjl[_hyshJg],
textAlign: TextAlign.left, overflow: TextOverflow.ellipsis),
SizedBox(width: ScreenUtil().setWidth(20)),
Container(
width: my_iconSize,
height: my_iconSize,
decoration: mapZpjl[_hyshJg] == ''
? null
: BoxDecoration(
//color: Colors.white,
image: DecorationImage(
image: AssetImage(mapZpjl[_hyshJg] == "黑烟车"
? "assets/images/hyc.png"
: "assets/images/fhyc.png"),
fit: BoxFit.contain),
),
alignment: Alignment.center,
//child:
),
],
),
),
],
),
getText('${_hyshLx}意见:' + mapZpjl[_hyshYj]),
getText('${_hyshLx}用户:' + mapZpjl[_hyshYh]),
getText('${_hyshLx}时间:' + mapZpjl[_hyshSj]),
_hyshInfo == 'hyfhInfo' && widget.hyshlx == 'tsjj'
? (getText2('推送状态:', widget.tsztText, ' (${getDate(mapZpjl['ts_time'])})',
color:
widget.tsztText.indexOf('成功') >= 0 ? Colors.blueAccent : Colors.black26))
: SizedBox.shrink(),
],
),
),
SizedBox(height: ScreenUtil().setHeight(_marginVer)),
],
);
}
//97
// 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),
preBtn,
nextBtn,
],
);
}
//getPreBtn_NextBtn()preBtnnextBtn
Widget preBtn = Container(
color: Colors.white12, //onPressedFunnull
width: 70.0,
height: 35.0,
child: RaisedButton(
padding: EdgeInsets.all(0),
textColor: Colors.black,
child: Text('上一条'),
onPressed: null,
),
);
Widget nextBtn = Container(
color: Colors.white12, //onPressedFunnull
width: 70.0,
height: 35.0,
child: RaisedButton(
padding: EdgeInsets.all(0),
textColor: Colors.black,
child: Text('下一条'),
onPressed: null,
),
);
getPreBtn_NextBtn() {
preBtn = getBtnSizeX(
text: "上一条",
onPressedFun: null,
);
nextBtn = getBtnSizeX(
text: "下一条",
onPressedFun: null,
);
if (widget.index > 0 && listLen > 0) {
preBtn = getBtnSizeX(
text: "上一条",
onPressedFun: () async {
if (widget.index > 0) {
widget.index--;
getZpjlData();
}
},
);
}
if (widget.index < (listLen - 1) && listLen > 0) {
nextBtn = getBtnSizeX(
text: "下一条",
onPressedFun: () async {
if (widget.index < listLen - 1) {
widget.index++;
getZpjlData();
}
},
);
}
}
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(widget.text + '记录' + num,
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
widget.hyshlx == 'hycs' ||
widget.hyshlx == 'hyfh' ||
widget.hyshlx == 'tsjj'
? getHyshInfo('hycsInfo')
: SizedBox.shrink(),
//8
widget.hyshlx == 'hyfh' || widget.hyshlx == 'tsjj'
? getHyshInfo('hyfhInfo')
: SizedBox.shrink(),
SizedBox(height: widget.hyshlx == 'tsjj' ? 0 : 15),
//9
getTsjjQr(),
//SizedBox(height: 10),
],
),
),
),
widget.hyshlx == 'tsjj'
? Positioned(
//alignment: Alignment(0.9, 0.35),
//alignment: Alignment(0.8, 0.45),
right: ScreenUtil().setWidth(50),
top: ScreenUtil().setHeight(1423),
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(mapZpjl['fs_tile'] == '黑烟车'
? "assets/images/hyc.png"
: "assets/images/fhyc.png"),
fit: BoxFit.contain),
),
//child:
),
)
: SizedBox.shrink(),
],
),
);
}
Widget getBtnSizeX({@required text, width = 70.0, height = 35.0, onPressedFun}) {
return Container(
color: Colors.white12, //onPressedFunnull
width: width,
height: height,
child: RaisedButton(
padding: EdgeInsets.all(0),
textColor: Colors.black,
child: Text(text),
onPressed: onPressedFun,
),
);
}
}
Loading…
Cancel
Save