hyzp_ybqx-Commit027:开始实现兴文县App。按照 yzp_ybqx-Commit026-区县切换新方法-OK 切换到 hyzp_ybqx511528_xingwen 版本,编译运行成功,但登录失败
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:hyzp_ybqx511505_sanjiang_new_area_launche/config/service_url.dart';
|
||||
import 'package:hyzp_ybqx511505_sanjiang_new_area_launche/services/EventBus.dart';
|
||||
import 'package:hyzp_ybqx511528_xingwen/config/service_url.dart';
|
||||
import 'package:hyzp_ybqx511528_xingwen/services/EventBus.dart';
|
||||
|
||||
import 'commonFun.dart';
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
//import '../my_wechat_assets_picker_fix/my_asset_picker_1.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:hyzp_ybqx511505_sanjiang_new_area_launche/provider/player_region.dart';
|
||||
import 'package:hyzp_ybqx511528_xingwen/provider/player_region.dart';
|
||||
|
||||
import 'UserInfo.dart';
|
||||
|
||||
@@ -28,8 +28,8 @@ import 'UserInfo.dart';
|
||||
// android:label="宜宾市筠连黑烟抓拍"
|
||||
// android:label="宜宾市兴文黑烟抓拍"
|
||||
|
||||
// 2、修改App的android和Flutter启动图片,制作并运行 hyzp_ybqx511505_sanjiang_new_area_launche.images_copy.cmd,自动完成两项拷贝任务
|
||||
// (1)、拷贝不同分辨率的图片文件hyzp_ybqx511505_sanjiang_new_area_launche_launche.png到下面目录,作为App的android启动图片
|
||||
// 2、修改App的android和Flutter启动图片,制作并运行 hyzp_ybqx511528_xingwen.images_copy.cmd,自动完成两项拷贝任务
|
||||
// (1)、拷贝不同分辨率的图片文件hyzp_ybqx511528_xingwen_launche.png到下面目录,作为App的android启动图片
|
||||
// r:\FlutterProject\FlutterProject51-hyzp_ybqx\hyzp_ybqx\android\app\src\main\res\mipmap-hdpi\
|
||||
// r:\FlutterProject\FlutterProject51-hyzp_ybqx\hyzp_ybqx\android\app\src\main\res\mipmap-mdpi\
|
||||
// r:\FlutterProject\FlutterProject51-hyzp_ybqx\hyzp_ybqx\android\app\src\main\res\mipmap-xhdpi\
|
||||
@@ -45,18 +45,21 @@ import 'UserInfo.dart';
|
||||
// String yibin_QuXian = '宜宾';
|
||||
// String copyright_info = '© ' + yibin_QuXian + '市生态环境局 四川省踏石科技有限公司 版权所有' + service_tel;
|
||||
// String copyright_info_PinYin = 'YIBIN BLACK SMOKE CAR CAPTURE SYSTEM';
|
||||
// const serviceUrl_ybqx = 'http://125.64.218.67:9904';
|
||||
|
||||
const serviceUrl_ybqx = 'http://125.64.218.67:9909';
|
||||
// 511502、翠屏区
|
||||
// int qxdm = 511502;
|
||||
// String service_tel = '';
|
||||
// String yibin_QuXian = '宜宾市翠屏';
|
||||
// String copyright_info = '© ' + yibin_QuXian + '生态环境局 版权所有' + service_tel;
|
||||
// String copyright_info_PinYin = 'YIBIN CUIPING BLACK SMOKE CAR CAPTURE SYSTEM';
|
||||
|
||||
// 511505、三江新区
|
||||
String service_tel = '服务热线:187-8467-8300';
|
||||
String yibin_QuXian = '宜宾三江新区';
|
||||
String copyright_info = '© ' + yibin_QuXian + '城乡融合发展局 四川省踏石科技\n版权所有, ' + service_tel;
|
||||
String copyright_info_PinYin = 'YIBIN SANJIANG NEW AREA BLACK SMOKE CAR CAPTURE SYSTEM';
|
||||
// String service_tel = '服务热线:187-8467-8300';
|
||||
// String yibin_QuXian = '宜宾三江新区';
|
||||
// String copyright_info = '© ' + yibin_QuXian + '城乡融合发展局 四川省踏石科技\n版权所有, ' + service_tel;
|
||||
// String copyright_info_PinYin = 'YIBIN SANJIANG NEW AREA BLACK SMOKE CAR CAPTURE SYSTEM';
|
||||
|
||||
// 511524、长宁县
|
||||
// String service_tel = '';
|
||||
@@ -71,19 +74,20 @@ String copyright_info_PinYin = 'YIBIN SANJIANG NEW AREA BLACK SMOKE CAR CAPTURE
|
||||
// String copyright_info_PinYin = 'YIBIN JUNLIAN BLACK SMOKE CAR CAPTURE SYSTEM';
|
||||
|
||||
// 511528、兴文县
|
||||
// String service_tel = '\n服务热线:187-8467-8300';
|
||||
// String yibin_QuXian = '宜宾市兴文';
|
||||
// String copyright_info = '© ' + yibin_QuXian + '生态环境局 四川省踏石科技 版权所有' + service_tel;
|
||||
// String copyright_info_PinYin = 'YIBIN XINGWEN BLACK SMOKE CAR CAPTURE SYSTEM';
|
||||
int qxdm = 511528;
|
||||
String service_tel = '\n服务热线:187-8467-8300';
|
||||
String yibin_QuXian = '宜宾市兴文';
|
||||
String copyright_info = '© ' + yibin_QuXian + '生态环境局 四川省踏石科技 版权所有' + service_tel;
|
||||
String copyright_info_PinYin = 'YIBIN XINGWEN BLACK SMOKE CAR CAPTURE SYSTEM';
|
||||
|
||||
// 4、全局替换,将 ”hyzp_ybqx511505_sanjiang_new_area_launche“全部替换为 ”hyzp_ybqx511505_sanjiang_new_area_launche“,自动完成以下修改
|
||||
// 4、全局替换,将 ”hyzp_ybqx511528_xingwen“全部替换为 ”hyzp_ybqx511528_xingwen“,自动完成以下修改
|
||||
// (1)、修改 R:\FlutterProject\FlutterProject51-hyzp_ybqx\hyzp_ybqx\pubspec.yaml 文件中的AppID,但存放目錄不變
|
||||
// name: hyzp_ybqx511505_sanjiang_new_area_launche
|
||||
// name: hyzp_ybqx511528_xingwen
|
||||
// (2)、全局替换:
|
||||
// A、将 “com.flutter.hyzp_ybqx00_yibin” 全部替换为 “com.flutter.hyzp_ybqx511505_sanjiang_new_area_launche”
|
||||
// B、将 “package:hyzp_ybqx00_yibin/” 全部替换为 “package:hyzp_ybqx511505_sanjiang_new_area_launche/”
|
||||
// C、将 “# hyzp_ybqx00_yibin” 全部替换为 “# hyzp_ybqx511505_sanjiang_new_area_launche”
|
||||
// D、将 “<string>hyzp_ybqx00_yibin</string>” 全部替换为 “<string>hyzp_ybqx511505_sanjiang_new_area_launche</string>”
|
||||
// A、将 “com.flutter.hyzp_ybqx00_yibin” 全部替换为 “com.flutter.hyzp_ybqx511528_xingwen”
|
||||
// B、将 “package:hyzp_ybqx00_yibin/” 全部替换为 “package:hyzp_ybqx511528_xingwen/”
|
||||
// C、将 “# hyzp_ybqx00_yibin” 全部替换为 “# hyzp_ybqx511528_xingwen”
|
||||
// D、将 “<string>hyzp_ybqx00_yibin</string>” 全部替换为 “<string>hyzp_ybqx511528_xingwen</string>”
|
||||
|
||||
// 5、完成以上修改后,打开 Android Studio 的终端窗口,切换到项目的 lib 目录下,运行 flutter clean
|
||||
|
||||
@@ -576,14 +580,14 @@ Future image2Base64(String imagePath) async {
|
||||
//从字符路径 path 获取扩展名,不含点号
|
||||
getFileExtension(String path) {
|
||||
//return path.substring(path.lastIndexOf('.'));
|
||||
//imagePath = /data/user/0/com.flutter.hyzp_ybqx511505_sanjiang_new_area_launche/app_flutter/Pictures/flutter_test/1614662209478.jpg, ext = .jpg
|
||||
//imagePath = /data/user/0/com.flutter.hyzp_ybqx511528_xingwen/app_flutter/Pictures/flutter_test/1614662209478.jpg, ext = .jpg
|
||||
return path.substring(path.lastIndexOf('.') + 1); //不含点号
|
||||
}
|
||||
|
||||
//从字符路径 path 获取文件名(含扩展名)
|
||||
getFileName(String path) {
|
||||
//return path.substring(path.lastIndexOf('.'));
|
||||
//imagePath = /data/user/0/com.flutter.hyzp_ybqx511505_sanjiang_new_area_launche/app_flutter/Pictures/flutter_test/1614662209478.jpg, ext = .jpg
|
||||
//imagePath = /data/user/0/com.flutter.hyzp_ybqx511528_xingwen/app_flutter/Pictures/flutter_test/1614662209478.jpg, ext = .jpg
|
||||
return path.substring(path.lastIndexOf('/') + 1); //不含点号
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'dart:io';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import '../config/service_url.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
|
||||
//拍照、选择相册图片对话框
|
||||
class customDialogH extends Dialog {
|
||||
@@ -154,7 +154,7 @@ class customDialogH extends Dialog {
|
||||
"file": await MultipartFile.fromFile(fileDir, filename: "xxx.jpg")
|
||||
});
|
||||
//var response = await Dio().post(ServicePath.uploadImageUrl, data: fileDir);
|
||||
var response = await Dio().post(ServiceUrlJd, data: fileDir);
|
||||
print(response);
|
||||
// var response = await Dio().post(ServiceUrlJd, data: fileDir);
|
||||
// print(response);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hyzp_ybqx511505_sanjiang_new_area_launche/components/dioFun.dart';
|
||||
import 'package:hyzp_ybqx511528_xingwen/components/dioFun.dart';
|
||||
|
||||
import 'commonFun.dart';
|
||||
|
||||
|
||||
+165
-170
@@ -1,22 +1,17 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/screen_util.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:http/http.dart' as my_http;
|
||||
import 'package:hyzp_ybqx511528_xingwen/components/doJSON.dart';
|
||||
import 'package:hyzp_ybqx511528_xingwen/services/EventBus.dart';
|
||||
import 'package:hyzp_ybqx511528_xingwen/widget/my_superplayer.dart';
|
||||
import 'package:sprintf/sprintf.dart';
|
||||
import 'package:hyzp_ybqx511505_sanjiang_new_area_launche/components/doJSON.dart';
|
||||
import 'package:hyzp_ybqx511505_sanjiang_new_area_launche/services/EventBus.dart';
|
||||
import 'package:hyzp_ybqx511505_sanjiang_new_area_launche/widget/my_superplayer.dart';
|
||||
|
||||
import '../components/hyxx_data_handle.dart';
|
||||
import '../config/service_url.dart';
|
||||
import '../res/listContacts.dart';
|
||||
import '../widget/my_delay_toast.dart';
|
||||
// import 'package:hyzp_ybqx511505_sanjiang_new_area_launche/widget/player_pro.dart';
|
||||
// import 'package:hyzp_ybqx511505_sanjiang_new_area_launche/widget/player_pro_new.dart';
|
||||
// import 'package:hyzp_ybqx511528_xingwen/widget/player_pro.dart';
|
||||
// import 'package:hyzp_ybqx511528_xingwen/widget/player_pro_new.dart';
|
||||
import 'UserAuthority.dart';
|
||||
import 'commonFun.dart';
|
||||
|
||||
@@ -2007,168 +2002,168 @@ Future getDwspUrlNew(
|
||||
}
|
||||
|
||||
///得到点位视频(Dwsp)播放地址,用插件 http: ^0.12.2
|
||||
Future getDwspUrl({@required int index, String theSbgllx = 'dwsp', BuildContext context}) async {
|
||||
print('\n --- getingDwVideo = $getingDwVideo --- \n');
|
||||
//正在获取点位视频标志,禁止重入
|
||||
if (getingDwVideo) {
|
||||
Fluttertoast.showToast(
|
||||
msg: '正在后台获取 $getingDwmc 点位视频地址,请稍后重试',
|
||||
toastLength: Toast.LENGTH_SHORT,
|
||||
gravity: ToastGravity.CENTER,
|
||||
);
|
||||
return '';
|
||||
}
|
||||
|
||||
//标注正在获取点位视频的记录
|
||||
getingIndex = index;
|
||||
print('_getingIndex = $getingIndex');
|
||||
eventBus.fire(DwspUpdateEvent('点位视频信息数据更新广播'));
|
||||
|
||||
getingDwVideo = true;
|
||||
getingDwmc = '${(index + 1)}、${listDwinfoGetList2[index]['dwmc']}'; //正在获取视频的点位名称
|
||||
print('\n --- 正在后台获取 $getingDwmc 点位视频地址 --- \n');
|
||||
print('\n --- getingDwVideo = $getingDwVideo --- \n');
|
||||
|
||||
String _dwspUrl;
|
||||
getCount = 1;
|
||||
|
||||
//MediaQueryData.fromWindow(window).padding.top //这个就是状态栏的高度
|
||||
//ScreenUtil().statusBarHeight //状态栏高度 刘海屏会更高 单位dp
|
||||
print('ScreenUtil().statusBarHeight = ${ScreenUtil().statusBarHeight}');
|
||||
getSumTime = getCurrentTiem();
|
||||
MyDelayToast(
|
||||
context: context,
|
||||
showTime: 30,
|
||||
top: ScreenUtil().statusBarHeight + 2.5,
|
||||
left: ScreenUtil().screenWidth - 80 - 2.5);
|
||||
|
||||
print('开始第$getCount次获取视频地址');
|
||||
getDwspUrl2(index: index, theSbgllx: theSbgllx).then((url) {
|
||||
_dwspUrl = url;
|
||||
if (!isVideoUrl(_dwspUrl)) {
|
||||
print('第$getCount次获取视频地址失败,等待1秒后重试');
|
||||
getCount++;
|
||||
Future.delayed(Duration(seconds: 1), () async {
|
||||
print('开始第$getCount次获取视频地址');
|
||||
getDwspUrl2(index: index, theSbgllx: theSbgllx).then((url) {
|
||||
_dwspUrl = url;
|
||||
if (!isVideoUrl(_dwspUrl)) {
|
||||
print('第$getCount次获取视频地址失败,等待1秒后重试');
|
||||
getCount++;
|
||||
Future.delayed(Duration(seconds: 1), () async {
|
||||
print('开始第$getCount次获取视频地址');
|
||||
getDwspUrl2(index: index, theSbgllx: theSbgllx).then((url) {
|
||||
_dwspUrl = url;
|
||||
if (!isVideoUrl(_dwspUrl)) {
|
||||
print('第$getCount次获取视频地址失败,等待1秒后重试');
|
||||
getCount++;
|
||||
Future.delayed(Duration(seconds: 1), () async {
|
||||
print('开始第$getCount次获取视频地址');
|
||||
getDwspUrl2(index: index, theSbgllx: theSbgllx).then((url) {
|
||||
_dwspUrl = url;
|
||||
if (!isVideoUrl(_dwspUrl)) {
|
||||
print('第$getCount次获取视频地址失败,等待1秒后重试');
|
||||
getCount++;
|
||||
Future.delayed(Duration(seconds: 1), () async {
|
||||
print('开始第$getCount次获取视频地址');
|
||||
getDwspUrl2(index: index, theSbgllx: theSbgllx).then((url) {
|
||||
_dwspUrl = url;
|
||||
if (!isVideoUrl(_dwspUrl)) {
|
||||
getSumTime = getCurrentTiem() - getSumTime;
|
||||
print('第$getCount次获取 $getingDwmc 点位视频地址失败,直接返回。共用时 $getSumTime 秒');
|
||||
Fluttertoast.showToast(
|
||||
msg: '第$getCount次获取 $getingDwmc 点位视频地址失败,请稍后重试。共用时 $getSumTime 秒',
|
||||
toastLength: Toast.LENGTH_SHORT,
|
||||
gravity: ToastGravity.CENTER,
|
||||
);
|
||||
//正在获取点位视频标志,禁止重入
|
||||
getingDwVideo = false;
|
||||
|
||||
//标注正在获取点位视频的记录
|
||||
getingIndex = -1;
|
||||
print('_getingIndex = $getingIndex');
|
||||
eventBus.fire(DwspUpdateEvent('点位视频信息数据更新广播'));
|
||||
} else {
|
||||
print('开始播放:第$getCount次成功获取的视频地址');
|
||||
playUrl(index: index, url: _dwspUrl, context: context);
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
print('开始播放:第$getCount次成功获取的视频地址');
|
||||
playUrl(index: index, url: _dwspUrl, context: context);
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
print('开始播放:第$getCount次成功获取的视频地址');
|
||||
playUrl(index: index, url: _dwspUrl, context: context);
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
print('开始播放:第$getCount次成功获取的视频地址');
|
||||
playUrl(index: index, url: _dwspUrl, context: context);
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
print('开始播放:第$getCount次成功获取的视频地址');
|
||||
playUrl(index: index, url: _dwspUrl, context: context);
|
||||
}
|
||||
});
|
||||
|
||||
//不能放到此处,此处不会等待,将导致禁止重入失败
|
||||
//正在获取点位视频标志,禁止重入
|
||||
//getingDwVideo = false;
|
||||
|
||||
//print('失败:$getCount次获取的视频地址都失败!');
|
||||
return _dwspUrl;
|
||||
}
|
||||
// Future getDwspUrl({@required int index, String theSbgllx = 'dwsp', BuildContext context}) async {
|
||||
// print('\n --- getingDwVideo = $getingDwVideo --- \n');
|
||||
// //正在获取点位视频标志,禁止重入
|
||||
// if (getingDwVideo) {
|
||||
// Fluttertoast.showToast(
|
||||
// msg: '正在后台获取 $getingDwmc 点位视频地址,请稍后重试',
|
||||
// toastLength: Toast.LENGTH_SHORT,
|
||||
// gravity: ToastGravity.CENTER,
|
||||
// );
|
||||
// return '';
|
||||
// }
|
||||
//
|
||||
// //标注正在获取点位视频的记录
|
||||
// getingIndex = index;
|
||||
// print('_getingIndex = $getingIndex');
|
||||
// eventBus.fire(DwspUpdateEvent('点位视频信息数据更新广播'));
|
||||
//
|
||||
// getingDwVideo = true;
|
||||
// getingDwmc = '${(index + 1)}、${listDwinfoGetList2[index]['dwmc']}'; //正在获取视频的点位名称
|
||||
// print('\n --- 正在后台获取 $getingDwmc 点位视频地址 --- \n');
|
||||
// print('\n --- getingDwVideo = $getingDwVideo --- \n');
|
||||
//
|
||||
// String _dwspUrl;
|
||||
// getCount = 1;
|
||||
//
|
||||
// //MediaQueryData.fromWindow(window).padding.top //这个就是状态栏的高度
|
||||
// //ScreenUtil().statusBarHeight //状态栏高度 刘海屏会更高 单位dp
|
||||
// print('ScreenUtil().statusBarHeight = ${ScreenUtil().statusBarHeight}');
|
||||
// getSumTime = getCurrentTiem();
|
||||
// MyDelayToast(
|
||||
// context: context,
|
||||
// showTime: 30,
|
||||
// top: ScreenUtil().statusBarHeight + 2.5,
|
||||
// left: ScreenUtil().screenWidth - 80 - 2.5);
|
||||
//
|
||||
// print('开始第$getCount次获取视频地址');
|
||||
// getDwspUrl2(index: index, theSbgllx: theSbgllx).then((url) {
|
||||
// _dwspUrl = url;
|
||||
// if (!isVideoUrl(_dwspUrl)) {
|
||||
// print('第$getCount次获取视频地址失败,等待1秒后重试');
|
||||
// getCount++;
|
||||
// Future.delayed(Duration(seconds: 1), () async {
|
||||
// print('开始第$getCount次获取视频地址');
|
||||
// getDwspUrl2(index: index, theSbgllx: theSbgllx).then((url) {
|
||||
// _dwspUrl = url;
|
||||
// if (!isVideoUrl(_dwspUrl)) {
|
||||
// print('第$getCount次获取视频地址失败,等待1秒后重试');
|
||||
// getCount++;
|
||||
// Future.delayed(Duration(seconds: 1), () async {
|
||||
// print('开始第$getCount次获取视频地址');
|
||||
// getDwspUrl2(index: index, theSbgllx: theSbgllx).then((url) {
|
||||
// _dwspUrl = url;
|
||||
// if (!isVideoUrl(_dwspUrl)) {
|
||||
// print('第$getCount次获取视频地址失败,等待1秒后重试');
|
||||
// getCount++;
|
||||
// Future.delayed(Duration(seconds: 1), () async {
|
||||
// print('开始第$getCount次获取视频地址');
|
||||
// getDwspUrl2(index: index, theSbgllx: theSbgllx).then((url) {
|
||||
// _dwspUrl = url;
|
||||
// if (!isVideoUrl(_dwspUrl)) {
|
||||
// print('第$getCount次获取视频地址失败,等待1秒后重试');
|
||||
// getCount++;
|
||||
// Future.delayed(Duration(seconds: 1), () async {
|
||||
// print('开始第$getCount次获取视频地址');
|
||||
// getDwspUrl2(index: index, theSbgllx: theSbgllx).then((url) {
|
||||
// _dwspUrl = url;
|
||||
// if (!isVideoUrl(_dwspUrl)) {
|
||||
// getSumTime = getCurrentTiem() - getSumTime;
|
||||
// print('第$getCount次获取 $getingDwmc 点位视频地址失败,直接返回。共用时 $getSumTime 秒');
|
||||
// Fluttertoast.showToast(
|
||||
// msg: '第$getCount次获取 $getingDwmc 点位视频地址失败,请稍后重试。共用时 $getSumTime 秒',
|
||||
// toastLength: Toast.LENGTH_SHORT,
|
||||
// gravity: ToastGravity.CENTER,
|
||||
// );
|
||||
// //正在获取点位视频标志,禁止重入
|
||||
// getingDwVideo = false;
|
||||
//
|
||||
// //标注正在获取点位视频的记录
|
||||
// getingIndex = -1;
|
||||
// print('_getingIndex = $getingIndex');
|
||||
// eventBus.fire(DwspUpdateEvent('点位视频信息数据更新广播'));
|
||||
// } else {
|
||||
// print('开始播放:第$getCount次成功获取的视频地址');
|
||||
// playUrl(index: index, url: _dwspUrl, context: context);
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
// } else {
|
||||
// print('开始播放:第$getCount次成功获取的视频地址');
|
||||
// playUrl(index: index, url: _dwspUrl, context: context);
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
// } else {
|
||||
// print('开始播放:第$getCount次成功获取的视频地址');
|
||||
// playUrl(index: index, url: _dwspUrl, context: context);
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
// } else {
|
||||
// print('开始播放:第$getCount次成功获取的视频地址');
|
||||
// playUrl(index: index, url: _dwspUrl, context: context);
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
// } else {
|
||||
// print('开始播放:第$getCount次成功获取的视频地址');
|
||||
// playUrl(index: index, url: _dwspUrl, context: context);
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// //不能放到此处,此处不会等待,将导致禁止重入失败
|
||||
// //正在获取点位视频标志,禁止重入
|
||||
// //getingDwVideo = false;
|
||||
//
|
||||
// //print('失败:$getCount次获取的视频地址都失败!');
|
||||
// return _dwspUrl;
|
||||
// }
|
||||
|
||||
///得到点位视频(Dwsp)播放地址,用插件 http: ^0.12.2
|
||||
Future getDwspUrl2({@required int index, String theSbgllx = 'dwsp'}) async {
|
||||
String _dwspUrl = '';
|
||||
|
||||
print('开始处理 ${mapHyshlx[theSbgllx]['text']} 网络请求...');
|
||||
String api = ServicePath.getDwspUrl + '${index.toString()}.php';
|
||||
print('api = ${api}');
|
||||
//api = http://125.64.218.67:9908/rtmp/1.php
|
||||
|
||||
try {
|
||||
my_http.Response response = await my_http.get(api);
|
||||
print('response.statusCode = ${response.statusCode}');
|
||||
//I/flutter (18114): Response status: 200
|
||||
|
||||
//var ret = json.decode(response.body); //报错
|
||||
//print('Utf8Codec().decode(response.bodyBytes) = ${Utf8Codec().decode(response.bodyBytes)}');
|
||||
// I/flutter (18114): rtmp://125.64.218.67:9903/rtp/26CCDAA7
|
||||
|
||||
print('response = ${response.toString()}');
|
||||
//response = Instance of 'Response'
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
//final Map<String, dynamic> responseData = json.decode(response.body);
|
||||
//报错:e:Error on line 1, column 18: Invalid media type: expected application/json;
|
||||
_dwspUrl = Utf8Codec().decode(response.bodyBytes).replaceAll('\n', ''); //删除所有换行符
|
||||
print('_dwspUrl = $_dwspUrl');
|
||||
//_dwspUrl = rtmp://125.64.218.67:9903/rtp/30C91573
|
||||
} else {
|
||||
throw Exception('${mapHyshlx[theSbgllx]['text']} 后端接口出现异常,请检测代码和服务器情况...');
|
||||
getingDwVideo = false; //出现异常必须提前释放禁止重入标志
|
||||
}
|
||||
} catch (e) {
|
||||
print('${mapHyshlx[theSbgllx]['text']} 网络请求过程异常 e:${e}');
|
||||
Fluttertoast.showToast(
|
||||
msg: 'ERROR:======>${e}',
|
||||
toastLength: Toast.LENGTH_SHORT,
|
||||
gravity: ToastGravity.CENTER,
|
||||
);
|
||||
getingDwVideo = false; //出现异常必须提前释放禁止重入标志
|
||||
}
|
||||
|
||||
return _dwspUrl;
|
||||
}
|
||||
// Future getDwspUrl2({@required int index, String theSbgllx = 'dwsp'}) async {
|
||||
// String _dwspUrl = '';
|
||||
//
|
||||
// print('开始处理 ${mapHyshlx[theSbgllx]['text']} 网络请求...');
|
||||
// String api = ServicePath.getDwspUrl + '${index.toString()}.php';
|
||||
// print('api = ${api}');
|
||||
// //api = http://125.64.218.67:9908/rtmp/1.php
|
||||
//
|
||||
// try {
|
||||
// my_http.Response response = await my_http.get(api);
|
||||
// print('response.statusCode = ${response.statusCode}');
|
||||
// //I/flutter (18114): Response status: 200
|
||||
//
|
||||
// //var ret = json.decode(response.body); //报错
|
||||
// //print('Utf8Codec().decode(response.bodyBytes) = ${Utf8Codec().decode(response.bodyBytes)}');
|
||||
// // I/flutter (18114): rtmp://125.64.218.67:9903/rtp/26CCDAA7
|
||||
//
|
||||
// print('response = ${response.toString()}');
|
||||
// //response = Instance of 'Response'
|
||||
//
|
||||
// if (response.statusCode == 200) {
|
||||
// //final Map<String, dynamic> responseData = json.decode(response.body);
|
||||
// //报错:e:Error on line 1, column 18: Invalid media type: expected application/json;
|
||||
// _dwspUrl = Utf8Codec().decode(response.bodyBytes).replaceAll('\n', ''); //删除所有换行符
|
||||
// print('_dwspUrl = $_dwspUrl');
|
||||
// //_dwspUrl = rtmp://125.64.218.67:9903/rtp/30C91573
|
||||
// } else {
|
||||
// throw Exception('${mapHyshlx[theSbgllx]['text']} 后端接口出现异常,请检测代码和服务器情况...');
|
||||
// getingDwVideo = false; //出现异常必须提前释放禁止重入标志
|
||||
// }
|
||||
// } catch (e) {
|
||||
// print('${mapHyshlx[theSbgllx]['text']} 网络请求过程异常 e:${e}');
|
||||
// Fluttertoast.showToast(
|
||||
// msg: 'ERROR:======>${e}',
|
||||
// toastLength: Toast.LENGTH_SHORT,
|
||||
// gravity: ToastGravity.CENTER,
|
||||
// );
|
||||
// getingDwVideo = false; //出现异常必须提前释放禁止重入标志
|
||||
// }
|
||||
//
|
||||
// return _dwspUrl;
|
||||
// }
|
||||
|
||||
/// 获取最新版本号
|
||||
Future getNewverUrl() async {
|
||||
|
||||
@@ -155,8 +155,8 @@ Future<File> getTheFile(String fileName) async {
|
||||
print(e);
|
||||
}
|
||||
|
||||
// /data/data/com.flutter.hyzp_ybqx511505_sanjiang_new_area_launche/app_flutter/json/listMessagesInbox02.json
|
||||
// /data/data/com.flutter.hyzp_ybqx511505_sanjiang_new_area_launche/app_flutter/json/listContacts02.json
|
||||
// /data/data/com.flutter.hyzp_ybqx511528_xingwen/app_flutter/json/listMessagesInbox02.json
|
||||
// /data/data/com.flutter.hyzp_ybqx511528_xingwen/app_flutter/json/listContacts02.json
|
||||
return File('${(await getApplicationDocumentsDirectory()).path}/json/$fileName');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user