Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
// ignore_for_file: prefer_const_constructors

import 'dart:io';

import 'package:file_selector/file_selector.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
// ignore_for_file: prefer_const_constructors

import 'dart:io';

import 'package:file_selector/file_selector.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class OpenTextPage extends StatelessWidget {
const OpenTextPage({Key? key}) : super(key: key);

Future<void> _openTextFile(BuildContext context) async {
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
// ignore: prefer_const_constructors
final XTypeGroup typeGroup = XTypeGroup(
label: 'text',
extensions: <String>['txt', 'json'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ void main() {
const String confirmButtonText = 'Use this profile picture';
const String suggestedName = 'suggested_name';
final List<XTypeGroup> acceptedTypeGroups = <XTypeGroup>[
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
// ignore: prefer_const_constructors
XTypeGroup(label: 'documents', mimeTypes: <String>[
'application/msword',
'application/vnd.openxmlformats-officedocument.wordprocessing',
]),
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
// ignore: prefer_const_constructors
XTypeGroup(label: 'images', extensions: <String>[
'jpg',
'png',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class OpenImagePage extends StatelessWidget {
const OpenImagePage({Key? key}) : super(key: key);

Future<void> _openImageFile(BuildContext context) async {
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
// ignore: prefer_const_constructors
final XTypeGroup typeGroup = XTypeGroup(
label: 'images',
extensions: <String>['jpg', 'png'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ class OpenMultipleImagesPage extends StatelessWidget {
const OpenMultipleImagesPage({Key? key}) : super(key: key);

Future<void> _openImageFile(BuildContext context) async {
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
// ignore: prefer_const_constructors
final XTypeGroup jpgsTypeGroup = XTypeGroup(
label: 'JPEGs',
extensions: <String>['jpg', 'jpeg'],
macUTIs: <String>['public.jpeg'],
);
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
// ignore: prefer_const_constructors
final XTypeGroup pngTypeGroup = XTypeGroup(
label: 'PNGs',
extensions: <String>['png'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class OpenTextPage extends StatelessWidget {
const OpenTextPage({Key? key}) : super(key: key);

Future<void> _openTextFile(BuildContext context) async {
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
// ignore: prefer_const_constructors
final XTypeGroup typeGroup = XTypeGroup(
label: 'text',
extensions: <String>['txt', 'json'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,17 @@ void main() {
});

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

// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
// ignore: prefer_const_constructors
final XTypeGroup groupTwo = XTypeGroup(
label: 'image',
extensions: <String>['jpg'],
Expand All @@ -62,6 +66,8 @@ void main() {
expect(config.allowMultiSelection, isFalse);
});
test('throws for a type group that does not support iOS', () async {
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
// ignore: prefer_const_constructors
final XTypeGroup group = XTypeGroup(
label: 'images',
webWildCards: <String>['images/*'],
Expand All @@ -73,6 +79,8 @@ void main() {
});

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

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

// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
// ignore: prefer_const_constructors
final XTypeGroup groupTwo = XTypeGroup(
label: 'image',
extensions: <String>['jpg'],
Expand All @@ -114,6 +126,8 @@ void main() {
expect(config.allowMultiSelection, isTrue);
});
test('throws for a type group that does not support iOS', () async {
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
// ignore: prefer_const_constructors
final XTypeGroup group = XTypeGroup(
label: 'images',
webWildCards: <String>['images/*'],
Expand All @@ -125,6 +139,8 @@ void main() {
});

test('allows a wildcard group', () async {
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
// ignore: prefer_const_constructors
final XTypeGroup group = XTypeGroup(
label: 'text',
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class OpenImagePage extends StatelessWidget {
const OpenImagePage({Key? key}) : super(key: key);

Future<void> _openImageFile(BuildContext context) async {
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
// ignore: prefer_const_constructors
final XTypeGroup typeGroup = XTypeGroup(
label: 'images',
extensions: <String>['jpg', 'png'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ class OpenMultipleImagesPage extends StatelessWidget {
const OpenMultipleImagesPage({Key? key}) : super(key: key);

Future<void> _openImageFile(BuildContext context) async {
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
// ignore: prefer_const_constructors
final XTypeGroup jpgsTypeGroup = XTypeGroup(
label: 'JPEGs',
extensions: <String>['jpg', 'jpeg'],
);
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
// ignore: prefer_const_constructors
final XTypeGroup pngTypeGroup = XTypeGroup(
label: 'PNGs',
extensions: <String>['png'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class OpenTextPage extends StatelessWidget {
const OpenTextPage({Key? key}) : super(key: key);

Future<void> _openTextFile(BuildContext context) async {
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
// ignore: prefer_const_constructors
final XTypeGroup typeGroup = XTypeGroup(
label: 'text',
extensions: <String>['txt', 'json'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,17 @@ void main() {

group('#openFile', () {
test('passes the accepted type groups correctly', () async {
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
// ignore: prefer_const_constructors
final XTypeGroup group = XTypeGroup(
label: 'text',
extensions: <String>['txt'],
mimeTypes: <String>['text/plain'],
macUTIs: <String>['public.text'],
);

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

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

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

group('#openFiles', () {
test('passes the accepted type groups correctly', () async {
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
// ignore: prefer_const_constructors
final XTypeGroup group = XTypeGroup(
label: 'text',
extensions: <String>['txt'],
mimeTypes: <String>['text/plain'],
macUTIs: <String>['public.text'],
);

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

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

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

group('#getSavePath', () {
test('passes the accepted type groups correctly', () async {
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
// ignore: prefer_const_constructors
final XTypeGroup group = XTypeGroup(
label: 'text',
extensions: <String>['txt'],
mimeTypes: <String>['text/plain'],
macUTIs: <String>['public.text'],
);

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

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

test('passes a wildcard group correctly', () async {
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
// ignore: prefer_const_constructors
final XTypeGroup group = XTypeGroup(
label: 'any',
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class OpenImagePage extends StatelessWidget {
const OpenImagePage({Key? key}) : super(key: key);

Future<void> _openImageFile(BuildContext context) async {
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
// ignore: prefer_const_constructors
final XTypeGroup typeGroup = XTypeGroup(
label: 'images',
extensions: <String>['jpg', 'png'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ class OpenMultipleImagesPage extends StatelessWidget {
const OpenMultipleImagesPage({Key? key}) : super(key: key);

Future<void> _openImageFile(BuildContext context) async {
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
// ignore: prefer_const_constructors
final XTypeGroup jpgsTypeGroup = XTypeGroup(
label: 'JPEGs',
extensions: <String>['jpg', 'jpeg'],
);
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
// ignore: prefer_const_constructors
final XTypeGroup pngTypeGroup = XTypeGroup(
label: 'PNGs',
extensions: <String>['png'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class OpenTextPage extends StatelessWidget {
const OpenTextPage({Key? key}) : super(key: key);

Future<void> _openTextFile(BuildContext context) async {
// TODO(stuartmorgan): https://github.com/flutter/flutter/issues/111906
// ignore: prefer_const_constructors
final XTypeGroup typeGroup = XTypeGroup(
label: 'text',
extensions: <String>['txt', 'json'],
Expand Down
Loading