mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
This commit is contained in:
parent
4a59ee9c31
commit
955e07461b
@ -980,7 +980,7 @@ class _RenderDecoration extends RenderBox {
|
||||
_boxSize(icon).width
|
||||
+ contentPadding.left
|
||||
+ _boxSize(prefixIcon).width
|
||||
+ (decoration.border!.isOutline ? 0.0 : _boxSize(suffixIcon).width)
|
||||
+ _boxSize(suffixIcon).width
|
||||
+ contentPadding.right));
|
||||
boxToBaseline[label] = _layoutLineBox(
|
||||
label,
|
||||
|
||||
@ -4253,40 +4253,6 @@ void main() {
|
||||
expect(getOpacity(tester, prefixText), 1.0);
|
||||
});
|
||||
|
||||
testWidgets('OutlineInputBorder with InputDecorator long label, width should ignore icon width', (WidgetTester tester) async {
|
||||
// Related issue: https://github.com/flutter/flutter/issues/64427
|
||||
const String labelText = 'Flutter is Google’s UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase.';
|
||||
|
||||
Widget getLabeledInputDecorator(bool useOutlineBorder) => MaterialApp(
|
||||
home: Material(
|
||||
child: Container(
|
||||
width: 300,
|
||||
child: TextField(
|
||||
decoration: InputDecoration(
|
||||
border: useOutlineBorder ? const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.greenAccent, width: 1.0),
|
||||
) : null,
|
||||
suffixIcon: const Icon(Icons.arrow_drop_down),
|
||||
floatingLabelBehavior: FloatingLabelBehavior.always,
|
||||
labelText: labelText,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
// Build with no OutlineInputBorder.
|
||||
await tester.pumpWidget(getLabeledInputDecorator(false));
|
||||
|
||||
// Get the width of the label when there is no OutlineInputBorder.
|
||||
final double labelWidth = tester.getSize(find.text(labelText)).width;
|
||||
|
||||
// Build with a OutlineInputBorder.
|
||||
await tester.pumpWidget(getLabeledInputDecorator(true));
|
||||
|
||||
expect(tester.getSize(find.text(labelText)).width > labelWidth, isTrue);
|
||||
});
|
||||
|
||||
testWidgets('given enough space, constrained and unconstrained heights result in the same size widget', (WidgetTester tester) async {
|
||||
// Regression test for https://github.com/flutter/flutter/issues/65572
|
||||
final UniqueKey keyUnconstrained = UniqueKey();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user