uri constant

Implementation

static const uri = SimpleValueFormat<NamedUri>(
  macos: SimplePlatformCodec(
    decodingFormats: ['public.url', 'public.utf8-plain-text'],
    encodingFormats: [
      'public.url',
      'public.url-name',
      'public.utf8-plain-text'
    ],
    onDecode: macosNamedUriFromSystem,
    onEncode: macosNamedUriToSystem,
  ),
  ios: SimplePlatformCodec(
    formats: ['public.url', 'public.utf8-plain-text'],
    onDecode: iosNamedUriFromSystem,
    onEncode: iosNamedUriToSystem,
  ),
  windows: SimplePlatformCodec(
    decodingFormats: [
      'UniformResourceLocatorW',
      'UniformResourceLocator',
      cfUnicodeText,
    ],
    encodingFormats: [
      'UniformResourceLocatorW',
      cfUnicodeText,
    ],
    onDecode: windowsNamedUriFromSystem,
    onEncode: namedUriToSystem,
  ),
  web: SimplePlatformCodec(
    // writing uri-list to clipboard is not supported on web
    // and it will be silently skipped
    formats: ['text/uri-list', 'text/plain'],
    onDecode: namedUriFromSystem,
    onEncode: namedUriToSystem,
  ),
  fallback: SimplePlatformCodec(
    formats: ['text/uri-list', 'text/plain'],
    onDecode: namedUriFromSystem,
    onEncode: namedUriToSystem,
  ),
);