Skip to content

Commit

Permalink
added freezed for code gen 🎨 🎨
Browse files Browse the repository at this point in the history
  • Loading branch information
olawills committed Oct 6, 2023
1 parent c6fc591 commit 39bcc94
Show file tree
Hide file tree
Showing 62 changed files with 5,614 additions and 383 deletions.
5 changes: 4 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.dating_app">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<application
android:label="Dating App"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
Expand Down
4 changes: 2 additions & 2 deletions lib/app/common/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export '../common/constants/color_style.dart';
export '../common/extensions/app_extension.dart';
export '../common/extensions/navigation_ext.dart';
export '../common/extensions/onpadding.dart';
export '../common/utils/asset_manager.dart';
export '../core/config/asset_manager.dart';
export '../common/utils/typedef.dart';
export '../common/widgets/custom_btn.dart';
export '../common/widgets/custom_txt_field.dart';
Expand All @@ -20,6 +20,6 @@ export '../common/widgets/reusable_text.dart';
export '../common/widgets/spacer.dart';
export '../common/widgets/stateless_view.dart';
// * * Utils Exports
export 'constants/app_string.dart';
export '../core/config/app_string.dart';
export 'utils/validators.dart';
export 'widgets/custom_appbar.dart';
5 changes: 3 additions & 2 deletions lib/app/common/utils/typedef.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import 'package:dartz/dartz.dart';
import 'package:dating_app/app/core/network/failures.dart';
import 'package:dating_app/src/auth/data/models/user.dart';

typedef ResultFuture<T> = Future<Either<Failure, T>>;
import '../../core/network/dio_exception.dart';

typedef ResultFuture<T> = Future<Either<NetworkExceptions, T>>;

typedef ResultVoid<T> = ResultFuture<void>;

Expand Down
2 changes: 1 addition & 1 deletion lib/app/common/widgets/custom_appbar.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter_svg/flutter_svg.dart';

import '../../core/core.dart';
import '../utils/asset_manager.dart';
import '../../core/config/asset_manager.dart';

class CustomAppB extends StatelessWidget {
const CustomAppB({super.key});
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 5 additions & 3 deletions lib/app/core/config/injection_container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ import 'package:dating_app/src/startup/presentation/bloc/onboarding_bloc.dart';
import 'package:dio/dio.dart';
import 'package:get_it/get_it.dart';

import '../network/dio_client.dart';
import '../../../src/auth/presentation/bloc/auth_bloc/auth_bloc.dart';
import '../../../src/auth/presentation/bloc/user_info_bloc/interest_bloc.dart';
import '../../../src/features/cubit/bottom_navbar/bottom_navigation_cubit.dart';
import '../../../src/features/cubit/internet_connection/internet_connection_cubit.dart';
import '../../../src/features/home/data/datasources/user_remote_data_source.dart';
import '../../../src/features/home/data/repository/user_repository.dart';
import '../../../src/features/home/presentation/bloc/users_bloc.dart';
import '../../../src/features/home/presentation/bloc/gps/gps_bloc.dart';
import '../../../src/features/home/presentation/bloc/users_closeby/users_bloc.dart';
import '../network/dio_client.dart';

GetIt serviceLocator = GetIt.instance;

Expand All @@ -27,6 +28,7 @@ class ServiceLocator {
serviceLocator.registerFactory<OnboardingBloc>(() => OnboardingBloc());
serviceLocator.registerFactory<FetchUserBloc>(() => FetchUserBloc());
serviceLocator.registerFactory<InterestBloc>(() => InterestBloc());
serviceLocator.registerFactory<GpsBloc>(() => GpsBloc());

// Cubit
serviceLocator
Expand All @@ -43,7 +45,7 @@ class ServiceLocator {
() => AuthInfoRemoteDataSourceImpl());

// Repositories
serviceLocator.registerFactory<AuthRepositories>(() => AuthRepositories());
serviceLocator.registerFactory<AuthRepository>(() => AuthRepository());
serviceLocator
.registerFactory<AuthInfoRepository>(() => AuthInfoRepository());
serviceLocator.registerFactory<UserRepository>(() => UserRepository());
Expand Down
7 changes: 3 additions & 4 deletions lib/app/core/core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export 'package:fluttertoast/fluttertoast.dart';
export 'package:go_router/go_router.dart';

export '../../../../../app/core/services/auth_local_data_source.dart';
export '../../../../src/features/home/presentation/bloc/users_closeby/users_bloc.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';
Expand All @@ -16,14 +17,12 @@ 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/cubit/bottom_navbar/bottom_navigation_cubit.dart';
export '../../../src/features/cubit/internet_connection/internet_connection_cubit.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';
8 changes: 5 additions & 3 deletions lib/app/core/domain/all_blocs.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import 'package:dating_app/app/core/core.dart';
import 'package:dating_app/app/core/config/injection_container.dart';
import 'package:dating_app/app/core/core.dart';
import 'package:dating_app/src/auth/presentation/bloc/auth_bloc/auth_bloc.dart';

import '../../../src/auth/presentation/bloc/user_info_bloc/interest_bloc.dart';
import '../../../src/features/home/presentation/bloc/gps/gps_bloc.dart';
import '../../../src/startup/presentation/bloc/onboarding_bloc.dart';

class AppBlocProviders {
Expand All @@ -16,12 +17,13 @@ class AppBlocProviders {

// User Bloc
BlocProvider<FetchUserBloc>(
create: (context) =>
serviceLocator<FetchUserBloc>()..add(FetchAllUserEvent())),
create: (context) => serviceLocator<FetchUserBloc>()),

BlocProvider<InterestBloc>(
create: (context) => serviceLocator<InterestBloc>()),

BlocProvider<GpsBloc>(create: (context) => serviceLocator<GpsBloc>()),

// RepositoryProvider(create: (context) => UserRepositories()),

// BottomNavBar Cubit
Expand Down
10 changes: 4 additions & 6 deletions lib/app/core/domain/dating_app.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import 'package:awesome_notifications/awesome_notifications.dart';
import 'package:dating_app/app/common/common.dart';
import 'package:dating_app/app/core/core.dart';
import 'package:dating_app/app/core/routes/app_router.dart';
import 'package:dating_app/app/core/services/push_notification.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class SparkzConfig extends StatefulWidget {
Expand All @@ -18,10 +16,10 @@ class _SparkzConfigState extends State<SparkzConfig> {
super.initState();

// ** Initialize Push Notifications
FirebasePushNotificationServce.getDeviceToken();
FirebasePushNotificationServce.requestPermission();
FirebasePushNotificationServce.initializeNotification();
AwesomeNotifications().requestPermissionToSendNotifications();
// FirebasePushNotificationServce.getDeviceToken();
// FirebasePushNotificationServce.requestPermission();
// FirebasePushNotificationServce.initializeNotification();
// AwesomeNotifications().requestPermissionToSendNotifications();
}

@override
Expand Down
13 changes: 13 additions & 0 deletions lib/app/core/error/exception.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import '../network/error_msg_model.dart';

class ServerException implements Exception {
final ErrorMessageModel errorMessageModel;

const ServerException({required this.errorMessageModel});
}

class LocalDatabaseException implements Exception {
final String message;

const LocalDatabaseException({required this.message});
}
Loading

0 comments on commit 39bcc94

Please sign in to comment.