Refactor isDevice check to computed property

Refactor isDevice property to use computed property and better simulator detection API.
This commit is contained in:
André Felipe Fleck Bedran
2026-02-23 19:45:47 -03:00
committed by GitHub
parent ee78f04d33
commit 1164b50cc2
@@ -3,7 +3,13 @@ import UIKit
import AudioToolbox
public class SwiftVibratePlugin: NSObject, FlutterPlugin, VibrateApi {
private let isDevice = TARGET_OS_SIMULATOR == 0
private var isDevice: Bool {
#if targetEnvironment(simulator)
return false
#else
return true
#endif
}
public static func register(with registrar: FlutterPluginRegistrar) {
let messenger : FlutterBinaryMessenger = registrar.messenger()