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> {
255
255
_editorFocusNode.requestFocus ();
256
256
}
257
257
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
+
258
268
@override
259
269
Widget build (BuildContext context) {
260
270
return ValueListenableBuilder (
@@ -397,6 +407,7 @@ class _ExampleEditorState extends State<ExampleEditor> {
397
407
selectionColor: Colors .red.withOpacity (0.3 ),
398
408
),
399
409
stylesheet: defaultStylesheet.copyWith (
410
+ selectedTextColorStrategy: isLight ? null : _darkModeSelectedColorStrategy,
400
411
addRulesAfter: [
401
412
if (! isLight) ..._darkModeStyles,
402
413
taskStyles,
You can’t perform that action at this time.
0 commit comments