Compare commits
2 Commits
5e4d362039
...
10cac52ec7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
10cac52ec7 | ||
|
|
531e3230cc |
BIN
android/app/src/main/ic_launcher-playstore.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 544 B After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 442 B After Width: | Height: | Size: 881 B |
|
Before Width: | Height: | Size: 721 B After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 5.3 KiB |
BIN
assets/images/logo.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
@@ -1,122 +1,120 @@
|
||||
{
|
||||
"images" : [
|
||||
"images": [
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-20x20@2x.png",
|
||||
"scale" : "2x"
|
||||
"filename": "Icon-App-20x20@2x.png",
|
||||
"idiom": "universal",
|
||||
"scale": "2x",
|
||||
"size": "20x20",
|
||||
"platform": "ios"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-20x20@3x.png",
|
||||
"scale" : "3x"
|
||||
"filename": "Icon-App-20x20@3x.png",
|
||||
"idiom": "universal",
|
||||
"scale": "3x",
|
||||
"size": "20x20",
|
||||
"platform": "ios"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@1x.png",
|
||||
"scale" : "1x"
|
||||
"filename": "Icon-App-29x29@2x.png",
|
||||
"idiom": "universal",
|
||||
"scale": "2x",
|
||||
"size": "29x29",
|
||||
"platform": "ios"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@2x.png",
|
||||
"scale" : "2x"
|
||||
"filename": "Icon-App-29x29@3x.png",
|
||||
"idiom": "universal",
|
||||
"scale": "3x",
|
||||
"size": "29x29",
|
||||
"platform": "ios"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@3x.png",
|
||||
"scale" : "3x"
|
||||
"filename": "Icon-App-38x38@2x.png",
|
||||
"idiom": "universal",
|
||||
"scale": "2x",
|
||||
"size": "38x38",
|
||||
"platform": "ios"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-40x40@2x.png",
|
||||
"scale" : "2x"
|
||||
"filename": "Icon-App-38x38@3x.png",
|
||||
"idiom": "universal",
|
||||
"scale": "3x",
|
||||
"size": "38x38",
|
||||
"platform": "ios"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-40x40@3x.png",
|
||||
"scale" : "3x"
|
||||
"filename": "Icon-App-40x40@2x.png",
|
||||
"idiom": "universal",
|
||||
"scale": "2x",
|
||||
"size": "40x40",
|
||||
"platform": "ios"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-60x60@2x.png",
|
||||
"scale" : "2x"
|
||||
"filename": "Icon-App-40x40@3x.png",
|
||||
"idiom": "universal",
|
||||
"scale": "3x",
|
||||
"size": "40x40",
|
||||
"platform": "ios"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-60x60@3x.png",
|
||||
"scale" : "3x"
|
||||
"filename": "Icon-App-60x60@2x.png",
|
||||
"idiom": "universal",
|
||||
"scale": "2x",
|
||||
"size": "60x60",
|
||||
"platform": "ios"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-20x20@1x.png",
|
||||
"scale" : "1x"
|
||||
"filename": "Icon-App-60x60@3x.png",
|
||||
"idiom": "universal",
|
||||
"scale": "3x",
|
||||
"size": "60x60",
|
||||
"platform": "ios"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-20x20@2x.png",
|
||||
"scale" : "2x"
|
||||
"filename": "Icon-App-64x64@2x.png",
|
||||
"idiom": "universal",
|
||||
"scale": "2x",
|
||||
"size": "64x64",
|
||||
"platform": "ios"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-29x29@1x.png",
|
||||
"scale" : "1x"
|
||||
"filename": "Icon-App-64x64@3x.png",
|
||||
"idiom": "universal",
|
||||
"scale": "3x",
|
||||
"size": "64x64",
|
||||
"platform": "ios"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-29x29@2x.png",
|
||||
"scale" : "2x"
|
||||
"filename": "Icon-App-68x68@2x.png",
|
||||
"idiom": "universal",
|
||||
"scale": "2x",
|
||||
"size": "68x68",
|
||||
"platform": "ios"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-40x40@1x.png",
|
||||
"scale" : "1x"
|
||||
"filename": "Icon-App-76x76@2x.png",
|
||||
"idiom": "universal",
|
||||
"scale": "2x",
|
||||
"size": "76x76",
|
||||
"platform": "ios"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-40x40@2x.png",
|
||||
"scale" : "2x"
|
||||
"filename": "Icon-App-83.5x83.5@2x.png",
|
||||
"idiom": "universal",
|
||||
"scale": "2x",
|
||||
"size": "83.5x83.5",
|
||||
"platform": "ios"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-76x76@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-76x76@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "83.5x83.5",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-83.5x83.5@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "1024x1024",
|
||||
"idiom" : "ios-marketing",
|
||||
"filename" : "Icon-App-1024x1024@1x.png",
|
||||
"scale" : "1x"
|
||||
"filename": "Icon-App-1024x1024@1x.png",
|
||||
"idiom": "universal",
|
||||
"scale": "1x",
|
||||
"size": "1024x1024",
|
||||
"platform": "ios"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
"info": {
|
||||
"author": "icons_launcher",
|
||||
"version": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 406 B After Width: | Height: | Size: 655 B |
|
Before Width: | Height: | Size: 450 B After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 462 B After Width: | Height: | Size: 1003 B |
|
Before Width: | Height: | Size: 704 B After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 586 B After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 862 B After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 862 B After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 4.1 KiB |
@@ -2,4 +2,10 @@ abstract class ApiConst {
|
||||
static const String baseUrl = "https://superapp.felixits.uz/api/v1";
|
||||
|
||||
static const String login = "/auth/login";
|
||||
static const String register = "/auth/register/create_user";
|
||||
static const String resetPassword = "/auth/reset_password";
|
||||
static const String forgotPassword = "/auth/forgot_password";
|
||||
static const String sendCode = "/auth/send_code";
|
||||
static const String verifyCode = "/auth/register/verify_code";
|
||||
static const String verifyPhone = "/auth/register/verify_phone";
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ abstract class AppLocaleKeys {
|
||||
static const String fontLight = "fontLight";
|
||||
|
||||
static const String imageUrl =
|
||||
"https://xsznseejebbai1lj.public.blob.vercel-storage.com/homepage/hero/hero-1.webp";
|
||||
"https://www.peanutbutterandfitness.com/wp-content/uploads/2023/07/Healthy-Weekly-Meal-Plan-Recipes-7.9.23-1.jpg";
|
||||
|
||||
static const String foodImageUrl =
|
||||
"https://www.precisionorthomd.com/wp-content/uploads/2023/10/percision-blog-header-junk-food-102323.jpg";
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import 'package:food_delivery_client/core/services/request_handler_service.dart';
|
||||
import 'package:food_delivery_client/feature/auth/data/models/response/login_response.dart';
|
||||
import 'package:food_delivery_client/feature/auth/domain/usecases/register_usecase.dart';
|
||||
import 'package:food_delivery_client/feature/auth/domain/usecases/reset_password_usecase.dart';
|
||||
import 'package:food_delivery_client/feature/auth/domain/usecases/verify_otp_code_login_usecase.dart';
|
||||
import 'package:food_delivery_client/feature/auth/domain/usecases/verify_phone_login_usecase.dart';
|
||||
import 'package:food_delivery_client/food_delivery_client.dart';
|
||||
|
||||
abstract class AuthDatasource {
|
||||
@@ -7,6 +11,26 @@ abstract class AuthDatasource {
|
||||
required String phoneNumber,
|
||||
required String password,
|
||||
});
|
||||
|
||||
Future<SuccessModel> verifyPhoneResetPassword({
|
||||
required VerifyPhoneNumberParams params,
|
||||
});
|
||||
|
||||
Future<SuccessModel> verifyOtpCodeResetPassword({
|
||||
required VerifyOtpCodeParams params,
|
||||
});
|
||||
|
||||
Future<SuccessModel> resetPassword({required ResetPasswordParams params});
|
||||
|
||||
Future<SuccessModel> verifyPhoneRegister({
|
||||
required VerifyPhoneNumberParams params,
|
||||
});
|
||||
|
||||
Future<SuccessModel> verifyOtpCodeRegister({
|
||||
required VerifyOtpCodeParams params,
|
||||
});
|
||||
|
||||
Future<SuccessModel> register({required RegisterParams params});
|
||||
}
|
||||
|
||||
@LazySingleton(as: AuthDatasource)
|
||||
@@ -27,4 +51,88 @@ class AuthDatasourceImpl implements AuthDatasource {
|
||||
fromJson: (response) async => LoginResponseModel.fromJson(response.data),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<SuccessModel> register({required RegisterParams params}) async {
|
||||
return _requestHandlerService.handleRequest(
|
||||
path: ApiConst.register,
|
||||
method: RequestMethodEnum.post,
|
||||
|
||||
data: {
|
||||
"firstName": params.firstName,
|
||||
"lastName": params.lastName,
|
||||
"password": params.password,
|
||||
"phoneNumber": params.phoneNumber,
|
||||
},
|
||||
|
||||
fromJson: (response) async {
|
||||
return SuccessModel.fromJson(response.data);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<SuccessModel> resetPassword({
|
||||
required ResetPasswordParams params,
|
||||
}) async {
|
||||
return _requestHandlerService.handleRequest(
|
||||
path: ApiConst.resetPassword,
|
||||
method: RequestMethodEnum.post,
|
||||
data: {
|
||||
"newPassword": params.newPassword,
|
||||
"phoneNumber": params.phoneNumber,
|
||||
},
|
||||
|
||||
fromJson: (response) async => SuccessModel.fromJson(response.data),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<SuccessModel> verifyOtpCodeRegister({
|
||||
required VerifyOtpCodeParams params,
|
||||
}) async {
|
||||
return _requestHandlerService.handleRequest(
|
||||
path: ApiConst.verifyCode,
|
||||
method: RequestMethodEnum.post,
|
||||
data: {"code": params.otpCode, "phoneNumber": params.phoneNumber},
|
||||
fromJson: (response) async => SuccessModel.fromJson(response.data),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<SuccessModel> verifyOtpCodeResetPassword({
|
||||
required VerifyOtpCodeParams params,
|
||||
}) async {
|
||||
return _requestHandlerService.handleRequest(
|
||||
path: ApiConst.forgotPassword,
|
||||
method: RequestMethodEnum.post,
|
||||
data: {"code": params.otpCode, "phoneNumber": params.phoneNumber},
|
||||
fromJson: (response) async => SuccessModel.fromJson(response.data),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<SuccessModel> verifyPhoneRegister({
|
||||
required VerifyPhoneNumberParams params,
|
||||
}) async {
|
||||
return _requestHandlerService.handleRequest(
|
||||
path: ApiConst.verifyPhone,
|
||||
method: RequestMethodEnum.post,
|
||||
|
||||
data: {"phoneNumber": params.phoneNumber},
|
||||
fromJson: (response) async => SuccessModel.fromJson(response.data),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<SuccessModel> verifyPhoneResetPassword({
|
||||
required VerifyPhoneNumberParams params,
|
||||
}) async {
|
||||
return _requestHandlerService.handleRequest(
|
||||
path: ApiConst.sendCode,
|
||||
method: RequestMethodEnum.post,
|
||||
data: {"phoneNumber": params.phoneNumber},
|
||||
fromJson: (response) async => SuccessModel.fromJson(response.data),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
13
lib/feature/auth/domain/usecases/register_usecase.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
class RegisterParams {
|
||||
final String firstName;
|
||||
final String lastName;
|
||||
final String phoneNumber;
|
||||
final String password;
|
||||
|
||||
RegisterParams({
|
||||
required this.firstName,
|
||||
required this.lastName,
|
||||
required this.phoneNumber,
|
||||
required this.password,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class ResetPasswordParams {
|
||||
final String newPassword;
|
||||
final String phoneNumber;
|
||||
|
||||
ResetPasswordParams({required this.newPassword, required this.phoneNumber});
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class VerifyOtpCodeParams {
|
||||
final String otpCode;
|
||||
final String phoneNumber;
|
||||
|
||||
VerifyOtpCodeParams({required this.otpCode, required this.phoneNumber});
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
class VerifyPhoneNumberParams {
|
||||
final String phoneNumber;
|
||||
|
||||
VerifyPhoneNumberParams({required this.phoneNumber});
|
||||
}
|
||||
@@ -33,7 +33,12 @@ class _WLoginBodyState extends State<WLoginBody> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<LoginBloc, LoginState>(
|
||||
return BlocConsumer<LoginBloc, LoginState>(
|
||||
listener: (context, state) {
|
||||
if (state.status.isLoaded()) {
|
||||
context.go(Routes.main);
|
||||
}
|
||||
},
|
||||
builder: (context, state) {
|
||||
return Form(
|
||||
key: _formKey,
|
||||
@@ -105,7 +110,7 @@ class _WLoginBodyState extends State<WLoginBody> {
|
||||
alignment: AlignmentGeometry.centerRight,
|
||||
child: TextButton(
|
||||
onPressed: () {
|
||||
context.push(Routes.verifyPhoneNumber, extra: false);
|
||||
// context.push(Routes.verifyPhoneNumber, extra: false);
|
||||
},
|
||||
child: Text(
|
||||
context.loc.forgot_password,
|
||||
@@ -124,15 +129,16 @@ class _WLoginBodyState extends State<WLoginBody> {
|
||||
).paddingOnly(left: 10),
|
||||
onPressed: () {
|
||||
if (_formKey.currentState?.validate() ?? false) {
|
||||
context.read<LoginBloc>().add(
|
||||
LoginEvent.login(
|
||||
LoginParams(
|
||||
phoneNumber:
|
||||
"+998${_phoneController.text.trim().replaceAll(" ", "")}",
|
||||
password: _passwordController.text.trim(),
|
||||
),
|
||||
),
|
||||
);
|
||||
context.go(Routes.main);
|
||||
// context.read<LoginBloc>().add(
|
||||
// LoginEvent.login(
|
||||
// LoginParams(
|
||||
// phoneNumber:
|
||||
// "+998${_phoneController.text.trim().replaceAll(" ", "")}",
|
||||
// password: _passwordController.text.trim(),
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
}
|
||||
},
|
||||
borderRadius: 15,
|
||||
@@ -148,10 +154,7 @@ class _WLoginBodyState extends State<WLoginBody> {
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
context.push(
|
||||
Routes.verifyPhoneNumber,
|
||||
extra: true,
|
||||
);
|
||||
// context.push(Routes.verifyPhoneNumber, extra: true);
|
||||
},
|
||||
child: Text(
|
||||
context.loc.sign_up,
|
||||
|
||||
40
pubspec.lock
@@ -17,6 +17,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "8.4.0"
|
||||
archive:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: archive
|
||||
sha256: "2fde1607386ab523f7a36bb3e7edb43bd58e6edaf2ffb29d8a6d578b297fdbbd"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.7"
|
||||
args:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -397,6 +405,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.1.2"
|
||||
icons_launcher:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: icons_launcher
|
||||
sha256: "6317d56a73ee528f1dd570d7cd7be120ce58014e0fe635d141ada3d88782f58d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.3"
|
||||
iconsax_flutter:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -405,6 +421,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
image:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: image
|
||||
sha256: "4e973fcf4caae1a4be2fa0a13157aa38a8f9cb049db6529aa00b4d71abc4d928"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.5.4"
|
||||
injectable:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -653,6 +677,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.5.2"
|
||||
posix:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: posix
|
||||
sha256: "6323a5b0fa688b6a010df4905a56b00181479e6d10534cecfecede2aa55add61"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.0.3"
|
||||
provider:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -914,6 +946,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.4.0"
|
||||
universal_io:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: universal_io
|
||||
sha256: "1722b2dcc462b4b2f3ee7d188dad008b6eb4c40bbd03a3de451d82c78bba9aad"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.2"
|
||||
uuid:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
12
pubspec.yaml
@@ -53,12 +53,22 @@ dependencies:
|
||||
#loading:
|
||||
skeletonizer: ^2.1.0+1
|
||||
|
||||
#Icon launcher
|
||||
icons_launcher: ^3.0.3
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
flutter_lints: ^5.0.0
|
||||
build_runner: ^2.10.0
|
||||
|
||||
icons_launcher:
|
||||
image_path: "assets/images/logo.png"
|
||||
platforms:
|
||||
android:
|
||||
enable: true
|
||||
ios:
|
||||
enable: true
|
||||
|
||||
flutter:
|
||||
generate: true
|
||||
@@ -88,3 +98,5 @@ flutter:
|
||||
fonts:
|
||||
- asset: assets/fonts/UberMoveTextLight.otf
|
||||
weight: 300
|
||||
|
||||
|
||||
|
||||