@@ -40,14 +40,28 @@ void main() {
4040 expect (
4141 log,
4242 < Matcher > [
43- isMethodCall ('authenticate' ,
44- arguments: < String , dynamic > {
45- 'localizedReason' : 'Needs secure' ,
46- 'useErrorDialogs' : true ,
47- 'stickyAuth' : false ,
48- 'sensitiveTransaction' : true ,
49- 'biometricOnly' : true ,
50- }..addAll (const AndroidAuthMessages ().args)),
43+ isMethodCall (
44+ 'authenticate' ,
45+ arguments: < String , dynamic > {
46+ 'localizedReason' : 'Needs secure' ,
47+ 'useErrorDialogs' : true ,
48+ 'stickyAuth' : false ,
49+ 'sensitiveTransaction' : true ,
50+ 'biometricOnly' : true ,
51+ 'biometricHint' : androidBiometricHint,
52+ 'biometricNotRecognized' : androidBiometricNotRecognized,
53+ 'biometricSuccess' : androidBiometricSuccess,
54+ 'biometricRequired' : androidBiometricRequiredTitle,
55+ 'cancelButton' : androidCancelButton,
56+ 'deviceCredentialsRequired' :
57+ androidDeviceCredentialsRequiredTitle,
58+ 'deviceCredentialsSetupDescription' :
59+ androidDeviceCredentialsSetupDescription,
60+ 'goToSetting' : goToSettings,
61+ 'goToSettingDescription' : androidGoToSettingsDescription,
62+ 'signInTitle' : androidSignInTitle,
63+ },
64+ ),
5165 ],
5266 );
5367 });
@@ -61,14 +75,45 @@ void main() {
6175 expect (
6276 log,
6377 < Matcher > [
64- isMethodCall ('authenticate' ,
65- arguments: < String , dynamic > {
66- 'localizedReason' : 'Needs secure' ,
67- 'useErrorDialogs' : true ,
68- 'stickyAuth' : false ,
69- 'sensitiveTransaction' : true ,
70- 'biometricOnly' : true ,
71- }..addAll (const IOSAuthMessages ().args)),
78+ isMethodCall ('authenticate' , arguments: < String , dynamic > {
79+ 'localizedReason' : 'Needs secure' ,
80+ 'useErrorDialogs' : true ,
81+ 'stickyAuth' : false ,
82+ 'sensitiveTransaction' : true ,
83+ 'biometricOnly' : true ,
84+ 'lockOut' : iOSLockOut,
85+ 'goToSetting' : goToSettings,
86+ 'goToSettingDescriptionIOS' : iOSGoToSettingsDescription,
87+ 'okButton' : iOSOkButton,
88+ }),
89+ ],
90+ );
91+ });
92+
93+ test ('authenticate with `localizedFallbackTitle` on iOS.' , () async {
94+ const IOSAuthMessages iosAuthMessages =
95+ IOSAuthMessages (localizedFallbackTitle: 'Enter PIN' );
96+ setMockPathProviderPlatform (FakePlatform (operatingSystem: 'ios' ));
97+ await localAuthentication.authenticate (
98+ localizedReason: 'Needs secure' ,
99+ biometricOnly: true ,
100+ iOSAuthStrings: iosAuthMessages,
101+ );
102+ expect (
103+ log,
104+ < Matcher > [
105+ isMethodCall ('authenticate' , arguments: < String , dynamic > {
106+ 'localizedReason' : 'Needs secure' ,
107+ 'useErrorDialogs' : true ,
108+ 'stickyAuth' : false ,
109+ 'sensitiveTransaction' : true ,
110+ 'biometricOnly' : true ,
111+ 'lockOut' : iOSLockOut,
112+ 'goToSetting' : goToSettings,
113+ 'goToSettingDescriptionIOS' : iOSGoToSettingsDescription,
114+ 'okButton' : iOSOkButton,
115+ 'localizedFallbackTitle' : 'Enter PIN' ,
116+ }),
72117 ],
73118 );
74119 });
@@ -95,14 +140,25 @@ void main() {
95140 expect (
96141 log,
97142 < Matcher > [
98- isMethodCall ('authenticate' ,
99- arguments: < String , dynamic > {
100- 'localizedReason' : 'Insecure' ,
101- 'useErrorDialogs' : false ,
102- 'stickyAuth' : false ,
103- 'sensitiveTransaction' : false ,
104- 'biometricOnly' : true ,
105- }..addAll (const AndroidAuthMessages ().args)),
143+ isMethodCall ('authenticate' , arguments: < String , dynamic > {
144+ 'localizedReason' : 'Insecure' ,
145+ 'useErrorDialogs' : false ,
146+ 'stickyAuth' : false ,
147+ 'sensitiveTransaction' : false ,
148+ 'biometricOnly' : true ,
149+ 'biometricHint' : androidBiometricHint,
150+ 'biometricNotRecognized' : androidBiometricNotRecognized,
151+ 'biometricSuccess' : androidBiometricSuccess,
152+ 'biometricRequired' : androidBiometricRequiredTitle,
153+ 'cancelButton' : androidCancelButton,
154+ 'deviceCredentialsRequired' :
155+ androidDeviceCredentialsRequiredTitle,
156+ 'deviceCredentialsSetupDescription' :
157+ androidDeviceCredentialsSetupDescription,
158+ 'goToSetting' : goToSettings,
159+ 'goToSettingDescription' : androidGoToSettingsDescription,
160+ 'signInTitle' : androidSignInTitle,
161+ }),
106162 ],
107163 );
108164 });
@@ -117,14 +173,25 @@ void main() {
117173 expect (
118174 log,
119175 < Matcher > [
120- isMethodCall ('authenticate' ,
121- arguments: < String , dynamic > {
122- 'localizedReason' : 'Needs secure' ,
123- 'useErrorDialogs' : true ,
124- 'stickyAuth' : false ,
125- 'sensitiveTransaction' : true ,
126- 'biometricOnly' : false ,
127- }..addAll (const AndroidAuthMessages ().args)),
176+ isMethodCall ('authenticate' , arguments: < String , dynamic > {
177+ 'localizedReason' : 'Needs secure' ,
178+ 'useErrorDialogs' : true ,
179+ 'stickyAuth' : false ,
180+ 'sensitiveTransaction' : true ,
181+ 'biometricOnly' : false ,
182+ 'biometricHint' : androidBiometricHint,
183+ 'biometricNotRecognized' : androidBiometricNotRecognized,
184+ 'biometricSuccess' : androidBiometricSuccess,
185+ 'biometricRequired' : androidBiometricRequiredTitle,
186+ 'cancelButton' : androidCancelButton,
187+ 'deviceCredentialsRequired' :
188+ androidDeviceCredentialsRequiredTitle,
189+ 'deviceCredentialsSetupDescription' :
190+ androidDeviceCredentialsSetupDescription,
191+ 'goToSetting' : goToSettings,
192+ 'goToSettingDescription' : androidGoToSettingsDescription,
193+ 'signInTitle' : androidSignInTitle,
194+ }),
128195 ],
129196 );
130197 });
@@ -137,14 +204,17 @@ void main() {
137204 expect (
138205 log,
139206 < Matcher > [
140- isMethodCall ('authenticate' ,
141- arguments: < String , dynamic > {
142- 'localizedReason' : 'Needs secure' ,
143- 'useErrorDialogs' : true ,
144- 'stickyAuth' : false ,
145- 'sensitiveTransaction' : true ,
146- 'biometricOnly' : false ,
147- }..addAll (const IOSAuthMessages ().args)),
207+ isMethodCall ('authenticate' , arguments: < String , dynamic > {
208+ 'localizedReason' : 'Needs secure' ,
209+ 'useErrorDialogs' : true ,
210+ 'stickyAuth' : false ,
211+ 'sensitiveTransaction' : true ,
212+ 'biometricOnly' : false ,
213+ 'lockOut' : iOSLockOut,
214+ 'goToSetting' : goToSettings,
215+ 'goToSettingDescriptionIOS' : iOSGoToSettingsDescription,
216+ 'okButton' : iOSOkButton,
217+ }),
148218 ],
149219 );
150220 });
@@ -159,14 +229,25 @@ void main() {
159229 expect (
160230 log,
161231 < Matcher > [
162- isMethodCall ('authenticate' ,
163- arguments: < String , dynamic > {
164- 'localizedReason' : 'Insecure' ,
165- 'useErrorDialogs' : false ,
166- 'stickyAuth' : false ,
167- 'sensitiveTransaction' : false ,
168- 'biometricOnly' : false ,
169- }..addAll (const AndroidAuthMessages ().args)),
232+ isMethodCall ('authenticate' , arguments: < String , dynamic > {
233+ 'localizedReason' : 'Insecure' ,
234+ 'useErrorDialogs' : false ,
235+ 'stickyAuth' : false ,
236+ 'sensitiveTransaction' : false ,
237+ 'biometricOnly' : false ,
238+ 'biometricHint' : androidBiometricHint,
239+ 'biometricNotRecognized' : androidBiometricNotRecognized,
240+ 'biometricSuccess' : androidBiometricSuccess,
241+ 'biometricRequired' : androidBiometricRequiredTitle,
242+ 'cancelButton' : androidCancelButton,
243+ 'deviceCredentialsRequired' :
244+ androidDeviceCredentialsRequiredTitle,
245+ 'deviceCredentialsSetupDescription' :
246+ androidDeviceCredentialsSetupDescription,
247+ 'goToSetting' : goToSettings,
248+ 'goToSettingDescription' : androidGoToSettingsDescription,
249+ 'signInTitle' : androidSignInTitle,
250+ }),
170251 ],
171252 );
172253 });
0 commit comments