Skip to content

Commit

Permalink
Nullablity fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhnroyal committed Mar 22, 2023
1 parent cae31e0 commit 2c5e5fe
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dio/lib/src/dio/dio_for_native.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class DioForNative with DioMixin implements Dio {
int received = 0;

// Stream<Uint8List>
final stream = response.data!.stream;
final stream = response.data.stream;
bool compressed = false;
int total = 0;
final contentEncoding = response.headers.value(
Expand Down
2 changes: 1 addition & 1 deletion example/lib/generic.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ void main() async {

// This is the recommended way.
final r = await dio.get<String>('https://baidu.com');
print(r.data?.length);
print(r.data.length);
}
2 changes: 1 addition & 1 deletion example_flutter_app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class _MyHomePageState extends State<MyHomePage> {
.then((r) {
setState(() {
print(r.data);
_text = r.data!.replaceAll(RegExp(r'\s'), '');
_text = r.data.replaceAll(RegExp(r'\s'), '');
});
});
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion example_flutter_app/lib/routes/request.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class _RequestRouteState extends State<RequestRoute> {
onPressed: () {
dio.get<String>('https://httpbin.org/get').then((r) {
setState(() {
_text = r.data!;
_text = r.data;
});
});
},
Expand Down
2 changes: 2 additions & 0 deletions plugins/cookie_manager/test/cookies_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ void main() {
final firstRequestOptions = RequestOptions(baseUrl: exampleUrl);

final mockResponse = Response(
data: null,
requestOptions: firstRequestOptions,
headers: Headers.fromMap(
{HttpHeaders.setCookieHeader: mockFirstRequestCookies},
Expand Down Expand Up @@ -76,6 +77,7 @@ void main() {
final requestOptions = RequestOptions(baseUrl: exampleUrl);

final mockResponse = Response(
data: null,
requestOptions: requestOptions,
headers: Headers.fromMap(
{HttpHeaders.setCookieHeader: mockResponseCookies},
Expand Down
2 changes: 1 addition & 1 deletion plugins/http2_adapter/example/example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void main() async {
Response<String> response;

response = await dio.get('/?xx=6');
print(response.data?.length);
print(response.data.length);
print(response.redirects.length);
print(response.data);
}

0 comments on commit 2c5e5fe

Please sign in to comment.