@@ -37,7 +37,7 @@ class SmartAuth {
3737 Future <SmartAuthResult <String >> getAppSignature () async {
3838 try {
3939 final result = await _api.getAppSignature ();
40- return SmartAuthResult < String > .success (result);
40+ return SmartAuthResult .success (result);
4141 } catch (error) {
4242 debugPrint ('Pinput/SmartAuth: getAppSignature failed: $error ' );
4343 return SmartAuthResult .failure (
@@ -55,12 +55,12 @@ class SmartAuth {
5555 }) async {
5656 try {
5757 final result = await _api.getSmsWithRetrieverApi ();
58- return SmartAuthResult < SmartAuthSms > .success (
58+ return SmartAuthResult .success (
5959 SmartAuthSms .fromSms (result, matcher),
6060 );
6161 } catch (error) {
6262 debugPrint ('Pinput/SmartAuth: getSmsWithRetrieverApi failed: $error ' );
63- return SmartAuthResult < SmartAuthSms > .failure (
63+ return SmartAuthResult .failure (
6464 'Failed to get SMS with retriever API with error: $error ' ,
6565 );
6666 }
@@ -78,7 +78,7 @@ class SmartAuth {
7878 }) async {
7979 try {
8080 final result = await _api.getSmsWithUserConsentApi (senderPhoneNumber);
81- return SmartAuthResult < SmartAuthSms > .success (
81+ return SmartAuthResult .success (
8282 SmartAuthSms .fromSms (result, matcher),
8383 );
8484 } catch (error) {
@@ -87,10 +87,10 @@ class SmartAuth {
8787
8888 if (isCanceled) {
8989 debugPrint ('Pinput/SmartAuth: ${error .message }' );
90- return SmartAuthResult < SmartAuthSms > .canceled ();
90+ return SmartAuthResult .canceled ();
9191 }
9292 debugPrint ('Pinput/SmartAuth: getSmsWithUserConsentApi failed: $error ' );
93- return SmartAuthResult < SmartAuthSms > .failure (
93+ return SmartAuthResult .failure (
9494 'Failed to get SMS with user consent API with error: $error ' ,
9595 );
9696 }
@@ -100,10 +100,10 @@ class SmartAuth {
100100 Future <SmartAuthResult <void >> removeUserConsentApiListener () async {
101101 try {
102102 await _api.removeUserConsentListener ();
103- return SmartAuthResult < void > .success (null );
103+ return SmartAuthResult .success (null );
104104 } catch (error) {
105105 debugPrint ('Pinput/SmartAuth: removeUserConsentListener failed: $error ' );
106- return SmartAuthResult < void > .failure (
106+ return SmartAuthResult .failure (
107107 'Failed to remove user consent listener with error: $error ' ,
108108 );
109109 }
@@ -113,10 +113,10 @@ class SmartAuth {
113113 Future <SmartAuthResult <void >> removeSmsRetrieverApiListener () async {
114114 try {
115115 await _api.removeSmsRetrieverListener ();
116- return SmartAuthResult < void > .success (null );
116+ return SmartAuthResult .success (null );
117117 } catch (error) {
118118 debugPrint ('Pinput/SmartAuth: removeSmsRetrieverListener failed: $error ' );
119- return SmartAuthResult < void > .failure (
119+ return SmartAuthResult .failure (
120120 'Failed to remove sms retriever listener with error: $error ' ,
121121 );
122122 }
@@ -125,21 +125,21 @@ class SmartAuth {
125125 /// Runs the Phone Number Hint API, a library powered by Google Play services
126126 /// provides a frictionless way to show a user’s (SIM-based) phone numbers as a hint.
127127 /// https://developers.google.com/identity/phone-number-hint/android
128- Future <SmartAuthResult <String ? >> requestPhoneNumberHint () async {
128+ Future <SmartAuthResult <String >> requestPhoneNumberHint () async {
129129 try {
130130 final result = await _api.requestPhoneNumberHint ();
131- return SmartAuthResult < String ?> .success (result);
131+ return SmartAuthResult .success (result);
132132 } catch (error) {
133133 final isCanceled = error is PlatformException &&
134134 error.details is SmartAuthRequestCanceled ;
135135 if (isCanceled) {
136136 debugPrint ('Pinput/SmartAuth: requestPhoneNumberHint canceled by user' );
137- return SmartAuthResult < String ?> .canceled ();
137+ return SmartAuthResult .canceled ();
138138 }
139139
140140 final message = 'Failed to request phone number hint with error: $error ' ;
141141 debugPrint ('Pinput/SmartAuth: $message ' );
142- return SmartAuthResult < String ?> .failure (message);
142+ return SmartAuthResult .failure (message);
143143 }
144144 }
145145}
0 commit comments