plainText constant

SimpleValueFormat<String> const plainText

Value format for plain text. This is used for copying and pasting text as well as dragging and dropping plain text snippets. This format takes care of conversion from/to platform specific encoding.

When consuming dropped text files use plainTextFile format instead.

Implementation

static const plainText = SimpleValueFormat<String>(
  ios: SimplePlatformCodec(
    formats: ['public.utf8-plain-text', 'public.plain-text'],
    onDecode: fromSystemUtf8,
  ),
  macos: SimplePlatformCodec(
    formats: ['public.utf8-plain-text'],
    onDecode: fromSystemUtf8,
  ),
  windows: SimplePlatformCodec(
    formats: [cfUnicodeText],
    onDecode: fromSystemUtf16NullTerminated,
  ),
  // other platforms
  fallback: SimplePlatformCodec(
    formats: ['text/plain'],
    onDecode: fromSystemUtf8,
  ),
);