File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ## Unreleased
2+
3+ - Add ` isAndroid ` , ` isIOS ` , ` isWeb ` and ` isMacOS ` getters.
4+
15## 3.3.0
26
37- Bump ` patrol_log ` to ` ^0.9.0 ` .
Original file line number Diff line number Diff line change @@ -141,6 +141,21 @@ class PatrolTester {
141141 /// Flutter's widget tester that this [PatrolTester] wraps.
142142 final WidgetTester tester;
143143
144+ /// Whether the test is running on Android.
145+ bool get isAndroid => _is (TargetPlatform .android);
146+
147+ /// Whether the test is running on iOS.
148+ bool get isIOS => _is (TargetPlatform .iOS);
149+
150+ /// Whether the test is running on web.
151+ bool get isWeb => kIsWeb;
152+
153+ /// Whether the test is running on macOS.
154+ bool get isMacOS => _is (TargetPlatform .macOS);
155+
156+ bool _is (TargetPlatform platform) =>
157+ ! kIsWeb && defaultTargetPlatform == platform;
158+
144159 /// Wraps a function with a log entry for the start and end of the function.
145160 Future <T > wrapWithPatrolLog <T >({
146161 required String action,
You can’t perform that action at this time.
0 commit comments