diff --git a/packages/flutter/test/material/text_field_test.dart b/packages/flutter/test/material/text_field_test.dart index 2729cb94c5..dd94976656 100644 --- a/packages/flutter/test/material/text_field_test.dart +++ b/packages/flutter/test/material/text_field_test.dart @@ -3201,7 +3201,7 @@ void main() { controller: textController, decoration: null, inputFormatters: [ - BlacklistingTextInputFormatter( + FilteringTextInputFormatter.deny( RegExp(r'[a-z]'), replacementString: '#', ), @@ -3250,11 +3250,11 @@ void main() { decoration: null, maxLines: 2, inputFormatters: [ - BlacklistingTextInputFormatter( + FilteringTextInputFormatter.deny( RegExp(r'[a-z]'), replacementString: '12\n', ), - WhitelistingTextInputFormatter(RegExp(r'\n[0-9]')), + FilteringTextInputFormatter.allow(RegExp(r'\n[0-9]')), ], ), )); @@ -3315,7 +3315,7 @@ void main() { controller: textController, decoration: null, inputFormatters: [ - WhitelistingTextInputFormatter.digitsOnly, + FilteringTextInputFormatter.digitsOnly, ], ), ), @@ -3635,7 +3635,7 @@ void main() { controller: textController, maxLength: 10, inputFormatters: [ - BlacklistingTextInputFormatter( + FilteringTextInputFormatter.deny( RegExp(r'[a-z]'), replacementString: '#', ), diff --git a/packages/flutter/test/material/theme_data_test.dart b/packages/flutter/test/material/theme_data_test.dart index 776d447636..70aa1e85cd 100644 --- a/packages/flutter/test/material/theme_data_test.dart +++ b/packages/flutter/test/material/theme_data_test.dart @@ -153,7 +153,7 @@ void main() { }); test('cursorColor', () { - expect(ThemeData(cursorColor: Colors.red).cursorColor, Colors.red); + expect(const TextSelectionThemeData(cursorColor: Colors.red).cursorColor, Colors.red); }); testWidgets('ThemeData.from a light color scheme sets appropriate values', (WidgetTester tester) async { @@ -430,9 +430,9 @@ void main() { toggleButtonsTheme: otherTheme.toggleButtonsTheme, buttonColor: otherTheme.buttonColor, secondaryHeaderColor: otherTheme.secondaryHeaderColor, - textSelectionColor: otherTheme.textSelectionColor, - cursorColor: otherTheme.cursorColor, - textSelectionHandleColor: otherTheme.textSelectionHandleColor, + textSelectionColor: otherTheme.textSelectionTheme.selectionColor, + cursorColor: otherTheme.textSelectionTheme.cursorColor, + textSelectionHandleColor: otherTheme.textSelectionTheme.selectionHandleColor, backgroundColor: otherTheme.backgroundColor, dialogBackgroundColor: otherTheme.dialogBackgroundColor, indicatorColor: otherTheme.indicatorColor, @@ -476,7 +476,6 @@ void main() { outlinedButtonTheme: otherTheme.outlinedButtonTheme, textSelectionTheme: otherTheme.textSelectionTheme, fixTextFieldOutlineLabel: otherTheme.fixTextFieldOutlineLabel, - useTextSelectionTheme: otherTheme.useTextSelectionTheme, ); expect(themeDataCopy.brightness, equals(otherTheme.brightness)); @@ -505,11 +504,11 @@ void main() { expect(themeDataCopy.toggleButtonsTheme, equals(otherTheme.toggleButtonsTheme)); expect(themeDataCopy.buttonColor, equals(otherTheme.buttonColor)); expect(themeDataCopy.secondaryHeaderColor, equals(otherTheme.secondaryHeaderColor)); - expect(themeDataCopy.textSelectionColor, equals(otherTheme.textSelectionColor)); - expect(themeDataCopy.cursorColor, equals(otherTheme.cursorColor)); - expect(themeDataCopy.textSelectionColor, equals(otherTheme.textSelectionColor)); - expect(themeDataCopy.cursorColor, equals(otherTheme.cursorColor)); - expect(themeDataCopy.textSelectionHandleColor, equals(otherTheme.textSelectionHandleColor)); + expect(themeDataCopy.textSelectionTheme.selectionColor, equals(otherTheme.textSelectionTheme.selectionColor)); + expect(themeDataCopy.textSelectionTheme.cursorColor, equals(otherTheme.textSelectionTheme.cursorColor)); + expect(themeDataCopy.textSelectionTheme.selectionColor, equals(otherTheme.textSelectionTheme.selectionColor)); + expect(themeDataCopy.textSelectionTheme.cursorColor, equals(otherTheme.textSelectionTheme.cursorColor)); + expect(themeDataCopy.textSelectionTheme.selectionHandleColor, equals(otherTheme.textSelectionTheme.selectionHandleColor)); expect(themeDataCopy.backgroundColor, equals(otherTheme.backgroundColor)); expect(themeDataCopy.dialogBackgroundColor, equals(otherTheme.dialogBackgroundColor)); expect(themeDataCopy.indicatorColor, equals(otherTheme.indicatorColor)); @@ -549,7 +548,6 @@ void main() { expect(themeDataCopy.outlinedButtonTheme, equals(otherTheme.outlinedButtonTheme)); expect(themeDataCopy.textSelectionTheme, equals(otherTheme.textSelectionTheme)); expect(themeDataCopy.fixTextFieldOutlineLabel, equals(otherTheme.fixTextFieldOutlineLabel)); - expect(themeDataCopy.useTextSelectionTheme, equals(otherTheme.useTextSelectionTheme)); }); testWidgets('ThemeData.toString has less than 200 characters output', (WidgetTester tester) async { diff --git a/packages/flutter/test/services/text_formatter_test.dart b/packages/flutter/test/services/text_formatter_test.dart index b38e332505..0458ce9697 100644 --- a/packages/flutter/test/services/text_formatter_test.dart +++ b/packages/flutter/test/services/text_formatter_test.dart @@ -101,7 +101,7 @@ void main() { test('test filtering formatter, deny mode (deprecated names)', () { final TextEditingValue actualValue = - BlacklistingTextInputFormatter(RegExp(r'[a-z]')) + FilteringTextInputFormatter.deny(RegExp(r'[a-z]')) .formatEditUpdate(testOldValue, testNewValue); // Expecting @@ -134,7 +134,7 @@ void main() { test('test single line formatter (deprecated names)', () { final TextEditingValue actualValue = - BlacklistingTextInputFormatter.singleLineFormatter + FilteringTextInputFormatter.singleLineFormatter .formatEditUpdate(testOldValue, testNewValue); // Expecting @@ -166,7 +166,7 @@ void main() { test('test filtering formatter, allow mode (deprecated names)', () { final TextEditingValue actualValue = - WhitelistingTextInputFormatter(RegExp(r'[a-c]')) + FilteringTextInputFormatter.allow(RegExp(r'[a-c]')) .formatEditUpdate(testOldValue, testNewValue); // Expecting @@ -198,7 +198,7 @@ void main() { test('test digits only formatter (deprecated names)', () { final TextEditingValue actualValue = - WhitelistingTextInputFormatter.digitsOnly + FilteringTextInputFormatter.digitsOnly .formatEditUpdate(testOldValue, testNewValue); // Expecting @@ -528,7 +528,7 @@ void main() { const TextEditingValue oldValue = TextEditingValue(text: '12345'); const TextEditingValue newValue = TextEditingValue(text: '12345@'); - final WhitelistingTextInputFormatter formatter = WhitelistingTextInputFormatter.digitsOnly; + final TextInputFormatter formatter = FilteringTextInputFormatter.digitsOnly; final TextEditingValue formatted = formatter.formatEditUpdate(oldValue, newValue); // assert that we are passing digits only at the first time @@ -583,8 +583,8 @@ void main() { TextEditingValue oldValue = collapsedValue('123', 0); TextEditingValue newValue = collapsedValue('123456', 6); - final WhitelistingTextInputFormatter formatter = - WhitelistingTextInputFormatter.digitsOnly; + final TextInputFormatter formatter = + FilteringTextInputFormatter.digitsOnly; TextEditingValue formatted = formatter.formatEditUpdate(oldValue, newValue); diff --git a/packages/flutter/test/widgets/stack_test.dart b/packages/flutter/test/widgets/stack_test.dart index 9c7f430381..b676f5dda8 100644 --- a/packages/flutter/test/widgets/stack_test.dart +++ b/packages/flutter/test/widgets/stack_test.dart @@ -453,7 +453,6 @@ void main() { textDirection: TextDirection.ltr, child: Center( child: Stack( - overflow: Overflow.visible, clipBehavior: Clip.none, children: const [ SizedBox(