File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -284,7 +284,7 @@ class Configurator {
284284 'homepage: https://flutter.dev' ,
285285 'version: 0.0.0' ,
286286 'environment:' ,
287- " sdk: '>=3.2.0-0 <4.0.0 '" ,
287+ " sdk: '^${ FlutterInformation . instance . getDartSdkVersion ()} '" ,
288288 'dependencies:' ,
289289 for (final String package in findPackageNames (filesystem)) ' $package :\n sdk: flutter' ,
290290 ' $kPlatformIntegrationPackageName : 0.0.1' ,
@@ -1194,6 +1194,9 @@ class FlutterInformation {
11941194 /// Gets the name of the current branch in the Flutter framework in the repo.
11951195 String getBranchName () => getFlutterInformation ()['branchName' ]! as String ;
11961196
1197+ /// Gets the current Dart SDK version.
1198+ Version getDartSdkVersion () => getFlutterInformation ()['dartSdkVersion' ]! as Version ;
1199+
11971200 Map <String , Object >? _cachedFlutterInformation;
11981201
11991202 /// Gets a Map of various kinds of information about the Flutter repo.
Original file line number Diff line number Diff line change @@ -338,15 +338,13 @@ void main() {
338338 test ('.generateConfiguration generates pubspec.yaml' , () async {
339339 configurator.generateConfiguration ();
340340 expect (packageRoot.childFile ('pubspec.yaml' ).existsSync (), isTrue);
341- expect (packageRoot.childFile ('pubspec.yaml' ).readAsStringSync (), contains ('flutter_gpu:' ));
342- expect (
343- packageRoot.childFile ('pubspec.yaml' ).readAsStringSync (),
344- contains ('dependency_overrides:' ),
345- );
346- expect (
347- packageRoot.childFile ('pubspec.yaml' ).readAsStringSync (),
348- contains ('platform_integration:' ),
349- );
341+
342+ final String pubspecContents = packageRoot.childFile ('pubspec.yaml' ).readAsStringSync ();
343+
344+ expect (pubspecContents, contains ('flutter_gpu:' ));
345+ expect (pubspecContents, contains ("sdk: '^2.14.0-360.0.dev'" ));
346+ expect (pubspecContents, contains ('dependency_overrides:' ));
347+ expect (pubspecContents, contains ('platform_integration:' ));
350348 });
351349
352350 test ('.generateConfiguration generates fake lib' , () async {
You can’t perform that action at this time.
0 commit comments