You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SpellCheckConfiguration == and hashCode ignore misspelledSelectionColor #195403
const red =SpellCheckConfiguration(misspelledSelectionColor:Color(0xFFFF0000));
const blue =SpellCheckConfiguration(misspelledSelectionColor:Color(0xFF0000FF));
print(red == blue); // true
Then rebuild an EditableText whose spellCheckConfiguration differs only in misspelledSelectionColor (same service and text style).
Expected results
red == blue is false, and EditableText uses the new misspelledSelectionColor.
Actual results
SpellCheckConfiguration.operator == and hashCode don't include misspelledSelectionColor (added in #125162), so the two configurations compare equal. EditableTextState.didUpdateWidget only re-infers _spellCheckConfiguration when oldWidget.spellCheckConfiguration != widget.spellCheckConfiguration, so it keeps using the old selection color for misspelled words.
@ChandraChaan Thanks for the report. Could you share a minimal code sample or widget test that reproduces the issue, the complete steps to reproduce it, and the output of flutter doctor -v for both stable and master channels?
Thanks! Steps: flutter create --empty repro, save this as test/repro_test.dart, run flutter test.
Widget test
import'package:flutter/services.dart';
import'package:flutter/widgets.dart';
import'package:flutter_test/flutter_test.dart';
voidmain() {
test('configs that differ only in misspelledSelectionColor are not equal', () {
const red =SpellCheckConfiguration(misspelledSelectionColor:Color(0xFFFF0000));
const blue =SpellCheckConfiguration(misspelledSelectionColor:Color(0xFF0000FF));
expect(red == blue, isFalse);
});
testWidgets('EditableText uses the new misspelledSelectionColor after a rebuild', (
WidgetTester tester,
) async {
final controller =TextEditingController(text:'Helo wrld');
addTearDown(controller.dispose);
final focusNode =FocusNode();
addTearDown(focusNode.dispose);
final spellCheckService =DefaultSpellCheckService();
Widgetbuild(Color misspelledSelectionColor) {
returnDirectionality(
textDirection:TextDirection.ltr,
child:MediaQuery(
data:constMediaQueryData(),
child:EditableText(
controller: controller,
focusNode: focusNode,
style:constTextStyle(),
cursorColor:constColor(0xFF000000),
backgroundCursorColor:constColor(0xFF808080),
spellCheckConfiguration:SpellCheckConfiguration(
spellCheckService: spellCheckService,
misspelledTextStyle:constTextStyle(
decoration:TextDecoration.underline,
decorationColor:Color(0xFFFF0000),
),
misspelledSelectionColor: misspelledSelectionColor,
),
),
),
);
}
await tester.pumpWidget(build(constColor(0xFFFF0000)));
await tester.pumpWidget(build(constColor(0xFF0000FF)));
finalEditableTextState state = tester.state<EditableTextState>(find.byType(EditableText));
expect(state.spellCheckConfiguration.misspelledSelectionColor, constColor(0xFF0000FF));
});
}
Expected: both tests pass.
Actual: both fail on stable 3.47.8 and on master (7ebd815). red == blue is true, and EditableText keeps the old red colour after the rebuild. Both pass with #195404.
flutter doctor -v (stable; SDK path and PATH warnings removed, the SDKs were separate checkouts)
[!] Flutter (Channel stable, 3.47.8, on macOS 27.0.1 26A434 darwin-arm64, locale en-IN) [3.8s]
• Flutter version 3.47.8 on channel stable at <stable SDK path>
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 737ba8f885 (4 days ago), 2026-10-22 21:37:31 -0700
• Engine revision cf636b1dfb
• Dart version 3.13.7
• DevTools version 2.60.0
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, enable-record-use, enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [5.9s]
• Android SDK at /Users/chandra/Library/Android/sdk
• Emulator version 36.3.10.0 (build_id 14472402) (CL:N/A)
• Platform android-37.0, build-tools 36.1.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 21.0.8+-14196175-b1038.72)
• All Android licenses accepted.
[!] Xcode - develop for iOS and macOS (Xcode 27.1) [6.0s]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 27A9275
! iOS 27.1 Simulator not installed; this may be necessary for iOS and macOS development.
To download and install the platform, open Xcode, select Xcode > Settings > Components,
and click the GET button for the required platform.
For more information, please visit:
https://developer.apple.com/documentation/xcode/installing-additional-simulator-runtimes
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [8ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Connected device (2 available) [13.6s]
• macOS (desktop) • macos • darwin-arm64 • macOS 27.0.1 26A434 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 156.0.8078.48
[✓] Network resources [1,009ms]
• All expected network resources are available.
! Doctor found issues in 2 categories.
flutter doctor -v (master; SDK path and PATH warnings removed)
[!] Flutter (Channel master, 3.50.0-0.2.pre, on macOS 27.0.1 26A434 darwin-arm64, locale en-IN) [2.3s]
• Flutter version 3.50.0-0.2.pre on channel master at <master SDK path>
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 7ebd8154ad (6 hours ago), 2026-10-27 07:39:25 +0000
• Engine revision 7ebd8154ad
• Dart version 3.15.0 (build 3.15.0-81.0.dev)
• DevTools version 2.61.0
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, enable-record-use, enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration, enable-riscv64, enable-hcpp
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [1,508ms]
• Android SDK at /Users/chandra/Library/Android/sdk
• Emulator version 36.3.10.0 (build_id 14472402) (CL:N/A)
• Platform android-37.0, build-tools 36.1.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 21.0.8+-14196175-b1038.72)
• All Android licenses accepted.
[!] Xcode - develop for iOS and macOS (Xcode 27.1) [1,120ms]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 27A9275
! iOS 27.1 Simulator not installed; this may be necessary for iOS and macOS development.
To download and install the platform, open Xcode, select Xcode > Settings > Components,
and click the GET button for the required platform.
For more information, please visit:
https://developer.apple.com/documentation/xcode/installing-additional-simulator-runtimes
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [5ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Connected device (2 available) [7.4s]
• macOS (desktop) • macos • darwin-arm64 • macOS 27.0.1 26A434 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 156.0.8078.48
[✓] Network resources [866ms]
• All expected network resources are available.
! Doctor found issues in 2 categories.
Thanks @Renzo-Olivares! The PR is already up: #195404 adds misspelledSelectionColor to == and hashCode, with a unit test for the equality and a widget test that rebuilds EditableText with a new color (both tests from the repro above). It's ready for review whenever you or someone on text input has a moment.
Activity
saurabh-mirajkar commentedon Oct 27, 2026
@ChandraChaan Thanks for the report. Could you share a minimal code sample or widget test that reproduces the issue, the complete steps to reproduce it, and the output of
flutter doctor -vfor both stable and master channels?ChandraChaan commentedon Oct 27, 2026
Thanks! Steps:
flutter create --empty repro, save this astest/repro_test.dart, runflutter test.Widget test
Expected: both tests pass.
Actual: both fail on stable 3.47.8 and on master (7ebd815).
red == blueistrue, andEditableTextkeeps the old red colour after the rebuild. Both pass with #195404.flutter doctor -v (stable; SDK path and PATH warnings removed, the SDKs were separate checkouts)
flutter doctor -v (master; SDK path and PATH warnings removed)
Renzo-Olivares commentedon Oct 29, 2026
Thanks for the report @ChandraChaan, this seems like a valid issue and we would definitely welcome a PR for it.
ChandraChaan commentedon Oct 29, 2026
Thanks @Renzo-Olivares! The PR is already up: #195404 adds
misspelledSelectionColorto==andhashCode, with a unit test for the equality and a widget test that rebuildsEditableTextwith a new color (both tests from the repro above). It's ready for review whenever you or someone on text input has a moment.