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

Commit e92ebe3

Browse files
committed
bool to enum
1 parent 7360833 commit e92ebe3

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -771,12 +771,16 @@ - (void)setTextInputClient:(int)client withConfiguration:(NSDictionary*)configur
771771
_activeView.returnKeyType = ToUIReturnKeyType(configuration[@"inputAction"]);
772772
_activeView.autocapitalizationType = ToUITextAutoCapitalizationType(configuration);
773773
if (@available(iOS 11.0, *)) {
774-
NSString* enableSmartDashes = configuration[@"enableSmartDashes"];
775-
_activeView.smartDashesType = enableSmartDashes && ![enableSmartDashes boolValue]
774+
NSString* smartDashesType = configuration[@"smartDashesType"];
775+
// This string comes from the SmartDashesType enum in the framework.
776+
bool smartDashesIsDisabled = smartDashesType && [smartDashesType isEqualToString:@"SmartDashesType.disabled"];
777+
_activeView.smartDashesType = smartDashesIsDisabled
776778
? UITextSmartDashesTypeNo
777779
: UITextSmartDashesTypeDefault;
778-
NSString* enableSmartQuotes = configuration[@"enableSmartQuotes"];
779-
_activeView.smartQuotesType = enableSmartQuotes && ![enableSmartQuotes boolValue]
780+
NSString* smartQuotesType = configuration[@"smartQuotesType"];
781+
// This string comes from the SmartQuotesType enum in the framework.
782+
bool smartQuotesIsDisabled = smartQuotesType && [smartQuotesType isEqualToString:@"SmartQuotesType.disabled"];
783+
_activeView.smartQuotesType = smartQuotesIsDisabled
780784
? UITextSmartQuotesTypeNo
781785
: UITextSmartQuotesTypeDefault;
782786
}

0 commit comments

Comments
 (0)