You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of using Platform.isAndroid to check if the current Platform is Android, I'm proposing the following solution:
import 'package:flutter/foundation.dart' show defaultTargetPlatform, TargetPlatform;
if (defaultTargetPlatform != TargetPlatform.android) {
throw UnsupportedError("Only android supported");
}
This will making widget testing with ext_storage easier because in tests, Platform.isAndroid always returns false. Whereas with defaultTargetPlatform != TargetPlatform.android, a tester could use debugDefaultTargetPlatformOverride to determine if the test environment is Android vs iOS:
testWidgets('test Android', (WidgetTester tester) async {
debugDefaultTargetPlatformOverride = TargetPlatform.android;
// Insert Test Code Here
debugDefaultTargetPlatformOverride = null;
I can submit a PR for this if you would like.
The text was updated successfully, but these errors were encountered:
This package has not been updated for a long time, I was hoping the author will atleast update the flutter embedding to v2 but no commits on this repo since Apr 6,2020. If you could fork the code and upload it with improved code the community as well as me would find it very helpful. Thanks!
https://github.com/yasukotelin/ext_storage/blob/master/lib/ext_storage.dart#L33-L46
Instead of using
Platform.isAndroid
to check if the current Platform is Android, I'm proposing the following solution:This will making widget testing with ext_storage easier because in tests, Platform.isAndroid always returns false. Whereas with
defaultTargetPlatform != TargetPlatform.android
, a tester could usedebugDefaultTargetPlatformOverride
to determine if the test environment is Android vs iOS:I can submit a PR for this if you would like.
The text was updated successfully, but these errors were encountered: