Closed PeterMee closed 3 years ago
Seems reasonable, do you have an example of a package that does this we can copy/learn from?
Hey, we switched for our projcet from final isAndroid = Platform.isAndroid;
in import 'dart:io';
to final isAndroid = const LocalPlatform().isAndroid;
in import 'package:platform/platform.dart';
. That allows us to create a FakePlatform for the test. For more infos you can watch LocalPlatform on flutter.dev. It would be very nice and useful. Thanks.
Can you take a look at https://github.com/HomeXLabs/open-mail-app-flutter/pull/30 and see if it fits your need? Added a sample test.
Perfekt! Exactly what we need. Thank you :)
Closed in 0.3.0 :)
You are using Platform.isAndroid and Platform.isIOS in openMailApp (). It is a static property and cannot be simulated in the test. Can you use other platform checks so we can mimic the platform check in openMailApp () while a unit test like FakePlatform?