File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
super_editor/example/lib/demos/example_editor Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -255,6 +255,16 @@ class _ExampleEditorState extends State<ExampleEditor> {
255255 _editorFocusNode.requestFocus ();
256256 }
257257
258+ /// Makes text white, for use during dark mode styling.
259+ ///
260+ /// This is the same behavior observed in Apple Notes.
261+ Color _darkModeSelectedColorStrategy ({
262+ required Color originalTextColor,
263+ required Color selectionHighlightColor,
264+ }) {
265+ return Colors .white;
266+ }
267+
258268 @override
259269 Widget build (BuildContext context) {
260270 return ValueListenableBuilder (
@@ -397,6 +407,7 @@ class _ExampleEditorState extends State<ExampleEditor> {
397407 selectionColor: Colors .red.withOpacity (0.3 ),
398408 ),
399409 stylesheet: defaultStylesheet.copyWith (
410+ selectedTextColorStrategy: isLight ? null : _darkModeSelectedColorStrategy,
400411 addRulesAfter: [
401412 if (! isLight) ..._darkModeStyles,
402413 taskStyles,
You can’t perform that action at this time.
0 commit comments