Skip to content

Instantly share code, notes, and snippets.

View bryantwilliam's full-sized avatar

W bryantwilliam

  • 22:04 (UTC +08:00)
View GitHub Profile
@bryantwilliam
bryantwilliam / selection_transformer.dart
Last active February 1, 2025 04:44 — forked from Schwusch/selection_transformer.dart
A widget that transforms the text selection when copied.
import 'package:collection/collection.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
typedef SelectionTransform = String Function(Iterable<String>);
/// Original version: https://github.com/flutter/flutter/issues/104548#issuecomment-1683714851
/// Next version: https://gist.github.com/Schwusch/edf778492423db42a0ad11efd5bc8727
/// This version: https://gist.github.com/bryantwilliam/62a2b4cbd390a0e62612b3ea85c7f5e9
/// A widget that transforms the text selection when copied.