更新空安全依赖

master
小赖 4 years ago
parent d2b977d049
commit aba917ade1

@ -0,0 +1,3 @@
{
"flutterSdkVersion": "2.0.0"
}

1
.gitignore vendored

@ -72,3 +72,4 @@ build/
!**/ios/**/default.mode2v3 !**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser !**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3 !**/ios/**/default.perspectivev3
flutter_sdk

@ -0,0 +1,3 @@
{
"dart.flutterSdkPath": "/Users/akufe/fvm/versions/2.0.0"
}

@ -57,14 +57,14 @@ class NetTool {
static Dio dio = Dio(); static Dio dio = Dio();
static init() { static init() {
dio.interceptors.add(InterceptorsWrapper( dio.interceptors.add(InterceptorsWrapper(
onRequest: (options) async { onRequest: (options, handler) async {
return options; return options;
}, },
onResponse: (response) async { onResponse: (response, handler) async {
LoggerData.addData(response); LoggerData.addData(response);
return response; return response;
}, },
onError: (DioError e) async { onError: (DioError e, handler) async {
LoggerData.addData(e); LoggerData.addData(e);
return e; return e;
}, },

@ -7,7 +7,7 @@ packages:
name: async name: async
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.5.0-nullsafety.1" version: "2.5.0"
auto_size_text: auto_size_text:
dependency: transitive dependency: transitive
description: description:
@ -21,35 +21,35 @@ packages:
name: boolean_selector name: boolean_selector
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0-nullsafety.1" version: "2.1.0"
characters: characters:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0-nullsafety.3" version: "1.1.0"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
name: charcode name: charcode
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0"
clock: clock:
dependency: transitive dependency: transitive
description: description:
name: clock name: clock
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0"
collection: collection:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.15.0-nullsafety.3" version: "1.15.0"
cupertino_icons: cupertino_icons:
dependency: "direct main" dependency: "direct main"
description: description:
@ -77,14 +77,14 @@ packages:
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-prev3"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@ -122,21 +122,21 @@ packages:
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"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
name: matcher name: matcher
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.12.10-nullsafety.1" version: "0.12.10"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0"
package_info: package_info:
dependency: transitive dependency: transitive
description: description:
@ -150,7 +150,7 @@ packages:
name: path name: path
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.8.0-nullsafety.1" version: "1.8.0"
plugin_platform_interface: plugin_platform_interface:
dependency: transitive dependency: transitive
description: description:
@ -183,56 +183,56 @@ packages:
name: source_span name: source_span
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.8.0-nullsafety.2" version: "1.8.0"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.10.0-nullsafety.1" version: "1.10.0"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0-nullsafety.1" version: "2.1.0"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
name: string_scanner name: string_scanner
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
name: term_glyph name: term_glyph
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.2.19-nullsafety.2" version: "0.2.19"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
name: typed_data name: typed_data
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0-nullsafety.3" version: "2.1.0"
sdks: sdks:
dart: ">=2.10.0 <2.11.0" dart: ">=2.12.0-29.10.beta <3.0.0"
flutter: ">=1.17.0 <2.0.0" flutter: ">=1.17.0"

@ -27,7 +27,7 @@ dependencies:
# The following adds the Cupertino Icons font to your application. # The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons. # Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.0 cupertino_icons: ^1.0.0
dio: ^3.0.10 dio: ^4.0.0-prev3
power_logger: power_logger:
path: ../ path: ../
get: get:

@ -12,26 +12,26 @@ class DioErrorBuilder extends StatefulWidget {
} }
class _DioErrorBuilderState extends State<DioErrorBuilder> { class _DioErrorBuilderState extends State<DioErrorBuilder> {
RequestOptions get _request => widget?.data?.request; RequestOptions get _request => widget?.data?.requestOptions;
String renderErrText(DioErrorType type) { String renderErrText(DioErrorType type) {
switch (type) { switch (type) {
case DioErrorType.CONNECT_TIMEOUT: case DioErrorType.connectTimeout:
return '连接超时'; return '连接超时';
break; break;
case DioErrorType.SEND_TIMEOUT: case DioErrorType.sendTimeout:
return '发送超时'; return '发送超时';
break; break;
case DioErrorType.RECEIVE_TIMEOUT: case DioErrorType.receiveTimeout:
return '接收超时'; return '接收超时';
break; break;
case DioErrorType.RESPONSE: case DioErrorType.response:
return 'Serve Side Error'; return 'Serve Side Error';
break; break;
case DioErrorType.CANCEL: case DioErrorType.cancel:
return '取消连接'; return '取消连接';
break; break;
case DioErrorType.DEFAULT: case DioErrorType.other:
return '未知错误'; return '未知错误';
break; break;
} }

@ -12,7 +12,7 @@ class DioResponseBuilder extends StatefulWidget {
} }
class _DioResponseBuilderState extends State<DioResponseBuilder> { class _DioResponseBuilderState extends State<DioResponseBuilder> {
RequestOptions get _request => widget?.data?.request; RequestOptions get _request => widget?.data?.requestOptions;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -21,7 +21,7 @@ class DioParser {
} }
/// get dio request /// get dio request
RequestOptions get request => _response.request; RequestOptions get request => _response.requestOptions;
/// get dio response /// get dio response
Response get response => _response; Response get response => _response;

@ -13,7 +13,7 @@ class DioErrorView extends StatefulWidget {
} }
class _DioErrorViewState extends State<DioErrorView> { class _DioErrorViewState extends State<DioErrorView> {
RequestOptions get _request => widget.data.request; RequestOptions get _request => widget.data.requestOptions;
_buildBaseURL() { _buildBaseURL() {
return _request.baseUrl == null || _request.baseUrl.length == 0 return _request.baseUrl == null || _request.baseUrl.length == 0
? const SizedBox() ? const SizedBox()
@ -61,10 +61,10 @@ class _DioErrorViewState extends State<DioErrorView> {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.red[600], backgroundColor: Colors.red[600],
title: Text(widget.data.request.path), title: Text(widget.data.requestOptions.path),
actions: [ actions: [
Chip( Chip(
label: Text(widget.data.request.method), label: Text(widget.data.requestOptions.method),
backgroundColor: Colors.lightGreen, backgroundColor: Colors.lightGreen,
), ),
SizedBox(width: 8), SizedBox(width: 8),

@ -152,10 +152,10 @@ class _DioResponseViewState extends State<DioResponseView> {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.green[600], backgroundColor: Colors.green[600],
title: Text(widget.data.request.path), title: Text(widget.data.requestOptions.path),
actions: [ actions: [
Chip( Chip(
label: Text(widget.data.request.method), label: Text(widget.data.requestOptions.method),
backgroundColor: Colors.lightGreen, backgroundColor: Colors.lightGreen,
), ),
SizedBox(width: 8), SizedBox(width: 8),

@ -7,7 +7,7 @@ packages:
name: async name: async
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.5.0-nullsafety.1" version: "2.5.0"
auto_size_text: auto_size_text:
dependency: "direct main" dependency: "direct main"
description: description:
@ -21,35 +21,35 @@ packages:
name: boolean_selector name: boolean_selector
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0-nullsafety.1" version: "2.1.0"
characters: characters:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0-nullsafety.3" version: "1.1.0"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
name: charcode name: charcode
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0"
clock: clock:
dependency: transitive dependency: transitive
description: description:
name: clock name: clock
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0"
collection: collection:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.15.0-nullsafety.3" version: "1.15.0"
device_info: device_info:
dependency: "direct main" dependency: "direct main"
description: description:
@ -70,14 +70,14 @@ packages:
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-prev3"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@ -108,21 +108,21 @@ packages:
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"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
name: matcher name: matcher
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.12.10-nullsafety.1" version: "0.12.10"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0"
package_info: package_info:
dependency: "direct main" dependency: "direct main"
description: description:
@ -136,7 +136,7 @@ packages:
name: path name: path
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.8.0-nullsafety.1" version: "1.8.0"
plugin_platform_interface: plugin_platform_interface:
dependency: transitive dependency: transitive
description: description:
@ -162,56 +162,56 @@ packages:
name: source_span name: source_span
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.8.0-nullsafety.2" version: "1.8.0"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.10.0-nullsafety.1" version: "1.10.0"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0-nullsafety.1" version: "2.1.0"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
name: string_scanner name: string_scanner
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
name: term_glyph name: term_glyph
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.2.19-nullsafety.2" version: "0.2.19"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
name: typed_data name: typed_data
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0-nullsafety.3" version: "2.1.0"
sdks: sdks:
dart: ">=2.10.0-110 <2.11.0" dart: ">=2.12.0-29.10.beta <3.0.0"
flutter: ">=1.17.0 <2.0.0" flutter: ">=1.17.0"

Loading…
Cancel
Save