From ccf6da2b26300419adcf1e0d5ef466d3790754e6 Mon Sep 17 00:00:00 2001 From: Tommy Chow Date: Sun, 5 Jun 2022 18:29:13 -0400 Subject: [PATCH] Fix iOS code running on Android (#138) --- lib/screens/channel/stores/video_store.dart | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/screens/channel/stores/video_store.dart b/lib/screens/channel/stores/video_store.dart index ea769af6..c0e20e90 100644 --- a/lib/screens/channel/stores/video_store.dart +++ b/lib/screens/channel/stores/video_store.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:io'; import 'package:device_info_plus/device_info_plus.dart'; import 'package:flutter/foundation.dart'; @@ -168,12 +169,14 @@ abstract class VideoStoreBase with Store { // Determine whether the device is an iPad or not. // Used to show or hide the rotate button on the overlay. // Flutter doesn't allow programmatic rotation on iPad unless multitasking is disabled. - final deviceInfo = DeviceInfoPlugin(); - final info = await deviceInfo.iosInfo; - if (info.model?.toLowerCase().contains('ipad') == true) { - _isIPad = true; - } else { - _isIPad = false; + if (Platform.isIOS) { + final deviceInfo = DeviceInfoPlugin(); + final info = await deviceInfo.iosInfo; + if (info.model?.toLowerCase().contains('ipad') == true) { + _isIPad = true; + } else { + _isIPad = false; + } } }