Skip to content

Commit b51cf04

Browse files
committed
[TextField] add flag to control visual mirroring.
1 parent 88f2b74 commit b51cf04

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/src/widgets/text_field.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ class PTextField extends PlatformAdaptingWidget {
1313
final BoxDecoration iosDecoration;
1414
final InputDecoration decoration;
1515

16+
/// If true, we try to map the [InputDecoration] [decoration] to iOS by converting
17+
/// [OutlineInputBorder] to a similar border on iOS. There may be more patches
18+
/// in the future.
19+
final bool iOSMirrorVisualDecoration;
20+
1621
final OverlayVisibilityMode iosPrefixMode;
1722

1823
final OverlayVisibilityMode iosSuffixMode;
@@ -115,6 +120,7 @@ class PTextField extends PlatformAdaptingWidget {
115120
this.focusNode,
116121
this.iosDecoration,
117122
this.decoration,
123+
this.iOSMirrorVisualDecoration = true,
118124
this.iosPrefixMode,
119125
this.iosSuffixMode,
120126
this.iosClearButtonMode,
@@ -164,7 +170,8 @@ class PTextField extends PlatformAdaptingWidget {
164170
final decorationBorder = decoration.border;
165171
final iosDecoration = this.iosDecoration ??
166172
// map the outline input border to the iosDecoration by default.
167-
(decorationBorder is OutlineInputBorder
173+
(decorationBorder is OutlineInputBorder &&
174+
this.iOSMirrorVisualDecoration
168175
? BoxDecoration(
169176
border: Border.fromBorderSide(decorationBorder.borderSide),
170177
color: decoration.fillColor,

0 commit comments

Comments
 (0)