修复 报事保修 派单提示未知错误的问题

升级dio库
hmxc
张萌 4 years ago
parent a1c941044c
commit d43be5986c

@ -13,6 +13,7 @@ import 'package:amap_map_fluttify/amap_map_fluttify.dart';
import 'package:get/get.dart' hide Response; import 'package:get/get.dart' hide Response;
import 'package:hive/hive.dart'; import 'package:hive/hive.dart';
import 'package:hive_flutter/hive_flutter.dart'; import 'package:hive_flutter/hive_flutter.dart';
import 'package:jpush_flutter/jpush_flutter.dart';
import 'package:power_logger/power_logger.dart'; import 'package:power_logger/power_logger.dart';
// Project imports: // Project imports:

@ -48,6 +48,8 @@ class _FixerDepartmentPageState extends State<FixerDepartmentPage> {
return false; return false;
} else if (_reportModel.workOrderTypeDetail == -1) { } else if (_reportModel.workOrderTypeDetail == -1) {
return false; return false;
} else if (_reportModel.remark == null) {
return false;
} }
return true; return true;
} }
@ -127,9 +129,9 @@ class _FixerDepartmentPageState extends State<FixerDepartmentPage> {
child: Text( child: Text(
'立即派单', '立即派单',
style: TextStyle( style: TextStyle(
color: _pickedFixers.isEmpty color: canDispatch
? AppStyle.minorTextColor ? AppStyle.primaryTextColor
: AppStyle.primaryTextColor, : AppStyle.minorTextColor,
fontSize: 32.w, fontSize: 32.w,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),

@ -41,7 +41,7 @@ class ManageFunc {
/// ///
static Future repairDispatch(DispatchReportModel model) async { static Future repairDispatch(DispatchReportModel model) async {
BaseModel baseModel = BaseModel baseModel =
await NetUtil().get(API.manage.repairDispatch, params: { await NetUtil().post(API.manage.repairDispatch, params: {
'dispatchListId': model.dispatchListId, 'dispatchListId': model.dispatchListId,
'workOrderType': model.workOrderTyoe, 'workOrderType': model.workOrderTyoe,
'workOrderTypeDetail': model.workOrderTypeDetail, 'workOrderTypeDetail': model.workOrderTypeDetail,

@ -34,14 +34,14 @@ class NetUtil {
); );
if (_dio == null) _dio = Dio(options); if (_dio == null) _dio = Dio(options);
dio.interceptors.add(InterceptorsWrapper( dio.interceptors.add(InterceptorsWrapper(
onRequest: (RequestOptions options) async => options, onRequest: (RequestOptions options,RequestInterceptorHandler handler) async => handler.next(options),
onResponse: (Response response) async { onResponse: (Response response,ResponseInterceptorHandler handler) async {
LoggerData.addData(response); LoggerData.addData(response);
return response; return handler.next(response);
}, },
onError: (DioError error) async { onError: (DioError error,ErrorInterceptorHandler handler) async {
_parseErr(error); _parseErr(error);
return error; return handler.next(error);
}, },
)); ));
} }
@ -154,17 +154,17 @@ class NetUtil {
} }
switch (err.type) { switch (err.type) {
case DioErrorType.CONNECT_TIMEOUT: case DioErrorType.connectTimeout:
case DioErrorType.SEND_TIMEOUT: case DioErrorType.sendTimeout:
case DioErrorType.RECEIVE_TIMEOUT: case DioErrorType.receiveTimeout:
_makeToast('连接超时'); _makeToast('连接超时');
break; break;
case DioErrorType.RESPONSE: case DioErrorType.response:
_makeToast('服务器出错'); _makeToast('服务器出错');
break; break;
case DioErrorType.CANCEL: case DioErrorType.cancel:
break; break;
case DioErrorType.DEFAULT: case DioErrorType.other:
_makeToast('未知错误'); _makeToast('未知错误');
break; break;
} }

@ -79,7 +79,7 @@ packages:
name: auto_size_text name: auto_size_text
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0" version: "3.0.0-nullsafety.0"
auto_size_text_pk: auto_size_text_pk:
dependency: transitive dependency: transitive
description: description:
@ -205,21 +205,21 @@ packages:
name: device_info name: device_info
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.0" version: "2.0.0"
device_info_platform_interface: device_info_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: device_info_platform_interface name: device_info_platform_interface
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.1" version: "2.0.0"
dio: dio:
dependency: "direct main" dependency: "direct main"
description: description:
name: dio name: dio
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "3.0.10" version: "4.0.0"
dotted_border: dotted_border:
dependency: "direct main" dependency: "direct main"
description: description:
@ -287,7 +287,7 @@ packages:
name: flutter_highlight name: flutter_highlight
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.6.0" version: "0.7.0"
flutter_localizations: flutter_localizations:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@ -299,7 +299,7 @@ packages:
name: flutter_plugin_android_lifecycle name: flutter_plugin_android_lifecycle
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.11" version: "2.0.1"
flutter_rating_bar: flutter_rating_bar:
dependency: "direct main" dependency: "direct main"
description: description:
@ -358,7 +358,7 @@ packages:
name: highlight name: highlight
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.6.0" version: "0.7.0"
hive: hive:
dependency: "direct main" dependency: "direct main"
description: description:
@ -379,28 +379,35 @@ packages:
name: http name: http
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.12.2" version: "0.13.1"
http_parser: http_parser:
dependency: transitive dependency: transitive
description: description:
name: http_parser name: http_parser
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "3.1.4" version: "4.0.0"
image_picker: image_picker:
dependency: "direct main" dependency: "direct main"
description: description:
name: image_picker name: image_picker
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.6.7+12" version: "0.7.4"
image_picker_for_web:
dependency: transitive
description:
name: image_picker_for_web
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.0"
image_picker_platform_interface: image_picker_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: image_picker_platform_interface name: image_picker_platform_interface
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.1" version: "2.0.0"
import_sorter: import_sorter:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -493,7 +500,7 @@ packages:
name: package_info name: package_info
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.4.3+4" version: "2.0.0"
path: path:
dependency: transitive dependency: transitive
description: description:
@ -542,7 +549,7 @@ packages:
name: pedantic name: pedantic
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.9.2" version: "1.11.0"
permission_handler: permission_handler:
dependency: "direct main" dependency: "direct main"
description: description:
@ -584,14 +591,7 @@ packages:
name: power_logger name: power_logger
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.1.3" version: "1.0.1-nullsafety.1"
pretty_json:
dependency: transitive
description:
name: pretty_json
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
provider: provider:
dependency: "direct main" dependency: "direct main"
description: description:

@ -35,7 +35,7 @@ dependencies:
#验证码 #验证码
pin_input_text_field: ^4.0.0 pin_input_text_field: ^4.0.0
image_picker: ^0.6.7+12 image_picker: ^0.7.4
flutter_rating_bar: ^4.0.0 flutter_rating_bar: ^4.0.0
@ -49,9 +49,9 @@ dependencies:
velocity_x: ^2.6.0 velocity_x: ^2.6.0
dotted_border: ^2.0.0-nullsafety.0 dotted_border: ^2.0.0-nullsafety.0
dio: dio: ^4.0.0
power_logger: ^0.1.3 power_logger: ^1.0.1-nullsafety.1
logger: ^1.0.0 logger: ^1.0.0
aku_ui: aku_ui:
git: git:

Loading…
Cancel
Save