-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
95 changed files
with
365 additions
and
341 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,29 @@ | ||
// packages exports | ||
|
||
export 'package:cached_network_image/cached_network_image.dart'; | ||
export 'package:dating_app/app/common/extensions/navigation_ext.dart'; | ||
export 'package:flutter/material.dart'; | ||
export 'package:flutter_bloc/flutter_bloc.dart'; | ||
export 'package:fluttertoast/fluttertoast.dart'; | ||
export 'package:go_router/go_router.dart'; | ||
export 'package:dating_app/app/common/extensions/navigation_ext.dart'; | ||
|
||
export '../../../../../app/core/services/auth_local_data_source.dart'; | ||
export '../../../presentation/auth/presentation/views/complete_verification/verification_barrels.dart'; | ||
export '../../../presentation/auth/presentation/views/forgot_password/forgot_password_barrels.dart'; | ||
export '../../../presentation/auth/presentation/views/info_view/barrels.dart'; | ||
export '../../../presentation/auth/presentation/views/interest_view/barrels.dart'; | ||
export '../../../presentation/auth/presentation/views/login/barrels.dart'; | ||
export '../../../presentation/auth/presentation/views/otp_verification/otp_barrels.dart'; | ||
export '../../../presentation/auth/presentation/views/signup/barrels.dart'; | ||
export '../../../presentation/features/presentation/cubit/internet_connection/internet_connection_cubit.dart'; | ||
export '../../../presentation/features/presentation/views/chats/chats_barrel.dart'; | ||
export '../../presentation/features/presentation/views/skeleton_controller.dart'; | ||
export '../../../presentation/features/presentation/views/home/home_barrel.dart'; | ||
export '../../../presentation/features/presentation/views/notification/notification_barrel.dart'; | ||
export '../../../presentation/features/presentation/views/profile/profile_barrel.dart'; | ||
export '../../../presentation/not_found/not_found_controller.dart'; | ||
export '../../../presentation/startup/presentation/views/onboarding/barrels.dart'; | ||
export '../../../presentation/startup/presentation/views/startup/startup_controller.dart'; | ||
export '../../../src/auth/presentation/views/complete_verification/verification_barrels.dart'; | ||
export '../../../src/auth/presentation/views/forgot_password/forgot_password_barrels.dart'; | ||
export '../../../src/auth/presentation/views/info_view/barrels.dart'; | ||
export '../../../src/auth/presentation/views/interest_view/barrels.dart'; | ||
export '../../../src/auth/presentation/views/login/barrels.dart'; | ||
export '../../../src/auth/presentation/views/otp_verification/otp_barrels.dart'; | ||
export '../../../src/auth/presentation/views/signup/barrels.dart'; | ||
export '../../../src/features/chats/presentation/chats_barrel.dart'; | ||
export '../../../src/features/home/presentation/home_barrel.dart'; | ||
export '../../../src/features/notification/presentation/notification_barrel.dart'; | ||
export '../../../src/features/profile/presentation/profile_barrel.dart'; | ||
export '../../../src/features/skeleton_controller.dart'; | ||
export '../../../src/not_found/not_found_controller.dart'; | ||
export '../../../src/startup/presentation/views/onboarding/barrels.dart'; | ||
export '../../../src/startup/presentation/views/startup/startup_controller.dart'; | ||
|
||
export '../../../src/features/cubit/bottom_navbar/bottom_navigation_cubit.dart'; | ||
export '../../../src/features/home/presentation/bloc/users_bloc.dart'; | ||
export '../../../src/features/cubit/internet_connection/internet_connection_cubit.dart'; |
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
2 changes: 1 addition & 1 deletion
2
lib/app/core/network_handler/dio_client.dart → lib/app/core/network/dio_client.dart
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
File renamed without changes.
File renamed without changes.
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,36 @@ | ||
import 'package:dio/dio.dart'; | ||
import 'package:equatable/equatable.dart'; | ||
|
||
import '../../common/constants/app_string.dart'; | ||
|
||
abstract class Failure extends Equatable { | ||
final String message; | ||
const Failure(this.message); | ||
|
||
@override | ||
List<Object?> get props => [message]; | ||
} | ||
|
||
class ServerFailure extends Failure { | ||
const ServerFailure(super.message); | ||
|
||
factory ServerFailure.fromDioError(DioException error) { | ||
switch (error.type) { | ||
case DioExceptionType.connectionTimeout: | ||
return const ServerFailure(AppString.connectionTimeout); | ||
case DioExceptionType.sendTimeout: | ||
return const ServerFailure(AppString.sendTimeOut); | ||
case DioExceptionType.receiveTimeout: | ||
return const ServerFailure(AppString.receiveTimeout); | ||
case DioExceptionType.badResponse: | ||
return ServerFailure(error.response!.data['message']); | ||
case DioExceptionType.unknown: | ||
if (error.message!.contains('SocketException')) { | ||
return const ServerFailure(AppString.socketException); | ||
} | ||
return const ServerFailure(AppString.unexpectedError); | ||
default: | ||
return const ServerFailure(AppString.unknownError); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,10 +1,18 @@ | ||
import 'dart:io'; | ||
|
||
class ApiConfig { | ||
static final ApiConfig _apiConfig = ApiConfig._internal(); | ||
|
||
// ** Singleton | ||
factory ApiConfig() => _apiConfig; | ||
|
||
ApiConfig._internal(); | ||
static const String baseUrl = 'https://spark-dating-api.onrender.com/api/v1'; | ||
|
||
static const Duration receiveTimeout = Duration(milliseconds: 15000); | ||
static const Duration connectionTimeout = Duration(milliseconds: 15000); | ||
static const header = { | ||
'content-Type': 'application/json', | ||
HttpHeaders.contentTypeHeader: 'application/json', | ||
}; | ||
} | ||
// https://meet.google.com/adw-kynw-kgh |
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
Oops, something went wrong.