Skip to content

Commit 25ab8b6

Browse files
authored
fix: ci actions, docs and issues with requestTimeout configs (#147)
1 parent e098bfd commit 25ab8b6

File tree

12 files changed

+163
-95
lines changed

12 files changed

+163
-95
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "Init Flutter"
2+
description: "Initializes Flutter repo"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: 📚 Checkout repository
7+
uses: actions/checkout@v4
8+
9+
- name: 🐦 Setup Flutter
10+
uses: subosito/flutter-action@v2
11+
with:
12+
flutter-version: '3.22.2'
13+
cache: true
14+
15+
- name: 📦 Get dependencies
16+
shell: bash
17+
run: flutter pub get
18+
19+
- name: ☕️ Set up JDK 17
20+
uses: actions/setup-java@v1
21+
with:
22+
java-version: '17'
23+
distribution: 'temurin'
24+
25+
- name: 🔎 Check Flutter environment
26+
shell: bash
27+
run: flutter doctor -v

.github/workflows/publish.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@ name: Publish to pub.dev
33
on:
44
push:
55
tags:
6-
- '[0-9]+.[0-9]+.[0-9]+*'
7-
workflow_dispatch:
6+
- "[0-9]+.[0-9]+.[0-9]+*"
87

98
jobs:
109
publish:
11-
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_pub_publish.yml@v1
10+
permissions:
11+
id-token: write # Required for authentication using OIDC
12+
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
13+
# with:
14+
# working-directory: path/to/package/within/repository

.github/workflows/validate.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: validate
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- main
8+
9+
jobs:
10+
analyze:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: 📚 Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: 📦 Setup Flutter & Deps
17+
uses: ./.github/actions/setup-flutter
18+
19+
- name: 📝 Format
20+
run: dart format . --set-exit-if-changed
21+
22+
- name: 📊 Analyze
23+
run: flutter analyze
24+
25+
- name: 🧪 Test
26+
run: flutter test --coverage
27+
28+
- name: 🔎 Check Publish Warnings
29+
run: flutter pub publish --dry-run

CHANGELOG.md

Lines changed: 84 additions & 77 deletions
Large diffs are not rendered by default.

example/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ EXTERNAL SOURCES:
2222
SPEC CHECKSUMS:
2323
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
2424
image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
25-
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
25+
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
2626

2727
PODFILE CHECKSUM: c4c93c5f6502fe2754f48404d3594bf779584011
2828

29-
COCOAPODS: 1.11.3
29+
COCOAPODS: 1.15.2

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
97C146E61CF9000F007C117D /* Project object */ = {
157157
isa = PBXProject;
158158
attributes = {
159-
LastUpgradeCheck = 1430;
159+
LastUpgradeCheck = 1510;
160160
ORGANIZATIONNAME = "";
161161
TargetAttributes = {
162162
97C146ED1CF9000F007C117D = {

example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1430"
3+
LastUpgradeVersion = "1510"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

example/lib/common.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class LoggerInterceptor extends InterceptorContract {
1010
log('----- Request -----');
1111
log(request.toString());
1212
log(request.headers.toString());
13+
log('Request type: ${request.runtimeType}');
1314
return request;
1415
}
1516

@@ -19,6 +20,7 @@ class LoggerInterceptor extends InterceptorContract {
1920
}) async {
2021
log('----- Response -----');
2122
log('Code: ${response.statusCode}');
23+
log('Response type: ${response.runtimeType}');
2224
if (response is Response) {
2325
log((response).body);
2426
}

example/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ dependencies:
1111
sdk: flutter
1212
http_interceptor:
1313
path: ../
14-
image_picker: ^0.8.9
15-
shared_preferences: ^2.2.2
14+
image_picker: ^1.1.2
15+
shared_preferences: ^2.2.3
1616

1717
dev_dependencies:
18-
flutter_lints: ^3.0.1
18+
flutter_lints: ^4.0.0
1919
flutter_test:
2020
sdk: flutter
2121

guides/migration_guide_2.0.0.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ v2.0.0 and up
3939
```dart
4040
class WeatherApiInterceptor extends InterceptorContract {
4141
@override
42-
Future<BaseRequest> interceptRequest({required BaseRequest request}) async {
42+
FutureOr<BaseRequest> interceptRequest({required BaseRequest request}) async {
4343
final cache = await SharedPreferences.getInstance();
4444
4545
final Map<String, String>? headers = Map.from(request.headers);
@@ -55,7 +55,7 @@ class WeatherApiInterceptor extends InterceptorContract {
5555
}
5656
5757
@override
58-
Future<BaseResponse> interceptResponse(
58+
FutureOr<BaseResponse> interceptResponse(
5959
{required BaseResponse response}) async =>
6060
response;
6161
}
@@ -92,7 +92,7 @@ v2.0.0 and up
9292
class ExpiredTokenRetryPolicy extends RetryPolicy {
9393
9494
@override
95-
Future<bool> shouldAttemptRetryOnResponse(BaseResponse response) async {
95+
FutureOr<bool> shouldAttemptRetryOnResponse(BaseResponse response) async {
9696
if (response.statusCode == 401) {
9797
log("Retrying request...");
9898
final cache = await SharedPreferences.getInstance();
@@ -111,7 +111,7 @@ If you are using `shouldAttemptRetryOnException` then you will also have to conv
111111

112112
```dart
113113
@override
114-
Future<bool> shouldAttemptRetryOnException(
114+
FutureOr<bool> shouldAttemptRetryOnException(
115115
Exception reason,
116116
BaseRequest request,
117117
) async {

0 commit comments

Comments
 (0)