Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change home module architecture to a data domain presentation archite… #188

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion app/l10n.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
arb-dir: lib/l10n/arb
arb-dir: lib/src/l10n/arb
template-arb-file: app_en.arb
output-localization-file: app_localizations.dart
nullable-getter: false
11 changes: 7 additions & 4 deletions app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:http/http.dart';
import 'package:just_audio_background/just_audio_background.dart';
import 'package:mq_storage/mq_storage.dart';

import 'package:my_quran/app/app.dart';
import 'package:my_quran/app_observer.dart';
import 'package:my_quran/config/config.dart';
import 'package:my_quran/core/core.dart';
import 'package:my_quran/src/src.dart';


Future<void> main({AppConfig? appConfig}) async {
WidgetsFlutterBinding.ensureInitialized();
Expand All @@ -28,6 +26,9 @@ Future<void> main({AppConfig? appConfig}) async {
Bloc.observer = AppBlocObserver();
final storage = await PreferencesStorage.getInstance();

final localStorage = HomeLocalDataSource(storage);
final remoteClient = RemoteClient(Client(), NetworkClient(Connectivity()));

appConfig ??= AppConfig(storage: storage);

appConfig.init();
Expand All @@ -37,6 +38,8 @@ Future<void> main({AppConfig? appConfig}) async {
providers: [
RepositoryProvider(create: (context) => appConfig),
RepositoryProvider(create: (context) => storage),
RepositoryProvider(create: (context) => localStorage),
RepositoryProvider(create: (context) => HomeRemoteDataSource(remoteClient)),
RepositoryProvider(create: (context) => NetworkClient(Connectivity())),
RepositoryProvider(
create: (context) => RemoteClient(Client(), context.read<NetworkClient>()),
Expand Down
4 changes: 0 additions & 4 deletions app/lib/modules/home/home.dart

This file was deleted.

19 changes: 0 additions & 19 deletions app/lib/modules/home/logic/home_cubit.dart

This file was deleted.

37 changes: 0 additions & 37 deletions app/lib/modules/home/service/home_service.dart

This file was deleted.

4 changes: 0 additions & 4 deletions app/lib/modules/login/login.dart

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

import 'package:my_quran/app/app.dart';
import 'package:my_quran/models/user/user_model.dart';
import 'package:my_quran/theme/custom/custom_theme.dart';

import 'package:my_quran/src/src.dart';
part 'app_state.dart';

class AppCubit extends Cubit<AppState> {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import 'package:equatable/equatable.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:my_quran/src/src.dart';

import 'package:my_quran/app/app.dart';
import 'package:my_quran/models/models.dart';

part 'auth_state.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
import 'package:my_quran/src/src.dart';

import 'package:my_quran/app/app.dart';
import 'package:my_quran/modules/modules.dart';

final _rootNavigatorKey = GlobalKey<NavigatorState>();
final _sectionNavigatorKey1 = GlobalKey<NavigatorState>(debugLabel: 'home');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import 'dart:ui';
import 'package:flutter/foundation.dart';

import 'package:mq_storage/mq_storage.dart';
import 'package:my_quran/constants/contants.dart';
import 'package:my_quran/l10n/l10.dart';
import 'package:my_quran/src/src.dart';

@immutable
final class AppService {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import 'package:flutter/cupertino.dart';

import 'package:mq_storage/mq_storage.dart';
import 'package:my_quran/config/config.dart';
import 'package:my_quran/constants/contants.dart';
import 'package:my_quran/core/core.dart';
import 'package:my_quran/models/models.dart';
import 'package:my_quran/src/src.dart';

@immutable
final class AuthService {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import 'package:flutter/material.dart';
import 'package:mq_storage/mq_storage.dart';
import 'package:my_quran/constants/contants.dart';

import 'package:my_quran/theme/theme.dart';

import 'package:my_quran/src/src.dart';
class ThemeService {
const ThemeService(this.storage);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:just_audio/just_audio.dart';
import 'package:mq_storage/mq_storage.dart';
import 'package:my_quran/src/src.dart';

import 'package:my_quran/app/app.dart';
import 'package:my_quran/core/core.dart';
import 'package:my_quran/l10n/l10.dart';
import 'package:my_quran/modules/modules.dart';

class MyApp extends StatelessWidget {
const MyApp({super.key});
Expand All @@ -31,9 +28,11 @@ class MyApp extends StatelessWidget {
),
BlocProvider(
create: (context) => HomeCubit(
HomeService(
context.read<PreferencesStorage>(),
context.read<RemoteClient>(),
GetHomeDataUseCase(
HomeRepositoryImpl(
context.read<HomeLocalDataSource>(),
context.read<HomeRemoteDataSource>(),
),
),
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'dart:math';

import 'package:flutter/material.dart';
import 'package:just_audio/just_audio.dart';
import 'package:my_quran/utils/urils.dart';
import 'package:my_quran/src/utils/urils.dart';

class SeekBar extends StatelessWidget {
const SeekBar({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import 'package:flutter/material.dart';
import 'package:my_quran/src/src.dart';

import 'package:my_quran/constants/contants.dart';
import 'package:my_quran/l10n/l10.dart';
import 'package:my_quran/models/models.dart';

class GenderCard extends StatelessWidget {
const GenderCard(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:mq_ci_keys/mq_ci_keys.dart';
import 'package:my_quran/src/src.dart';

import 'package:my_quran/app/app.dart';
import 'package:my_quran/constants/contants.dart';

class SelectLangFromListViewBuilder extends StatelessWidget {
const SelectLangFromListViewBuilder({super.key});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/foundation.dart';
import 'package:mq_storage/mq_storage.dart';
import 'package:my_quran/constants/contants.dart';
import 'package:my_quran/src/src.dart';

@immutable
final class AppConfig {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:my_quran/config/app_config.dart';
import 'package:my_quran/src/config/app_config.dart';

class AppConst {
const AppConst._();
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import 'dart:developer';

import 'package:flutter/foundation.dart';
import 'package:http/http.dart';
import 'package:my_quran/src/src.dart';

import 'package:my_quran/core/core.dart';

@immutable
class RemoteClient {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:ui';

import 'package:json_annotation/json_annotation.dart';
import 'package:my_quran/theme/theme.dart';
import 'package:my_quran/src/src.dart';

part 'hatim_page.g.dart';

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/foundation.dart';
import 'package:json_annotation/json_annotation.dart';

import 'package:my_quran/models/models.dart';
import 'package:my_quran/src/models/models.dart';

part 'juz_model.g.dart';

Expand Down
3 changes: 0 additions & 3 deletions app/lib/models/models.dart → app/lib/src/models/models.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
export 'hatim/hatim_juz.dart';
export 'home/home_model.dart';
export 'home/hatim_read_model.dart';
export 'hatim/hatim_page.dart';
export 'juz/juz_data.dart';
export 'juz/juz_model.dart';
Expand All @@ -11,4 +9,3 @@ export 'quran_page/quran_page.dart';
export 'quran_page/verse.dart';
export 'surah/surah_data.dart';
export 'surah/surah_model.dart';
export 'user/user_model.dart';
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/foundation.dart';
import 'package:json_annotation/json_annotation.dart';

import 'package:my_quran/models/models.dart';
import 'package:my_quran/src/models/models.dart';

part 'meta.g.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import 'package:flutter/foundation.dart';
import 'package:json_annotation/json_annotation.dart';

import 'package:my_quran/constants/contants.dart';
import 'package:my_quran/models/models.dart';
import 'package:my_quran/src/src.dart';

part 'quran_page.g.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/foundation.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:my_quran/constants/app/app_const.dart';
import 'package:my_quran/src/constants/app/app_const.dart';

part 'verse.g.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:my_quran/config/app_config.dart';
import 'package:my_quran/utils/show/alerts.dart';
import 'package:my_quran/src/src.dart';


class DevModeView extends StatefulWidget {
const DevModeView({super.key});
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ import 'dart:developer';

import 'package:equatable/equatable.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:my_quran/src/src.dart';
import 'package:stomp_dart_client/stomp.dart';
import 'package:stomp_dart_client/stomp_config.dart';
import 'package:stomp_dart_client/stomp_frame.dart';

import 'package:my_quran/config/config.dart';
import 'package:my_quran/core/core.dart';
import 'package:my_quran/models/models.dart';

part 'hatim_juz_state.dart';

class HatimJuzCubit extends Cubit<HatimJuzState> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ import 'dart:convert';

import 'package:equatable/equatable.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:my_quran/src/src.dart';
import 'package:stomp_dart_client/stomp.dart';
import 'package:stomp_dart_client/stomp_config.dart';
import 'package:stomp_dart_client/stomp_frame.dart';

import 'package:my_quran/config/config.dart';
import 'package:my_quran/models/hatim/hatim_juz.dart';

part 'hatim_juzs_state.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ import 'dart:convert';

import 'package:equatable/equatable.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:my_quran/src/src.dart';
import 'package:stomp_dart_client/stomp.dart';
import 'package:stomp_dart_client/stomp_config.dart';
import 'package:stomp_dart_client/stomp_frame.dart';

import 'package:my_quran/config/config.dart';
import 'package:my_quran/models/models.dart';

part 'hatim_pages_state.dart';

class HatimPagesCubit extends Cubit<HatimPagesState> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import 'package:equatable/equatable.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:my_quran/src/src.dart';


import 'package:my_quran/core/core.dart';
import 'package:my_quran/models/models.dart';
import 'package:my_quran/modules/modules.dart';

part 'hatim_read_state.dart';

Expand Down
Loading
Loading