[file_selector] Update file_selector_platform_interface by adding the new property 'uniformTypeIdentifiers' to the XTypeGroup. (#6433)

diff --git a/packages/file_selector/file_selector_platform_interface/CHANGELOG.md b/packages/file_selector/file_selector_platform_interface/CHANGELOG.md
index ad1fe2c..ad803fb 100644
--- a/packages/file_selector/file_selector_platform_interface/CHANGELOG.md
+++ b/packages/file_selector/file_selector_platform_interface/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 2.3.0
+
+* Replaces `macUTIs` with `uniformTypeIdentifiers`. `macUTIs` is available as an alias, but will be deprecated in a future release.
+
 ## 2.2.0
 
 * Makes `XTypeGroup`'s constructor constant.
diff --git a/packages/file_selector/file_selector_platform_interface/lib/src/types/x_type_group/x_type_group.dart b/packages/file_selector/file_selector_platform_interface/lib/src/types/x_type_group/x_type_group.dart
index 00cd565..e12b431 100644
--- a/packages/file_selector/file_selector_platform_interface/lib/src/types/x_type_group/x_type_group.dart
+++ b/packages/file_selector/file_selector_platform_interface/lib/src/types/x_type_group/x_type_group.dart
@@ -14,9 +14,13 @@
     this.label,
     List<String>? extensions,
     this.mimeTypes,
-    this.macUTIs,
+    List<String>? macUTIs,
+    List<String>? uniformTypeIdentifiers,
     this.webWildCards,
-  }) : _extensions = extensions;
+  })  : _extensions = extensions,
+        assert(uniformTypeIdentifiers == null || macUTIs == null,
+            'Only one of uniformTypeIdentifiers or macUTIs can be non-null'),
+        uniformTypeIdentifiers = uniformTypeIdentifiers ?? macUTIs;
 
   /// The 'name' or reference to this group of types.
   final String? label;
@@ -24,8 +28,8 @@
   /// The MIME types for this group.
   final List<String>? mimeTypes;
 
-  /// The UTIs for this group.
-  final List<String>? macUTIs;
+  /// The uniform type identifiers for this group
+  final List<String>? uniformTypeIdentifiers;
 
   /// The web wild cards for this group (ex: image/*, video/*).
   final List<String>? webWildCards;
@@ -56,6 +60,9 @@
         (webWildCards?.isEmpty ?? true);
   }
 
+  /// Returns the list of uniform type identifiers for this group
+  List<String>? get macUTIs => uniformTypeIdentifiers;
+
   static List<String>? _removeLeadingDots(List<String>? exts) => exts
       ?.map((String ext) => ext.startsWith('.') ? ext.substring(1) : ext)
       .toList();
diff --git a/packages/file_selector/file_selector_platform_interface/pubspec.yaml b/packages/file_selector/file_selector_platform_interface/pubspec.yaml
index c450006..ac8727c 100644
--- a/packages/file_selector/file_selector_platform_interface/pubspec.yaml
+++ b/packages/file_selector/file_selector_platform_interface/pubspec.yaml
@@ -4,7 +4,7 @@
 issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+file_selector%22
 # NOTE: We strongly prefer non-breaking changes, even at the expense of a
 # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
-version: 2.2.0
+version: 2.3.0
 
 environment:
   sdk: ">=2.12.0 <3.0.0"
diff --git a/packages/file_selector/file_selector_platform_interface/test/x_type_group_test.dart b/packages/file_selector/file_selector_platform_interface/test/x_type_group_test.dart
index c5e65d0..5ac5722 100644
--- a/packages/file_selector/file_selector_platform_interface/test/x_type_group_test.dart
+++ b/packages/file_selector/file_selector_platform_interface/test/x_type_group_test.dart
@@ -8,12 +8,11 @@
 void main() {
   group('XTypeGroup', () {
     test('toJSON() creates correct map', () {
-      const String label = 'test group';
       const List<String> extensions = <String>['txt', 'jpg'];
       const List<String> mimeTypes = <String>['text/plain'];
       const List<String> macUTIs = <String>['public.plain-text'];
       const List<String> webWildCards = <String>['image/*'];
-
+      const String label = 'test group';
       const XTypeGroup group = XTypeGroup(
         label: label,
         extensions: extensions,
@@ -30,7 +29,7 @@
       expect(jsonMap['webWildCards'], webWildCards);
     });
 
-    test('A wildcard group can be created', () {
+    test('a wildcard group can be created', () {
       const XTypeGroup group = XTypeGroup(
         label: 'Any',
       );
@@ -71,7 +70,70 @@
       expect(webOnly.allowsAny, false);
     });
 
-    test('Leading dots are removed from extensions', () {
+    test('passing only macUTIs should fill uniformTypeIdentifiers', () {
+      const List<String> macUTIs = <String>['public.plain-text'];
+      const XTypeGroup group = XTypeGroup(
+        macUTIs: macUTIs,
+      );
+
+      expect(group.uniformTypeIdentifiers, macUTIs);
+    });
+
+    test(
+        'passing only uniformTypeIdentifiers should fill uniformTypeIdentifiers',
+        () {
+      const List<String> uniformTypeIdentifiers = <String>['public.plain-text'];
+      const XTypeGroup group = XTypeGroup(
+        uniformTypeIdentifiers: uniformTypeIdentifiers,
+      );
+
+      expect(group.uniformTypeIdentifiers, uniformTypeIdentifiers);
+    });
+
+    test('macUTIs getter return macUTIs value passed in constructor', () {
+      const List<String> macUTIs = <String>['public.plain-text'];
+      const XTypeGroup group = XTypeGroup(
+        macUTIs: macUTIs,
+      );
+
+      expect(group.macUTIs, macUTIs);
+    });
+
+    test(
+        'macUTIs getter returns uniformTypeIdentifiers value passed in constructor',
+        () {
+      const List<String> uniformTypeIdentifiers = <String>['public.plain-text'];
+      const XTypeGroup group = XTypeGroup(
+        uniformTypeIdentifiers: uniformTypeIdentifiers,
+      );
+
+      expect(group.macUTIs, uniformTypeIdentifiers);
+    });
+
+    test('passing both uniformTypeIdentifiers and macUTIs should throw', () {
+      const List<String> macUTIs = <String>['public.plain-text'];
+      const List<String> uniformTypeIndentifiers = <String>[
+        'public.plain-images'
+      ];
+      expect(
+          () => XTypeGroup(
+              macUTIs: macUTIs,
+              uniformTypeIdentifiers: uniformTypeIndentifiers),
+          throwsA(predicate((Object? e) =>
+              e is AssertionError &&
+              e.message ==
+                  'Only one of uniformTypeIdentifiers or macUTIs can be non-null')));
+    });
+
+    test(
+        'having uniformTypeIdentifiers and macUTIs as null should leave uniformTypeIdentifiers as null',
+        () {
+      const XTypeGroup group = XTypeGroup();
+
+      expect(group.uniformTypeIdentifiers, null);
+    });
+
+    test('leading dots are removed from extensions', () {
       const List<String> extensions = <String>['.txt', '.jpg'];
       const XTypeGroup group = XTypeGroup(extensions: extensions);