@@ -10,7 +10,8 @@ import 'utils_local.dart' as local_utils;
1010/// - Path to the root of the Monarch repo
1111/// - Path to the Flutter SDK to use
1212/// - Path to the monarch_ui/{flutter_id} output directory
13- void buildPreviewApi (String repo_root, String flutter_sdk, String out_ui_flutter_id) {
13+ void buildPreviewApi (
14+ String repo_root, String flutter_sdk, String out_ui_flutter_id) {
1415 var repo_paths = RepoPaths (repo_root);
1516
1617 print ('''
@@ -32,11 +33,10 @@ Building Monarch Preview API using these arguments:
3233 out_preview_api_dir.deleteSync (recursive: true );
3334 out_preview_api_dir.createSync (recursive: true );
3435
36+ var dartVersion = pub.Version .parse (get_dart_version (flutter_sdk));
37+ var dart3 = pub.Version (3 , 0 , 0 );
3538
36- var flutterVersion = pub.Version .parse (get_flutter_version (flutter_sdk));
37- var flutterVersionWithDart3 = pub.Version (3 , 8 , 0 , pre: '10.1.pre' );
38-
39- var useGrpc310 = flutterVersion < flutterVersionWithDart3;
39+ var useGrpc310 = dartVersion < dart3;
4040 if (useGrpc310) {
4141 print ('Running `git apply grpc_310.patch`\n ' );
4242 utils.gitApplyPatch (repo_paths.preview_api, 'grpc_310.patch' );
@@ -81,7 +81,8 @@ Building monarch preview_api flutter bundle. Will output to:
8181 }
8282
8383 {
84- var icudtl_dat_ = icudtl_dat (flutter_sdk, local_utils.read_target_platform ());
84+ var icudtl_dat_ =
85+ icudtl_dat (flutter_sdk, local_utils.read_target_platform ());
8586
8687 if (Platform .isWindows) {
8788 var result = Process .runSync (
@@ -109,4 +110,3 @@ Building monarch preview_api flutter bundle. Will output to:
109110===============================================================================
110111''' );
111112}
112-
0 commit comments