Skip to content

Commit adf0495

Browse files
committed
docs(example): updates logging examples
1 parent e659d5a commit adf0495

File tree

7 files changed

+37
-24
lines changed

7 files changed

+37
-24
lines changed

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,26 @@ In order to implement `http_interceptor` you need to implement the `InterceptorC
7171
- Logging with interceptor:
7272

7373
```dart
74-
class LoggingInterceptor implements InterceptorContract {
74+
class LoggerInterceptor extends InterceptorContract {
7575
@override
76-
Future<BaseRequest> interceptRequest({required BaseRequest request}) async {
76+
Future<BaseRequest> interceptRequest({
77+
required BaseRequest request,
78+
}) async {
79+
print('----- Request -----');
7780
print(request.toString());
81+
print(request.headers.toString());
7882
return request;
7983
}
8084
8185
@override
82-
Future<BaseResponse> interceptResponse({required BaseResponse response}) async {
83-
print(response.toString());
84-
return response;
86+
Future<BaseResponse> interceptResponse({
87+
required BaseResponse response,
88+
}) async {
89+
print('----- Response -----');
90+
print('Code: ${response.statusCode}');
91+
print((response as Response).body);
92+
return response;
8593
}
86-
8794
}
8895
```
8996

example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>9.0</string>
24+
<string>11.0</string>
2525
</dict>
2626
</plist>

example/ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Uncomment this line to define a global platform for your project
2-
# platform :ios, '9.0'
2+
# platform :ios, '11.0'
33

44
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
55
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

example/ios/Podfile.lock

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,28 @@ PODS:
22
- Flutter (1.0.0)
33
- image_picker_ios (0.0.1):
44
- Flutter
5-
- shared_preferences_ios (0.0.1):
5+
- shared_preferences_foundation (0.0.1):
66
- Flutter
7+
- FlutterMacOS
78

89
DEPENDENCIES:
910
- Flutter (from `Flutter`)
1011
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
11-
- shared_preferences_ios (from `.symlinks/plugins/shared_preferences_ios/ios`)
12+
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
1213

1314
EXTERNAL SOURCES:
1415
Flutter:
1516
:path: Flutter
1617
image_picker_ios:
1718
:path: ".symlinks/plugins/image_picker_ios/ios"
18-
shared_preferences_ios:
19-
:path: ".symlinks/plugins/shared_preferences_ios/ios"
19+
shared_preferences_foundation:
20+
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
2021

2122
SPEC CHECKSUMS:
22-
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
23-
image_picker_ios: b786a5dcf033a8336a657191401bfdf12017dabb
24-
shared_preferences_ios: 548a61f8053b9b8a49ac19c1ffbc8b92c50d68ad
23+
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
24+
image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
25+
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
2526

26-
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
27+
PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
2728

28-
COCOAPODS: 1.11.3
29+
COCOAPODS: 1.12.1

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 50;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -200,10 +200,12 @@
200200
/* Begin PBXShellScriptBuildPhase section */
201201
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
202202
isa = PBXShellScriptBuildPhase;
203+
alwaysOutOfDate = 1;
203204
buildActionMask = 2147483647;
204205
files = (
205206
);
206207
inputPaths = (
208+
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
207209
);
208210
name = "Thin Binary";
209211
outputPaths = (
@@ -236,6 +238,7 @@
236238
};
237239
9740EEB61CF901F6004384FC /* Run Script */ = {
238240
isa = PBXShellScriptBuildPhase;
241+
alwaysOutOfDate = 1;
239242
buildActionMask = 2147483647;
240243
files = (
241244
);
@@ -340,7 +343,7 @@
340343
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
341344
GCC_WARN_UNUSED_FUNCTION = YES;
342345
GCC_WARN_UNUSED_VARIABLE = YES;
343-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
346+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
344347
MTL_ENABLE_DEBUG_INFO = NO;
345348
SDKROOT = iphoneos;
346349
SUPPORTED_PLATFORMS = iphoneos;
@@ -418,7 +421,7 @@
418421
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
419422
GCC_WARN_UNUSED_FUNCTION = YES;
420423
GCC_WARN_UNUSED_VARIABLE = YES;
421-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
424+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
422425
MTL_ENABLE_DEBUG_INFO = YES;
423426
ONLY_ACTIVE_ARCH = YES;
424427
SDKROOT = iphoneos;
@@ -467,7 +470,7 @@
467470
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
468471
GCC_WARN_UNUSED_FUNCTION = YES;
469472
GCC_WARN_UNUSED_VARIABLE = YES;
470-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
473+
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
471474
MTL_ENABLE_DEBUG_INFO = NO;
472475
SDKROOT = iphoneos;
473476
SUPPORTED_PLATFORMS = iphoneos;

example/ios/Runner/Info.plist

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,7 @@
4949
<string>We need camera access to choose pictures and then removing background.</string>
5050
<key>NSCameraUsageDescription</key>
5151
<string>We need camera access to take pictures and then removing background.</string>
52-
</dict>
53-
</plist>
52+
<key>UIApplicationSupportsIndirectInputEvents</key>
53+
<true/>
54+
</dict>
55+
</plist>

example/lib/common.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class LoggerInterceptor extends InterceptorContract {
1919
}) async {
2020
log('----- Response -----');
2121
log('Code: ${response.statusCode}');
22-
log(response.toString());
22+
log((response as Response).body);
2323
return response;
2424
}
2525
}

0 commit comments

Comments
 (0)