-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from tortamque:develop
Release 1.0
- Loading branch information
Showing
154 changed files
with
7,758 additions
and
91 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,28 +1,91 @@ | ||
# This file configures the analyzer, which statically analyzes Dart code to | ||
# check for errors, warnings, and lints. | ||
# | ||
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled | ||
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be | ||
# invoked from the command line by running `flutter analyze`. | ||
|
||
# The following line activates a set of recommended lints for Flutter apps, | ||
# packages, and plugins designed to encourage good coding practices. | ||
include: package:flutter_lints/flutter.yaml | ||
|
||
analyzer: | ||
exclude: | ||
- "build/**" | ||
- "**/*.g.dart" | ||
- "**/*.gr.dart" | ||
- "**/*.config.dart" | ||
- "**/*.freezed.dart" | ||
- "**/generated/**" | ||
errors: | ||
unused_element: error | ||
unused_import: error | ||
unused_local_variable: error | ||
dead_code: error | ||
|
||
linter: | ||
# The lint rules applied to this project can be customized in the | ||
# section below to disable rules from the `package:flutter_lints/flutter.yaml` | ||
# included above or to enable additional rules. A list of all available lints | ||
# and their documentation is published at https://dart.dev/lints. | ||
# | ||
# Instead of disabling a lint rule for the entire project in the | ||
# section below, it can also be suppressed for a single line of code | ||
# or a specific dart file by using the `// ignore: name_of_lint` and | ||
# `// ignore_for_file: name_of_lint` syntax on the line or in the file | ||
# producing the lint. | ||
rules: | ||
# avoid_print: false # Uncomment to disable the `avoid_print` rule | ||
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule | ||
|
||
# Additional information about this file can be found at | ||
# https://dart.dev/guides/language/analysis-options | ||
- unnecessary_late | ||
- null_check_on_nullable_type_parameter | ||
- use_super_parameters | ||
- always_use_package_imports | ||
- avoid_returning_null_for_future | ||
- avoid_slow_async_io | ||
- avoid_type_to_string | ||
- cancel_subscriptions | ||
- close_sinks | ||
- literal_only_boolean_expressions | ||
- no_adjacent_strings_in_list | ||
- test_types_in_equals | ||
- throw_in_finally | ||
- unnecessary_statements | ||
- always_declare_return_types | ||
- avoid_bool_literals_in_conditional_expressions | ||
- avoid_equals_and_hash_code_on_mutable_classes | ||
- avoid_escaping_inner_quotes | ||
- avoid_field_initializers_in_const_classes | ||
- avoid_final_parameters | ||
- avoid_multiple_declarations_per_line | ||
- avoid_private_typedef_functions | ||
- avoid_redundant_argument_values | ||
- avoid_returning_null | ||
- avoid_returning_this | ||
- avoid_setters_without_getters | ||
- avoid_types_on_closure_parameters | ||
- avoid_unused_constructor_parameters | ||
- avoid_void_async | ||
- deprecated_consistency | ||
- directives_ordering | ||
- do_not_use_environment | ||
- eol_at_end_of_file | ||
- join_return_with_assignment | ||
- leading_newlines_in_multiline_strings | ||
- library_private_types_in_public_api | ||
- no_default_cases | ||
- no_leading_underscores_for_library_prefixes | ||
- no_leading_underscores_for_local_identifiers | ||
- no_runtimeType_toString | ||
- noop_primitive_operations | ||
- omit_local_variable_types | ||
- parameter_assignments | ||
- prefer_asserts_in_initializer_lists | ||
- prefer_constructors_over_static_methods | ||
- prefer_expression_function_bodies | ||
- prefer_if_elements_to_conditional_expressions | ||
- prefer_interpolation_to_compose_strings | ||
- prefer_null_aware_method_calls | ||
- prefer_single_quotes | ||
- require_trailing_commas | ||
- sized_box_shrink_expand | ||
- sort_child_properties_last | ||
- sort_constructors_first | ||
- sort_unnamed_constructors_first | ||
- tighten_type_of_initializing_formals | ||
- type_annotate_public_apis | ||
- unawaited_futures | ||
- unnecessary_await_in_return | ||
- unnecessary_constructor_name | ||
- unnecessary_null_aware_assignments | ||
- unnecessary_parenthesis | ||
- unnecessary_raw_strings | ||
- use_decorated_box | ||
- use_if_null_to_convert_nulls_to_bools | ||
- use_is_even_rather_than_modulo | ||
- use_named_constants | ||
- use_setters_to_change_properties | ||
- use_string_buffers | ||
- use_test_throws_matchers | ||
- use_to_and_as_if_applicable | ||
- depend_on_referenced_packages | ||
- secure_pubspec_urls |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<background android:drawable="@color/ic_launcher_background"/> | ||
<foreground android:drawable="@drawable/ic_launcher_foreground"/> | ||
</adaptive-icon> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<color name="ic_launcher_background">#ecfafc</color> | ||
</resources> |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,6 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
ThemeData theme(Color color) => ThemeData( | ||
colorScheme: ColorScheme.fromSeed(seedColor: color), | ||
useMaterial3: true, | ||
); |
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,4 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
const Curve animationCurve = Curves.easeOutSine; | ||
const Duration animationDuration = Duration(milliseconds: 500); |
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,8 @@ | ||
const String authWrapperPageConstant = '/auth_wrapper'; | ||
const String registerPageConstant = '/register'; | ||
const String loginPageConstant = '/login'; | ||
const String screensWrapperPageConstant = '/screen_wrapper'; | ||
const String poemViewPageConstant = '/poem_view'; | ||
const String writePoemPageConstant = '/write_poem'; | ||
const String savedCollectionViewConstant = '/saved_collection_view'; | ||
const String savedPoemViewConstant = '/saved_poem_view'; |
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,2 @@ | ||
const String poemApiBaseUrl = 'https://poetrydb.org/'; | ||
const int defaultPoemsCount = 50; |
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 @@ | ||
const String savedColorConstant = 'saved_color'; |
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,123 @@ | ||
import 'package:dio/dio.dart'; | ||
import 'package:firebase_auth/firebase_auth.dart'; | ||
import 'package:get_it/get_it.dart'; | ||
import 'package:poetlum/core/shared/data/repository/user_repository_impl.dart'; | ||
import 'package:poetlum/core/shared/domain/repository/user_repository.dart'; | ||
import 'package:poetlum/core/shared/presentation/bloc/credentials/credentials_bloc.dart'; | ||
import 'package:poetlum/features/authorization/data/data_sources/remote/firebase_service.dart'; | ||
import 'package:poetlum/features/authorization/data/repository/auth_repository_impl.dart'; | ||
import 'package:poetlum/features/authorization/data/repository/firebase_repository_impl.dart'; | ||
import 'package:poetlum/features/authorization/domain/repository/auth_repository.dart'; | ||
import 'package:poetlum/features/authorization/domain/repository/firebase_repository.dart'; | ||
import 'package:poetlum/features/authorization/domain/usecases/login/login_user_usecase.dart'; | ||
import 'package:poetlum/features/authorization/domain/usecases/register/register_user_usecase.dart'; | ||
import 'package:poetlum/features/authorization/presentation/bloc/authorization/auth_cubit.dart'; | ||
import 'package:poetlum/features/authorization/presentation/bloc/validation/validation_cubit.dart'; | ||
import 'package:poetlum/features/authorization/presentation/bloc/validation/validators.dart'; | ||
import 'package:poetlum/features/poems_feed/data/data_sources/remote/poem_api_service.dart'; | ||
import 'package:poetlum/features/poems_feed/data/repository/poem_repository_impl.dart'; | ||
import 'package:poetlum/features/poems_feed/domain/repository/poem_repository.dart'; | ||
import 'package:poetlum/features/poems_feed/domain/usecases/get_poems_usecase.dart'; | ||
import 'package:poetlum/features/poems_feed/presentation/bloc/poem/remote/remote_poem_bloc.dart'; | ||
import 'package:poetlum/features/saved_poems/data/data_sources/remote/firebase_api_service.dart'; | ||
import 'package:poetlum/features/saved_poems/data/repository/firebase_db_repository_impl.dart'; | ||
import 'package:poetlum/features/saved_poems/domain/repository/firebase_db_repository.dart'; | ||
import 'package:poetlum/features/saved_poems/domain/usecases/create_new_collection/create_new_collection_usecase.dart'; | ||
import 'package:poetlum/features/saved_poems/domain/usecases/delete_collection/delete_collection_usecase.dart'; | ||
import 'package:poetlum/features/saved_poems/domain/usecases/delete_poem/delete_poem_usecase.dart'; | ||
import 'package:poetlum/features/saved_poems/domain/usecases/delete_poem_from_collection/delete_poem_from_collection_usecase.dart'; | ||
import 'package:poetlum/features/saved_poems/domain/usecases/get_poems_in_collection/get_poems_in_collection_usecase.dart'; | ||
import 'package:poetlum/features/saved_poems/domain/usecases/get_user_collections/get_user_collections_usecase.dart'; | ||
import 'package:poetlum/features/saved_poems/domain/usecases/get_user_poems/get_user_poems_usecase.dart'; | ||
import 'package:poetlum/features/saved_poems/domain/usecases/is_collection_exists/is_collection_exists_usecase.dart'; | ||
import 'package:poetlum/features/saved_poems/domain/usecases/is_poem_exists/is_poem_exists_usecase.dart'; | ||
import 'package:poetlum/features/saved_poems/domain/usecases/is_poem_exists_by_name/is_poem_exists_by_name_usecase.dart'; | ||
import 'package:poetlum/features/saved_poems/domain/usecases/save_poem/save_poem_usecase.dart'; | ||
import 'package:poetlum/features/saved_poems/domain/usecases/update_poems_in_collection/update_poems_in_collection_usecase.dart'; | ||
import 'package:poetlum/features/saved_poems/presentation/bloc/firebase_database/firebase_database_cubit.dart'; | ||
import 'package:poetlum/features/theme_change/data/data_sources/local/shared_preferences_service.dart'; | ||
import 'package:poetlum/features/theme_change/data/repository/shared_preferences_repository_impl.dart'; | ||
import 'package:poetlum/features/theme_change/domain/repository/shared_preferences_repository.dart'; | ||
import 'package:poetlum/features/theme_change/domain/usecases/get_color/get_color_usecase.dart'; | ||
import 'package:poetlum/features/theme_change/domain/usecases/save_color/save_color_usecase.dart'; | ||
import 'package:poetlum/features/theme_change/presentation/bloc/change_theme_cubit.dart'; | ||
|
||
GetIt getIt = GetIt.instance; | ||
|
||
void initializeDependencies() { | ||
if(!GetIt.instance.isRegistered<Dio>()){ | ||
getIt | ||
// Dio | ||
..registerSingleton<Dio>(Dio()) | ||
|
||
// API Service | ||
..registerSingleton<PoemApiService>(PoemApiService(getIt())) | ||
..registerSingleton<FirebaseService>(FirebaseServiceImpl()) | ||
..registerSingleton<FirebaseDatabaseService>(FirebaseDatabaseServiceImpl()) | ||
..registerSingleton<SharedPreferencesService>(SharedPreferencesServiceImpl()) | ||
|
||
// Repository | ||
..registerSingleton<AuthenticationRepository>(AuthenticationRepositoryImpl()) | ||
..registerSingleton<PoemRepository>(PoemRepositoryImpl(getIt())) | ||
..registerSingleton<FirebaseRepository>(FirebaseRepositoryImpl(getIt())) | ||
..registerSingleton<FirebaseDatabaseRepository>(FirebaseDatabaseRepositoryImpl(getIt())) | ||
..registerSingleton<SharedPreferencesRepository>(SharedPreferencesRepositoryImpl(getIt())) | ||
..registerSingleton<UserRepository>(UserRepositoryImpl(FirebaseAuth.instance)) | ||
|
||
// Usecase | ||
..registerSingleton<GetInitialPoemsUseCase>(GetInitialPoemsUseCase(getIt())) | ||
..registerSingleton<GetPoemsUseCase>(GetPoemsUseCase(getIt())) | ||
..registerSingleton<RegisterUserUseCase>(RegisterUserUseCase(getIt())) | ||
..registerSingleton<LoginUserUseCase>(LoginUserUseCase(getIt())) | ||
..registerSingleton<GetUserPoemsUseCase>(GetUserPoemsUseCase(getIt())) | ||
..registerSingleton<GetUserCollectionsUseCase>(GetUserCollectionsUseCase(getIt())) | ||
..registerSingleton<SavePoemUseCase>(SavePoemUseCase(getIt())) | ||
..registerSingleton<DeletePoemUseCase>(DeletePoemUseCase(getIt())) | ||
..registerSingleton<IsPoemExistsUseCase>(IsPoemExistsUseCase(getIt())) | ||
..registerSingleton<IsPoemExistsByNameUseCase>(IsPoemExistsByNameUseCase(getIt())) | ||
..registerSingleton<CreateNewCollectionUseCase>(CreateNewCollectionUseCase(getIt())) | ||
..registerSingleton<DeleteCollectionUseCase>(DeleteCollectionUseCase(getIt())) | ||
..registerSingleton<DeletePoemFromCollectionUseCase>(DeletePoemFromCollectionUseCase(getIt())) | ||
..registerSingleton<UpdatePoemsInCollectionUseCase>(UpdatePoemsInCollectionUseCase(getIt())) | ||
..registerSingleton<GetPoemsInCollectionUseCase>(GetPoemsInCollectionUseCase(getIt())) | ||
..registerSingleton<IsCollectionExistsUseCase>(IsCollectionExistsUseCase(getIt())) | ||
..registerSingleton<SaveColorUseCase>(SaveColorUseCase(getIt())) | ||
..registerSingleton<GetColorUseCase>(GetColorUseCase(getIt())) | ||
|
||
// Validators | ||
..registerLazySingleton<UsernameValidator>(() => UsernameValidator()) | ||
..registerLazySingleton<LocalEmailValidator>(() => LocalEmailValidator()) | ||
..registerLazySingleton<PasswordValidator>(() => PasswordValidator()) | ||
|
||
// Bloc | ||
..registerFactory<RemotePoemBloc>(() => RemotePoemBloc(getIt(), getIt())) | ||
..registerFactory<AuthCubit>(() => AuthCubit(getIt(), getIt())) | ||
..registerFactory<CredentialsCubit>(() => CredentialsCubit()) | ||
..registerFactory<ThemeCubit>(() => ThemeCubit(getIt(), getIt())) | ||
..registerFactory<FirebaseDatabaseCubit>( | ||
() => FirebaseDatabaseCubit( | ||
getIt(), | ||
getIt(), | ||
getIt(), | ||
getIt(), | ||
getIt(), | ||
getIt(), | ||
getIt(), | ||
getIt(), | ||
getIt(), | ||
getIt(), | ||
getIt(), | ||
getIt(), | ||
), | ||
) | ||
..registerFactory<RegisterFormValidationCubit>(() => RegisterFormValidationCubit( | ||
usernameValidator: getIt<UsernameValidator>(), | ||
emailValidator: getIt<LocalEmailValidator>(), | ||
passwordValidator: getIt<PasswordValidator>(), | ||
),) | ||
..registerFactory<LoginFormValidationCubit>(() => LoginFormValidationCubit( | ||
emailValidator: getIt<LocalEmailValidator>(), | ||
passwordValidator: getIt<PasswordValidator>(), | ||
),); | ||
} | ||
} |
Oops, something went wrong.