-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #245 from Eldar2021/ai/auth
Integrated Email Otp Authentication
- Loading branch information
Showing
35 changed files
with
572 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import 'package:meta/meta.dart'; | ||
import 'package:my_quran/app/app.dart'; | ||
|
||
@immutable | ||
final class EmailLoginUseCase { | ||
const EmailLoginUseCase(this.repository); | ||
|
||
final AuthRepository repository; | ||
|
||
Future<void> call(String email) { | ||
return repository.loginWithEmail(email); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import 'package:meta/meta.dart'; | ||
import 'package:mq_either/mq_either.dart'; | ||
import 'package:my_quran/app/app.dart'; | ||
|
||
@immutable | ||
final class VerifyOtpUseCase { | ||
const VerifyOtpUseCase(this.repository); | ||
|
||
final AuthRepository repository; | ||
|
||
Future<Either<UserEntity, Exception>> call({ | ||
required String email, | ||
required String otp, | ||
required String languageCode, | ||
required Gender gender, | ||
}) { | ||
return repository.verifyOtp( | ||
email: email, | ||
otp: otp, | ||
languageCode: languageCode, | ||
gender: gender, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class CustomTextFormField extends StatelessWidget { | ||
const CustomTextFormField({ | ||
this.controller, | ||
this.labelText, | ||
this.obscureText = false, | ||
this.suffixIcon, | ||
this.validator, | ||
super.key, | ||
}); | ||
|
||
final bool obscureText; | ||
final TextEditingController? controller; | ||
final String? labelText; | ||
final Widget? suffixIcon; | ||
final String? Function(String?)? validator; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return TextFormField( | ||
controller: controller, | ||
decoration: InputDecoration( | ||
labelText: labelText, | ||
border: const OutlineInputBorder(), | ||
suffixIcon: suffixIcon, | ||
errorMaxLines: 3, | ||
), | ||
obscureText: obscureText, | ||
validator: validator, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.