From 7397bfdaaff95a64946dcec92b76d8be0d3660c4 Mon Sep 17 00:00:00 2001 From: Renzo Olivares Date: Thu, 12 May 2022 10:39:52 -0700 Subject: [PATCH] [Simplistic_Editor] Fix delta history color switch on web release build (#1264) --- simplistic_editor/lib/main.dart | 12 ++++-------- simplistic_editor/pubspec.lock | 6 +++--- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/simplistic_editor/lib/main.dart b/simplistic_editor/lib/main.dart index 55b66073a..ad7dc5bcd 100644 --- a/simplistic_editor/lib/main.dart +++ b/simplistic_editor/lib/main.dart @@ -63,8 +63,7 @@ class _MyHomePageState extends State { if (delta is TextEditingDeltaInsertion) { deltaView = TextEditingDeltaView( - deltaType: - delta.runtimeType.toString().replaceAll('TextEditingDelta', ''), + deltaType: 'Insertion', deltaText: delta.textInserted, deltaRange: TextRange.collapsed(delta.insertionOffset), newSelection: delta.selection, @@ -72,8 +71,7 @@ class _MyHomePageState extends State { ); } else if (delta is TextEditingDeltaDeletion) { deltaView = TextEditingDeltaView( - deltaType: - delta.runtimeType.toString().replaceAll('TextEditingDelta', ''), + deltaType: 'Deletion', deltaText: delta.textDeleted, deltaRange: delta.deletedRange, newSelection: delta.selection, @@ -81,8 +79,7 @@ class _MyHomePageState extends State { ); } else if (delta is TextEditingDeltaReplacement) { deltaView = TextEditingDeltaView( - deltaType: - delta.runtimeType.toString().replaceAll('TextEditingDelta', ''), + deltaType: 'Replacement', deltaText: delta.replacementText, deltaRange: delta.replacedRange, newSelection: delta.selection, @@ -90,8 +87,7 @@ class _MyHomePageState extends State { ); } else if (delta is TextEditingDeltaNonTextUpdate) { deltaView = TextEditingDeltaView( - deltaType: - delta.runtimeType.toString().replaceAll('TextEditingDelta', ''), + deltaType: 'NonTextUpdate', deltaText: '', deltaRange: TextRange.empty, newSelection: delta.selection, diff --git a/simplistic_editor/pubspec.lock b/simplistic_editor/pubspec.lock index 9eb292a5b..3005e69e5 100644 --- a/simplistic_editor/pubspec.lock +++ b/simplistic_editor/pubspec.lock @@ -7,7 +7,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.2" + version: "2.9.0" boolean_selector: dependency: transitive description: @@ -21,7 +21,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.1" charcode: dependency: transitive description: @@ -120,7 +120,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.2" + version: "1.9.0" stack_trace: dependency: transitive description: