Merge remote-tracking branch 'Gitea/master' into iOS
This commit is contained in:
@@ -446,7 +446,8 @@ class _BasicMapState extends State<BasicMap> {
|
||||
//color: Colors.white,
|
||||
child: InkWell(
|
||||
// child: Icon(Icons.my_location_outlined, color: Colors.black45),
|
||||
child: Icon(Icons.add, color: g_zoomLevel < g_zoomMax ? Colors.blue : Colors.grey),
|
||||
child: Icon(Icons.add,
|
||||
color: g_zoomLevel < g_zoomMax ? Colors.blue : Colors.grey),
|
||||
onTap: g_zoomLevel < g_zoomMax
|
||||
? () {
|
||||
//放大按钮,缩放限制g_zoomMin-g_zoomMax
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bmfbase/BaiduMap/bmfmap_base.dart';
|
||||
import 'package:flutter_bmfmap/BaiduMap/bmfmap_map.dart';
|
||||
@@ -10,6 +12,12 @@ int g_zoomLevel_default = 14; //地图默认缩放倍数
|
||||
int g_zoomLevel = 14; //地图缩放倍数
|
||||
int g_zoomMin = 10;
|
||||
int g_zoomMax = 18;
|
||||
|
||||
String g_myIconPathPre = "";
|
||||
// g_myIconPathPre = /data/user/0/com.example.hyzp_yibin_bmfmap/app_flutter/myIcons
|
||||
String g_myIconDir = "myIcons";
|
||||
String g_myIconPre = "myIcon";
|
||||
|
||||
///批量添加定位标记
|
||||
List<BMFMarker> g_listBMFMarker = [];
|
||||
Map g_map_BMFMarkerID_dwIndex = {};
|
||||
@@ -35,25 +43,62 @@ Future getListBMFMarker({List listDwinfo}) async {
|
||||
|
||||
int len = listDwinfo.length;
|
||||
for (int i = 0; i < len; i++) {
|
||||
BMFMarker marker = BMFMarker(
|
||||
position: getBMFCoordinate(listDwinfo[i]["dwzb"]),
|
||||
// title: '${listDwinfo[i]["id"].toString()}、${listDwinfo[i]["dwmc"]}',
|
||||
title: '${(i + 1).toString()}、${listDwinfo[i]["dwmc"]}',
|
||||
subtitle: 'test',
|
||||
// identifier: '${listDwinfo[i]["id"].toString()}、${listDwinfo[i]["dwmc"]}',
|
||||
identifier: '${(i + 1).toString()}、${listDwinfo[i]["dwmc"]}',
|
||||
icon: 'assets/images/location.png',
|
||||
BMFMarker marker;
|
||||
if (Platform.isIOS) {
|
||||
marker = BMFMarker(
|
||||
position: getBMFCoordinate(listDwinfo[i]["dwzb"]),
|
||||
// title: '${listDwinfo[i]["id"].toString()}、${listDwinfo[i]["dwmc"]}',
|
||||
title: '${(i + 1).toString()}、${listDwinfo[i]["dwmc"]}',
|
||||
subtitle: 'test',
|
||||
// identifier: '${listDwinfo[i]["id"].toString()}、${listDwinfo[i]["dwmc"]}',
|
||||
identifier: '${(i + 1).toString()}、${listDwinfo[i]["dwmc"]}',
|
||||
|
||||
// android版使用
|
||||
// icon: 'assets/images/location.png',
|
||||
|
||||
// 为IOS在百度地图中显示文本图标
|
||||
icon: "$g_myIconPathPre/${g_myIconPre}${i + 1}.png",
|
||||
// icon: '/data/user/0/com.example.hyzp_yibin_bmfmap/app_flutter/myIcons/myIcon01.png',
|
||||
|
||||
/// 默认情况下, annotation view的中心位于annotation的坐标位置,
|
||||
/// 可以设置centerOffset改变view的位置,正的偏移使view朝右下方移动,负的朝左上方,单位是像素
|
||||
/// 目前Android只支持Y轴设置偏移量对应SDK的 yOffset(int yOffset) 方法
|
||||
/// 添加标记 BMFMarker 百度官方有 centerOffset 偏移参数,
|
||||
/// 文本标签 BMFText 官方没有 centerOffset 偏移参数,我取消了 BMFMarker 的偏移。你看这样行吗?
|
||||
/// 按公司要求,为更准确定位,取消 BMFMarker 的偏移
|
||||
centerOffset: BMFPoint(0, 0),
|
||||
//标记中心偏移
|
||||
enabled: enable,
|
||||
draggable: dragable);
|
||||
} else if (Platform.isAndroid) {
|
||||
marker = BMFMarker(
|
||||
position: getBMFCoordinate(listDwinfo[i]["dwzb"]),
|
||||
// title: '${listDwinfo[i]["id"].toString()}、${listDwinfo[i]["dwmc"]}',
|
||||
title: '${(i + 1).toString()}、${listDwinfo[i]["dwmc"]}',
|
||||
subtitle: 'test',
|
||||
// identifier: '${listDwinfo[i]["id"].toString()}、${listDwinfo[i]["dwmc"]}',
|
||||
identifier: '${(i + 1).toString()}、${listDwinfo[i]["dwmc"]}',
|
||||
|
||||
// android版使用
|
||||
icon: 'assets/images/location.png',
|
||||
|
||||
// 为IOS在百度地图中显示文本图标
|
||||
// icon: "$g_myIconPathPre/${g_myIconPre}${i + 1}.png",
|
||||
// icon: '/data/user/0/com.example.hyzp_yibin_bmfmap/app_flutter/myIcons/myIcon01.png',
|
||||
|
||||
/// 默认情况下, annotation view的中心位于annotation的坐标位置,
|
||||
/// 可以设置centerOffset改变view的位置,正的偏移使view朝右下方移动,负的朝左上方,单位是像素
|
||||
/// 目前Android只支持Y轴设置偏移量对应SDK的 yOffset(int yOffset) 方法
|
||||
/// 添加标记 BMFMarker 百度官方有 centerOffset 偏移参数,
|
||||
/// 文本标签 BMFText 官方没有 centerOffset 偏移参数,我取消了 BMFMarker 的偏移。你看这样行吗?
|
||||
/// 按公司要求,为更准确定位,取消 BMFMarker 的偏移
|
||||
centerOffset: BMFPoint(0, 0),
|
||||
//标记中心偏移
|
||||
enabled: enable,
|
||||
draggable: dragable);
|
||||
}
|
||||
|
||||
|
||||
/// 默认情况下, annotation view的中心位于annotation的坐标位置,
|
||||
/// 可以设置centerOffset改变view的位置,正的偏移使view朝右下方移动,负的朝左上方,单位是像素
|
||||
/// 目前Android只支持Y轴设置偏移量对应SDK的 yOffset(int yOffset) 方法
|
||||
/// 添加标记 BMFMarker 百度官方有 centerOffset 偏移参数,
|
||||
/// 文本标签 BMFText 官方没有 centerOffset 偏移参数,我取消了 BMFMarker 的偏移。你看这样行吗?
|
||||
/// 按公司要求,为更准确定位,取消 BMFMarker 的偏移
|
||||
centerOffset: BMFPoint(0, 0),
|
||||
//标记中心偏移
|
||||
enabled: enable,
|
||||
draggable: dragable);
|
||||
// 百度地图的脑残设计,用Flutter添加多个BMFMarker时,必须在添加BMFMarker时自己保存ID,
|
||||
// 否则响应点击时无法确定用户点击的是哪个定位标注
|
||||
// 代码不会自动返回,也没有任何文档说明,是花了一天时间搜索网络无果,是自己翻江倒海摸索出来的
|
||||
@@ -62,33 +107,36 @@ Future getListBMFMarker({List listDwinfo}) async {
|
||||
g_map_BMFMarkerID_dwIndex[marker.getId()] = i;
|
||||
g_listBMFMarker.add(marker);
|
||||
|
||||
g_listBMFText.add(BMFText(
|
||||
// text: '${listDwinfo[i]["id"].toString()}、${listDwinfo[i]["dwmc"]}',
|
||||
text: '${(i + 1).toString()}、${listDwinfo[i]["dwmc"]}',
|
||||
//纬度偏移-上下 off_latitude, 经度偏移-左右 off_longitude
|
||||
//已经在zoomLevel = 15时调整好定位标记与文本标记的相对位置
|
||||
// ,当地图缩放时,会发生位置变化,必须使用 Provider 或者 EventBus 进行跟踪更新
|
||||
// android版专有
|
||||
if (Platform.isAndroid) {
|
||||
g_listBMFText.add(BMFText(
|
||||
// text: '${listDwinfo[i]["id"].toString()}、${listDwinfo[i]["dwmc"]}',
|
||||
text: '${(i + 1).toString()}、${listDwinfo[i]["dwmc"]}',
|
||||
//纬度偏移-上下 off_latitude, 经度偏移-左右 off_longitude
|
||||
//已经在zoomLevel = 15时调整好定位标记与文本标记的相对位置
|
||||
// ,当地图缩放时,会发生位置变化,必须使用 Provider 或者 EventBus 进行跟踪更新
|
||||
|
||||
//https://time.geekbang.org/column/article/131890
|
||||
//老师,provider、eventBus的用途有啥区别吗,都可以做状态的通知
|
||||
// 作者回复: Provider 主要是用来做数据读写共享;event_bus主要是用来做数据状态通知、实现组件间单向数据传递。
|
||||
//如果我们的应用足够简单,数据流动的方向和顺序是清晰的,我们只需要将数据映射成视图就可以了。
|
||||
// 作为声明式的框架,Flutter 可以自动处理数据到渲染的全过程,通常并不需要 Provider 状态管理。
|
||||
// position: getBMFCoordinate(listDwinfo[i]["dwzb"],
|
||||
// off_latitude: -0.0002 * g_zoomLevel * _scale,
|
||||
// off_longitude: -0.00009 * g_zoomLevel * _scale),
|
||||
position: getBMFCoordinate(listDwinfo[i]["dwzb"]),
|
||||
//自己控制off_latitude、off_longitude效果不好
|
||||
bgColor: Colors.yellow,
|
||||
fontColor: Colors.black,
|
||||
fontSize: 35,
|
||||
// typeFace:
|
||||
// BMFTypeFace(familyName: BMFFamilyName.sMonospace, textStype: BMFTextStyle.BOLD_ITALIC),
|
||||
typeFace: BMFTypeFace(familyName: BMFFamilyName.sMonospace, textStype: BMFTextStyle.BOLD),
|
||||
alignY: BMFVerticalAlign.ALIGN_TOP,
|
||||
alignX: BMFHorizontalAlign.ALIGN_LEFT,
|
||||
rotate: 0.0,
|
||||
zIndex: 99));
|
||||
//https://time.geekbang.org/column/article/131890
|
||||
//老师,provider、eventBus的用途有啥区别吗,都可以做状态的通知
|
||||
// 作者回复: Provider 主要是用来做数据读写共享;event_bus主要是用来做数据状态通知、实现组件间单向数据传递。
|
||||
//如果我们的应用足够简单,数据流动的方向和顺序是清晰的,我们只需要将数据映射成视图就可以了。
|
||||
// 作为声明式的框架,Flutter 可以自动处理数据到渲染的全过程,通常并不需要 Provider 状态管理。
|
||||
// position: getBMFCoordinate(listDwinfo[i]["dwzb"],
|
||||
// off_latitude: -0.0002 * g_zoomLevel * _scale,
|
||||
// off_longitude: -0.00009 * g_zoomLevel * _scale),
|
||||
position: getBMFCoordinate(listDwinfo[i]["dwzb"]),
|
||||
//自己控制off_latitude、off_longitude效果不好
|
||||
bgColor: Colors.yellow,
|
||||
fontColor: Colors.black,
|
||||
fontSize: 35,
|
||||
// typeFace:
|
||||
// BMFTypeFace(familyName: BMFFamilyName.sMonospace, textStype: BMFTextStyle.BOLD_ITALIC),
|
||||
typeFace: BMFTypeFace(familyName: BMFFamilyName.sMonospace, textStype: BMFTextStyle.BOLD),
|
||||
alignY: BMFVerticalAlign.ALIGN_TOP,
|
||||
alignX: BMFHorizontalAlign.ALIGN_LEFT,
|
||||
rotate: 0.0,
|
||||
zIndex: 99));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:path/path.dart' as mypath;
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
Future getIconWidget(String name) async {
|
||||
// print("name length = ${name.length}");
|
||||
double _widthBtn = name.length * 40.0;
|
||||
double _text_height = 45;
|
||||
double _icon_width = 40;
|
||||
double _icon_height = 65;
|
||||
double _edge = 16;
|
||||
|
||||
return Container(
|
||||
width: _widthBtn * 1.5 + _icon_width,
|
||||
height: _text_height + _icon_height,
|
||||
color: Colors.transparent,
|
||||
child: Column(
|
||||
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(
|
||||
width: _widthBtn,
|
||||
height: _icon_height,
|
||||
color: Colors.transparent,
|
||||
child: Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
child: RichText(
|
||||
text: TextSpan(style: TextStyle(color: Colors.black, fontSize: 36.0), children: [
|
||||
WidgetSpan(
|
||||
child: IconTheme(
|
||||
data: IconThemeData(size: 64, color: Colors.red),
|
||||
child: Icon(
|
||||
new IconData(0xe60b, fontFamily: 'myfont', matchTextDirection: true),
|
||||
),
|
||||
)),
|
||||
// TextSpan(text: "\n白塔山公园", style: TextStyle(color: Colors.black, fontSize: 36.0)),
|
||||
]),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future createDir(String dirName) async {
|
||||
final appDir = await getApplicationDocumentsDirectory();
|
||||
final myDir = Directory('${appDir.path}/$dirName');
|
||||
|
||||
// 查看目录是否存在
|
||||
bool isExist = await myDir.exists();
|
||||
if (!isExist) {
|
||||
myDir.create(recursive: true);
|
||||
}
|
||||
return myDir.path;
|
||||
}
|
||||
|
||||
Future<void> saveImage(String dirName, String fileName, ByteData image) async {
|
||||
final appDir = await getApplicationDocumentsDirectory();
|
||||
final myDir = Directory('${appDir.path}/$dirName');
|
||||
|
||||
// 查看目录是否存在
|
||||
bool isExist = await myDir.exists();
|
||||
if (!isExist) {
|
||||
myDir.create(recursive: true);
|
||||
}
|
||||
|
||||
// final myDir = await Directory('${appDir.path}/$dirName').create(recursive: true);
|
||||
final localPath = mypath.join(myDir.path, fileName);
|
||||
print('localPath = $localPath');
|
||||
// localPath = /data/user/0/com.example.hyzp_yibin_bmfmap/app_flutter/myIcons/myIcon1.png
|
||||
File(localPath).writeAsBytesSync(image.buffer.asInt8List());
|
||||
}
|
||||
|
||||
Future<ByteData> widgetToImage(Widget widget,
|
||||
{Alignment alignment = Alignment.center,
|
||||
Size size = const Size(double.maxFinite, double.maxFinite),
|
||||
double devicePixelRatio = 1.0,
|
||||
double pixelRatio = 1.0}) async {
|
||||
RenderRepaintBoundary repaintBoundary = RenderRepaintBoundary();
|
||||
|
||||
RenderView renderView = RenderView(
|
||||
child: RenderPositionedBox(alignment: alignment, child: repaintBoundary),
|
||||
configuration: ViewConfiguration(
|
||||
size: size,
|
||||
devicePixelRatio: devicePixelRatio,
|
||||
),
|
||||
window: ui.window,
|
||||
);
|
||||
|
||||
PipelineOwner pipelineOwner = PipelineOwner();
|
||||
pipelineOwner.rootNode = renderView;
|
||||
renderView.prepareInitialFrame();
|
||||
|
||||
BuildOwner buildOwner = BuildOwner();
|
||||
buildOwner.focusManager = FocusManager();
|
||||
RenderObjectToWidgetElement rootElement = RenderObjectToWidgetAdapter(
|
||||
container: repaintBoundary,
|
||||
child: widget,
|
||||
).attachToRenderTree(buildOwner);
|
||||
buildOwner.buildScope(rootElement);
|
||||
buildOwner.finalizeTree();
|
||||
|
||||
pipelineOwner.flushLayout();
|
||||
pipelineOwner.flushCompositingBits();
|
||||
pipelineOwner.flushPaint();
|
||||
|
||||
ui.Image image = await repaintBoundary.toImage(pixelRatio: pixelRatio);
|
||||
// E/flutter (10823): [ERROR:flutter/flow/layers/transform_layer.cc(24)] TransformLayer is constructed with an invalid matrix.
|
||||
// E/flutter (10823): [ERROR:flutter/flow/layers/transform_layer.cc(24)] TransformLayer is constructed with an invalid matrix.
|
||||
ByteData byteData = await image.toByteData(format: ui.ImageByteFormat.png);
|
||||
|
||||
return byteData;
|
||||
}
|
||||
|
||||
// read image file from path
|
||||
Future<File> getLocalFile(String filename) async {
|
||||
String dir = (await getApplicationDocumentsDirectory()).path;
|
||||
final directoryName = "myIcons";
|
||||
File file = new File('$dir/$directoryName/$filename');
|
||||
return file;
|
||||
}
|
||||
@@ -65,6 +65,7 @@ class _FhycxPageState extends State<FhycxContentNew> {
|
||||
|
||||
Map _mapTsjjGetTsStatus = {};
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
@@ -111,7 +112,7 @@ class _FhycxPageState extends State<FhycxContentNew> {
|
||||
_mapTsjjGetTsStatus = await tsjjGetTsStatus(widget.id);
|
||||
|
||||
// 获取网络图片尺寸
|
||||
flustars.WidgetUtil.getImageWH(url: getMediaUrl(_mapGetTsjjGetData['pic_url'])).then((rect) {
|
||||
await flustars.WidgetUtil.getImageWH(url: getMediaUrl(_mapGetTsjjGetData['pic_url'])).then((rect) {
|
||||
if (null != rect) {
|
||||
_radioImage = rect.height / rect.width;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
//屏幕适配 flutter_screenutil 库与 flustars(获取网络图片尺寸要用到其 WidgetUtil) 库使用的 ScreenUtil() 类名冲突
|
||||
// 解决办法是将 flustars 库取个别名 as flustars
|
||||
import 'package:flustars/flustars.dart' as flustars;
|
||||
@@ -77,6 +78,7 @@ class _HyshPageState extends State<HyshContentNew> with SingleTickerProviderStat
|
||||
String cpysText = '';
|
||||
String myCpys = '蓝色';
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
fh_hyc = true;
|
||||
@@ -96,7 +98,7 @@ class _HyshPageState extends State<HyshContentNew> with SingleTickerProviderStat
|
||||
// getListFlields();
|
||||
// });
|
||||
|
||||
//黑监听烟初审数据审核Radio选项改变事件
|
||||
//监听黑烟初审数据审核Radio选项改变事件
|
||||
eventBus.on<HycsDataAuditRadioEvent>().listen((event) {
|
||||
print(event.str);
|
||||
print('event.selectedRadio = ${event.selectedRadio.toString()}');
|
||||
@@ -222,8 +224,8 @@ class _HyshPageState extends State<HyshContentNew> with SingleTickerProviderStat
|
||||
Rect rect =
|
||||
await flustars.WidgetUtil.getImageWH(url: getMediaUrl(listGetZpjl[i]['pic_url']));
|
||||
ratioList.add(rect.height / rect.width);
|
||||
print("rect: " + rect.toString());
|
||||
print("ratio: " + ratioList[i].toString());
|
||||
print("rect: " + rect.toString()); // rect: Rect.fromLTRB(0.0, 0.0, 4096.0, 3360.0)
|
||||
print("ratio: " + ratioList[i].toString()); // ratio: 0.8203125
|
||||
}
|
||||
await getTopTabsMap();
|
||||
|
||||
@@ -275,21 +277,6 @@ class _HyshPageState extends State<HyshContentNew> with SingleTickerProviderStat
|
||||
);
|
||||
}
|
||||
|
||||
//使用 cached_network_image 插件实现网络图片缓存
|
||||
Widget getNetworkImage1(String url) {
|
||||
return CachedNetworkImage(
|
||||
imageUrl: url,
|
||||
alignment: Alignment.topCenter,
|
||||
//placeholder: (context, url) => CircularProgressIndicator(),
|
||||
imageBuilder: (context, imageProvider) => PhotoView(
|
||||
imageProvider: imageProvider,
|
||||
),
|
||||
placeholder: (context, url) =>
|
||||
getMoreWidget(color: Colors.black38, size: 20.0, strokeWidth: 2.0),
|
||||
errorWidget: (context, url, error) => Icon(Icons.error),
|
||||
);
|
||||
}
|
||||
|
||||
//3、得到违章图片说明信息组件
|
||||
Widget getWztpSmxx(int index) {
|
||||
return Container(
|
||||
@@ -663,11 +650,14 @@ class _HyshPageState extends State<HyshContentNew> with SingleTickerProviderStat
|
||||
//为了用户在切换审核结果Radio时显示不同图片,必须将以下组件都移入到RadioListItems类中
|
||||
//5-6、得到黑烟审核组件、审核确认组件
|
||||
HyshGroup(
|
||||
index: index,
|
||||
hyshlx: hyshlx,
|
||||
fontSize: _fontSize,
|
||||
size: Size(_listTileHeight, _listTileHeight),
|
||||
id: widget.id),
|
||||
index: index,
|
||||
hyshlx: hyshlx,
|
||||
fontSize: _fontSize,
|
||||
size: Size(_listTileHeight, _listTileHeight),
|
||||
id: widget.id,
|
||||
selectedRadio:
|
||||
hyshlx == 'hyfh' && mapGetHycsShenheData['title'] == "非黑烟车" ? 1 : 0,
|
||||
),
|
||||
//为了用户在切换审核结果Radio时显示不同图片,必须将以下组件都移入到RadioListItems类中
|
||||
// SizedBox(height: 6),
|
||||
// Divider(height: 1.0, color: Colors.blue),
|
||||
|
||||
@@ -92,7 +92,8 @@ class _HyshGroupState extends State<HyshGroup> {
|
||||
getHyshItems(int index) {
|
||||
return Container(
|
||||
width: ScreenUtil().setWidth(1022),
|
||||
height: ScreenUtil().setHeight(550),
|
||||
// height: ScreenUtil().setHeight(550),
|
||||
height: ScreenUtil().setHeight(480),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.all(
|
||||
@@ -325,6 +326,88 @@ class _HyshGroupState extends State<HyshGroup> {
|
||||
|
||||
//5.3、得到审核结果组件
|
||||
Widget getShjg(int index) {
|
||||
return Container(
|
||||
width: ScreenUtil().setWidth(1022),
|
||||
// height: ScreenUtil().setHeight(175),
|
||||
height: ScreenUtil().setHeight(110),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: ScreenUtil().setHeight(15)),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
SizedBox(width: my_marginLeft),
|
||||
Text((widget.hyshlx == 'hyfh' ? '复审' : '初审') + '结果: ',
|
||||
style: TextStyle(
|
||||
fontSize: widget.fontSize,
|
||||
color: 0 == _selectedRadio ? Colors.red : Colors.green)),
|
||||
CustomRadioWidget(
|
||||
value: 0,
|
||||
title: mapHyshlx[hyshlx]['nick_text'] + "为黑烟车",
|
||||
fontSize: widget.fontSize,
|
||||
width: ScreenUtil().setWidth(400),
|
||||
groupValue: _selectedRadio,
|
||||
onChanged: (int value) {
|
||||
_selectedRadio = value;
|
||||
fh_hyc = true; //复审为黑烟车
|
||||
tsjj = true; //同时推送交警
|
||||
//黑烟初审数据审核Radio选项改变广播
|
||||
eventBus.fire(HycsDataAuditRadioEvent('黑烟初审数据审核Radio选项已改变', _selectedRadio));
|
||||
setState(() {});
|
||||
print('selectedRadio = ${_selectedRadio.toString()}');
|
||||
},
|
||||
),
|
||||
SizedBox(height: ScreenUtil().setWidth(20)),
|
||||
CustomRadioWidget(
|
||||
value: 1,
|
||||
title: "非黑烟车",
|
||||
fontSize: widget.fontSize,
|
||||
width: ScreenUtil().setWidth(340),
|
||||
groupValue: _selectedRadio,
|
||||
onChanged: (int value) {
|
||||
_selectedRadio = value;
|
||||
fh_hyc = false; //复审为黑烟车
|
||||
tsjj = false; //同时推送交警
|
||||
//黑烟初审数据审核Radio选项改变广播
|
||||
eventBus.fire(HycsDataAuditRadioEvent('黑烟初审数据审核Radio选项已改变', _selectedRadio));
|
||||
setState(() {});
|
||||
print('selectedRadio = ${_selectedRadio.toString()}');
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: ScreenUtil().setHeight(15)),
|
||||
// Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// children: <Widget>[
|
||||
// SizedBox(width: my_marginLeft),
|
||||
// Text((widget.hyshlx == 'hyfh' ? '复审' : '初审') + '结果: ',
|
||||
// style: TextStyle(fontSize: widget.fontSize, color: Colors.red)),
|
||||
// CustomRadioWidget(
|
||||
// value: 1,
|
||||
// title: "非黑烟车",
|
||||
// fontSize: widget.fontSize,
|
||||
// width: ScreenUtil().setWidth(400),
|
||||
// groupValue: _selectedRadio,
|
||||
// onChanged: (int value) {
|
||||
// _selectedRadio = value;
|
||||
// fh_hyc = false; //复审为黑烟车
|
||||
// tsjj = false; //同时推送交警
|
||||
// //黑烟初审数据审核Radio选项改变广播
|
||||
// eventBus.fire(HycsDataAuditRadioEvent('黑烟初审数据审核Radio选项已改变', _selectedRadio));
|
||||
// setState(() {});
|
||||
// print('selectedRadio = ${_selectedRadio.toString()}');
|
||||
// },
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
//5.3-0、得到审核结果组件
|
||||
Widget getShjg0(int index) {
|
||||
return Container(
|
||||
width: ScreenUtil().setWidth(1022),
|
||||
height: ScreenUtil().setHeight(175),
|
||||
|
||||
@@ -67,6 +67,7 @@ class _LoginPageState extends State<TsjjContentNew> with SingleTickerProviderSta
|
||||
|
||||
Map _mapTsjjGetTsStatus = {};
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
//黑烟审核推送交警Checkbox改变事件
|
||||
eventBus.on<HycsDataAuditSfyc>().listen((event) {
|
||||
@@ -121,10 +122,12 @@ class _LoginPageState extends State<TsjjContentNew> with SingleTickerProviderSta
|
||||
_mapTsjjGetTsStatus = await tsjjGetTsStatus(widget.id);
|
||||
print('_mapTsjjGetTsStatus = $_mapTsjjGetTsStatus');
|
||||
|
||||
// 获取网络图片尺寸
|
||||
flustars.WidgetUtil.getImageWH(url: getMediaUrl(_mapGetTsjjGetData['pic_url'])).then((rect) {
|
||||
// 获取网络图片尺寸,getMediaUrl(_mapGetTsjjGetData['pic_url'])
|
||||
await flustars.WidgetUtil.getImageWH(url: getMediaUrl(_mapGetTsjjGetData['pic_url'])).then((rect) {
|
||||
if (null != rect) {
|
||||
_radioImage = rect.height / rect.width;
|
||||
print("rect = $rect,_radioImage = $_radioImage");
|
||||
// rect = Rect.fromLTRB(0.0, 0.0, 4096.0, 3360.0),_radioImage = 0.8203125
|
||||
}
|
||||
});
|
||||
|
||||
@@ -274,9 +277,10 @@ class _LoginPageState extends State<TsjjContentNew> with SingleTickerProviderSta
|
||||
width: ScreenUtil().setWidth(1022),
|
||||
//height: ScreenUtil().setHeight(639),
|
||||
//height: ScreenUtil().setHeight(22 + 1022 * _radioImage),
|
||||
// height: ScreenUtil().setHeight(30 + 1022 * _radioImage),
|
||||
height: ScreenUtil().setHeight(30 + 1022 * _radioImage),
|
||||
decoration: BoxDecoration(
|
||||
//color: Colors.white,
|
||||
// color: Colors.red,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(12),
|
||||
),
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:hyzp_ybqx/components/commonFun.dart';
|
||||
import 'package:hyzp_ybqx/components/dioFun.dart';
|
||||
import 'package:hyzp_ybqx/components/hyxx_data_handle.dart';
|
||||
import 'package:hyzp_ybqx/pages/Works/DWDT/dwInfo_data.dart';
|
||||
import 'package:hyzp_ybqx/pages/Works/DWDT/widget_to_image.dart';
|
||||
import 'package:hyzp_ybqx/services/EventBus.dart';
|
||||
|
||||
///获取车流量日统计数据
|
||||
@@ -481,10 +487,14 @@ Future startGetStatisDataNew() async {
|
||||
|
||||
if (listDwinfoGetList2.isEmpty) {
|
||||
//若没有读取点位数据,便需要先读取
|
||||
getThePageList(theHyshlx: 'dwxx').then((value) {
|
||||
getThePageList(theHyshlx: 'dwxx').then((value) async {
|
||||
listDwinfoGetList2 = value;
|
||||
print('listDwinfoGetList2 = \n$listDwinfoGetList2');
|
||||
dwSum = listDwinfoGetList2.length;
|
||||
|
||||
// 百度地图初始化
|
||||
await bmfInit();
|
||||
|
||||
//获取记录数据
|
||||
getZptjStatisAlone();
|
||||
getTodayShtj();
|
||||
@@ -504,6 +514,9 @@ Future startGetStatisDataNew() async {
|
||||
// }
|
||||
});
|
||||
} else {
|
||||
// 百度地图初始化
|
||||
await bmfInit();
|
||||
|
||||
if (mapStatisInfo['今日抓拍'] < 0) {
|
||||
//获取记录数据
|
||||
getZptjStatisAlone();
|
||||
@@ -680,3 +693,26 @@ Future getAllSumCll(String field, List listStatis) async {
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// 百度地图初始化
|
||||
Future bmfInit() async {
|
||||
// 只有IOS版才需要
|
||||
if (Platform.isIOS) {
|
||||
g_myIconPathPre = await createDir(g_myIconDir);
|
||||
print("g_myIconPathPre = $g_myIconPathPre");
|
||||
// g_myIconPathPre = /data/user/0/com.example.hyzp_yibin_bmfmap/app_flutter/myIcons
|
||||
|
||||
int len = listDwinfoGetList2.length;
|
||||
for (int i = 0; i < len; i++) {
|
||||
Widget iconWidget = await getIconWidget("${i + 1}、" + listDwinfoGetList2[i]["dwmc"]);
|
||||
ByteData byteData = await widgetToImage(iconWidget);
|
||||
await saveImage(g_myIconDir, "${g_myIconPre}${i + 1}.png", byteData);
|
||||
print("i = $i");
|
||||
if (i == len - 1) {
|
||||
// setState(() {});
|
||||
// runApp(MyApp());
|
||||
}
|
||||
}
|
||||
} else if (Platform.isAndroid) {}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -11,6 +11,7 @@ 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,
|
||||
@@ -43,6 +44,7 @@ class TodayListZpjlContentNew extends StatefulWidget {
|
||||
// String num;
|
||||
int index;
|
||||
String text;
|
||||
|
||||
// Map mapZpjl;
|
||||
String tsztText;
|
||||
|
||||
@@ -89,6 +91,7 @@ class _TodayListZpjlPageState extends State<TodayListZpjlContentNew> {
|
||||
String num;
|
||||
Map mapZpjl;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_context = context;
|
||||
_widthLeft = _screenWidth / 2.6;
|
||||
@@ -106,6 +109,17 @@ class _TodayListZpjlPageState extends State<TodayListZpjlContentNew> {
|
||||
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();
|
||||
|
||||
+16
-34
@@ -16,7 +16,10 @@ import '../../components/commonFun.dart';
|
||||
import '../../services/ServiceLocator.dart';
|
||||
import '../../services/Storage.dart';
|
||||
import 'page1_work.dart';
|
||||
|
||||
// import 'package:audioplayers/audio_cache.dart';
|
||||
import 'package:flutter_background_service/flutter_background_service.dart';
|
||||
import 'package:hyzp_ybqx/pages/tabs/flutter_background_service_my.dart';
|
||||
|
||||
class Tabs extends StatefulWidget {
|
||||
Tabs({Key key, this.arguments = 0}) : super(key: key);
|
||||
@@ -65,6 +68,7 @@ class _TabsState extends State<Tabs> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
getlistItems().then((value) => try_setState());
|
||||
print('widget.arguments = ${widget.arguments}');
|
||||
//_currentIndex = 3 == widget.arguments ? 0 : widget.arguments; //解决"我的"页面根据用户所属组及时刷新问题
|
||||
@@ -85,47 +89,25 @@ class _TabsState extends State<Tabs> {
|
||||
}
|
||||
|
||||
init() async {
|
||||
// // 从磁盘读取变量
|
||||
// g_bVoiceRemind = await Storage.getBool('bVoiceRemind');
|
||||
// g_bVoiceRemind = (null == g_bVoiceRemind) ? false : g_bVoiceRemind;
|
||||
// // print('g_bVoiceRemind = $g_bVoiceRemind');
|
||||
// eventBus.fire(VoiceRemindUpdate('g_bVoiceRemind 数据已更新'));
|
||||
|
||||
// 执行语音提醒
|
||||
doRemind();
|
||||
|
||||
// doRemind();
|
||||
//设置定时提醒,循环执行定时任务,间隔 g_remindGap 秒
|
||||
setRemindTimer();
|
||||
// setRemindTimer();
|
||||
|
||||
// g_remindTimer = Timer.periodic(Duration(seconds: g_remindGap), (timer) {
|
||||
// ///定时任务
|
||||
// doRemind();
|
||||
// });
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
FlutterBackgroundService.initialize(onStart);
|
||||
if (g_bVoiceRemind) {
|
||||
doRemind();
|
||||
} else {
|
||||
Future.delayed(Duration(seconds: 1), () {
|
||||
FlutterBackgroundService().sendData({"action": "stopService"});
|
||||
print('stopService');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// // 执行语音提醒
|
||||
// Future doRemind() async {
|
||||
// // 获取待审核黑烟车记录
|
||||
// listReviewed.clear();
|
||||
// print("listReviewed = $listReviewed");
|
||||
// await getReviewedList(); //注意:访问区县后台接口,需要统一添加区县代码参数
|
||||
// print("listReviewed = $listReviewed");
|
||||
// if (g_bVoiceRemind && listReviewed.length > 0) {
|
||||
// // if (g_bVoiceRemind) {
|
||||
// // import 'dart:io';
|
||||
// // import 'package:audioplayers/audio_cache.dart';
|
||||
// // print("播放:语音提醒.mp3");
|
||||
// AudioCache().play(File('audio/语音提醒.mp3').path); //语音提醒
|
||||
// }
|
||||
// }
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
// 取消定时任务
|
||||
if (null != g_remindTimer) {
|
||||
g_remindTimer.cancel(); //取消计时器
|
||||
}
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@ import 'package:hyzp_ybqx/services/Storage.dart';
|
||||
|
||||
import '../../components/commonFun.dart';
|
||||
import '../../widget/JdButton.dart';
|
||||
import 'package:flutter_background_service/flutter_background_service.dart';
|
||||
import 'package:hyzp_ybqx/pages/tabs/flutter_background_service_my.dart';
|
||||
|
||||
class page7_setRemind extends StatefulWidget {
|
||||
page7_setRemind({Key key}) : super(key: key);
|
||||
@@ -19,6 +21,9 @@ class page7_setRemind extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _LoginPageState extends State<page7_setRemind> {
|
||||
bool bVoiceRemind;
|
||||
int remindGap;
|
||||
|
||||
dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
@@ -27,16 +32,7 @@ class _LoginPageState extends State<page7_setRemind> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
bVoiceRemind = g_bVoiceRemind;
|
||||
|
||||
getListView();
|
||||
|
||||
// //监听 g_bVoiceRemind 更新事件
|
||||
// eventBus.on<VoiceRemindUpdate>().listen((event) async {
|
||||
// print(event.str + ", g_bVoiceRemind = $g_bVoiceRemind");
|
||||
// setState(() {
|
||||
// getListView();
|
||||
// });
|
||||
// });
|
||||
remindGap = g_remindGap;
|
||||
}
|
||||
|
||||
////////
|
||||
@@ -106,85 +102,15 @@ class _LoginPageState extends State<page7_setRemind> {
|
||||
setState(() {
|
||||
bVoiceRemind = !bVoiceRemind;
|
||||
print("bVoiceRemind = $bVoiceRemind");
|
||||
// Storage.setBool('bVoiceRemind', bVoiceRemind);
|
||||
print("播放语音提醒");
|
||||
if (bVoiceRemind) {
|
||||
print("播放语音提醒");
|
||||
// AudioCache().play(File('audio/语音提醒.mp3').path); //语音提醒
|
||||
myPlayVoiceRemind();
|
||||
} else {
|
||||
myPlayClick();
|
||||
}
|
||||
getListView();
|
||||
});
|
||||
}
|
||||
|
||||
bool bVoiceRemind;
|
||||
|
||||
getListView() {
|
||||
_listViewUser.clear();
|
||||
_listViewUser = [
|
||||
Center(
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 30),
|
||||
height: ScreenUtil().setWidth(160),
|
||||
width: ScreenUtil().setWidth(160),
|
||||
//child: Image.asset('assets/images/user.png', fit: BoxFit.cover),
|
||||
child: Image.asset('assets/images/ybsthbj.png', fit: BoxFit.fitHeight),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 50),
|
||||
_getListTile('待审提醒',
|
||||
leadPath: 'assets/images/语音提醒.png',
|
||||
leadColor: _deepGreyColor,
|
||||
textColor: bVoiceRemind ? Colors.blue : null,
|
||||
onTapFun: OnTap_Remind,
|
||||
trailWidget: bVoiceRemind
|
||||
? Icon(Icons.check_box, color: Colors.blue)
|
||||
: Icon(Icons.check_box_outline_blank, color: Colors.blueAccent)),
|
||||
_getListTile('提醒间隔(秒)',
|
||||
leadPath: 'assets/images/时间间隔.png',
|
||||
leadColor: _deepBlueColor,
|
||||
trailWidget: getTextField()),
|
||||
SizedBox(height: 60),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
JdButton(
|
||||
height: 128,
|
||||
width: 282,
|
||||
//height: 126,
|
||||
text: "确认",
|
||||
color: Colors.blueAccent,
|
||||
onTop: () {
|
||||
g_bVoiceRemind = bVoiceRemind;
|
||||
print("g_bVoiceRemind = $g_bVoiceRemind");
|
||||
Storage.setBool('bVoiceRemind', g_bVoiceRemind);
|
||||
|
||||
g_remindGap = _gap;
|
||||
print("g_remindGap = $g_remindGap");
|
||||
Storage.setInt('nRemindGap', g_remindGap);
|
||||
setRemindTimer(enable: g_bVoiceRemind);
|
||||
|
||||
// AudioCache().play(File('audio/yinxiao1064.mp3').path); //音效提醒
|
||||
myPlayClacks(); //音效提醒
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
JdButton(
|
||||
height: 128,
|
||||
width: 282,
|
||||
//height: 126,
|
||||
text: "取消",
|
||||
color: Colors.blueAccent,
|
||||
onTop: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
int _gap = g_remindGap;
|
||||
|
||||
Widget getTextField() {
|
||||
return Container(
|
||||
width: ScreenUtil().setWidth(150),
|
||||
@@ -193,10 +119,10 @@ class _LoginPageState extends State<page7_setRemind> {
|
||||
focusNode: FocusNode(),
|
||||
textAlignVertical: TextAlignVertical(y: 1.0),
|
||||
controller: TextEditingController.fromValue(TextEditingValue(
|
||||
text: _gap.toString(),
|
||||
text: remindGap.toString(),
|
||||
// 保持光标在最后
|
||||
selection: TextSelection.fromPosition(
|
||||
TextPosition(affinity: TextAffinity.downstream, offset: _gap.toString().length)))),
|
||||
selection: TextSelection.fromPosition(TextPosition(
|
||||
affinity: TextAffinity.downstream, offset: remindGap.toString().length)))),
|
||||
maxLines: 1,
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: InputDecoration(
|
||||
@@ -209,7 +135,10 @@ class _LoginPageState extends State<page7_setRemind> {
|
||||
enabledBorder: UnderlineInputBorder(borderSide: BorderSide(color: Colors.lightBlue)),
|
||||
),
|
||||
onChanged: (v) {
|
||||
_gap = int.parse(v);
|
||||
int n = int.parse(v);
|
||||
if (n > 10 && n < 36000) {
|
||||
remindGap = int.parse(v);
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
@@ -279,7 +208,83 @@ class _LoginPageState extends State<page7_setRemind> {
|
||||
body: Container(
|
||||
padding: EdgeInsets.only(top: 30, bottom: 20, left: 20, right: 20),
|
||||
child: ListView(
|
||||
children: _listViewUser,
|
||||
children: [
|
||||
Center(
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 30),
|
||||
height: ScreenUtil().setWidth(160),
|
||||
width: ScreenUtil().setWidth(160),
|
||||
//child: Image.asset('assets/images/user.png', fit: BoxFit.cover),
|
||||
child: Image.asset('assets/images/ybsthbj.png', fit: BoxFit.fitHeight),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 50),
|
||||
_getListTile('待审提醒',
|
||||
leadPath: 'assets/images/语音提醒.png',
|
||||
leadColor: _deepGreyColor,
|
||||
textColor: bVoiceRemind ? Colors.blue : null,
|
||||
onTapFun: OnTap_Remind,
|
||||
trailWidget: bVoiceRemind
|
||||
? Icon(Icons.check_box, color: Colors.blue)
|
||||
: Icon(Icons.check_box_outline_blank, color: Colors.blueAccent)),
|
||||
_getListTile('提醒间隔(秒)',
|
||||
leadPath: 'assets/images/时间间隔.png',
|
||||
leadColor: _deepBlueColor,
|
||||
trailWidget: getTextField()),
|
||||
SizedBox(height: 60),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
JdButton(
|
||||
height: 128,
|
||||
width: 282,
|
||||
//height: 126,
|
||||
text: "确认",
|
||||
color: Colors.blueAccent,
|
||||
onTop: () async {
|
||||
print("g_remindGap = $g_remindGap, remindGap = $remindGap");
|
||||
if (g_bVoiceRemind != bVoiceRemind || g_remindGap != remindGap) {
|
||||
var isRuning = await FlutterBackgroundService().isServiceRunning();
|
||||
print("isRuning = $isRuning");
|
||||
if (isRuning) {
|
||||
FlutterBackgroundService().sendData({"action": "stopService"});
|
||||
}
|
||||
|
||||
g_bVoiceRemind = bVoiceRemind;
|
||||
print("g_bVoiceRemind = $g_bVoiceRemind");
|
||||
await Storage.setBool('bVoiceRemind', g_bVoiceRemind);
|
||||
|
||||
g_remindGap = remindGap;
|
||||
print("g_remindGap = $g_remindGap");
|
||||
await Storage.setInt('nRemindGap', g_remindGap);
|
||||
|
||||
if (bVoiceRemind) {
|
||||
Future.delayed(Duration(seconds: 2), (){
|
||||
print('延时2s执行');
|
||||
FlutterBackgroundService.initialize(onStart);
|
||||
doRemind();
|
||||
});
|
||||
} else {
|
||||
myPlayClick();
|
||||
}
|
||||
}
|
||||
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
JdButton(
|
||||
height: 128,
|
||||
width: 282,
|
||||
//height: 126,
|
||||
text: "取消",
|
||||
color: Colors.blueAccent,
|
||||
onTop: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user