Skip to content

Commit

Permalink
[file_selector_platform_interface] null safety stable release (flutte…
Browse files Browse the repository at this point in the history
  • Loading branch information
ditman authored Feb 23, 2021
1 parent d4480fb commit ab8fb51
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 2.0.0-nullsafety.0
## 2.0.0

* Migration to null-safety

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,22 @@ description: A common platform interface for the file_selector plugin.
homepage: https://github.com/flutter/plugins/tree/master/packages/file_selector/file_selector_platform_interface
# 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.0.0-nullsafety.0
version: 2.0.0

dependencies:
flutter:
sdk: flutter
meta: ^1.0.5
http: ^0.13.0-nullsafety.0
plugin_platform_interface: ^1.1.0-nullsafety.2
cross_file: ^0.3.0-nullsafety
meta: ^1.3.0
http: ^0.13.0
plugin_platform_interface: ">=1.0.0 <3.0.0"
cross_file: ^0.3.0

dev_dependencies:
test: ^1.15.0
test: ^1.16.3
flutter_test:
sdk: flutter
mockito: ^5.0.0-nullsafety.5
pedantic: ^1.8.0
pedantic: ^1.10.0

environment:
sdk: '>=2.12.0-0 <3.0.0'
flutter: ">=1.9.1+hotfix.4"
sdk: ">=2.12.0-259.9.beta <3.0.0"
flutter: ">=1.20.0"
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:mockito/mockito.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

import 'package:file_selector_platform_interface/file_selector_platform_interface.dart';
import 'package:file_selector_platform_interface/src/method_channel/method_channel_file_selector.dart';
Expand All @@ -16,28 +14,10 @@ void main() {
isInstanceOf<MethodChannelFileSelector>());
});

test('Cannot be implemented with `implements`', () {
expect(() {
FileSelectorPlatform.instance = ImplementsFileSelectorPlatform();
}, throwsA(isInstanceOf<AssertionError>()));
});

test('Can be mocked with `implements`', () {
final FileSelectorPlatformMock mock = FileSelectorPlatformMock();
FileSelectorPlatform.instance = mock;
});

test('Can be extended', () {
FileSelectorPlatform.instance = ExtendsFileSelectorPlatform();
});
});
}

class FileSelectorPlatformMock extends Mock
with MockPlatformInterfaceMixin
implements FileSelectorPlatform {}

class ImplementsFileSelectorPlatform extends Mock
implements FileSelectorPlatform {}

class ExtendsFileSelectorPlatform extends FileSelectorPlatform {}

0 comments on commit ab8fb51

Please sign in to comment.