Skip to content

Commit

Permalink
chore: fix overload database connection instances issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Gambley1 committed Aug 3, 2024
1 parent d537666 commit 766920f
Show file tree
Hide file tree
Showing 68 changed files with 744 additions and 456 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Yandex Food Delivery Clone
# Yandex Eats Delivery Clone

## 💫 About The Project

Expand Down
11 changes: 6 additions & 5 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ package="com.example.yandex_food_delivery_clone">
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />

<meta-data android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyCThbQUZlTxyDRpiPQKPaFeFflAK0TfPkw"/>

<!-- Provide required visibility configuration for API level 30 and above -->
<queries>
<!-- If your app checks for SMS support -->
Expand All @@ -33,8 +30,10 @@ package="com.example.yandex_food_delivery_clone">
android:label="yandex_food_delivery_clone"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"
android:enableOnBackInvokedCallback="true"
android:requestLegacyExternalStorage="true">

<meta-data android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyCThbQUZlTxyDRpiPQKPaFeFflAK0TfPkw"/>
<activity
android:name=".MainActivity"
android:exported="true"
Expand All @@ -43,7 +42,8 @@ package="com.example.yandex_food_delivery_clone">
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize"
android:enableOnBackInvokedCallback="true">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
Expand All @@ -52,6 +52,7 @@ package="com.example.yandex_food_delivery_clone">
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>

<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.3.1" apply false
id "com.android.application" version "7.1.2" apply false
id "org.jetbrains.kotlin.android" version "1.9.0" apply false
id "com.google.gms.google-services" version "4.3.14" apply false
}
Expand Down
2 changes: 1 addition & 1 deletion api/lib/api.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Yandex Food Clone API Server-Side Library
/// Yandex Eats Clone API Server-Side Library
library api;

export 'src/common/common.dart' hide Env;
Expand Down
4 changes: 2 additions & 2 deletions api/lib/client.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// Yandex Food Clone API Client-Side Library
/// Yandex Eats Clone API Client-Side Library
library client;

export 'src/client/yandex_food_api_client.dart';
export 'src/client/yandex_eats_api_client.dart';
export 'src/common/config/uuid_gen.dart';
export 'src/common/remote/app_dio.dart';
export 'src/common/utils/extensions/formatter_extension.dart';
Expand Down
48 changes: 24 additions & 24 deletions api/lib/src/client/api_exceptions.dart
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
/// {@template yandex_food_api_exception}
/// Exceptions from Yandex Food API client.
/// {@template yandex_eats_api_exception}
/// Exceptions from Yandex Eats API client.
/// {@endtemplate}
abstract class YandexFoodApiException implements Exception {
/// {@macro yandex_food_api_exception}
const YandexFoodApiException(this.error);
abstract class YandexEatsApiException implements Exception {
/// {@macro yandex_eats_api_exception}
const YandexEatsApiException(this.error);

/// The error which was caught.
final Object error;

@override
String toString() => 'Yandex Food API exception error: $error';
String toString() => 'Yandex Eats API exception error: $error';
}

/// {@template get_user_notifications_failure}
/// Thrown during the get user notifications if a failure occurs.
/// {@endtemplate}
class GetUserNotificationsFailure extends YandexFoodApiException {
class GetUserNotificationsFailure extends YandexEatsApiException {
/// {@macro get_user_notifications_failure}
const GetUserNotificationsFailure(super.error);
}

/// {@template get_restaurant_by_id}
/// Thrown during the get of restaurant by id if a failure occurs.
/// {@endtemplate}
class GetRestaurantById extends YandexFoodApiException {
class GetRestaurantById extends YandexEatsApiException {
/// {@macro get_restaurant_by_id}
const GetRestaurantById(super.error);
}

/// {@template get_restaurant_by_location_failure}
/// Thrown during the get of restaurant by location if a failure occurs.
/// {@endtemplate}
class GetRestaurantByLocationFailure extends YandexFoodApiException {
class GetRestaurantByLocationFailure extends YandexEatsApiException {
/// {@macro get_restaurant_by_location_failure}
const GetRestaurantByLocationFailure(super.error);
}

/// {@template get_restaurant_by_location_failure}
/// Thrown during the add of restaurant if a failure occurs.
/// {@endtemplate}
class AddRestaurantFailure extends YandexFoodApiException {
class AddRestaurantFailure extends YandexEatsApiException {
/// {@macro get_restaurant_by_location_failure}
const AddRestaurantFailure(super.error);
}

/// {@template update_restaurant_failure}
/// Thrown during the update of restaurant if a failure occurs.
/// {@endtemplate}
class UpdateRestaurantFailure extends YandexFoodApiException {
class UpdateRestaurantFailure extends YandexEatsApiException {
/// {@macro update_restaurant_failure}
const UpdateRestaurantFailure(super.error);
}

/// {@template delete_restaurant_failure}
/// Thrown during the delete of restaurant if a failure occurs.
/// {@endtemplate}
class DeleteRestaurantFailure extends YandexFoodApiException {
class DeleteRestaurantFailure extends YandexEatsApiException {
/// {@macro delete_restaurant_failure}
const DeleteRestaurantFailure(super.error);
}
Expand All @@ -64,95 +64,95 @@ class DeleteRestaurantFailure extends YandexFoodApiException {
/// Thrown during the get of popular restaurants by location if a
/// failure occurs.
/// {@endtemplate}
class GetPopularRestaurantByLocationFailure extends YandexFoodApiException {
class GetPopularRestaurantByLocationFailure extends YandexEatsApiException {
/// {@macro get_popular_restaurants_by_location_failure}
const GetPopularRestaurantByLocationFailure(super.error);
}

/// {@template search_restaurants_failure}
/// Thrown during the search of restaurants if a failure occurs.
/// {@endtemplate}
class SearchRestaurantsFailure extends YandexFoodApiException {
class SearchRestaurantsFailure extends YandexEatsApiException {
/// {@macro search_restaurants_failure}
const SearchRestaurantsFailure(super.error);
}

/// {@template get_restaurants_tags_failure}
/// Thrown during the get of restaurants tags if a failure occurs.
/// {@endtemplate}
class GetRestaurantsTagsFailure extends YandexFoodApiException {
class GetRestaurantsTagsFailure extends YandexEatsApiException {
/// {@macro get_restaurants_tags_failure}
const GetRestaurantsTagsFailure(super.error);
}

/// {@template get_restaurants_by_tags_failure}
/// Thrown during the get of restaurants by tags if a failure occurs.
/// {@endtemplate}
class GetRestaurantsByTagsFailure extends YandexFoodApiException {
class GetRestaurantsByTagsFailure extends YandexEatsApiException {
/// {@macro get_restaurants_by_tags_failure}
const GetRestaurantsByTagsFailure(super.error);
}

/// {@template get_menu_failure}
/// Thrown during the get of menu if a failure occurs.
/// {@endtemplate}
class GetMenuFailure extends YandexFoodApiException {
class GetMenuFailure extends YandexEatsApiException {
/// {@macro get_menu_failure}
const GetMenuFailure(super.error);
}

/// {@template get_user_profile_failure}
/// Thrown during the get of user if a failure occurs.
/// {@endtemplate}
class GetUserProfileFailure extends YandexFoodApiException {
class GetUserProfileFailure extends YandexEatsApiException {
/// {@macro get_user_profile_failure}
const GetUserProfileFailure(super.error);
}

/// {@template add_user_credit_card_failure}
/// Thrown during the add of user credit card if a failure occurs.
/// {@endtemplate}
class AddCreditCardFailure extends YandexFoodApiException {
class AddCreditCardFailure extends YandexEatsApiException {
/// {@macro add_user_credit_card_failure}
const AddCreditCardFailure(super.error);
}

/// {@template delete_credit_card_failure}
/// Thrown during the get of user if a failure occurs.
/// {@endtemplate}
class DeleteCreditCardFailure extends YandexFoodApiException {
class DeleteCreditCardFailure extends YandexEatsApiException {
/// {@macro delete_credit_card_failure}
const DeleteCreditCardFailure(super.error);
}

/// {@template get_credit_cards_failure}
/// Thrown during the get of credit cards if a failure occurs.
/// {@endtemplate}
class GetCreditCardsFailure extends YandexFoodApiException {
class GetCreditCardsFailure extends YandexEatsApiException {
/// {@macro get_credit_cards_failure}
const GetCreditCardsFailure(super.error);
}

/// {@template get_credit_card_info_failure}
/// Thrown during the get of credit card info if a failure occurs.
/// {@endtemplate}
class GetCreditCardInfoFailure extends YandexFoodApiException {
class GetCreditCardInfoFailure extends YandexEatsApiException {
/// {@macro get_credit_card_info_failure}
const GetCreditCardInfoFailure(super.error);
}

/// {@template update_credit_card_failure}
/// Thrown during the update of credit card if a failure occurs.
/// {@endtemplate}
class UpdateCreditCardFailure extends YandexFoodApiException {
class UpdateCreditCardFailure extends YandexEatsApiException {
/// {@macro update_credit_card_failure}
const UpdateCreditCardFailure(super.error);
}

/// {@template get_user_failure}
/// Thrown during the get of user if a failure occurs.
/// {@endtemplate}
class GetUserFailure extends YandexFoodApiException {
class GetUserFailure extends YandexEatsApiException {
/// {@macro get_user_failure}
const GetUserFailure(super.error);
}
2 changes: 1 addition & 1 deletion api/lib/src/client/client.dart
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export 'yandex_food_api_client.dart';
export 'yandex_eats_api_client.dart';
Loading

0 comments on commit 766920f

Please sign in to comment.