Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 167c97b

Browse files
Revert "Match PlatformConfiguration properties to PlatformDispatcher ones (#39685)" (#39833)
This reverts commit cad5eec.
1 parent 2f4b81b commit 167c97b

File tree

2 files changed

+14
-36
lines changed

2 files changed

+14
-36
lines changed

lib/ui/platform_dispatcher.dart

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,8 @@ class PlatformDispatcher {
977977
/// This option is used by [EditableTextState] to define its
978978
/// [SpellCheckConfiguration] when a default spell check service
979979
/// is requested.
980-
bool get nativeSpellCheckServiceDefined => configuration.nativeSpellCheckServiceDefined;
980+
bool get nativeSpellCheckServiceDefined => _nativeSpellCheckServiceDefined;
981+
bool _nativeSpellCheckServiceDefined = false;
981982

982983
/// Whether briefly displaying the characters as you type in obscured text
983984
/// fields is enabled in system settings.
@@ -986,7 +987,8 @@ class PlatformDispatcher {
986987
///
987988
/// * [EditableText.obscureText], which when set to true hides the text in
988989
/// the text field.
989-
bool get brieflyShowPassword => configuration.brieflyShowPassword;
990+
bool get brieflyShowPassword => _brieflyShowPassword;
991+
bool _brieflyShowPassword = true;
990992

991993
/// The setting indicating the current brightness mode of the host platform.
992994
/// If the platform has no preference, [platformBrightness] defaults to
@@ -1040,8 +1042,16 @@ class PlatformDispatcher {
10401042
final double textScaleFactor = (data['textScaleFactor']! as num).toDouble();
10411043
final bool alwaysUse24HourFormat = data['alwaysUse24HourFormat']! as bool;
10421044
final bool? nativeSpellCheckServiceDefined = data['nativeSpellCheckServiceDefined'] as bool?;
1045+
if (nativeSpellCheckServiceDefined != null) {
1046+
_nativeSpellCheckServiceDefined = nativeSpellCheckServiceDefined;
1047+
} else {
1048+
_nativeSpellCheckServiceDefined = false;
1049+
}
10431050
// This field is optional.
10441051
final bool? brieflyShowPassword = data['brieflyShowPassword'] as bool?;
1052+
if (brieflyShowPassword != null) {
1053+
_brieflyShowPassword = brieflyShowPassword;
1054+
}
10451055
final Brightness platformBrightness =
10461056
data['platformBrightness']! as String == 'dark' ? Brightness.dark : Brightness.light;
10471057
final String? systemFontFamily = data['systemFontFamily'] as String?;
@@ -1058,8 +1068,6 @@ class PlatformDispatcher {
10581068
_configuration = previousConfiguration.copyWith(
10591069
textScaleFactor: textScaleFactor,
10601070
alwaysUse24HourFormat: alwaysUse24HourFormat,
1061-
nativeSpellCheckServiceDefined: nativeSpellCheckServiceDefined ?? false,
1062-
brieflyShowPassword: brieflyShowPassword,
10631071
platformBrightness: platformBrightness,
10641072
systemFontFamily: systemFontFamily,
10651073
);
@@ -1247,8 +1255,6 @@ class PlatformConfiguration {
12471255
this.semanticsEnabled = false,
12481256
this.platformBrightness = Brightness.light,
12491257
this.textScaleFactor = 1.0,
1250-
this.nativeSpellCheckServiceDefined = false,
1251-
this.brieflyShowPassword = true,
12521258
this.locales = const <Locale>[],
12531259
this.defaultRouteName,
12541260
this.systemFontFamily,
@@ -1261,8 +1267,6 @@ class PlatformConfiguration {
12611267
bool? semanticsEnabled,
12621268
Brightness? platformBrightness,
12631269
double? textScaleFactor,
1264-
bool? nativeSpellCheckServiceDefined,
1265-
bool? brieflyShowPassword,
12661270
List<Locale>? locales,
12671271
String? defaultRouteName,
12681272
String? systemFontFamily,
@@ -1273,8 +1277,6 @@ class PlatformConfiguration {
12731277
semanticsEnabled: semanticsEnabled ?? this.semanticsEnabled,
12741278
platformBrightness: platformBrightness ?? this.platformBrightness,
12751279
textScaleFactor: textScaleFactor ?? this.textScaleFactor,
1276-
nativeSpellCheckServiceDefined: nativeSpellCheckServiceDefined ?? this.nativeSpellCheckServiceDefined,
1277-
brieflyShowPassword: brieflyShowPassword ?? this.brieflyShowPassword,
12781280
locales: locales ?? this.locales,
12791281
defaultRouteName: defaultRouteName ?? this.defaultRouteName,
12801282
systemFontFamily: systemFontFamily ?? this.systemFontFamily,
@@ -1300,22 +1302,6 @@ class PlatformConfiguration {
13001302
/// The system-reported text scale.
13011303
final double textScaleFactor;
13021304

1303-
/// Whether the spell check service is supported on the current platform.
1304-
///
1305-
/// This option is used by [EditableTextState] to define its
1306-
/// [SpellCheckConfiguration] when a default spell check service
1307-
/// is requested.
1308-
final bool nativeSpellCheckServiceDefined;
1309-
1310-
/// Whether briefly displaying the characters as you type in obscured text
1311-
/// fields is enabled in system settings.
1312-
///
1313-
/// See also:
1314-
///
1315-
/// * [EditableText.obscureText], which when set to true hides the text in
1316-
/// the text field.
1317-
final bool brieflyShowPassword;
1318-
13191305
/// The full system-reported supported locales of the device.
13201306
final List<Locale> locales;
13211307

lib/web_ui/lib/platform_dispatcher.dart

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ abstract class PlatformDispatcher {
109109

110110
double get textScaleFactor => configuration.textScaleFactor;
111111

112-
bool get nativeSpellCheckServiceDefined => configuration.nativeSpellCheckServiceDefined;
112+
bool get nativeSpellCheckServiceDefined => false;
113113

114-
bool get brieflyShowPassword => configuration.brieflyShowPassword;
114+
bool get brieflyShowPassword => true;
115115

116116
VoidCallback? get onTextScaleFactorChanged;
117117
set onTextScaleFactorChanged(VoidCallback? callback);
@@ -152,8 +152,6 @@ class PlatformConfiguration {
152152
this.semanticsEnabled = false,
153153
this.platformBrightness = Brightness.light,
154154
this.textScaleFactor = 1.0,
155-
this.nativeSpellCheckServiceDefined = false,
156-
this.brieflyShowPassword = true,
157155
this.locales = const <Locale>[],
158156
this.defaultRouteName = '/',
159157
this.systemFontFamily,
@@ -165,8 +163,6 @@ class PlatformConfiguration {
165163
bool? semanticsEnabled,
166164
Brightness? platformBrightness,
167165
double? textScaleFactor,
168-
bool? nativeSpellCheckServiceDefined,
169-
bool? brieflyShowPassword,
170166
List<Locale>? locales,
171167
String? defaultRouteName,
172168
String? systemFontFamily,
@@ -177,8 +173,6 @@ class PlatformConfiguration {
177173
semanticsEnabled: semanticsEnabled ?? this.semanticsEnabled,
178174
platformBrightness: platformBrightness ?? this.platformBrightness,
179175
textScaleFactor: textScaleFactor ?? this.textScaleFactor,
180-
nativeSpellCheckServiceDefined: nativeSpellCheckServiceDefined ?? this.nativeSpellCheckServiceDefined,
181-
brieflyShowPassword: brieflyShowPassword ?? this.brieflyShowPassword,
182176
locales: locales ?? this.locales,
183177
defaultRouteName: defaultRouteName ?? this.defaultRouteName,
184178
systemFontFamily: systemFontFamily ?? this.systemFontFamily,
@@ -190,8 +184,6 @@ class PlatformConfiguration {
190184
final bool semanticsEnabled;
191185
final Brightness platformBrightness;
192186
final double textScaleFactor;
193-
final bool nativeSpellCheckServiceDefined;
194-
final bool brieflyShowPassword;
195187
final List<Locale> locales;
196188
final String defaultRouteName;
197189
final String? systemFontFamily;

0 commit comments

Comments
 (0)