Skip to content

Commit d6f0bd1

Browse files
feat: support the flutter 3.10 and dart 3
Signed-off-by: Vincenzo Palazzo <[email protected]>
1 parent cbe1099 commit d6f0bd1

File tree

8 files changed

+20
-16
lines changed

8 files changed

+20
-16
lines changed

example/lib/main.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

examples/starwars/pubspec.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@ description: An example graphql_flutter application utilizing graphql_starwars_t
44
publish_to: none
55

66
environment:
7-
sdk: ">=2.10.0 <3.0.0"
7+
sdk: ">=2.13.0 <=3.0.0"
88

99
dependencies:
1010
flutter:
1111
sdk: flutter
1212
graphql_flutter:
1313
path: ../../packages/graphql_flutter
1414
graphql: ^5.1.2-beta.1
15-
universal_platform:
16-
^0.1.3
15+
universal_platform: ^1.0.0+1
1716
# https://github.com/flutter/flutter/issues/36126#issuecomment-596215587
1817

1918
flutter:
20-
uses-material-design: true
19+
uses-material-design: true

packages/graphql/example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ void readRepositories() async {
7878
result.data!['viewer']['repositories']['nodes'] as List<dynamic>;
7979

8080
repositories.forEach(
81-
(dynamic f) => {stdout.writeln('Id: ${f['id']} Name: ${f['name']}')},
81+
(dynamic f) => stdout.writeln('Id: ${f['id']} Name: ${f['name']}'),
8282
);
8383

8484
exit(0);

packages/graphql/lib/src/scheduler/scheduler.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class QueryScheduler {
5757
}
5858

5959
// fetch each query on the interval
60-
intervalQueries[interval]!.forEach(queryManager!.refetchQuery);
60+
intervalQueries[interval]!.forEach(queryManager!.refetchQuery<dynamic>);
6161
}
6262

6363
void startPollingQuery(

packages/graphql/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ dev_dependencies:
3232
lints: ^1.0.1
3333

3434
environment:
35-
sdk: '>=2.12.0 <=3.0.0'
35+
sdk: '>=2.15.0 <=3.0.0'

packages/graphql_flutter/example/pubspec.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ module:
99
dependencies:
1010
flutter:
1111
sdk: flutter
12-
cupertino_icons: ^0.1.3
1312
graphql_flutter:
1413
path: ..
1514
trash_themes: ^0.0.1

packages/graphql_flutter/test/widgets/query_test.dart

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ Future<void> mockApplicationDocumentsDirectory() async {
4242
return null;
4343
};
4444
// Mock out the MethodChannel for the path_provider plugin.
45-
const MethodChannel('plugins.flutter.io/path_provider')
46-
.setMockMethodCallHandler(handler);
47-
const MethodChannel('plugins.flutter.io/path_provider_macos')
48-
.setMockMethodCallHandler(handler);
45+
final channel = MethodChannel('plugins.flutter.io/path_provider');
46+
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
47+
.setMockMethodCallHandler(channel, handler);
48+
final channel_osx = MethodChannel('plugins.flutter.io/path_provider_macos');
49+
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
50+
.setMockMethodCallHandler(channel_osx, handler);
4951
}
5052

5153
class Page extends StatefulWidget {

packages/graphql_flutter/test/widgets/subscription_test.dart

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,14 @@ Future<void> mockApplicationDocumentsDirectory() async {
4040
}
4141
return null;
4242
};
43+
4344
// Mock out the MethodChannel for the path_provider plugin.
44-
const MethodChannel('plugins.flutter.io/path_provider')
45-
.setMockMethodCallHandler(handler);
46-
const MethodChannel('plugins.flutter.io/path_provider_macos')
47-
.setMockMethodCallHandler(handler);
45+
final channel = MethodChannel('plugins.flutter.io/path_provider');
46+
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
47+
.setMockMethodCallHandler(channel, handler);
48+
final channel_osx = MethodChannel('plugins.flutter.io/path_provider_macos');
49+
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
50+
.setMockMethodCallHandler(channel_osx, handler);
4851
}
4952

5053
class Page extends StatelessWidget {

0 commit comments

Comments
 (0)