import "package:flutter/widgets.dart"; import "eyedropper_native.dart" if (dart.library.html) "eyedropper_web.dart" as impl; // Screen-wide colour sampling, where the platform can actually do it. // // macOS gets NSColorSampler (see macos/Runner/ScreenColorSampler.swift) and // Chromium browsers get the EyeDropper web api. Both of those draw their own // magnifier loupe over the whole desktop and hand back a single colour when // the user clicks, so theres no live preview to stream on the way - the // preview IS the loupe. // // Everywhere else [nativeEyedropperAvailable] just answers false and callers // fall back to sampling the apps own frame (see widgets/app_frame_capture.dart), // which is window-only but works on every platform. Future nativeEyedropperAvailable() => impl.nativeEyedropperAvailable(); /// Opens the system sampler and resolves with the picked colour, or null if /// the user cancelled (escape) or something went wrong on the way. Future pickNativeScreenColor() => impl.pickNativeScreenColor();