-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[local_auth] support localizedFallbackTitle in IOSAuthMessages #5297
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ class IOSAuthMessages extends AuthMessages { | |
this.goToSettingsButton, | ||
this.goToSettingsDescription, | ||
this.cancelButton, | ||
this.localizedFallbackTitle, | ||
}); | ||
|
||
/// Message advising the user to re-enable biometrics on their device. | ||
|
@@ -35,6 +36,10 @@ class IOSAuthMessages extends AuthMessages { | |
/// Maximum 30 characters. | ||
final String? cancelButton; | ||
|
||
/// The localized title for the fallback button in the dialog presented to | ||
/// the user during authentication. | ||
final String? localizedFallbackTitle; | ||
|
||
@override | ||
Map<String, String> get args { | ||
return <String, String>{ | ||
|
@@ -43,6 +48,8 @@ class IOSAuthMessages extends AuthMessages { | |
'goToSettingDescriptionIOS': | ||
goToSettingsDescription ?? iOSGoToSettingsDescription, | ||
'okButton': cancelButton ?? iOSOkButton, | ||
if (localizedFallbackTitle != null) | ||
'localizedFallbackTitle': localizedFallbackTitle!, | ||
}; | ||
} | ||
|
||
|
@@ -54,14 +61,16 @@ class IOSAuthMessages extends AuthMessages { | |
lockOut == other.lockOut && | ||
goToSettingsButton == other.goToSettingsButton && | ||
goToSettingsDescription == other.goToSettingsDescription && | ||
cancelButton == other.cancelButton; | ||
cancelButton == other.cancelButton && | ||
localizedFallbackTitle == other.localizedFallbackTitle; | ||
|
||
@override | ||
int get hashCode => | ||
lockOut.hashCode ^ | ||
goToSettingsButton.hashCode ^ | ||
goToSettingsDescription.hashCode ^ | ||
cancelButton.hashCode; | ||
cancelButton.hashCode ^ | ||
localizedFallbackTitle.hashCode; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just curious: i'm wondering does dart auto synthesize the hash function (like in swift)? manually implement this can be error prone (e.g. forgetting to include an attribute). Also interesting choice using xor to combine hashes, because normally we use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for example, in java's Arrays we use
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
We should update this to the new |
||
} | ||
|
||
// Default Strings for IOSAuthMessages plugin. Currently supports English. | ||
|
Uh oh!
There was an error while loading. Please reload this page.