garage_auth, garage_entitlements, garage_iap and garage_ui, moved out of Garage-Services and Metro-Map-Maker into one public repo. MIT, one readme, docs under docs/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013F4NWNvYcdeSgqbWMT1VQ7
24 lines
1.0 KiB
Dart
24 lines
1.0 KiB
Dart
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<bool> 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<Color?> pickNativeScreenColor() => impl.pickNativeScreenColor();
|