hyzp_ybqx-Commit139:reset到hyzp_ybqx-Commit138,在此次提交基础上进行修改,不依赖任何外部模块。修改包括:
1、修改IOS的点位地图文本图标元素的上下顺序,IOS版点位地图的文本图标定位基本准确;
2、按公司要求合并初审、复审页面的车牌文字和颜色框到一行
This commit is contained in:
@@ -45,6 +45,8 @@ Future getListBMFMarker({List listDwinfo}) async {
|
|||||||
for (int i = 0; i < len; i++) {
|
for (int i = 0; i < len; i++) {
|
||||||
BMFMarker marker;
|
BMFMarker marker;
|
||||||
if (Platform.isIOS) {
|
if (Platform.isIOS) {
|
||||||
|
// if (true) {
|
||||||
|
// 用于安卓环境下测试
|
||||||
marker = BMFMarker(
|
marker = BMFMarker(
|
||||||
position: getBMFCoordinate(listDwinfo[i]["dwzb"]),
|
position: getBMFCoordinate(listDwinfo[i]["dwzb"]),
|
||||||
// title: '${listDwinfo[i]["id"].toString()}、${listDwinfo[i]["dwmc"]}',
|
// title: '${listDwinfo[i]["id"].toString()}、${listDwinfo[i]["dwmc"]}',
|
||||||
@@ -98,7 +100,6 @@ Future getListBMFMarker({List listDwinfo}) async {
|
|||||||
draggable: dragable);
|
draggable: dragable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 百度地图的脑残设计,用Flutter添加多个BMFMarker时,必须在添加BMFMarker时自己保存ID,
|
// 百度地图的脑残设计,用Flutter添加多个BMFMarker时,必须在添加BMFMarker时自己保存ID,
|
||||||
// 否则响应点击时无法确定用户点击的是哪个定位标注
|
// 否则响应点击时无法确定用户点击的是哪个定位标注
|
||||||
// 代码不会自动返回,也没有任何文档说明,是花了一天时间搜索网络无果,是自己翻江倒海摸索出来的
|
// 代码不会自动返回,也没有任何文档说明,是花了一天时间搜索网络无果,是自己翻江倒海摸索出来的
|
||||||
@@ -109,6 +110,8 @@ Future getListBMFMarker({List listDwinfo}) async {
|
|||||||
|
|
||||||
// android版专有
|
// android版专有
|
||||||
if (Platform.isAndroid) {
|
if (Platform.isAndroid) {
|
||||||
|
// if (false) {
|
||||||
|
// 用于安卓环境下测试
|
||||||
g_listBMFText.add(BMFText(
|
g_listBMFText.add(BMFText(
|
||||||
// text: '${listDwinfo[i]["id"].toString()}、${listDwinfo[i]["dwmc"]}',
|
// text: '${listDwinfo[i]["id"].toString()}、${listDwinfo[i]["dwmc"]}',
|
||||||
text: '${(i + 1).toString()}、${listDwinfo[i]["dwmc"]}',
|
text: '${(i + 1).toString()}、${listDwinfo[i]["dwmc"]}',
|
||||||
|
|||||||
@@ -22,25 +22,6 @@ Future getIconWidget(String name) async {
|
|||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Row(
|
|
||||||
textDirection: TextDirection.ltr,
|
|
||||||
children: [
|
|
||||||
SizedBox(width: _widthBtn * 0.5 + _icon_width),
|
|
||||||
Container(
|
|
||||||
// margin: EdgeInsets.only(left: _widthBtn * 0.5),
|
|
||||||
// padding: EdgeInsets.only(left: _widthBtn * 0.5),
|
|
||||||
width: _widthBtn,
|
|
||||||
height: _text_height,
|
|
||||||
color: Colors.yellow,
|
|
||||||
child: Directionality(
|
|
||||||
textDirection: TextDirection.ltr,
|
|
||||||
child: Text(name,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.black, fontWeight: FontWeight.bold, fontSize: 36.0))),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Container(
|
Container(
|
||||||
width: _widthBtn,
|
width: _widthBtn,
|
||||||
height: _icon_height,
|
height: _icon_height,
|
||||||
@@ -62,6 +43,25 @@ Future getIconWidget(String name) async {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Row(
|
||||||
|
textDirection: TextDirection.ltr,
|
||||||
|
children: [
|
||||||
|
SizedBox(width: _widthBtn * 0.5 + _icon_width),
|
||||||
|
Container(
|
||||||
|
// margin: EdgeInsets.only(left: _widthBtn * 0.5),
|
||||||
|
// padding: EdgeInsets.only(left: _widthBtn * 0.5),
|
||||||
|
width: _widthBtn,
|
||||||
|
height: _text_height,
|
||||||
|
color: Colors.yellow,
|
||||||
|
child: Directionality(
|
||||||
|
textDirection: TextDirection.ltr,
|
||||||
|
child: Text(name,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.black, fontWeight: FontWeight.bold, fontSize: 36.0))),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -93,7 +93,8 @@ class _HyshGroupState extends State<HyshGroup> {
|
|||||||
return Container(
|
return Container(
|
||||||
width: ScreenUtil().setWidth(1022),
|
width: ScreenUtil().setWidth(1022),
|
||||||
// height: ScreenUtil().setHeight(550),
|
// height: ScreenUtil().setHeight(550),
|
||||||
height: ScreenUtil().setHeight(480),
|
// height: ScreenUtil().setHeight(480),
|
||||||
|
height: ScreenUtil().setHeight(380),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(
|
||||||
|
|||||||
@@ -697,6 +697,8 @@ Future getAllSumCll(String field, List listStatis) async {
|
|||||||
Future bmfInit() async {
|
Future bmfInit() async {
|
||||||
// 只有IOS版才需要
|
// 只有IOS版才需要
|
||||||
if (Platform.isIOS) {
|
if (Platform.isIOS) {
|
||||||
|
// if (true) {
|
||||||
|
// 用于安卓环境下测试
|
||||||
g_myIconPathPre = await createDir(g_myIconDir);
|
g_myIconPathPre = await createDir(g_myIconDir);
|
||||||
print("g_myIconPathPre = $g_myIconPathPre");
|
print("g_myIconPathPre = $g_myIconPathPre");
|
||||||
// g_myIconPathPre = /data/user/0/com.example.hyzp_yibin_bmfmap/app_flutter/myIcons
|
// g_myIconPathPre = /data/user/0/com.example.hyzp_yibin_bmfmap/app_flutter/myIcons
|
||||||
|
|||||||
@@ -85,15 +85,15 @@ class _CarNumberAndCpysItemsState extends State<CarNumberAndCpysItems> {
|
|||||||
Widget getCarNumberAndCpys(int i) {
|
Widget getCarNumberAndCpys(int i) {
|
||||||
return Container(
|
return Container(
|
||||||
width: ScreenUtil().setWidth(1022),
|
width: ScreenUtil().setWidth(1022),
|
||||||
height: ScreenUtil().setHeight(my_listTileHeight2 * 2 + 15),
|
height: ScreenUtil().setHeight(my_listTileHeight2 + 15),
|
||||||
child: Column(children: [
|
child: Row(
|
||||||
//1、车牌号码
|
children: [
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
|
||||||
SizedBox(width: ScreenUtil().setWidth(my_marginLeft2)),
|
SizedBox(width: ScreenUtil().setWidth(my_marginLeft2)),
|
||||||
Text('${mapGetZpjlGetDataSpecial['car_number'].fieldText}: ',
|
//1、车牌号码
|
||||||
style: TextStyle(fontSize: my_fontSize)),
|
// Text('${mapGetZpjlGetDataSpecial['car_number'].fieldText}: ',
|
||||||
|
// style: TextStyle(fontSize: my_fontSize)),
|
||||||
|
Text('车牌号码\n及颜色: ', maxLines: 2),
|
||||||
|
SizedBox(width: ScreenUtil().setWidth(my_marginLeft)),
|
||||||
Container(
|
Container(
|
||||||
alignment: Alignment(-1, 0),
|
alignment: Alignment(-1, 0),
|
||||||
//widthTrail = 400报错,360刚能显示,300换行,260
|
//widthTrail = 400报错,360刚能显示,300换行,260
|
||||||
@@ -151,21 +151,13 @@ class _CarNumberAndCpysItemsState extends State<CarNumberAndCpysItems> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: ScreenUtil().setWidth(my_marginLeft2)),
|
SizedBox(width: ScreenUtil().setWidth(my_marginLeft)),
|
||||||
],
|
|
||||||
),
|
|
||||||
SizedBox(height: ScreenUtil().setHeight(15)),
|
|
||||||
//2、车牌颜色
|
//2、车牌颜色
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
|
||||||
SizedBox(width: ScreenUtil().setWidth(my_marginLeft2)),
|
|
||||||
Text('车牌颜色: ',
|
|
||||||
style: TextStyle(fontSize: my_fontSize)),
|
|
||||||
Container(
|
Container(
|
||||||
alignment: Alignment(1, 0),
|
alignment: Alignment(1, 0),
|
||||||
//widthTrail = 400报错,360刚能显示,300换行,260
|
//widthTrail = 400报错,360刚能显示,300换行,260
|
||||||
height: ScreenUtil().setHeight(my_listTileHeight2), //最大高度
|
height: ScreenUtil().setHeight(my_listTileHeight2),
|
||||||
|
//最大高度
|
||||||
width: ScreenUtil().setWidth(400),
|
width: ScreenUtil().setWidth(400),
|
||||||
margin: EdgeInsets.only(bottom: 0),
|
margin: EdgeInsets.only(bottom: 0),
|
||||||
padding: EdgeInsets.only(left: 0, bottom: 2),
|
padding: EdgeInsets.only(left: 0, bottom: 2),
|
||||||
@@ -179,10 +171,9 @@ class _CarNumberAndCpysItemsState extends State<CarNumberAndCpysItems> {
|
|||||||
top: Radius.elliptical(3, 3), bottom: Radius.elliptical(3, 3)),
|
top: Radius.elliptical(3, 3), bottom: Radius.elliptical(3, 3)),
|
||||||
),
|
),
|
||||||
child: getDropdownButton(),
|
child: getDropdownButton(),
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,193 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/screen_util.dart';
|
||||||
|
import '../components/hyxx_data_handle.dart';
|
||||||
|
import '../services/EventBus.dart';
|
||||||
|
|
||||||
|
class CarNumberAndCpysItems extends StatefulWidget {
|
||||||
|
int index;
|
||||||
|
String initValue;
|
||||||
|
|
||||||
|
CarNumberAndCpysItems(
|
||||||
|
this.index, this.initValue); //I don't know what is this index for but I will put it in anyway
|
||||||
|
@override
|
||||||
|
_CarNumberAndCpysItemsState createState() => _CarNumberAndCpysItemsState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _CarNumberAndCpysItemsState extends State<CarNumberAndCpysItems> {
|
||||||
|
List<DropdownMenuItem<String>> _dropDownMenuItems;
|
||||||
|
String selectedValue;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
selectedValue = widget.initValue;
|
||||||
|
_dropDownMenuItems = getDropDownMenuItems();
|
||||||
|
}
|
||||||
|
|
||||||
|
List<DropdownMenuItem<String>> getDropDownMenuItems() {
|
||||||
|
List<DropdownMenuItem<String>> items = [];
|
||||||
|
int len = cpysList.length;
|
||||||
|
for (int i = 0; i < len; i++) {
|
||||||
|
items.add(
|
||||||
|
DropdownMenuItem(
|
||||||
|
value: cpysList[i].cpysText,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
Text(
|
||||||
|
cpysList[i].cpysText,
|
||||||
|
style: TextStyle(
|
||||||
|
color: cpysList[i].cpysFont,
|
||||||
|
background: Paint()..color = cpysList[i].cpysBackground),
|
||||||
|
),
|
||||||
|
(selectedValue == cpysList[i].cpysText)
|
||||||
|
? Icon(
|
||||||
|
Icons.check,
|
||||||
|
//color: cpysList[i].cpysBackground,
|
||||||
|
size: 16,
|
||||||
|
)
|
||||||
|
: SizedBox(
|
||||||
|
width: 0,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return items;
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget getDropdownButton() {
|
||||||
|
//DropdownButton默认有一条下划线,DropdownButtonHideUnderline去除下划线
|
||||||
|
//更改图标亮度
|
||||||
|
return Theme(
|
||||||
|
//data: Theme.of(context).copyWith(primaryColor: cpysList[getIndexOfCpysList(colorText: selectedValue)].cpysFont),
|
||||||
|
data: Theme.of(context).copyWith(brightness: Brightness.dark),
|
||||||
|
child: DropdownButtonHideUnderline(
|
||||||
|
child: DropdownButton(
|
||||||
|
iconEnabledColor: cpysList[getIndexOfCpysList(colorText: selectedValue)].cpysFont,
|
||||||
|
value: selectedValue,
|
||||||
|
items: _dropDownMenuItems,
|
||||||
|
onChanged: (String _selectedFruit) {
|
||||||
|
selectedValue = _selectedFruit;
|
||||||
|
_dropDownMenuItems = getDropDownMenuItems();
|
||||||
|
//黑烟初审数据审核Dropdown选项改变广播
|
||||||
|
eventBus.fire(HycsDataAuditDropdownEvent('黑烟初审数据审核Dropdown选项已改变', selectedValue));
|
||||||
|
setState(() {});
|
||||||
|
print('selectedValue = $selectedValue');
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Tab页面中的车牌号码、车牌颜色组件
|
||||||
|
Widget getCarNumberAndCpys(int i) {
|
||||||
|
return Container(
|
||||||
|
width: ScreenUtil().setWidth(1022),
|
||||||
|
height: ScreenUtil().setHeight(my_listTileHeight2 * 2 + 15),
|
||||||
|
child: Column(children: [
|
||||||
|
//1、车牌号码
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
SizedBox(width: ScreenUtil().setWidth(my_marginLeft2)),
|
||||||
|
Text('${mapGetZpjlGetDataSpecial['car_number'].fieldText}: ',
|
||||||
|
style: TextStyle(fontSize: my_fontSize)),
|
||||||
|
Container(
|
||||||
|
alignment: Alignment(-1, 0),
|
||||||
|
//widthTrail = 400报错,360刚能显示,300换行,260
|
||||||
|
height: ScreenUtil().setHeight(my_listTileHeight2), //最大高度
|
||||||
|
width: ScreenUtil().setWidth(400),
|
||||||
|
child: TextField(
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: my_fontSize,
|
||||||
|
//color: cpysList[getIndexOfCpysList(colorText: listGetZpjl[i]['cpys'])].cpysFont,
|
||||||
|
//color: cpysList[getIndexOfCpysList(colorText: topTabs_map['cpysText_List'][i])].cpysFont,
|
||||||
|
color: cpysList[getIndexOfCpysList(colorText: selectedValue)].cpysFont,
|
||||||
|
),
|
||||||
|
// background: Paint()
|
||||||
|
// ..color = cpysList[getIndexOfCpysList(colorText: listGetZpjl[i]['cpys'])]
|
||||||
|
// .cpysBackground),
|
||||||
|
decoration: InputDecoration(
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(width: 2.0), borderRadius: BorderRadius.circular(3.0)),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(width: 2.0), borderRadius: BorderRadius.circular(3.0)),
|
||||||
|
//prefixText: "pre",
|
||||||
|
filled: true,
|
||||||
|
//fillColor: cpysList[getIndexOfCpysList(colorText: listGetZpjl[i]['cpys'])].cpysBackground,
|
||||||
|
//fillColor: cpysList[getIndexOfCpysList(colorText: topTabs_map['cpysText_List'][i])].cpysBackground,
|
||||||
|
fillColor: cpysList[getIndexOfCpysList(colorText: selectedValue)].cpysBackground,
|
||||||
|
hintText: '车牌号码',
|
||||||
|
//border: InputBorder.none, //TextField去掉下划线
|
||||||
|
//contentPadding: EdgeInsets.only(right: 0),
|
||||||
|
//contentPadding: const EdgeInsets.symmetric(vertical: _textFieldHeight),
|
||||||
|
//contentPadding: EdgeInsets.symmetric(vertical: _textFieldHeight),
|
||||||
|
contentPadding: EdgeInsets.all(0),
|
||||||
|
//contentPadding: EdgeInsets.only(top: 0),
|
||||||
|
|
||||||
|
// border: OutlineInputBorder(
|
||||||
|
// //borderRadius: BorderRadius.circular(1.0),
|
||||||
|
// borderSide: BorderSide(
|
||||||
|
// //color: cpysList[getIndexOfCpysList(colorText: listGetZpjl[i]['cpys'])].cpysBorder,
|
||||||
|
// color:
|
||||||
|
// cpysList[getIndexOfCpysList(colorText: topTabs_map['cpysText_List'][i])]
|
||||||
|
// .cpysBorder,
|
||||||
|
// width: 2.0)),
|
||||||
|
),
|
||||||
|
//controller: listZpljController[i][indexField],
|
||||||
|
controller: TextEditingController.fromValue(TextEditingValue(
|
||||||
|
text: listGetZpjl[i]['car_number'].toString(),
|
||||||
|
// 保持光标在最后
|
||||||
|
selection: TextSelection.fromPosition(TextPosition(
|
||||||
|
affinity: TextAffinity.downstream,
|
||||||
|
offset: '${listGetZpjl[i]['car_number'].toString()}'.length)))),
|
||||||
|
enabled: true,
|
||||||
|
//利用控制器初始化文本
|
||||||
|
onChanged: (value) {
|
||||||
|
listGetZpjl[i]['car_number'] = value;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: ScreenUtil().setWidth(my_marginLeft2)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(height: ScreenUtil().setHeight(15)),
|
||||||
|
//2、车牌颜色
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
SizedBox(width: ScreenUtil().setWidth(my_marginLeft2)),
|
||||||
|
Text('车牌颜色: ',
|
||||||
|
style: TextStyle(fontSize: my_fontSize)),
|
||||||
|
Container(
|
||||||
|
alignment: Alignment(1, 0),
|
||||||
|
//widthTrail = 400报错,360刚能显示,300换行,260
|
||||||
|
height: ScreenUtil().setHeight(my_listTileHeight2), //最大高度
|
||||||
|
width: ScreenUtil().setWidth(400),
|
||||||
|
margin: EdgeInsets.only(bottom: 0),
|
||||||
|
padding: EdgeInsets.only(left: 0, bottom: 2),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
//color: cpysList[getIndexOfCpysList(colorText: listGetZpjl[i]['cpys'])].cpysBackground,
|
||||||
|
//color: cpysList[getIndexOfCpysList(colorText: topTabs_map['cpysText_List'][i])].cpysBackground,
|
||||||
|
color: cpysList[getIndexOfCpysList(colorText: selectedValue)].cpysBackground,
|
||||||
|
border: Border.all(color: Colors.black87, width: 2),
|
||||||
|
//边框圆角设置
|
||||||
|
borderRadius: BorderRadius.vertical(
|
||||||
|
top: Radius.elliptical(3, 3), bottom: Radius.elliptical(3, 3)),
|
||||||
|
),
|
||||||
|
child: getDropdownButton(),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return getCarNumberAndCpys(widget.index);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user