Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 4b2a636

Browse files
authored
[file_selector] Annotate all creation of XTypeGroup with // ignore: prefer_const_contructor (#6463)
1 parent de55e76 commit 4b2a636

22 files changed

+164
-0
lines changed

packages/file_selector/file_selector/example/lib/open_image_page.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
6+
// ignore_for_file: prefer_const_constructors
7+
58
import 'dart:io';
69

710
import 'package:file_selector/file_selector.dart';

packages/file_selector/file_selector/example/lib/open_multiple_images_page.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
6+
// ignore_for_file: prefer_const_constructors
7+
58
import 'dart:io';
69

710
import 'package:file_selector/file_selector.dart';

packages/file_selector/file_selector/example/lib/open_text_page.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ class OpenTextPage extends StatelessWidget {
1212
const OpenTextPage({Key? key}) : super(key: key);
1313

1414
Future<void> _openTextFile(BuildContext context) async {
15+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
16+
// ignore: prefer_const_constructors
1517
final XTypeGroup typeGroup = XTypeGroup(
1618
label: 'text',
1719
extensions: <String>['txt', 'json'],

packages/file_selector/file_selector/test/file_selector_test.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@ void main() {
1313
const String confirmButtonText = 'Use this profile picture';
1414
const String suggestedName = 'suggested_name';
1515
final List<XTypeGroup> acceptedTypeGroups = <XTypeGroup>[
16+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
17+
// ignore: prefer_const_constructors
1618
XTypeGroup(label: 'documents', mimeTypes: <String>[
1719
'application/msword',
1820
'application/vnd.openxmlformats-officedocument.wordprocessing',
1921
]),
22+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
23+
// ignore: prefer_const_constructors
2024
XTypeGroup(label: 'images', extensions: <String>[
2125
'jpg',
2226
'png',

packages/file_selector/file_selector_ios/example/lib/open_image_page.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class OpenImagePage extends StatelessWidget {
1515
const OpenImagePage({Key? key}) : super(key: key);
1616

1717
Future<void> _openImageFile(BuildContext context) async {
18+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
19+
// ignore: prefer_const_constructors
1820
final XTypeGroup typeGroup = XTypeGroup(
1921
label: 'images',
2022
extensions: <String>['jpg', 'png'],

packages/file_selector/file_selector_ios/example/lib/open_multiple_images_page.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,15 @@ class OpenMultipleImagesPage extends StatelessWidget {
1515
const OpenMultipleImagesPage({Key? key}) : super(key: key);
1616

1717
Future<void> _openImageFile(BuildContext context) async {
18+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
19+
// ignore: prefer_const_constructors
1820
final XTypeGroup jpgsTypeGroup = XTypeGroup(
1921
label: 'JPEGs',
2022
extensions: <String>['jpg', 'jpeg'],
2123
macUTIs: <String>['public.jpeg'],
2224
);
25+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
26+
// ignore: prefer_const_constructors
2327
final XTypeGroup pngTypeGroup = XTypeGroup(
2428
label: 'PNGs',
2529
extensions: <String>['png'],

packages/file_selector/file_selector_ios/example/lib/open_text_page.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ class OpenTextPage extends StatelessWidget {
1212
const OpenTextPage({Key? key}) : super(key: key);
1313

1414
Future<void> _openTextFile(BuildContext context) async {
15+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
16+
// ignore: prefer_const_constructors
1517
final XTypeGroup typeGroup = XTypeGroup(
1618
label: 'text',
1719
extensions: <String>['txt', 'json'],

packages/file_selector/file_selector_ios/test/file_selector_ios_test.dart

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,17 @@ void main() {
3636
});
3737

3838
test('passes the accepted type groups correctly', () async {
39+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
40+
// ignore: prefer_const_constructors
3941
final XTypeGroup group = XTypeGroup(
4042
label: 'text',
4143
extensions: <String>['txt'],
4244
mimeTypes: <String>['text/plain'],
4345
macUTIs: <String>['public.text'],
4446
);
4547

48+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
49+
// ignore: prefer_const_constructors
4650
final XTypeGroup groupTwo = XTypeGroup(
4751
label: 'image',
4852
extensions: <String>['jpg'],
@@ -62,6 +66,8 @@ void main() {
6266
expect(config.allowMultiSelection, isFalse);
6367
});
6468
test('throws for a type group that does not support iOS', () async {
69+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
70+
// ignore: prefer_const_constructors
6571
final XTypeGroup group = XTypeGroup(
6672
label: 'images',
6773
webWildCards: <String>['images/*'],
@@ -73,6 +79,8 @@ void main() {
7379
});
7480

7581
test('allows a wildcard group', () async {
82+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
83+
// ignore: prefer_const_constructors
7684
final XTypeGroup group = XTypeGroup(
7785
label: 'text',
7886
);
@@ -88,13 +96,17 @@ void main() {
8896
});
8997

9098
test('passes the accepted type groups correctly', () async {
99+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
100+
// ignore: prefer_const_constructors
91101
final XTypeGroup group = XTypeGroup(
92102
label: 'text',
93103
extensions: <String>['txt'],
94104
mimeTypes: <String>['text/plain'],
95105
macUTIs: <String>['public.text'],
96106
);
97107

108+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
109+
// ignore: prefer_const_constructors
98110
final XTypeGroup groupTwo = XTypeGroup(
99111
label: 'image',
100112
extensions: <String>['jpg'],
@@ -114,6 +126,8 @@ void main() {
114126
expect(config.allowMultiSelection, isTrue);
115127
});
116128
test('throws for a type group that does not support iOS', () async {
129+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
130+
// ignore: prefer_const_constructors
117131
final XTypeGroup group = XTypeGroup(
118132
label: 'images',
119133
webWildCards: <String>['images/*'],
@@ -125,6 +139,8 @@ void main() {
125139
});
126140

127141
test('allows a wildcard group', () async {
142+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
143+
// ignore: prefer_const_constructors
128144
final XTypeGroup group = XTypeGroup(
129145
label: 'text',
130146
);

packages/file_selector/file_selector_linux/example/lib/open_image_page.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class OpenImagePage extends StatelessWidget {
1515
const OpenImagePage({Key? key}) : super(key: key);
1616

1717
Future<void> _openImageFile(BuildContext context) async {
18+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
19+
// ignore: prefer_const_constructors
1820
final XTypeGroup typeGroup = XTypeGroup(
1921
label: 'images',
2022
extensions: <String>['jpg', 'png'],

packages/file_selector/file_selector_linux/example/lib/open_multiple_images_page.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@ class OpenMultipleImagesPage extends StatelessWidget {
1515
const OpenMultipleImagesPage({Key? key}) : super(key: key);
1616

1717
Future<void> _openImageFile(BuildContext context) async {
18+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
19+
// ignore: prefer_const_constructors
1820
final XTypeGroup jpgsTypeGroup = XTypeGroup(
1921
label: 'JPEGs',
2022
extensions: <String>['jpg', 'jpeg'],
2123
);
24+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
25+
// ignore: prefer_const_constructors
2226
final XTypeGroup pngTypeGroup = XTypeGroup(
2327
label: 'PNGs',
2428
extensions: <String>['png'],

packages/file_selector/file_selector_linux/example/lib/open_text_page.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ class OpenTextPage extends StatelessWidget {
1212
const OpenTextPage({Key? key}) : super(key: key);
1313

1414
Future<void> _openTextFile(BuildContext context) async {
15+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
16+
// ignore: prefer_const_constructors
1517
final XTypeGroup typeGroup = XTypeGroup(
1618
label: 'text',
1719
extensions: <String>['txt', 'json'],

packages/file_selector/file_selector_linux/test/file_selector_linux_test.dart

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,17 @@ void main() {
2929

3030
group('#openFile', () {
3131
test('passes the accepted type groups correctly', () async {
32+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
33+
// ignore: prefer_const_constructors
3234
final XTypeGroup group = XTypeGroup(
3335
label: 'text',
3436
extensions: <String>['txt'],
3537
mimeTypes: <String>['text/plain'],
3638
macUTIs: <String>['public.text'],
3739
);
3840

41+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
42+
// ignore: prefer_const_constructors
3943
final XTypeGroup groupTwo = XTypeGroup(
4044
label: 'image',
4145
extensions: <String>['jpg'],
@@ -101,6 +105,8 @@ void main() {
101105
});
102106

103107
test('throws for a type group that does not support Linux', () async {
108+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
109+
// ignore: prefer_const_constructors
104110
final XTypeGroup group = XTypeGroup(
105111
label: 'images',
106112
webWildCards: <String>['images/*'],
@@ -112,6 +118,8 @@ void main() {
112118
});
113119

114120
test('passes a wildcard group correctly', () async {
121+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
122+
// ignore: prefer_const_constructors
115123
final XTypeGroup group = XTypeGroup(
116124
label: 'any',
117125
);
@@ -139,13 +147,17 @@ void main() {
139147

140148
group('#openFiles', () {
141149
test('passes the accepted type groups correctly', () async {
150+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
151+
// ignore: prefer_const_constructors
142152
final XTypeGroup group = XTypeGroup(
143153
label: 'text',
144154
extensions: <String>['txt'],
145155
mimeTypes: <String>['text/plain'],
146156
macUTIs: <String>['public.text'],
147157
);
148158

159+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
160+
// ignore: prefer_const_constructors
149161
final XTypeGroup groupTwo = XTypeGroup(
150162
label: 'image',
151163
extensions: <String>['jpg'],
@@ -211,6 +223,8 @@ void main() {
211223
});
212224

213225
test('throws for a type group that does not support Linux', () async {
226+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
227+
// ignore: prefer_const_constructors
214228
final XTypeGroup group = XTypeGroup(
215229
label: 'images',
216230
webWildCards: <String>['images/*'],
@@ -222,6 +236,8 @@ void main() {
222236
});
223237

224238
test('passes a wildcard group correctly', () async {
239+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
240+
// ignore: prefer_const_constructors
225241
final XTypeGroup group = XTypeGroup(
226242
label: 'any',
227243
);
@@ -249,13 +265,17 @@ void main() {
249265

250266
group('#getSavePath', () {
251267
test('passes the accepted type groups correctly', () async {
268+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
269+
// ignore: prefer_const_constructors
252270
final XTypeGroup group = XTypeGroup(
253271
label: 'text',
254272
extensions: <String>['txt'],
255273
mimeTypes: <String>['text/plain'],
256274
macUTIs: <String>['public.text'],
257275
);
258276

277+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
278+
// ignore: prefer_const_constructors
259279
final XTypeGroup groupTwo = XTypeGroup(
260280
label: 'image',
261281
extensions: <String>['jpg'],
@@ -322,6 +342,8 @@ void main() {
322342
});
323343

324344
test('throws for a type group that does not support Linux', () async {
345+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
346+
// ignore: prefer_const_constructors
325347
final XTypeGroup group = XTypeGroup(
326348
label: 'images',
327349
webWildCards: <String>['images/*'],
@@ -333,6 +355,8 @@ void main() {
333355
});
334356

335357
test('passes a wildcard group correctly', () async {
358+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
359+
// ignore: prefer_const_constructors
336360
final XTypeGroup group = XTypeGroup(
337361
label: 'any',
338362
);

packages/file_selector/file_selector_macos/example/lib/open_image_page.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class OpenImagePage extends StatelessWidget {
1515
const OpenImagePage({Key? key}) : super(key: key);
1616

1717
Future<void> _openImageFile(BuildContext context) async {
18+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
19+
// ignore: prefer_const_constructors
1820
final XTypeGroup typeGroup = XTypeGroup(
1921
label: 'images',
2022
extensions: <String>['jpg', 'png'],

packages/file_selector/file_selector_macos/example/lib/open_multiple_images_page.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@ class OpenMultipleImagesPage extends StatelessWidget {
1515
const OpenMultipleImagesPage({Key? key}) : super(key: key);
1616

1717
Future<void> _openImageFile(BuildContext context) async {
18+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
19+
// ignore: prefer_const_constructors
1820
final XTypeGroup jpgsTypeGroup = XTypeGroup(
1921
label: 'JPEGs',
2022
extensions: <String>['jpg', 'jpeg'],
2123
);
24+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
25+
// ignore: prefer_const_constructors
2226
final XTypeGroup pngTypeGroup = XTypeGroup(
2327
label: 'PNGs',
2428
extensions: <String>['png'],

packages/file_selector/file_selector_macos/example/lib/open_text_page.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ class OpenTextPage extends StatelessWidget {
1212
const OpenTextPage({Key? key}) : super(key: key);
1313

1414
Future<void> _openTextFile(BuildContext context) async {
15+
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
16+
// ignore: prefer_const_constructors
1517
final XTypeGroup typeGroup = XTypeGroup(
1618
label: 'text',
1719
extensions: <String>['txt', 'json'],

0 commit comments

Comments
 (0)