├── test ├── helpers │ ├── helpers.dart │ ├── json_reader.dart │ ├── pump_app.dart │ ├── test_helper.dart │ └── dummy_data │ │ └── dummy_data_volumes.json ├── data │ ├── models │ │ ├── volume_request_model_test.dart │ │ └── volume_response_model_test.dart │ ├── data_sources │ │ └── volumes_data_source_test.dart │ └── repositories │ │ └── volumes_repository_impl_test.dart └── domain │ └── use_cases │ └── get_volumes_use_case_test.dart ├── ios ├── Runner │ ├── Runner-Bridging-Header.h │ ├── Assets.xcassets │ │ ├── Contents.json │ │ ├── AppIcon.appiconset │ │ │ ├── 100.png │ │ │ ├── 114.png │ │ │ ├── 120.png │ │ │ ├── 128.png │ │ │ ├── 144.png │ │ │ ├── 152.png │ │ │ ├── 16.png │ │ │ ├── 167.png │ │ │ ├── 172.png │ │ │ ├── 180.png │ │ │ ├── 196.png │ │ │ ├── 20.png │ │ │ ├── 216.png │ │ │ ├── 256.png │ │ │ ├── 29.png │ │ │ ├── 32.png │ │ │ ├── 40.png │ │ │ ├── 48.png │ │ │ ├── 50.png │ │ │ ├── 512.png │ │ │ ├── 55.png │ │ │ ├── 57.png │ │ │ ├── 58.png │ │ │ ├── 60.png │ │ │ ├── 64.png │ │ │ ├── 72.png │ │ │ ├── 76.png │ │ │ ├── 80.png │ │ │ ├── 87.png │ │ │ ├── 88.png │ │ │ └── 1024.png │ │ ├── AppIcon-dev.appiconset │ │ │ ├── 16.png │ │ │ ├── 20.png │ │ │ ├── 29.png │ │ │ ├── 32.png │ │ │ ├── 40.png │ │ │ ├── 48.png │ │ │ ├── 50.png │ │ │ ├── 55.png │ │ │ ├── 57.png │ │ │ ├── 58.png │ │ │ ├── 60.png │ │ │ ├── 64.png │ │ │ ├── 72.png │ │ │ ├── 76.png │ │ │ ├── 80.png │ │ │ ├── 87.png │ │ │ ├── 88.png │ │ │ ├── 100.png │ │ │ ├── 1024.png │ │ │ ├── 114.png │ │ │ ├── 120.png │ │ │ ├── 128.png │ │ │ ├── 144.png │ │ │ ├── 152.png │ │ │ ├── 167.png │ │ │ ├── 172.png │ │ │ ├── 180.png │ │ │ ├── 196.png │ │ │ ├── 216.png │ │ │ ├── 256.png │ │ │ └── 512.png │ │ ├── AppIcon-stg.appiconset │ │ │ ├── 16.png │ │ │ ├── 20.png │ │ │ ├── 29.png │ │ │ ├── 32.png │ │ │ ├── 40.png │ │ │ ├── 48.png │ │ │ ├── 50.png │ │ │ ├── 55.png │ │ │ ├── 57.png │ │ │ ├── 58.png │ │ │ ├── 60.png │ │ │ ├── 64.png │ │ │ ├── 72.png │ │ │ ├── 76.png │ │ │ ├── 80.png │ │ │ ├── 87.png │ │ │ ├── 88.png │ │ │ ├── 100.png │ │ │ ├── 1024.png │ │ │ ├── 114.png │ │ │ ├── 120.png │ │ │ ├── 128.png │ │ │ ├── 144.png │ │ │ ├── 152.png │ │ │ ├── 167.png │ │ │ ├── 172.png │ │ │ ├── 180.png │ │ │ ├── 196.png │ │ │ ├── 216.png │ │ │ ├── 256.png │ │ │ └── 512.png │ │ └── LaunchImage.imageset │ │ │ ├── LaunchImage@1x.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ ├── README.md │ │ │ └── Contents.json │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.storyboard │ └── Info.plist ├── Flutter │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── AppFrameworkInfo.plist ├── Runner.xcodeproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ ├── staging.xcscheme │ │ ├── production.xcscheme │ │ └── development.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── WorkspaceSettings.xcsettings │ │ └── IDEWorkspaceChecks.plist ├── RunnerTests │ └── RunnerTests.swift ├── .gitignore └── Podfile ├── makefile ├── .gitattributes ├── web ├── favicon.png ├── icons │ ├── favicon.png │ ├── Icon-192.png │ └── Icon-512.png └── manifest.json ├── android ├── gradle.properties ├── app │ └── src │ │ ├── main │ │ ├── ic_launcher-playstore.png │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── values │ │ │ │ ├── ic_launcher_background.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── drawable-v21 │ │ │ │ └── launch_background.xml │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ └── values-night │ │ │ │ └── styles.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── emeksiz │ │ │ │ └── MainActivity.kt │ │ └── AndroidManifest.xml │ │ ├── staging │ │ ├── ic_launcher-playstore.png │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── values │ │ │ └── ic_launcher_background.xml │ │ │ └── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ ├── development │ │ ├── ic_launcher-playstore.png │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── values │ │ │ └── ic_launcher_background.xml │ │ │ └── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ ├── debug │ │ └── AndroidManifest.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── .gitignore ├── settings.gradle └── build.gradle ├── macos ├── Runner │ ├── Configs │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ ├── Warnings.xcconfig │ │ └── AppInfo.xcconfig │ ├── Assets.xcassets │ │ ├── Contents.json │ │ ├── AppIcon.appiconset │ │ │ ├── 1024.png │ │ │ ├── 128.png │ │ │ ├── 16.png │ │ │ ├── 256.png │ │ │ ├── 32 1.png │ │ │ ├── 32.png │ │ │ ├── 512.png │ │ │ ├── 64.png │ │ │ ├── 256 1.png │ │ │ ├── 512 1.png │ │ │ └── Contents.json │ │ ├── AppIcon-dev.appiconset │ │ │ ├── 16.png │ │ │ ├── 32.png │ │ │ ├── 64.png │ │ │ ├── 1024.png │ │ │ ├── 128.png │ │ │ ├── 256 1.png │ │ │ ├── 256.png │ │ │ ├── 32 1.png │ │ │ ├── 512 1.png │ │ │ ├── 512.png │ │ │ └── Contents.json │ │ ├── AppIcon-stg.appiconset │ │ │ ├── 16.png │ │ │ ├── 32.png │ │ │ ├── 64.png │ │ │ ├── 1024.png │ │ │ ├── 128.png │ │ │ ├── 256 1.png │ │ │ ├── 256.png │ │ │ ├── 32 1.png │ │ │ ├── 512 1.png │ │ │ ├── 512.png │ │ │ └── Contents.json │ │ └── LaunchImage.imageset │ │ │ ├── LaunchImage@1x.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── Contents.json │ ├── AppDelegate.swift │ ├── Release.entitlements │ ├── DebugProfile.entitlements │ ├── MainFlutterWindow.swift │ └── Info.plist ├── .gitignore ├── Flutter │ ├── Flutter-Debug.xcconfig │ ├── Flutter-Release.xcconfig │ └── GeneratedPluginRegistrant.swift ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── Runner.xcodeproj │ └── project.xcworkspace │ │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── RunnerTests │ └── RunnerTests.swift └── Podfile ├── windows ├── runner │ ├── resources │ │ └── app_icon.ico │ ├── resource.h │ ├── CMakeLists.txt │ ├── utils.h │ ├── runner.exe.manifest │ ├── flutter_window.h │ ├── main.cpp │ ├── utils.cpp │ ├── flutter_window.cpp │ ├── Runner.rc │ └── win32_window.h ├── flutter │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake └── .gitignore ├── lib ├── core │ ├── cubit │ │ ├── base_state.dart │ │ └── base_cubit.dart │ ├── constants │ │ ├── hive_type_constants.dart │ │ ├── flavor_constants.dart │ │ ├── environment_constants.dart │ │ ├── color_constants.dart │ │ └── locale_key_constants.dart │ ├── utils │ │ ├── extensions │ │ │ ├── widget_extensions.dart │ │ │ └── context_extensions.dart │ │ ├── observers │ │ │ └── bloc_observer.dart │ │ └── mixins │ │ │ └── network_handler_mixin.dart │ ├── config │ │ ├── localization_config.dart │ │ ├── types.dart │ │ └── flavor_config.dart │ ├── widget │ │ └── base_widget.dart │ ├── api │ │ ├── dio_client.dart │ │ └── hive_client.dart │ ├── error │ │ └── failure.dart │ └── view │ │ └── base_view.dart ├── domain │ ├── use_cases │ │ ├── close_favorite_use_case.dart │ │ ├── remove_favorites_use_case.dart │ │ ├── get_favorites_use_case.dart │ │ ├── stream_favorites_use_case.dart │ │ ├── add_favorite_use_case.dart │ │ └── get_volumes_use_case.dart │ ├── repositories │ │ ├── local │ │ │ └── favorites_repository.dart │ │ └── remote │ │ │ └── volumes_repository.dart │ └── entities │ │ ├── volume_request_entity.dart │ │ └── volume_response_entity.dart ├── presentation │ ├── theme │ │ └── theme_data.dart │ ├── widgets │ │ ├── flavor_banner.dart │ │ ├── custom_app_bar.dart │ │ └── custom_scaffold.dart │ └── views │ │ ├── favorites │ │ ├── widget │ │ │ └── favorite_builder.dart │ │ ├── cubit │ │ │ ├── favorites_state.dart │ │ │ └── favorites_cubit.dart │ │ └── favorites_view.dart │ │ └── search │ │ ├── cubit │ │ ├── search_state.dart │ │ └── search_cubit.dart │ │ ├── search_view.dart │ │ └── widget │ │ ├── volume_builder.dart │ │ └── search.dart ├── routers │ ├── app_router.dart │ └── app_router.gr.dart ├── inject.dart ├── data │ ├── data_sources │ │ ├── remote │ │ │ ├── volumes_data_source.dart │ │ │ └── volumes_data_source.g.dart │ │ └── local │ │ │ └── favorites_data_source.dart │ ├── models │ │ └── volume_request_model.dart │ └── repositories │ │ ├── remote │ │ └── volumes_repository_impl.dart │ │ └── local │ │ └── favorites_repository_impl.dart ├── bootstrap.dart └── main.dart ├── .vscode ├── extensions.json └── launch.json ├── .idea └── runConfigurations │ ├── staging.xml │ ├── production.xml │ └── development.xml ├── .github └── PULL_REQUEST_TEMPLATE.md ├── analysis_options.yaml ├── assets └── translations │ └── en-US.json ├── LICENSE ├── pubspec.yaml ├── .metadata ├── README.md └── .gitignore /test/helpers/helpers.dart: -------------------------------------------------------------------------------- 1 | export 'pump_app.dart'; 2 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /makefile: -------------------------------------------------------------------------------- 1 | gen: 2 | flutter pub run build_runner build --delete-conflicting-outputs -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/web/favicon.png -------------------------------------------------------------------------------- /web/icons/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/web/icons/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/web/icons/Icon-512.png -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /lib/core/cubit/base_state.dart: -------------------------------------------------------------------------------- 1 | part of 'base_cubit.dart'; 2 | 3 | abstract base class BaseState extends Equatable { 4 | const BaseState(); 5 | } 6 | -------------------------------------------------------------------------------- /android/app/src/main/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/main/ic_launcher-playstore.png -------------------------------------------------------------------------------- /android/app/src/staging/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/staging/ic_launcher-playstore.png -------------------------------------------------------------------------------- /android/app/src/development/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/development/ic_launcher-playstore.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/100.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/128.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/144.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/152.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/16.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/167.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/167.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/172.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/172.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/196.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/196.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/20.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/216.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/216.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/256.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/32.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/48.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/50.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/512.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/55.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/55.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/64.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/72.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/76.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/88.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/88.png -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/staging/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/staging/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/staging/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/staging/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/staging/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/staging/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/16.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/20.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/29.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/32.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/40.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/48.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/50.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/55.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/55.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/57.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/58.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/60.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/64.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/72.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/76.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/80.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/87.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/88.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/88.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/16.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/20.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/29.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/32.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/40.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/48.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/50.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/55.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/55.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/57.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/58.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/60.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/64.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/72.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/76.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/80.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/87.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/88.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/88.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/32 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/32 1.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/512.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/64.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/staging/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/staging/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/staging/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/staging/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/100.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/1024.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/114.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/120.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/128.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/144.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/152.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/167.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/167.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/172.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/172.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/180.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/196.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/196.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/216.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/216.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/256.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/512.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/100.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/1024.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/114.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/120.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/128.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/144.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/152.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/167.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/167.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/172.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/172.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/180.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/196.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/196.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/216.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/216.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/256.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/512.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon-dev.appiconset/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon-dev.appiconset/16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon-dev.appiconset/32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon-dev.appiconset/32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon-dev.appiconset/64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon-dev.appiconset/64.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon-stg.appiconset/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon-stg.appiconset/16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon-stg.appiconset/32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon-stg.appiconset/32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon-stg.appiconset/64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon-stg.appiconset/64.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/256 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/256 1.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/512 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/512 1.png -------------------------------------------------------------------------------- /android/app/src/development/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/development/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/development/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/development/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/development/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/development/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/development/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/development/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/staging/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/staging/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/staging/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/staging/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon-dev.appiconset/1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon-dev.appiconset/1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon-dev.appiconset/128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon-dev.appiconset/128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon-dev.appiconset/256 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon-dev.appiconset/256 1.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon-dev.appiconset/256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon-dev.appiconset/256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon-dev.appiconset/32 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon-dev.appiconset/32 1.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon-dev.appiconset/512 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon-dev.appiconset/512 1.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon-dev.appiconset/512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon-dev.appiconset/512.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon-stg.appiconset/1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon-stg.appiconset/1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon-stg.appiconset/128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon-stg.appiconset/128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon-stg.appiconset/256 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon-stg.appiconset/256 1.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon-stg.appiconset/256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon-stg.appiconset/256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon-stg.appiconset/32 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon-stg.appiconset/32 1.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon-stg.appiconset/512 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon-stg.appiconset/512 1.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon-stg.appiconset/512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/AppIcon-stg.appiconset/512.png -------------------------------------------------------------------------------- /android/app/src/development/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/development/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | -------------------------------------------------------------------------------- /android/app/src/staging/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/staging/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/staging/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/staging/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/staging/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | -------------------------------------------------------------------------------- /android/app/src/development/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/development/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/development/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/development/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/development/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/development/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/development/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | -------------------------------------------------------------------------------- /android/app/src/staging/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/staging/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /android/app/src/development/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/development/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/development/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/android/app/src/development/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@1x.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yakupemeksiz/my_favorite_books/HEAD/macos/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/emeksiz/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.emeksiz.my_favorite_books 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /lib/core/constants/hive_type_constants.dart: -------------------------------------------------------------------------------- 1 | abstract final class HiveTypeConstants { 2 | static const int volumeItemModel = 1; 3 | static const int imageLinksModel = 2; 4 | static const int volumeInfoModel = 3; 5 | } 6 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /lib/core/constants/flavor_constants.dart: -------------------------------------------------------------------------------- 1 | mixin FlavorConstants { 2 | static const String envKey = 'APP_ENV'; 3 | 4 | static const String dev = 'dev'; 5 | static const String stage = 'stage'; 6 | static const String prod = 'prod'; 7 | } 8 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | 10 | void RegisterPlugins(flutter::PluginRegistry* registry) { 11 | } 12 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "dart-code.dart-code", 6 | "dart-code.flutter", 7 | "felixangelov.bloc" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test/helpers/json_reader.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | String readJson(String name) { 4 | var dir = Directory.current.path; 5 | if (dir.endsWith('/test')) { 6 | dir = dir.replaceAll('/test', ''); 7 | } 8 | return File('$dir/test/$name').readAsStringSync(); 9 | } 10 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip 7 | -------------------------------------------------------------------------------- /macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /local.properties 5 | GeneratedPluginRegistrant.java 6 | 7 | # Remember to never publicly share your keystore. 8 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 9 | key.properties 10 | **/*.keystore 11 | **/*.jks 12 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /test/helpers/pump_app.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | 4 | extension PumpApp on WidgetTester { 5 | Future pumpApp(Widget widget) { 6 | return pumpWidget( 7 | MaterialApp( 8 | home: widget, 9 | ), 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /android/app/src/development/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/staging/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/staging/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/development/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /ios/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /macos/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import FlutterMacOS 2 | import Cocoa 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /.idea/runConfigurations/staging.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | 3 | 4 | 5 | ## Type of Change 6 | 7 | 8 | 9 | - [ ] ✨ New feature (non-breaking change which adds functionality) 10 | - [ ] 🛠️ Bug fix (non-breaking change which fixes an issue) 11 | - [ ] 🧹 Code refactor 12 | - [ ] ✅ All existing and new tests are passing. 13 | - [ ] 📝 Documentation 14 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /lib/core/constants/environment_constants.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_dotenv/flutter_dotenv.dart'; 2 | 3 | /// Environment constants for the app to use. 4 | mixin EnvironmentConstants { 5 | /// The API key for the google books API. 6 | static String get apiKey { 7 | final key = dotenv.env['API_KEY']; 8 | 9 | if (key == null) { 10 | throw Exception('API_KEY is not defined in .env'); 11 | } 12 | 13 | return key; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/domain/use_cases/close_favorite_use_case.dart: -------------------------------------------------------------------------------- 1 | import 'package:injectable/injectable.dart'; 2 | import 'package:my_favorite_books/domain/repositories/local/favorites_repository.dart'; 3 | 4 | @injectable 5 | final class CloseFavoriteUseCase { 6 | final FavoritesRepository _favoritesRepository; 7 | 8 | const CloseFavoriteUseCase(this._favoritesRepository); 9 | 10 | Future call() { 11 | return _favoritesRepository.close(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/core/constants/color_constants.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | abstract final class ColorConstants { 4 | static const Color scaffoldBackgroundColor = Color(0xFF1A252C); 5 | static const Color textColor = Colors.white; 6 | static const Color iconColor = Colors.white; 7 | static const Color errorColor = Colors.redAccent; 8 | static const Color borderColor = Colors.blue; 9 | static const Color borderFavoriteColor = Colors.red; 10 | } 11 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/domain/use_cases/remove_favorites_use_case.dart: -------------------------------------------------------------------------------- 1 | import 'package:injectable/injectable.dart'; 2 | import 'package:my_favorite_books/domain/repositories/local/favorites_repository.dart'; 3 | 4 | @injectable 5 | final class RemoveFavoriteUseCase { 6 | final FavoritesRepository _favoritesRepository; 7 | 8 | const RemoveFavoriteUseCase(this._favoritesRepository); 9 | 10 | Future call(String key) { 11 | return _favoritesRepository.removeFavorite(key); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/domain/repositories/local/favorites_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:my_favorite_books/domain/entities/volume_response_entity.dart'; 2 | 3 | abstract interface class FavoritesRepository { 4 | Future addToFavorites({ 5 | required String key, 6 | required VolumeItemEntity item, 7 | }); 8 | List getFavorites(); 9 | Future removeFavorite(String key); 10 | Stream> watchFavorites(); 11 | Future close(); 12 | } 13 | -------------------------------------------------------------------------------- /.idea/runConfigurations/production.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | -------------------------------------------------------------------------------- /.idea/runConfigurations/development.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | -------------------------------------------------------------------------------- /windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | // 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /lib/core/utils/extensions/widget_extensions.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | 4 | extension WidgetExtension on Widget { 5 | /// Adds horizontal padding of 16 to the widget 6 | /// 7 | /// ```dart 8 | /// Text('Hello World').symmetricHDefaultPadding 9 | /// ``` 10 | Widget get symmetricHDefaultPadding => Padding( 11 | padding: EdgeInsets.symmetric(horizontal: 16.w), 12 | child: this, 13 | ); 14 | } 15 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "LaunchImage@1x.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "LaunchImage@2x.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "LaunchImage@3x.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "LaunchImage@1x.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "LaunchImage@2x.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "LaunchImage@3x.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/domain/use_cases/get_favorites_use_case.dart: -------------------------------------------------------------------------------- 1 | import 'package:injectable/injectable.dart'; 2 | import 'package:my_favorite_books/domain/entities/volume_response_entity.dart'; 3 | import 'package:my_favorite_books/domain/repositories/local/favorites_repository.dart'; 4 | 5 | @injectable 6 | final class GetFavoritesUseCase { 7 | final FavoritesRepository _favoritesRepository; 8 | 9 | const GetFavoritesUseCase(this._favoritesRepository); 10 | 11 | List call() { 12 | return _favoritesRepository.getFavorites(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/core/cubit/base_cubit.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_bloc/flutter_bloc.dart'; 4 | 5 | part 'base_state.dart'; 6 | 7 | abstract base class BaseCubit extends Cubit 8 | implements StateStreamableSource { 9 | BaseCubit(super.initialState) { 10 | onBindingCreated(); 11 | } 12 | 13 | void safeEmit(S state) { 14 | if (!isClosed) { 15 | emit(state); 16 | } 17 | } 18 | 19 | @mustCallSuper 20 | void onBindingCreated() {} 21 | } 22 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:very_good_analysis/analysis_options.5.1.0.yaml 2 | linter: 3 | rules: 4 | sort_constructors_first: false 5 | public_member_api_docs: false 6 | sort_pub_dependencies: false 7 | avoid_positional_boolean_parameters: false 8 | avoid_dynamic_calls: false 9 | one_member_abstracts: false 10 | library_private_types_in_public_api: false 11 | unnecessary_lambdas: false 12 | 13 | analyzer: 14 | exclude: 15 | - lib/inject.config.dart 16 | - '**.g.dart' 17 | 18 | language: 19 | strict-casts: false 20 | -------------------------------------------------------------------------------- /lib/domain/use_cases/stream_favorites_use_case.dart: -------------------------------------------------------------------------------- 1 | import 'package:injectable/injectable.dart'; 2 | import 'package:my_favorite_books/domain/entities/volume_response_entity.dart'; 3 | import 'package:my_favorite_books/domain/repositories/local/favorites_repository.dart'; 4 | 5 | @injectable 6 | final class StreamFavoritesUseCase { 7 | final FavoritesRepository _favoritesRepository; 8 | 9 | const StreamFavoritesUseCase(this._favoritesRepository); 10 | 11 | Stream> call() { 12 | return _favoritesRepository.watchFavorites(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/domain/repositories/remote/volumes_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:my_favorite_books/core/config/types.dart'; 3 | import 'package:my_favorite_books/domain/entities/volume_request_entity.dart'; 4 | import 'package:my_favorite_books/domain/entities/volume_response_entity.dart'; 5 | 6 | /// This class is a repository for volumes in the remote data source 7 | abstract interface class VolumesRepository { 8 | RemoteFetchResult getVolumes( 9 | CancelToken token, { 10 | required VolumesRequestEntity request, 11 | }); 12 | } 13 | -------------------------------------------------------------------------------- /lib/domain/use_cases/add_favorite_use_case.dart: -------------------------------------------------------------------------------- 1 | import 'package:injectable/injectable.dart'; 2 | import 'package:my_favorite_books/domain/entities/volume_response_entity.dart'; 3 | import 'package:my_favorite_books/domain/repositories/local/favorites_repository.dart'; 4 | 5 | @injectable 6 | final class AddFavoriteUseCase { 7 | final FavoritesRepository _favoritesRepository; 8 | 9 | const AddFavoriteUseCase(this._favoritesRepository); 10 | 11 | Future call(String key, VolumeItemEntity item) { 12 | return _favoritesRepository.addToFavorites(key: key, item: item); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/core/config/localization_config.dart: -------------------------------------------------------------------------------- 1 | import 'package:easy_localization/easy_localization.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | final class LocalizationConfig { 5 | LocalizationConfig._(); 6 | 7 | static List get _supportedLocales => const [ 8 | Locale('en', 'US'), 9 | ]; 10 | 11 | static String get _path => 'assets/translations'; 12 | 13 | static Widget runAppWithEasyWidget(Widget myApp) { 14 | return EasyLocalization( 15 | supportedLocales: _supportedLocales, 16 | path: _path, 17 | child: myApp, 18 | ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import path_provider_foundation 9 | import shared_preferences_foundation 10 | import sqflite 11 | 12 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 13 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) 14 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) 15 | SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) 16 | } 17 | -------------------------------------------------------------------------------- /assets/translations/en-US.json: -------------------------------------------------------------------------------- 1 | { 2 | "appTitle": "My Favorite Books", 3 | "searchText": "Search", 4 | "searchPlaceholder": "Book name, author, or genre...", 5 | "authors": "Authors: {}", 6 | "publisher": "Publisher: {}", 7 | "pages": "Pages: {}", 8 | "publishedAt": "Published at: {}", 9 | "noBooksFound": "No books found", 10 | "pleaseEnterSearchText": "Please enter search text", 11 | "enteredLengthShouldBeAtLeast": "Entered length should be at least 500", 12 | "favoriteTitle": "Favorite", 13 | "unknownText": "Unknown", 14 | "somethingWentWrong": "Something went wrong", 15 | "noFavoriteBooksYet": "No favorite books yet" 16 | } 17 | -------------------------------------------------------------------------------- /test/data/models/volume_request_model_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | 4 | import '../../helpers/test_helper.dart'; 5 | 6 | void main() { 7 | test('should be a subclass of Equatable', () { 8 | expect(dummyVolumeResponseModel, isA()); 9 | }); 10 | 11 | test('should return a json map containing proper data', () { 12 | final result = volumesRequestModel.toJson(); 13 | 14 | final expected = { 15 | 'q': 'harry potter', 16 | 'maxResults': 10, 17 | 'startIndex': 0, 18 | }; 19 | 20 | expect(result, expected); 21 | }); 22 | } 23 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | add_executable(${BINARY_NAME} WIN32 5 | "flutter_window.cpp" 6 | "main.cpp" 7 | "utils.cpp" 8 | "win32_window.cpp" 9 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 10 | "Runner.rc" 11 | "runner.exe.manifest" 12 | ) 13 | apply_standard_settings(${BINARY_NAME}) 14 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 15 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 16 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 17 | add_dependencies(${BINARY_NAME} flutter_assemble) 18 | -------------------------------------------------------------------------------- /lib/presentation/theme/theme_data.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | import 'package:my_favorite_books/core/constants/color_constants.dart'; 4 | 5 | class AppThemeData { 6 | static final ThemeData appTheme = ThemeData.dark( 7 | useMaterial3: false, 8 | ).copyWith( 9 | scaffoldBackgroundColor: ColorConstants.scaffoldBackgroundColor, 10 | brightness: Brightness.dark, 11 | textTheme: TextTheme( 12 | headlineMedium: TextStyle( 13 | color: ColorConstants.textColor, 14 | fontWeight: FontWeight.bold, 15 | fontSize: 30.sp, 16 | ), 17 | ), 18 | ); 19 | } 20 | -------------------------------------------------------------------------------- /macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = my_app 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.myApp 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2023 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /lib/routers/app_router.dart: -------------------------------------------------------------------------------- 1 | import 'package:auto_route/auto_route.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:my_favorite_books/presentation/views/favorites/favorites_view.dart'; 4 | import 'package:my_favorite_books/presentation/views/search/search_view.dart'; 5 | 6 | part 'app_router.gr.dart'; 7 | 8 | @AutoRouterConfig(replaceInRouteName: 'View,Route') 9 | class AppRouter extends _$AppRouter { 10 | @override 11 | List get routes => [ 12 | AutoRoute( 13 | page: SearchRoute.page, 14 | initial: true, 15 | ), 16 | AutoRoute( 17 | page: FavoritesRoute.page, 18 | ), 19 | ]; 20 | } 21 | -------------------------------------------------------------------------------- /lib/inject.dart: -------------------------------------------------------------------------------- 1 | import 'package:get_it/get_it.dart'; 2 | import 'package:injectable/injectable.dart'; 3 | import 'package:my_favorite_books/core/api/dio_client.dart'; 4 | import 'package:my_favorite_books/core/config/flavor_config.dart'; 5 | import 'package:my_favorite_books/data/data_sources/remote/volumes_data_source.dart'; 6 | import 'package:my_favorite_books/inject.config.dart'; 7 | 8 | final getIt = GetIt.instance; 9 | 10 | @InjectableInit() 11 | void configureDependencies() { 12 | getIt.init(environment: FlavorConfig.currentFlavor); 13 | } 14 | 15 | @module 16 | abstract class RegisterModule { 17 | final VolumesDataSource volumesDataSource = VolumesDataSource(DioClient.dio); 18 | } 19 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "My Favorite Books", 3 | "short_name": "My Favorite Books", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "My Favotire Books", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /test/data/models/volume_response_model_test.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:equatable/equatable.dart'; 4 | import 'package:flutter_test/flutter_test.dart'; 5 | import 'package:my_favorite_books/data/models/volume_response_model.dart'; 6 | 7 | import '../../helpers/test_helper.dart'; 8 | 9 | void main() { 10 | test('should be a subclass of Equatable', () { 11 | expect(dummyVolumeResponseModel, isA()); 12 | }); 13 | 14 | test('should return a valid model', () { 15 | final Map jsonMap = jsonDecode(jsonVolumesData); 16 | final result = VolumeResponseModel.fromJson(jsonMap); 17 | expect(result, equals(dummyVolumeResponseModel)); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /lib/core/config/types.dart: -------------------------------------------------------------------------------- 1 | import 'package:either_dart/either.dart'; 2 | import 'package:my_favorite_books/core/error/failure.dart'; 3 | import 'package:my_favorite_books/domain/entities/volume_response_entity.dart'; 4 | 5 | /// A type definition for a remote fetch result. 6 | /// It is a [Future] of [Either] of [Failure] and [T]. 7 | /// [T] is a generic type that extends [Object]. 8 | /// [T] is the type of the result of the remote fetch operation. 9 | /// [Failure] is the type of the error that can occur during the remote fetch 10 | /// operation. 11 | 12 | typedef RemoteFetchResult = Future>; 13 | 14 | typedef OnVolumePressed = void Function(VolumeItemEntity volumeItemEntity); 15 | -------------------------------------------------------------------------------- /lib/data/data_sources/remote/volumes_data_source.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:my_favorite_books/data/models/volume_request_model.dart'; 3 | import 'package:my_favorite_books/data/models/volume_response_model.dart'; 4 | import 'package:retrofit/retrofit.dart'; 5 | 6 | part 'volumes_data_source.g.dart'; 7 | 8 | @RestApi() 9 | abstract class VolumesDataSource { 10 | factory VolumesDataSource(Dio dio, {String baseUrl}) = _VolumesDataSource; 11 | 12 | static const String _endpoint = '/volumes'; 13 | 14 | @GET(_endpoint) 15 | Future getVolumes( 16 | @CancelRequest() CancelToken cancelToken, { 17 | @Queries() required VolumesRequestModel request, 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.7.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.3.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | tasks.register("clean", Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /lib/presentation/widgets/flavor_banner.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:my_favorite_books/core/config/flavor_config.dart'; 3 | 4 | final class FlavorBanner extends StatelessWidget { 5 | const FlavorBanner({ 6 | required this.child, 7 | required this.message, 8 | super.key, 9 | }); 10 | final Widget child; 11 | final String message; 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return Directionality( 16 | textDirection: TextDirection.ltr, 17 | child: FlavorConfig.isProd 18 | ? child 19 | : Banner( 20 | message: message, 21 | location: BannerLocation.topStart, 22 | color: FlavorConfig.isStage ? Colors.red : Colors.green, 23 | child: child, 24 | ), 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/presentation/widgets/custom_app_bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:my_favorite_books/core/utils/extensions/context_extensions.dart'; 3 | 4 | final class CustomAppBar extends StatelessWidget { 5 | final String title; 6 | final Widget? leading; 7 | final Widget? trailing; 8 | 9 | const CustomAppBar({ 10 | required this.title, 11 | this.trailing, 12 | this.leading, 13 | super.key, 14 | }); 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | return Row( 19 | children: [ 20 | if (leading != null) leading!, 21 | Expanded( 22 | child: Text( 23 | title, 24 | style: context.textTheme.headlineMedium, 25 | ), 26 | ), 27 | if (trailing != null) trailing!, 28 | ], 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 9 | ) 10 | 11 | set(PLUGIN_BUNDLED_LIBRARIES) 12 | 13 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 18 | endforeach(plugin) 19 | 20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 23 | endforeach(ffi_plugin) 24 | -------------------------------------------------------------------------------- /lib/domain/entities/volume_request_entity.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:my_favorite_books/data/models/volume_request_model.dart'; 3 | 4 | base class VolumesRequestEntity extends Equatable { 5 | /// Term to search 6 | final String query; 7 | 8 | /// Index of the first result to return (starts at 0) 9 | final int startIndex; 10 | 11 | /// Maximum number of results to return (max 40) 12 | final int maxResults; 13 | 14 | const VolumesRequestEntity({ 15 | required this.query, 16 | this.startIndex = 0, 17 | this.maxResults = 10, 18 | }); 19 | 20 | @override 21 | List get props => [query, startIndex, maxResults]; 22 | 23 | VolumesRequestModel toModel() { 24 | return VolumesRequestModel( 25 | query: query, 26 | startIndex: startIndex, 27 | maxResults: maxResults, 28 | ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/core/widget/base_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_bloc/flutter_bloc.dart'; 3 | import 'package:my_favorite_books/core/cubit/base_cubit.dart'; 4 | 5 | abstract base class BaseWidget, S extends BaseState> 6 | extends StatefulWidget { 7 | const BaseWidget({super.key}); 8 | 9 | Widget build(BuildContext context, C cubit, S state); 10 | 11 | @override 12 | State createState() => _BaseWidgetState(); 13 | } 14 | 15 | final class _BaseWidgetState, S extends BaseState> 16 | extends State { 17 | @override 18 | Widget build(BuildContext context) { 19 | final cubit = context.read(); 20 | return BlocBuilder( 21 | builder: (context, state) { 22 | return widget.build(context, cubit, state); 23 | }, 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/domain/use_cases/get_volumes_use_case.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:injectable/injectable.dart'; 3 | import 'package:my_favorite_books/core/config/types.dart'; 4 | import 'package:my_favorite_books/domain/entities/volume_request_entity.dart'; 5 | import 'package:my_favorite_books/domain/entities/volume_response_entity.dart'; 6 | import 'package:my_favorite_books/domain/repositories/remote/volumes_repository.dart'; 7 | 8 | @injectable 9 | final class GetVolumesUseCase { 10 | final VolumesRepository _volumesRepository; 11 | 12 | const GetVolumesUseCase(this._volumesRepository); 13 | 14 | RemoteFetchResult call({ 15 | required VolumesRequestEntity request, 16 | required CancelToken cancelToken, 17 | }) { 18 | return _volumesRepository.getVolumes( 19 | cancelToken, 20 | request: request, 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/data/models/volume_request_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:my_favorite_books/domain/entities/volume_request_entity.dart'; 2 | 3 | /// This class is a model for the request of volumes 4 | final class VolumesRequestModel extends VolumesRequestEntity { 5 | const VolumesRequestModel({ 6 | /// Term to search 7 | required super.query, 8 | 9 | /// Index of the first result to return (starts at 0) 10 | /// Default: 0 11 | super.startIndex, 12 | 13 | /// Maximum number of results to return (max 40) 14 | /// Default: 10 15 | super.maxResults, 16 | }) : assert(maxResults <= 40, 'maxResults must be less than or equal to 40'), 17 | assert(maxResults > 0, 'maxResults must be greater than 0'); 18 | 19 | Map toJson() { 20 | return { 21 | 'q': super.query, 22 | 'startIndex': super.startIndex, 23 | 'maxResults': super.maxResults, 24 | }; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 12.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /lib/core/utils/extensions/context_extensions.dart: -------------------------------------------------------------------------------- 1 | import 'package:flash/flash.dart'; 2 | import 'package:flash/flash_helper.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | extension ContextExtension on BuildContext { 6 | double get width => MediaQuery.sizeOf(this).width; 7 | double get height => MediaQuery.sizeOf(this).height; 8 | double get defaultPadding => 16; 9 | double get bottomPadding => MediaQuery.paddingOf(this).bottom; 10 | double get topPadding => MediaQuery.paddingOf(this).top; 11 | double get bottomOrDefaultPadding => 12 | bottomPadding > 0 ? bottomPadding : defaultPadding; 13 | 14 | // textTheme 15 | TextTheme get textTheme => Theme.of(this).textTheme; 16 | 17 | /// Show a flash bar at the top of the screen 18 | Future showTopError({ 19 | required String title, 20 | }) async { 21 | return showErrorBar( 22 | position: FlashPosition.top, 23 | content: Text(title), 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /lib/core/api/dio_client.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:dio/dio.dart'; 4 | import 'package:fancy_dio_inspector/fancy_dio_inspector.dart'; 5 | import 'package:my_favorite_books/core/constants/environment_constants.dart'; 6 | 7 | mixin DioClient { 8 | static final Dio dio = _init(); 9 | 10 | static final BaseOptions _baseOptions = BaseOptions( 11 | queryParameters: { 12 | 'key': EnvironmentConstants.apiKey, 13 | }, 14 | baseUrl: 'https://www.googleapis.com/books/v1/', 15 | headers: { 16 | HttpHeaders.acceptHeader: 'application/json', 17 | }, 18 | ); 19 | 20 | static Dio _init() { 21 | final dio = Dio(_baseOptions); 22 | dio.interceptors.add( 23 | FancyDioInterceptor( 24 | options: const FancyDioInspectorOptions( 25 | consoleOptions: FancyDioInspectorConsoleOptions( 26 | verbose: true, 27 | ), 28 | ), 29 | ), 30 | ); 31 | 32 | return dio; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/data/data_sources/local/favorites_data_source.dart: -------------------------------------------------------------------------------- 1 | import 'package:injectable/injectable.dart'; 2 | import 'package:my_favorite_books/core/api/hive_client.dart'; 3 | import 'package:my_favorite_books/core/constants/hive_type_constants.dart'; 4 | import 'package:my_favorite_books/data/models/volume_response_model.dart'; 5 | 6 | @singleton 7 | final class FavoritesDataSource extends HiveClient { 8 | FavoritesDataSource() : super('favorite_volumes'); 9 | 10 | @override 11 | void registerAdapters() { 12 | if (!isAdapterRegistered(HiveTypeConstants.volumeItemModel)) { 13 | registerAdapter(VolumeItemModelAdapter()); 14 | } 15 | if (!isAdapterRegistered(HiveTypeConstants.volumeInfoModel)) { 16 | registerAdapter(VolumeInfoModelAdapter()); 17 | } 18 | if (!isAdapterRegistered(HiveTypeConstants.imageLinksModel)) { 19 | registerAdapter(ImageLinksModelAdapter()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /lib/core/utils/observers/bloc_observer.dart: -------------------------------------------------------------------------------- 1 | import 'dart:developer'; 2 | 3 | import 'package:bloc/bloc.dart'; 4 | 5 | final class AppBlocObserver extends BlocObserver { 6 | const AppBlocObserver(); 7 | @override 8 | void onCreate(BlocBase bloc) { 9 | _log('onCreate(${bloc.runtimeType})'); 10 | super.onCreate(bloc); 11 | } 12 | 13 | @override 14 | void onChange(BlocBase bloc, Change change) { 15 | super.onChange(bloc, change); 16 | _log('onChange(${bloc.runtimeType}, $change)'); 17 | } 18 | 19 | @override 20 | void onError(BlocBase bloc, Object error, StackTrace stackTrace) { 21 | _log( 22 | 'onError(${bloc.runtimeType}, $error, $stackTrace)', 23 | ); 24 | super.onError(bloc, error, stackTrace); 25 | } 26 | 27 | @override 28 | void onClose(BlocBase bloc) { 29 | _log('onClose(${bloc.runtimeType})'); 30 | super.onClose(bloc); 31 | } 32 | 33 | /// Log the message with the bloc observer name as the logger. 34 | void _log(String message) { 35 | log(message, name: 'BlocObserver'); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/core/config/flavor_config.dart: -------------------------------------------------------------------------------- 1 | import 'dart:developer'; 2 | 3 | import 'package:my_favorite_books/core/constants/flavor_constants.dart'; 4 | 5 | /// This class is a configuration for the flavor of the app (dev, stage, prod) 6 | final class FlavorConfig { 7 | FlavorConfig() { 8 | if (!_flavors.contains(_currentFlavor)) { 9 | final errorMessage = 10 | 'Unknown flavor! (${FlavorConstants.envKey}: $_currentFlavor)'; 11 | 12 | log(errorMessage); 13 | throw Exception(errorMessage); 14 | } 15 | 16 | log('Current flavor: $_currentFlavor'); 17 | } 18 | final List _flavors = [ 19 | FlavorConstants.dev, 20 | FlavorConstants.stage, 21 | FlavorConstants.prod, 22 | ]; 23 | 24 | static String get _currentFlavor => 25 | const String.fromEnvironment(FlavorConstants.envKey); 26 | static String get currentFlavor => _currentFlavor; 27 | 28 | static bool get isProd => _currentFlavor == FlavorConstants.prod; 29 | static bool get isDev => _currentFlavor == FlavorConstants.dev; 30 | static bool get isStage => _currentFlavor == FlavorConstants.stage; 31 | } 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Yakup Emeksiz 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /lib/presentation/widgets/custom_scaffold.dart: -------------------------------------------------------------------------------- 1 | import 'package:fancy_dio_inspector/fancy_dio_inspector.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:my_favorite_books/core/config/flavor_config.dart'; 4 | import 'package:my_favorite_books/core/utils/extensions/context_extensions.dart'; 5 | 6 | final class CustomScaffold extends StatelessWidget { 7 | final Widget body; 8 | 9 | const CustomScaffold({ 10 | required this.body, 11 | super.key, 12 | }); 13 | 14 | void _onTap(BuildContext context) { 15 | final focusScope = FocusScope.of(context); 16 | 17 | if (focusScope.hasFocus) { 18 | focusScope.unfocus(); 19 | } 20 | } 21 | 22 | @override 23 | Widget build(BuildContext context) { 24 | return GestureDetector( 25 | behavior: HitTestBehavior.translucent, 26 | onTap: () => _onTap(context), 27 | child: Scaffold( 28 | body: body, 29 | endDrawer: !FlavorConfig.isProd 30 | ? SizedBox( 31 | width: context.width * 0.8, 32 | child: const FancyDioInspectorView(), 33 | ) 34 | : null, 35 | ), 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: my_favorite_books 2 | description: My Favorite Books 3 | version: 1.0.0+1 4 | publish_to: none 5 | 6 | environment: 7 | sdk: '>=3.1.0 <4.0.0' 8 | 9 | dependencies: 10 | auto_route: ^7.8.4 11 | bloc: ^8.1.2 12 | cached_network_image: ^3.3.1 13 | dio: ^5.4.0 14 | easy_localization: ^3.0.4 15 | either_dart: ^1.0.0 16 | equatable: ^2.0.5 17 | fancy_dio_inspector: ^1.6.1 18 | flash: ^3.1.0 19 | flutter: 20 | sdk: flutter 21 | flutter_bloc: ^8.1.3 22 | flutter_dotenv: ^5.1.0 23 | flutter_localizations: 24 | sdk: flutter 25 | flutter_screenutil: ^5.9.0 26 | gap: ^3.0.1 27 | get_it: ^7.6.7 28 | hive_flutter: ^1.1.0 29 | injectable: ^2.3.2 30 | retrofit: ^4.1.0 31 | 32 | dev_dependencies: 33 | bloc_test: ^9.1.4 34 | flutter_test: 35 | sdk: flutter 36 | retrofit_generator: ^8.1.0 37 | very_good_analysis: ^5.1.0 38 | injectable_generator: ^2.4.1 39 | auto_route_generator: ^7.3.2 40 | hive_generator: ^2.0.1 41 | build_runner: ^2.4.8 42 | mockito: ^5.4.4 43 | mock_web_server: ^5.0.0-nullsafety.1 44 | 45 | flutter: 46 | uses-material-design: true 47 | 48 | assets: 49 | - .env 50 | - assets/translations/ 51 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: "d211f42860350d914a5ad8102f9ec32764dc6d06" 8 | channel: "stable" 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a 17 | base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a 18 | - platform: macos 19 | create_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 20 | base_revision: d211f42860350d914a5ad8102f9ec32764dc6d06 21 | - platform: ios 22 | create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a 23 | base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a 24 | 25 | # User provided section 26 | 27 | # List of Local paths (relative to this file) that should be 28 | # ignored by the migrate tool. 29 | # 30 | # Files that are not part of the templates will be ignored by default. 31 | unmanaged_files: 32 | - 'lib/main.dart' 33 | - 'ios/Runner.xcodeproj/project.pbxproj' 34 | -------------------------------------------------------------------------------- /macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleName 12 | $(FLAVOR_APP_NAME) 13 | CFBundleDisplayName 14 | $(FLAVOR_APP_NAME) 15 | CFBundleIdentifier 16 | $(PRODUCT_BUNDLE_IDENTIFIER) 17 | CFBundleInfoDictionaryVersion 18 | 6.0 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | $(FLUTTER_BUILD_NAME) 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSHumanReadableCopyright 28 | $(PRODUCT_COPYRIGHT) 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /test/helpers/test_helper.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:mockito/annotations.dart'; 4 | import 'package:my_favorite_books/data/data_sources/remote/volumes_data_source.dart'; 5 | import 'package:my_favorite_books/data/models/volume_request_model.dart'; 6 | import 'package:my_favorite_books/data/models/volume_response_model.dart'; 7 | import 'package:my_favorite_books/domain/entities/volume_response_entity.dart'; 8 | import 'package:my_favorite_books/domain/repositories/remote/volumes_repository.dart'; 9 | 10 | import 'json_reader.dart'; 11 | 12 | @GenerateMocks([VolumesDataSource, VolumesRepository]) 13 | void main() {} 14 | 15 | const dummyDataPath = 'helpers/dummy_data/dummy_data_volumes.json'; 16 | 17 | /// Get the dummy VolumesRequestModel 18 | const volumesRequestModel = VolumesRequestModel(query: 'harry potter'); 19 | 20 | /// Get the dummy data from the json file 21 | String get jsonVolumesData => readJson(dummyDataPath); 22 | 23 | /// Get the dummy VolumeResponseModel 24 | VolumeResponseModel get dummyVolumeResponseModel => 25 | VolumeResponseModel.fromJson( 26 | jsonDecode(readJson(dummyDataPath)), 27 | ); 28 | 29 | /// Get the dummy VolumeResponseEntity 30 | VolumeResponseEntity get dummyVolumeResponseEntity => 31 | dummyVolumeResponseModel.toEntity(); 32 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Launch development", 9 | "request": "launch", 10 | "type": "dart", 11 | "program": "lib/main.dart", 12 | "args": [ 13 | "--flavor", 14 | "development", 15 | "--target", 16 | "lib/main.dart", 17 | "--dart-define", 18 | "APP_ENV=dev" 19 | ] 20 | }, 21 | { 22 | "name": "Launch staging", 23 | "request": "launch", 24 | "type": "dart", 25 | "program": "lib/main.dart", 26 | "args": [ 27 | "--flavor", 28 | "staging", 29 | "--target", 30 | "lib/main.dart", 31 | "--dart-define", 32 | "APP_ENV=stage" 33 | ] 34 | }, 35 | { 36 | "name": "Launch production", 37 | "request": "launch", 38 | "type": "dart", 39 | "program": "lib/main.dart", 40 | "args": [ 41 | "--flavor", 42 | "production", 43 | "--target", 44 | "lib/main.dart", 45 | "--dart-define", 46 | "APP_ENV=prod" 47 | ] 48 | } 49 | ] 50 | } 51 | -------------------------------------------------------------------------------- /lib/core/utils/mixins/network_handler_mixin.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:dio/dio.dart'; 4 | import 'package:either_dart/either.dart'; 5 | import 'package:my_favorite_books/core/error/failure.dart'; 6 | 7 | /// Network handler mixin to handle network exceptions 8 | mixin NetworkHandlerMixin { 9 | Future> networkHandler( 10 | Future Function() f, 11 | ) async { 12 | try { 13 | return Right(await f()); 14 | } on SocketException { 15 | return const Left(ConnectionFailure('Failed to connect to the network')); 16 | } on DioException catch (e) { 17 | return Left( 18 | switch (e.type) { 19 | DioExceptionType.connectionTimeout || 20 | DioExceptionType.sendTimeout || 21 | DioExceptionType.receiveTimeout => 22 | const TimeoutFailure('Timeout failure'), 23 | DioExceptionType.badCertificate || 24 | DioExceptionType.badResponse || 25 | DioExceptionType.connectionError => 26 | const ConnectionFailure('Connection failure'), 27 | DioExceptionType.cancel => null, 28 | DioExceptionType.unknown => const UnknownFailure('Unknown failure'), 29 | }, 30 | ); 31 | } catch (s) { 32 | return const Left(UnknownFailure('Unknown failure')); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/core/constants/locale_key_constants.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: lines_longer_than_80_chars, comment_references, dangling_library_doc_comments, eol_at_end_of_file 2 | 3 | /// GENERATED CODE - DO NOT MODIFY BY HAND `locale_gen.dart` 4 | 5 | import 'package:easy_localization/easy_localization.dart'; 6 | 7 | abstract class LocaleKeyConstants { 8 | 9 | static final String enteredLengthShouldBeAtLeast = 'enteredLengthShouldBeAtLeast'.tr(); 10 | static String publishedAtWithArgs(List args) => 'publishedAt'.tr(args:args); 11 | static String publisherWithArgs(List args) => 'publisher'.tr(args:args); 12 | static String authorsWithArgs(List args) => 'authors'.tr(args:args); 13 | static final String pleaseEnterSearchText = 'pleaseEnterSearchText'.tr(); 14 | static String pagesWithArgs(List args) => 'pages'.tr(args:args); 15 | static final String somethingWentWrong = 'somethingWentWrong'.tr(); 16 | static final String noFavoriteBooksYet = 'noFavoriteBooksYet'.tr(); 17 | static final String searchPlaceholder = 'searchPlaceholder'.tr(); 18 | static final String favoriteTitle = 'favoriteTitle'.tr(); 19 | static final String noBooksFound = 'noBooksFound'.tr(); 20 | static final String unknownText = 'unknownText'.tr(); 21 | static final String searchText = 'searchText'.tr(); 22 | static final String appTitle = 'appTitle'.tr(); 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /lib/data/repositories/remote/volumes_repository_impl.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:injectable/injectable.dart'; 3 | import 'package:my_favorite_books/core/config/types.dart'; 4 | import 'package:my_favorite_books/core/utils/mixins/network_handler_mixin.dart'; 5 | import 'package:my_favorite_books/data/data_sources/remote/volumes_data_source.dart'; 6 | import 'package:my_favorite_books/domain/entities/volume_request_entity.dart'; 7 | import 'package:my_favorite_books/domain/entities/volume_response_entity.dart'; 8 | import 'package:my_favorite_books/domain/repositories/remote/volumes_repository.dart'; 9 | 10 | /// Volumes repository implementation class 11 | @Injectable(as: VolumesRepository) 12 | class VolumesRepositoryImpl 13 | with NetworkHandlerMixin 14 | implements VolumesRepository { 15 | final VolumesDataSource _volumesDataSource; 16 | 17 | VolumesRepositoryImpl(this._volumesDataSource); 18 | 19 | /// Get volumes from the API 20 | @override 21 | RemoteFetchResult getVolumes( 22 | CancelToken token, { 23 | required VolumesRequestEntity request, 24 | }) async { 25 | return networkHandler( 26 | () async { 27 | final res = await _volumesDataSource.getVolumes( 28 | token, 29 | request: request.toModel(), 30 | ); 31 | return res.toEntity(); 32 | }, 33 | ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "utils.h" 7 | 8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 9 | _In_ wchar_t *command_line, _In_ int show_command) { 10 | // Attach to console when present (e.g., 'flutter run') or create a 11 | // new console when running with a debugger. 12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 13 | CreateAndAttachConsole(); 14 | } 15 | 16 | // Initialize COM, so that it is available for use in the library and/or 17 | // plugins. 18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 19 | 20 | flutter::DartProject project(L"data"); 21 | 22 | std::vector command_line_arguments = 23 | GetCommandLineArguments(); 24 | 25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 26 | 27 | FlutterWindow window(project); 28 | Win32Window::Point origin(10, 10); 29 | Win32Window::Size size(1280, 720); 30 | if (!window.CreateAndShow(L"My Favorite Books", origin, size)) { 31 | return EXIT_FAILURE; 32 | } 33 | window.SetQuitOnClose(true); 34 | 35 | ::MSG msg; 36 | while (::GetMessage(&msg, nullptr, 0, 0)) { 37 | ::TranslateMessage(&msg); 38 | ::DispatchMessage(&msg); 39 | } 40 | 41 | ::CoUninitialize(); 42 | return EXIT_SUCCESS; 43 | } 44 | -------------------------------------------------------------------------------- /lib/core/error/failure.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | 3 | /// Base class for all failures in the app. 4 | abstract base class Failure extends Equatable { 5 | /// The error message of the failure. 6 | final String message; 7 | const Failure(this.message); 8 | 9 | @override 10 | List get props => [message]; 11 | } 12 | 13 | /// A failure that occurs when the server returns an error. 14 | final class ServerFailure extends Failure { 15 | /// Constructs a [ServerFailure] with the specified error [message]. 16 | const ServerFailure(super.message); 17 | } 18 | 19 | /// A failure that occurs when the device has no internet. 20 | final class ConnectionFailure extends Failure { 21 | /// Constructs a [ConnectionFailure] with the specified error [message]. 22 | const ConnectionFailure(super.message); 23 | } 24 | 25 | /// A failure that occurs when the database returns an error. 26 | final class DatabaseFailure extends Failure { 27 | /// Constructs a [DatabaseFailure] with the specified error [message]. 28 | const DatabaseFailure(super.message); 29 | } 30 | 31 | /// A failure that occurs when the request times out. 32 | final class TimeoutFailure extends Failure { 33 | /// Constructs a [TimeoutFailure] with the specified error [message]. 34 | const TimeoutFailure(super.message); 35 | } 36 | 37 | /// A failure that represents other unknown failures. 38 | final class UnknownFailure extends Failure { 39 | /// Constructs an [UnknownFailure] with the specified error [message]. 40 | const UnknownFailure(super.message); 41 | } 42 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon-dev.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "16.png", 5 | "idiom" : "mac", 6 | "scale" : "1x", 7 | "size" : "16x16" 8 | }, 9 | { 10 | "filename" : "32 1.png", 11 | "idiom" : "mac", 12 | "scale" : "2x", 13 | "size" : "16x16" 14 | }, 15 | { 16 | "filename" : "32.png", 17 | "idiom" : "mac", 18 | "scale" : "1x", 19 | "size" : "32x32" 20 | }, 21 | { 22 | "filename" : "64.png", 23 | "idiom" : "mac", 24 | "scale" : "2x", 25 | "size" : "32x32" 26 | }, 27 | { 28 | "filename" : "128.png", 29 | "idiom" : "mac", 30 | "scale" : "1x", 31 | "size" : "128x128" 32 | }, 33 | { 34 | "filename" : "256 1.png", 35 | "idiom" : "mac", 36 | "scale" : "2x", 37 | "size" : "128x128" 38 | }, 39 | { 40 | "filename" : "256.png", 41 | "idiom" : "mac", 42 | "scale" : "1x", 43 | "size" : "256x256" 44 | }, 45 | { 46 | "filename" : "512 1.png", 47 | "idiom" : "mac", 48 | "scale" : "2x", 49 | "size" : "256x256" 50 | }, 51 | { 52 | "filename" : "512.png", 53 | "idiom" : "mac", 54 | "scale" : "1x", 55 | "size" : "512x512" 56 | }, 57 | { 58 | "filename" : "1024.png", 59 | "idiom" : "mac", 60 | "scale" : "2x", 61 | "size" : "512x512" 62 | } 63 | ], 64 | "info" : { 65 | "author" : "xcode", 66 | "version" : 1 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon-stg.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "16.png", 5 | "idiom" : "mac", 6 | "scale" : "1x", 7 | "size" : "16x16" 8 | }, 9 | { 10 | "filename" : "32 1.png", 11 | "idiom" : "mac", 12 | "scale" : "2x", 13 | "size" : "16x16" 14 | }, 15 | { 16 | "filename" : "32.png", 17 | "idiom" : "mac", 18 | "scale" : "1x", 19 | "size" : "32x32" 20 | }, 21 | { 22 | "filename" : "64.png", 23 | "idiom" : "mac", 24 | "scale" : "2x", 25 | "size" : "32x32" 26 | }, 27 | { 28 | "filename" : "128.png", 29 | "idiom" : "mac", 30 | "scale" : "1x", 31 | "size" : "128x128" 32 | }, 33 | { 34 | "filename" : "256 1.png", 35 | "idiom" : "mac", 36 | "scale" : "2x", 37 | "size" : "128x128" 38 | }, 39 | { 40 | "filename" : "256.png", 41 | "idiom" : "mac", 42 | "scale" : "1x", 43 | "size" : "256x256" 44 | }, 45 | { 46 | "filename" : "512 1.png", 47 | "idiom" : "mac", 48 | "scale" : "2x", 49 | "size" : "256x256" 50 | }, 51 | { 52 | "filename" : "512.png", 53 | "idiom" : "mac", 54 | "scale" : "1x", 55 | "size" : "512x512" 56 | }, 57 | { 58 | "filename" : "1024.png", 59 | "idiom" : "mac", 60 | "scale" : "2x", 61 | "size" : "512x512" 62 | } 63 | ], 64 | "info" : { 65 | "author" : "xcode", 66 | "version" : 1 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "16.png", 5 | "idiom" : "mac", 6 | "scale" : "1x", 7 | "size" : "16x16" 8 | }, 9 | { 10 | "filename" : "32 1.png", 11 | "idiom" : "mac", 12 | "scale" : "2x", 13 | "size" : "16x16" 14 | }, 15 | { 16 | "filename" : "32.png", 17 | "idiom" : "mac", 18 | "scale" : "1x", 19 | "size" : "32x32" 20 | }, 21 | { 22 | "filename" : "64.png", 23 | "idiom" : "mac", 24 | "scale" : "2x", 25 | "size" : "32x32" 26 | }, 27 | { 28 | "filename" : "128.png", 29 | "idiom" : "mac", 30 | "scale" : "1x", 31 | "size" : "128x128" 32 | }, 33 | { 34 | "filename" : "256 1.png", 35 | "idiom" : "mac", 36 | "scale" : "2x", 37 | "size" : "128x128" 38 | }, 39 | { 40 | "filename" : "256.png", 41 | "idiom" : "mac", 42 | "scale" : "1x", 43 | "size" : "256x256" 44 | }, 45 | { 46 | "filename" : "512 1.png", 47 | "idiom" : "mac", 48 | "scale" : "2x", 49 | "size" : "256x256" 50 | }, 51 | { 52 | "filename" : "512.png", 53 | "idiom" : "mac", 54 | "scale" : "1x", 55 | "size" : "512x512" 56 | }, 57 | { 58 | "filename" : "1024.png", 59 | "idiom" : "mac", 60 | "scale" : "2x", 61 | "size" : "512x512" 62 | } 63 | ], 64 | "info" : { 65 | "author" : "xcode", 66 | "version" : 1 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /macos/Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.14' 2 | 3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 5 | 6 | project 'Runner', { 7 | 'Debug' => :debug, 8 | 'Profile' => :release, 9 | 'Release' => :release, 10 | } 11 | 12 | def flutter_root 13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) 14 | unless File.exist?(generated_xcode_build_settings_path) 15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" 16 | end 17 | 18 | File.foreach(generated_xcode_build_settings_path) do |line| 19 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 20 | return matches[1].strip if matches 21 | end 22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" 23 | end 24 | 25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 26 | 27 | flutter_macos_podfile_setup 28 | 29 | target 'Runner' do 30 | use_frameworks! 31 | use_modular_headers! 32 | 33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) 34 | target 'RunnerTests' do 35 | inherit! :search_paths 36 | end 37 | end 38 | 39 | post_install do |installer| 40 | installer.pods_project.targets.each do |target| 41 | flutter_additional_macos_build_settings(target) 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /lib/data/repositories/local/favorites_repository_impl.dart: -------------------------------------------------------------------------------- 1 | import 'package:injectable/injectable.dart'; 2 | import 'package:my_favorite_books/data/data_sources/local/favorites_data_source.dart'; 3 | import 'package:my_favorite_books/domain/entities/volume_response_entity.dart'; 4 | import 'package:my_favorite_books/domain/repositories/local/favorites_repository.dart'; 5 | 6 | @Injectable(as: FavoritesRepository) 7 | final class FavoritesRepositoryImpl implements FavoritesRepository { 8 | final FavoritesDataSource _favoritesDataSource; 9 | 10 | const FavoritesRepositoryImpl(this._favoritesDataSource); 11 | 12 | @override 13 | Stream> watchFavorites() async* { 14 | final events = _favoritesDataSource.watch(); 15 | 16 | if (events == null) { 17 | yield []; 18 | return; 19 | } 20 | 21 | await for (final _ in events) { 22 | yield _favoritesDataSource.readAll().map((e) => e.toEntity()).toList(); 23 | } 24 | } 25 | 26 | @override 27 | Future addToFavorites({ 28 | required String key, 29 | required VolumeItemEntity item, 30 | }) { 31 | return _favoritesDataSource.save(key, item.toModel()); 32 | } 33 | 34 | @override 35 | Future removeFavorite(String key) { 36 | return _favoritesDataSource.delete(key); 37 | } 38 | 39 | @override 40 | List getFavorites() { 41 | return _favoritesDataSource.readAll().map((e) => e.toEntity()).toList(); 42 | } 43 | 44 | @override 45 | Future close() { 46 | return _favoritesDataSource.close(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /lib/bootstrap.dart: -------------------------------------------------------------------------------- 1 | part of '../main.dart'; 2 | 3 | /// Bootstrap the app with the given builder function 4 | Future bootstrap(FutureOr Function() builder) async { 5 | /// Run the app in a zone to catch all errors and log them to the console 6 | await runZonedGuarded(() async { 7 | WidgetsFlutterBinding.ensureInitialized(); 8 | 9 | Bloc.observer = const AppBlocObserver(); 10 | 11 | /// Set the preferred orientations 12 | await SystemChrome.setPreferredOrientations([ 13 | DeviceOrientation.portraitUp, 14 | ]); 15 | 16 | /// Set the logger for EasyLocalization 17 | EasyLocalization.logger.printer = 18 | (object, {level, name, stackTrace}) => log('$name: $object'); 19 | 20 | /// Initialize EasyLocalization 21 | await EasyLocalization.ensureInitialized(); 22 | 23 | /// Load environment variables from .env file 24 | await dotenv.load(); 25 | 26 | /// Configure dependencies using injectable 27 | configureDependencies(); 28 | 29 | /// Initialize Hive 30 | await Hive.initFlutter(); 31 | 32 | await getIt().init(); 33 | 34 | /// Run the app with EasyLocalization 35 | runApp(LocalizationConfig.runAppWithEasyWidget(await builder())); 36 | }, (error, stack) { 37 | log(error.toString(), stackTrace: stack, name: 'bootstrap'); 38 | }); 39 | 40 | /// Log all errors to the console 41 | FlutterError.onError = (details) { 42 | log( 43 | details.exceptionAsString(), 44 | stackTrace: details.stack, 45 | name: 'FlutterError', 46 | ); 47 | }; 48 | } 49 | -------------------------------------------------------------------------------- /lib/presentation/views/favorites/widget/favorite_builder.dart: -------------------------------------------------------------------------------- 1 | part of '../favorites_view.dart'; 2 | 3 | final class _FavoriteBuilderWidget 4 | extends BaseWidget { 5 | const _FavoriteBuilderWidget(); 6 | 7 | @override 8 | Widget build( 9 | BuildContext context, 10 | FavoritesCubit cubit, 11 | FavoritesState state, 12 | ) { 13 | return state.when( 14 | initial: () => const Center(child: Icon(Icons.book)), 15 | loading: () => const Center(child: CircularProgressIndicator.adaptive()), 16 | loaded: (state) => _loaded(state, cubit, context), 17 | error: (message) => Center(child: Text(message)), 18 | ); 19 | } 20 | 21 | Widget _loaded( 22 | FavoritesLoaded state, 23 | FavoritesCubit cubit, 24 | BuildContext context, 25 | ) { 26 | if (state.favoriteVolumes.isEmpty) { 27 | return Center( 28 | child: Text( 29 | LocaleKeyConstants.noFavoriteBooksYet, 30 | style: context.textTheme.titleMedium, 31 | ), 32 | ); 33 | } 34 | 35 | return ListView.separated( 36 | padding: EdgeInsets.only(top: 16.h, bottom: context.bottomPadding + 16.h), 37 | itemCount: state.favoriteVolumes.length, 38 | separatorBuilder: (context, index) => Gap(16.h), 39 | itemBuilder: (context, index) { 40 | final volume = state.favoriteVolumes[index]; 41 | return VolumeTileWidget( 42 | volume: volume, 43 | onLongPress: cubit.removeFavorite, 44 | ); 45 | }, 46 | ).symmetricHDefaultPadding; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '12.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | target 'RunnerTests' do 36 | inherit! :search_paths 37 | end 38 | end 39 | 40 | post_install do |installer| 41 | installer.pods_project.targets.each do |target| 42 | flutter_additional_ios_build_settings(target) 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /test/domain/use_cases/get_volumes_use_case_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:either_dart/either.dart'; 3 | import 'package:flutter_test/flutter_test.dart'; 4 | import 'package:mockito/mockito.dart'; 5 | import 'package:my_favorite_books/core/error/failure.dart'; 6 | import 'package:my_favorite_books/domain/entities/volume_response_entity.dart'; 7 | import 'package:my_favorite_books/domain/use_cases/get_volumes_use_case.dart'; 8 | 9 | import '../../helpers/test_helper.dart'; 10 | import '../../helpers/test_helper.mocks.dart'; 11 | 12 | Future main() async { 13 | late final MockVolumesRepository volumesRepository; 14 | late final GetVolumesUseCase getVolumesUseCase; 15 | 16 | late final CancelToken cancelToken; 17 | 18 | provideDummy>( 19 | Right(dummyVolumeResponseEntity), 20 | ); 21 | 22 | setUp(() { 23 | volumesRepository = MockVolumesRepository(); 24 | getVolumesUseCase = GetVolumesUseCase(volumesRepository); 25 | cancelToken = CancelToken(); 26 | }); 27 | 28 | test('should call getVolumes from VolumesRepository', () async { 29 | when( 30 | getVolumesUseCase.call( 31 | request: volumesRequestModel, 32 | cancelToken: cancelToken, 33 | ), 34 | ).thenAnswer((realInvocation) async => Right(dummyVolumeResponseEntity)); 35 | 36 | final result = await getVolumesUseCase.call( 37 | request: volumesRequestModel, 38 | cancelToken: cancelToken, 39 | ); 40 | 41 | expect( 42 | result, 43 | Right(dummyVolumeResponseEntity), 44 | ); 45 | }); 46 | } 47 | -------------------------------------------------------------------------------- /lib/presentation/views/favorites/cubit/favorites_state.dart: -------------------------------------------------------------------------------- 1 | part of 'favorites_cubit.dart'; 2 | 3 | sealed class FavoritesState extends BaseState { 4 | const FavoritesState(); 5 | 6 | @override 7 | List get props => []; 8 | 9 | Widget when({ 10 | required Widget Function() initial, 11 | required Widget Function() loading, 12 | required Widget Function(FavoritesLoaded state) loaded, 13 | required Widget Function(String message) error, 14 | }) { 15 | return switch (this) { 16 | FavoritesInitial() => initial(), 17 | FavoritesLoading() => loading(), 18 | FavoritesLoaded() => loaded(this as FavoritesLoaded), 19 | FavoritesError() => error((this as FavoritesError).message), 20 | }; 21 | } 22 | } 23 | 24 | final class FavoritesInitial extends FavoritesState { 25 | const FavoritesInitial(); 26 | } 27 | 28 | final class FavoritesLoading extends FavoritesState { 29 | const FavoritesLoading(); 30 | } 31 | 32 | final class FavoritesLoaded extends FavoritesState { 33 | final List favoriteVolumes; 34 | const FavoritesLoaded({ 35 | required this.favoriteVolumes, 36 | }); 37 | 38 | FavoritesLoaded copyWith({ 39 | List? favoriteVolumes, 40 | }) { 41 | return FavoritesLoaded( 42 | favoriteVolumes: favoriteVolumes ?? this.favoriteVolumes, 43 | ); 44 | } 45 | 46 | @override 47 | List get props => [favoriteVolumes]; 48 | } 49 | 50 | final class FavoritesError extends FavoritesState { 51 | final String message; 52 | const FavoritesError({ 53 | required this.message, 54 | }); 55 | 56 | @override 57 | List get props => [message]; 58 | } 59 | -------------------------------------------------------------------------------- /lib/presentation/views/favorites/favorites_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:auto_route/auto_route.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 4 | import 'package:gap/gap.dart'; 5 | import 'package:my_favorite_books/core/constants/locale_key_constants.dart'; 6 | import 'package:my_favorite_books/core/utils/extensions/context_extensions.dart'; 7 | import 'package:my_favorite_books/core/utils/extensions/widget_extensions.dart'; 8 | import 'package:my_favorite_books/core/view/base_view.dart'; 9 | import 'package:my_favorite_books/core/widget/base_widget.dart'; 10 | import 'package:my_favorite_books/inject.dart'; 11 | import 'package:my_favorite_books/presentation/views/favorites/cubit/favorites_cubit.dart'; 12 | import 'package:my_favorite_books/presentation/widgets/custom_app_bar.dart'; 13 | import 'package:my_favorite_books/presentation/widgets/custom_scaffold.dart'; 14 | import 'package:my_favorite_books/presentation/widgets/volume_tile.dart'; 15 | 16 | part 'widget/favorite_builder.dart'; 17 | 18 | @RoutePage() 19 | final class FavoritesView extends BaseView { 20 | FavoritesView({super.key}) : super(cubit: getIt.call); 21 | 22 | @override 23 | Widget builder(BuildContext context, FavoritesCubit cubit) { 24 | return CustomScaffold( 25 | body: Column( 26 | children: [ 27 | Gap(context.topPadding), 28 | CustomAppBar( 29 | leading: const BackButton(), 30 | title: LocaleKeyConstants.favoriteTitle, 31 | ), 32 | const Expanded(child: _FavoriteBuilderWidget()), 33 | ], 34 | ), 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/core/api/hive_client.dart: -------------------------------------------------------------------------------- 1 | import 'package:hive_flutter/hive_flutter.dart'; 2 | 3 | abstract base class HiveClient { 4 | final String boxName; 5 | HiveClient(this.boxName); 6 | Box? box; 7 | Future init() async { 8 | registerAdapters(); 9 | if (!(box?.isOpen ?? false)) { 10 | box = await Hive.openBox(boxName); 11 | } 12 | } 13 | 14 | void registerAdapters() {} 15 | 16 | Future save(dynamic key, T data) async { 17 | await box?.put(key, data); 18 | } 19 | 20 | T? read(String key) { 21 | return (box?.isOpen ?? false) ? box?.get(key) : null; 22 | } 23 | 24 | Future write(String key, dynamic value) async { 25 | if (box?.isOpen ?? false) { 26 | await box?.put(key, value); 27 | } 28 | } 29 | 30 | Future saveAll(List data) async { 31 | await box?.putAll({for (final e in data) e.hashCode: e}); 32 | } 33 | 34 | List readAll() { 35 | return box?.values.toList() ?? []; 36 | } 37 | 38 | Future delete(dynamic key) async { 39 | await box?.delete(key); 40 | } 41 | 42 | Future clear() async { 43 | await box?.clear(); 44 | } 45 | 46 | Stream? watch([String? key]) { 47 | return box?.watch(key: key); 48 | } 49 | 50 | Future close() async { 51 | await box?.close(); 52 | } 53 | 54 | bool isAdapterRegistered(int adapterId) { 55 | return Hive.isAdapterRegistered(adapterId); 56 | } 57 | 58 | void registerAdapter( 59 | TypeAdapter adapter, { 60 | bool internal = false, 61 | bool override = false, 62 | }) { 63 | Hive.registerAdapter(adapter, internal: internal, override: override); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 15 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /lib/presentation/views/search/cubit/search_state.dart: -------------------------------------------------------------------------------- 1 | part of 'search_cubit.dart'; 2 | 3 | sealed class SearchBaseState extends BaseState { 4 | const SearchBaseState(); 5 | 6 | Widget when({ 7 | required Widget Function() initial, 8 | required Widget Function() loading, 9 | required Widget Function(SearchLoaded state) loaded, 10 | required Widget Function(String? message) error, 11 | }) { 12 | return switch (this) { 13 | SearchInitial() => initial(), 14 | SearchLoading() => loading(), 15 | SearchLoaded() => loaded(this as SearchLoaded), 16 | SearchError() => error((this as SearchError).message), 17 | }; 18 | } 19 | 20 | @override 21 | List get props => []; 22 | } 23 | 24 | final class SearchInitial extends SearchBaseState { 25 | const SearchInitial(); 26 | } 27 | 28 | final class SearchLoading extends SearchBaseState { 29 | const SearchLoading(); 30 | } 31 | 32 | final class SearchLoaded extends SearchBaseState { 33 | final VolumeResponseEntity volumeResponseEntity; 34 | final List favoriteVolumes; 35 | const SearchLoaded({ 36 | required this.volumeResponseEntity, 37 | required this.favoriteVolumes, 38 | }); 39 | 40 | SearchLoaded copyWith({ 41 | VolumeResponseEntity? volumeResponseEntity, 42 | List? favoriteVolumes, 43 | }) { 44 | return SearchLoaded( 45 | volumeResponseEntity: volumeResponseEntity ?? this.volumeResponseEntity, 46 | favoriteVolumes: favoriteVolumes ?? this.favoriteVolumes, 47 | ); 48 | } 49 | 50 | @override 51 | List get props => [volumeResponseEntity, favoriteVolumes]; 52 | } 53 | 54 | final class SearchError extends SearchBaseState { 55 | final String? message; 56 | const SearchError({ 57 | this.message, 58 | }); 59 | 60 | @override 61 | List get props => [message]; 62 | } 63 | -------------------------------------------------------------------------------- /test/data/data_sources/volumes_data_source_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:mock_web_server/mock_web_server.dart'; 4 | import 'package:my_favorite_books/data/data_sources/remote/volumes_data_source.dart'; 5 | import 'package:my_favorite_books/data/models/volume_response_model.dart'; 6 | 7 | import '../../helpers/test_helper.dart'; 8 | 9 | void main() { 10 | late VolumesDataSource volumesDataSource; 11 | late MockWebServer mockWebServer; 12 | final headers = {'Content-Type': 'application/json'}; 13 | 14 | setUp(() async { 15 | mockWebServer = MockWebServer(); 16 | await mockWebServer.start(); 17 | final dio = Dio(); 18 | dio.interceptors.add(LogInterceptor(responseBody: true)); 19 | volumesDataSource = VolumesDataSource(dio, baseUrl: mockWebServer.url); 20 | }); 21 | 22 | tearDown(() { 23 | mockWebServer.shutdown(); 24 | }); 25 | 26 | group('VolumesDataSource', () { 27 | test('should return VolumesRequestModel when the response code is 200', 28 | () async { 29 | mockWebServer.enqueue( 30 | body: jsonVolumesData, 31 | headers: headers, 32 | ); 33 | 34 | final result = await volumesDataSource.getVolumes( 35 | CancelToken(), 36 | request: volumesRequestModel, 37 | ); 38 | 39 | expect(result, isA()); 40 | }); 41 | 42 | test('should throw an exception when the response code is not 200', 43 | () async { 44 | mockWebServer.enqueue( 45 | body: 'Internal Server Error', 46 | headers: headers, 47 | httpCode: 500, 48 | ); 49 | 50 | expect( 51 | () => volumesDataSource.getVolumes( 52 | CancelToken(), 53 | request: volumesRequestModel, 54 | ), 55 | throwsA(isA()), 56 | ); 57 | }); 58 | }); 59 | } 60 | -------------------------------------------------------------------------------- /windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr); 51 | if (target_length == 0) { 52 | return std::string(); 53 | } 54 | std::string utf8_string; 55 | utf8_string.resize(target_length); 56 | int converted_length = ::WideCharToMultiByte( 57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 58 | -1, utf8_string.data(), 59 | target_length, nullptr, nullptr); 60 | if (converted_length == 0) { 61 | return std::string(); 62 | } 63 | return utf8_string; 64 | } 65 | -------------------------------------------------------------------------------- /lib/presentation/views/favorites/cubit/favorites_cubit.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:injectable/injectable.dart'; 5 | import 'package:my_favorite_books/core/cubit/base_cubit.dart'; 6 | import 'package:my_favorite_books/domain/entities/volume_response_entity.dart'; 7 | import 'package:my_favorite_books/domain/use_cases/get_favorites_use_case.dart'; 8 | import 'package:my_favorite_books/domain/use_cases/remove_favorites_use_case.dart'; 9 | import 'package:my_favorite_books/domain/use_cases/stream_favorites_use_case.dart'; 10 | 11 | part 'favorites_state.dart'; 12 | 13 | @injectable 14 | final class FavoritesCubit extends BaseCubit { 15 | final GetFavoritesUseCase _getFavoritesUseCase; 16 | final RemoveFavoriteUseCase _removeFavoriteUseCase; 17 | final StreamFavoritesUseCase _streamFavoritesUseCase; 18 | 19 | FavoritesCubit( 20 | this._getFavoritesUseCase, 21 | this._removeFavoriteUseCase, 22 | this._streamFavoritesUseCase, 23 | ) : super(const FavoritesInitial()); 24 | 25 | late final StreamSubscription> _subscription; 26 | 27 | @override 28 | void onBindingCreated() { 29 | super.onBindingCreated(); 30 | _subscription = _streamFavoritesUseCase.call().listen((event) { 31 | if (state is FavoritesLoaded) { 32 | emit( 33 | (state as FavoritesLoaded).copyWith(favoriteVolumes: event), 34 | ); 35 | } 36 | }); 37 | getFavorites(); 38 | } 39 | 40 | void getFavorites() { 41 | emit(const FavoritesLoading()); 42 | final favorites = _getFavoritesUseCase.call(); 43 | emit(FavoritesLoaded(favoriteVolumes: favorites)); 44 | } 45 | 46 | void removeFavorite(VolumeItemEntity volume) { 47 | _removeFavoriteUseCase.call(volume.id); 48 | getFavorites(); 49 | } 50 | 51 | @override 52 | Future close() { 53 | _subscription.cancel(); 54 | return super.close(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project) 8 | : project_(project) {} 9 | 10 | FlutterWindow::~FlutterWindow() {} 11 | 12 | bool FlutterWindow::OnCreate() { 13 | if (!Win32Window::OnCreate()) { 14 | return false; 15 | } 16 | 17 | RECT frame = GetClientArea(); 18 | 19 | // The size here must match the window dimensions to avoid unnecessary surface 20 | // creation / destruction in the startup path. 21 | flutter_controller_ = std::make_unique( 22 | frame.right - frame.left, frame.bottom - frame.top, project_); 23 | // Ensure that basic setup of the controller was successful. 24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 25 | return false; 26 | } 27 | RegisterPlugins(flutter_controller_->engine()); 28 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 29 | return true; 30 | } 31 | 32 | void FlutterWindow::OnDestroy() { 33 | if (flutter_controller_) { 34 | flutter_controller_ = nullptr; 35 | } 36 | 37 | Win32Window::OnDestroy(); 38 | } 39 | 40 | LRESULT 41 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 42 | WPARAM const wparam, 43 | LPARAM const lparam) noexcept { 44 | // Give Flutter, including plugins, an opportunity to handle window messages. 45 | if (flutter_controller_) { 46 | std::optional result = 47 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 48 | lparam); 49 | if (result) { 50 | return *result; 51 | } 52 | } 53 | 54 | switch (message) { 55 | case WM_FONTCHANGE: 56 | flutter_controller_->engine()->ReloadSystemFonts(); 57 | break; 58 | } 59 | 60 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 61 | } 62 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleLocalizations 6 | 7 | en 8 | es 9 | 10 | CFBundleDevelopmentRegion 11 | $(DEVELOPMENT_LANGUAGE) 12 | CFBundleDisplayName 13 | $(FLAVOR_APP_NAME) 14 | CFBundleExecutable 15 | $(EXECUTABLE_NAME) 16 | CFBundleIdentifier 17 | $(PRODUCT_BUNDLE_IDENTIFIER) 18 | CFBundleInfoDictionaryVersion 19 | 6.0 20 | CFBundleName 21 | $(FLAVOR_APP_NAME) 22 | CFBundlePackageType 23 | APPL 24 | CFBundleShortVersionString 25 | $(FLUTTER_BUILD_NAME) 26 | CFBundleSignature 27 | ???? 28 | CFBundleVersion 29 | $(FLUTTER_BUILD_NUMBER) 30 | LSRequiresIPhoneOS 31 | 32 | UILaunchStoryboardName 33 | LaunchScreen 34 | UIMainStoryboardFile 35 | Main 36 | UISupportedInterfaceOrientations 37 | 38 | UIInterfaceOrientationPortrait 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UISupportedInterfaceOrientations~ipad 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationPortraitUpsideDown 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | UIViewControllerBasedStatusBarAppearance 50 | 51 | CADisableMinimumFrameDurationOnPhone 52 | 53 | UIApplicationSupportsIndirectInputEvents 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /lib/presentation/views/search/search_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:auto_route/auto_route.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 4 | import 'package:gap/gap.dart'; 5 | import 'package:my_favorite_books/core/constants/color_constants.dart'; 6 | import 'package:my_favorite_books/core/constants/locale_key_constants.dart'; 7 | import 'package:my_favorite_books/core/utils/extensions/context_extensions.dart'; 8 | import 'package:my_favorite_books/core/utils/extensions/widget_extensions.dart'; 9 | import 'package:my_favorite_books/core/view/base_view.dart'; 10 | import 'package:my_favorite_books/core/widget/base_widget.dart'; 11 | import 'package:my_favorite_books/inject.dart'; 12 | import 'package:my_favorite_books/presentation/views/search/cubit/search_cubit.dart'; 13 | import 'package:my_favorite_books/presentation/widgets/custom_app_bar.dart'; 14 | import 'package:my_favorite_books/presentation/widgets/custom_scaffold.dart'; 15 | import 'package:my_favorite_books/presentation/widgets/volume_tile.dart'; 16 | import 'package:my_favorite_books/routers/app_router.dart'; 17 | 18 | part './widget/search.dart'; 19 | part './widget/volume_builder.dart'; 20 | 21 | @RoutePage() 22 | final class SearchView extends BaseView { 23 | SearchView({super.key}) : super(cubit: getIt.call); 24 | 25 | @override 26 | Widget builder(BuildContext context, SearchCubit cubit) { 27 | return CustomScaffold( 28 | body: Column( 29 | children: [ 30 | Gap(context.topPadding), 31 | CustomAppBar( 32 | title: LocaleKeyConstants.appTitle, 33 | trailing: GestureDetector( 34 | onTap: () => AutoRouter.of(context).push(FavoritesRoute()), 35 | child: Icon(Icons.favorite, size: 28.h), 36 | ), 37 | ), 38 | Gap(16.h), 39 | _SearchWidget(onSearch: cubit.getVolumes), 40 | Gap(16.h), 41 | const Expanded(child: _VolumeBuilderWidget()), 42 | ], 43 | ).symmetricHDefaultPadding, 44 | ); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:developer'; 3 | 4 | import 'package:bloc/bloc.dart'; 5 | import 'package:easy_localization/easy_localization.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:flutter/services.dart'; 8 | import 'package:flutter_dotenv/flutter_dotenv.dart'; 9 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 10 | import 'package:hive_flutter/hive_flutter.dart'; 11 | import 'package:my_favorite_books/core/config/flavor_config.dart'; 12 | import 'package:my_favorite_books/core/config/localization_config.dart'; 13 | import 'package:my_favorite_books/core/utils/observers/bloc_observer.dart'; 14 | import 'package:my_favorite_books/data/data_sources/local/favorites_data_source.dart'; 15 | import 'package:my_favorite_books/inject.dart'; 16 | import 'package:my_favorite_books/presentation/theme/theme_data.dart'; 17 | import 'package:my_favorite_books/presentation/widgets/flavor_banner.dart'; 18 | import 'package:my_favorite_books/routers/app_router.dart'; 19 | 20 | part 'bootstrap.dart'; 21 | 22 | void main() async { 23 | await bootstrap( 24 | () => FlavorBanner( 25 | message: FlavorConfig.currentFlavor.toUpperCase(), 26 | child: App(), 27 | ), 28 | ); 29 | } 30 | 31 | final class App extends StatelessWidget { 32 | App({super.key}); 33 | 34 | final _appRouter = AppRouter(); 35 | 36 | @override 37 | Widget build(BuildContext context) { 38 | return ScreenUtilInit( 39 | designSize: const Size(375, 812), 40 | builder: (context, child) { 41 | return AnnotatedRegion( 42 | value: const SystemUiOverlayStyle( 43 | statusBarBrightness: Brightness.dark, 44 | systemNavigationBarIconBrightness: Brightness.light, 45 | ), 46 | child: MaterialApp.router( 47 | routerConfig: _appRouter.config(), 48 | themeMode: ThemeMode.dark, 49 | theme: AppThemeData.appTheme, 50 | supportedLocales: context.supportedLocales, 51 | localizationsDelegates: context.localizationDelegates, 52 | ), 53 | ); 54 | }, 55 | ); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /lib/core/view/base_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_bloc/flutter_bloc.dart'; 3 | import 'package:my_favorite_books/core/cubit/base_cubit.dart'; 4 | 5 | typedef Create> = C Function(); 6 | 7 | abstract base class BaseView, S extends BaseState> 8 | extends StatefulWidget { 9 | const BaseView({ 10 | this.cubit, 11 | this.value, 12 | super.key, 13 | }) : assert( 14 | !(cubit == null && value == null), 15 | 'cubit and value can not be null at the same time!', 16 | ), 17 | assert( 18 | !(cubit != null && value != null), 19 | 'cubit and value can not be assigned at the same time.', 20 | ); 21 | final Create? cubit; 22 | final Create? value; 23 | 24 | Widget builder(BuildContext context, C cubit); 25 | 26 | @override 27 | State createState() => _BaseViewState(); 28 | } 29 | 30 | final class _BaseViewState, S extends BaseState> 31 | extends State { 32 | late final C? cubit; 33 | late final C? value; 34 | 35 | @override 36 | void initState() { 37 | super.initState(); 38 | 39 | if (widget.cubit != null) { 40 | value = null; 41 | cubit = widget.cubit!() as C; 42 | } else if (widget.value != null) { 43 | cubit = null; 44 | value = widget.value!() as C; 45 | } 46 | } 47 | 48 | @override 49 | Widget build(BuildContext context) { 50 | if (cubit != null) { 51 | return BlocProvider( 52 | create: (context) => cubit!, 53 | child: Builder( 54 | builder: (context) { 55 | return widget.builder(context, context.read()); 56 | }, 57 | ), 58 | ); 59 | } else { 60 | return BlocProvider.value( 61 | value: value!, 62 | child: Builder( 63 | builder: (context) { 64 | return widget.builder(context, context.read()); 65 | }, 66 | ), 67 | ); 68 | } 69 | } 70 | 71 | @override 72 | void dispose() { 73 | super.dispose(); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /test/helpers/dummy_data/dummy_data_volumes.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "books#volumes", 3 | "totalItems": 6188, 4 | "items": [ 5 | { 6 | "kind": "books#volume", 7 | "id": "G3oQAAAACAAJ", 8 | "etag": "XNDP8aJoJ6M", 9 | "selfLink": "https://www.googleapis.com/books/v1/volumes/G3oQAAAACAAJ", 10 | "volumeInfo": { 11 | "title": "The Contaminated Man", 12 | "authors": ["Daniel Keyes"], 13 | "publishedDate": "1977", 14 | "industryIdentifiers": [ 15 | { 16 | "type": "ISBN_10", 17 | "identifier": "0583124348" 18 | }, 19 | { 20 | "type": "ISBN_13", 21 | "identifier": "9780583124348" 22 | } 23 | ], 24 | "readingModes": { 25 | "text": false, 26 | "image": false 27 | }, 28 | "pageCount": 206, 29 | "printType": "BOOK", 30 | "categories": ["English fiction"], 31 | "maturityRating": "NOT_MATURE", 32 | "allowAnonLogging": false, 33 | "contentVersion": "preview-1.0.0", 34 | "language": "en", 35 | "previewLink": "http://books.google.com.tr/books?id=G3oQAAAACAAJ&dq=flowers+inauthor:keyes&hl=&cd=21&source=gbs_api", 36 | "infoLink": "http://books.google.com.tr/books?id=G3oQAAAACAAJ&dq=flowers+inauthor:keyes&hl=&source=gbs_api", 37 | "canonicalVolumeLink": "https://books.google.com/books/about/The_Contaminated_Man.html?hl=&id=G3oQAAAACAAJ" 38 | }, 39 | "saleInfo": { 40 | "country": "TR", 41 | "saleability": "NOT_FOR_SALE", 42 | "isEbook": false 43 | }, 44 | "accessInfo": { 45 | "country": "TR", 46 | "viewability": "NO_PAGES", 47 | "embeddable": false, 48 | "publicDomain": false, 49 | "textToSpeechPermission": "ALLOWED", 50 | "epub": { 51 | "isAvailable": false 52 | }, 53 | "pdf": { 54 | "isAvailable": false 55 | }, 56 | "webReaderLink": "http://play.google.com/books/reader?id=G3oQAAAACAAJ&hl=&source=gbs_api", 57 | "accessViewStatus": "NONE", 58 | "quoteSharingAllowed": false 59 | } 60 | } 61 | ] 62 | } 63 | -------------------------------------------------------------------------------- /lib/presentation/views/search/widget/volume_builder.dart: -------------------------------------------------------------------------------- 1 | part of '../search_view.dart'; 2 | 3 | final class _VolumeBuilderWidget 4 | extends BaseWidget { 5 | const _VolumeBuilderWidget(); 6 | 7 | @override 8 | Widget build( 9 | BuildContext context, 10 | SearchCubit cubit, 11 | SearchBaseState state, 12 | ) { 13 | return state.when( 14 | initial: () => Center( 15 | child: Text('📘', style: TextStyle(fontSize: 72.sp)), 16 | ), 17 | loading: () => const Center( 18 | child: CircularProgressIndicator.adaptive(), 19 | ), 20 | loaded: (state) => _loaded(context, cubit, state), 21 | error: (message) => _error(message, context), 22 | ); 23 | } 24 | 25 | Widget _loaded(BuildContext context, SearchCubit cubit, SearchLoaded state) { 26 | if (state.volumeResponseEntity.items == null || 27 | state.volumeResponseEntity.items!.isEmpty) { 28 | return Center( 29 | child: Text( 30 | LocaleKeyConstants.noBooksFound, 31 | style: context.textTheme.titleMedium, 32 | ), 33 | ); 34 | } 35 | return MediaQuery.removePadding( 36 | context: context, 37 | removeTop: true, 38 | child: ListView.separated( 39 | padding: EdgeInsets.only(bottom: context.bottomOrDefaultPadding), 40 | itemCount: state.volumeResponseEntity.items!.length, 41 | keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag, 42 | separatorBuilder: (context, index) => Gap(16.h), 43 | itemBuilder: (context, index) { 44 | final volume = state.volumeResponseEntity.items![index]; 45 | 46 | return VolumeTileWidget( 47 | volume: volume, 48 | isFavorite: state.favoriteVolumes.contains(volume), 49 | onLongPress: cubit.removeFromFavorites, 50 | onDoubleTap: cubit.addToFavorites, 51 | ); 52 | }, 53 | ), 54 | ); 55 | } 56 | 57 | Widget _error(String? message, BuildContext context) { 58 | return Center( 59 | child: Text( 60 | message ?? LocaleKeyConstants.somethingWentWrong, 61 | style: context.textTheme.bodyMedium?.copyWith( 62 | color: ColorConstants.errorColor, 63 | ), 64 | ), 65 | ); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /lib/presentation/views/search/widget/search.dart: -------------------------------------------------------------------------------- 1 | part of '../search_view.dart'; 2 | 3 | final class _SearchWidget extends StatefulWidget { 4 | final ValueChanged onSearch; 5 | const _SearchWidget({ 6 | required this.onSearch, 7 | }); 8 | 9 | @override 10 | State<_SearchWidget> createState() => _SearchWidgetState(); 11 | } 12 | 13 | final class _SearchWidgetState extends State<_SearchWidget> { 14 | late final TextEditingController _textEditingController; 15 | 16 | /// Maximum length of the search text 17 | final int _maxCharacterLength = 500; 18 | 19 | @override 20 | void initState() { 21 | _textEditingController = TextEditingController(); 22 | super.initState(); 23 | } 24 | 25 | void _onSearch() { 26 | final text = _textEditingController.text.trim(); 27 | 28 | if (text.isEmpty) { 29 | context.showTopError( 30 | title: LocaleKeyConstants.pleaseEnterSearchText, 31 | ); 32 | return; 33 | } 34 | 35 | if (text.length > _maxCharacterLength) { 36 | context.showTopError( 37 | title: LocaleKeyConstants.enteredLengthShouldBeAtLeast, 38 | ); 39 | 40 | return; 41 | } 42 | 43 | widget.onSearch(_textEditingController.text); 44 | FocusScope.of(context).unfocus(); 45 | } 46 | 47 | @override 48 | Widget build(BuildContext context) { 49 | return Row( 50 | children: [ 51 | Expanded( 52 | child: TextField( 53 | autofocus: true, 54 | textInputAction: TextInputAction.search, 55 | onSubmitted: (_) => _onSearch(), 56 | controller: _textEditingController, 57 | decoration: InputDecoration( 58 | contentPadding: EdgeInsets.zero, 59 | hintText: LocaleKeyConstants.searchPlaceholder, 60 | prefixIcon: const Icon( 61 | Icons.search, 62 | color: ColorConstants.iconColor, 63 | ), 64 | border: OutlineInputBorder( 65 | borderRadius: BorderRadius.circular(8.r), 66 | ), 67 | ), 68 | ), 69 | ), 70 | Gap(8.w), 71 | ElevatedButton( 72 | onPressed: _onSearch, 73 | child: Text(LocaleKeyConstants.searchText), 74 | ), 75 | ], 76 | ); 77 | } 78 | 79 | @override 80 | void dispose() { 81 | _textEditingController.dispose(); 82 | super.dispose(); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /lib/data/data_sources/remote/volumes_data_source.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'volumes_data_source.dart'; 4 | 5 | // ************************************************************************** 6 | // RetrofitGenerator 7 | // ************************************************************************** 8 | 9 | // ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers 10 | 11 | class _VolumesDataSource implements VolumesDataSource { 12 | _VolumesDataSource( 13 | this._dio, { 14 | this.baseUrl, 15 | }); 16 | 17 | final Dio _dio; 18 | 19 | String? baseUrl; 20 | 21 | @override 22 | Future getVolumes( 23 | CancelToken cancelToken, { 24 | required VolumesRequestModel request, 25 | }) async { 26 | final _extra = {}; 27 | final queryParameters = {}; 28 | queryParameters.addAll(request.toJson()); 29 | final _headers = {}; 30 | const Map? _data = null; 31 | final _result = await _dio.fetch>( 32 | _setStreamType(Options( 33 | method: 'GET', 34 | headers: _headers, 35 | extra: _extra, 36 | ) 37 | .compose( 38 | _dio.options, 39 | '/volumes', 40 | queryParameters: queryParameters, 41 | data: _data, 42 | cancelToken: cancelToken, 43 | ) 44 | .copyWith( 45 | baseUrl: _combineBaseUrls( 46 | _dio.options.baseUrl, 47 | baseUrl, 48 | )))); 49 | final value = VolumeResponseModel.fromJson(_result.data!); 50 | return value; 51 | } 52 | 53 | RequestOptions _setStreamType(RequestOptions requestOptions) { 54 | if (T != dynamic && 55 | !(requestOptions.responseType == ResponseType.bytes || 56 | requestOptions.responseType == ResponseType.stream)) { 57 | if (T == String) { 58 | requestOptions.responseType = ResponseType.plain; 59 | } else { 60 | requestOptions.responseType = ResponseType.json; 61 | } 62 | } 63 | return requestOptions; 64 | } 65 | 66 | String _combineBaseUrls( 67 | String dioBaseUrl, 68 | String? baseUrl, 69 | ) { 70 | if (baseUrl == null || baseUrl.trim().isEmpty) { 71 | return dioBaseUrl; 72 | } 73 | 74 | final url = Uri.parse(baseUrl); 75 | 76 | if (url.isAbsolute) { 77 | return url.toString(); 78 | } 79 | 80 | return Uri.parse(dioBaseUrl).resolveUri(url).toString(); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /lib/routers/app_router.gr.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | // ************************************************************************** 4 | // AutoRouterGenerator 5 | // ************************************************************************** 6 | 7 | // ignore_for_file: type=lint 8 | // coverage:ignore-file 9 | 10 | part of 'app_router.dart'; 11 | 12 | abstract class _$AppRouter extends RootStackRouter { 13 | // ignore: unused_element 14 | _$AppRouter({super.navigatorKey}); 15 | 16 | @override 17 | final Map pagesMap = { 18 | FavoritesRoute.name: (routeData) { 19 | final args = routeData.argsAs( 20 | orElse: () => const FavoritesRouteArgs()); 21 | return AutoRoutePage( 22 | routeData: routeData, 23 | child: FavoritesView(key: args.key), 24 | ); 25 | }, 26 | SearchRoute.name: (routeData) { 27 | final args = routeData.argsAs( 28 | orElse: () => const SearchRouteArgs()); 29 | return AutoRoutePage( 30 | routeData: routeData, 31 | child: SearchView(key: args.key), 32 | ); 33 | }, 34 | }; 35 | } 36 | 37 | /// generated route for 38 | /// [FavoritesView] 39 | class FavoritesRoute extends PageRouteInfo { 40 | FavoritesRoute({ 41 | Key? key, 42 | List? children, 43 | }) : super( 44 | FavoritesRoute.name, 45 | args: FavoritesRouteArgs(key: key), 46 | initialChildren: children, 47 | ); 48 | 49 | static const String name = 'FavoritesRoute'; 50 | 51 | static const PageInfo page = 52 | PageInfo(name); 53 | } 54 | 55 | class FavoritesRouteArgs { 56 | const FavoritesRouteArgs({this.key}); 57 | 58 | final Key? key; 59 | 60 | @override 61 | String toString() { 62 | return 'FavoritesRouteArgs{key: $key}'; 63 | } 64 | } 65 | 66 | /// generated route for 67 | /// [SearchView] 68 | class SearchRoute extends PageRouteInfo { 69 | SearchRoute({ 70 | Key? key, 71 | List? children, 72 | }) : super( 73 | SearchRoute.name, 74 | args: SearchRouteArgs(key: key), 75 | initialChildren: children, 76 | ); 77 | 78 | static const String name = 'SearchRoute'; 79 | 80 | static const PageInfo page = PageInfo(name); 81 | } 82 | 83 | class SearchRouteArgs { 84 | const SearchRouteArgs({this.key}); 85 | 86 | final Key? key; 87 | 88 | @override 89 | String toString() { 90 | return 'SearchRouteArgs{key: $key}'; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /lib/domain/entities/volume_response_entity.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:my_favorite_books/data/models/volume_response_model.dart'; 3 | 4 | final class VolumeResponseEntity extends Equatable { 5 | final List? items; 6 | final int totalItems; 7 | 8 | const VolumeResponseEntity({ 9 | required this.items, 10 | required this.totalItems, 11 | }); 12 | 13 | @override 14 | List get props => [items, totalItems]; 15 | } 16 | 17 | final class VolumeItemEntity extends Equatable { 18 | final VolumeInfoEntity volumeInfo; 19 | final String id; 20 | 21 | const VolumeItemEntity({ 22 | required this.volumeInfo, 23 | required this.id, 24 | }); 25 | 26 | @override 27 | List get props => [volumeInfo, id]; 28 | 29 | VolumeItemModel toModel() { 30 | return VolumeItemModel( 31 | id: id, 32 | volumeInfo: volumeInfo.toModel(), 33 | ); 34 | } 35 | } 36 | 37 | final class VolumeInfoEntity extends Equatable { 38 | final String? title; 39 | final String? description; 40 | final String? publisher; 41 | final String? publishedDate; 42 | final int? pageCount; 43 | final ImageLinksEntity? imageLinks; 44 | final List? authors; 45 | 46 | String? get author => authors?.join(', '); 47 | 48 | const VolumeInfoEntity({ 49 | this.title, 50 | this.description, 51 | this.publisher, 52 | this.publishedDate, 53 | this.pageCount, 54 | this.imageLinks, 55 | this.authors, 56 | }); 57 | 58 | @override 59 | List get props { 60 | return [ 61 | title, 62 | description, 63 | publisher, 64 | publishedDate, 65 | pageCount, 66 | imageLinks, 67 | authors, 68 | ]; 69 | } 70 | 71 | VolumeInfoModel toModel() { 72 | return VolumeInfoModel( 73 | title: title, 74 | description: description, 75 | publisher: publisher, 76 | publishedDate: publishedDate, 77 | pageCount: pageCount, 78 | imageLinks: imageLinks?.toModel(), 79 | authors: authors, 80 | ); 81 | } 82 | } 83 | 84 | final class ImageLinksEntity extends Equatable { 85 | final String? smallThumbnail; 86 | final String? thumbnail; 87 | 88 | const ImageLinksEntity({ 89 | this.smallThumbnail, 90 | this.thumbnail, 91 | }); 92 | 93 | @override 94 | List get props => [smallThumbnail, thumbnail]; 95 | 96 | ImageLinksModel toModel() { 97 | return ImageLinksModel( 98 | smallThumbnail: smallThumbnail, 99 | thumbnail: thumbnail, 100 | ); 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # My Favorite Books 2 | 3 | [![style: very good analysis][very_good_analysis_badge]][very_good_analysis_link] 4 | [![License: MIT][license_badge]][license_link] 5 | 6 | --- 7 | 8 | ## Getting Started 🚀 9 | 10 | In order to run the project, you need to get an API key first from [Google Books API](https://developers.google.com/books/docs/v1/using#APIKey). After you get the API key, you need to create a `.env` file in the root directory and add the following line: 11 | 12 | ```sh 13 | API_KEY=YOUR_API_KEY 14 | ``` 15 | 16 | This project contains 3 flavors: 17 | 18 | - development 19 | - staging 20 | - production 21 | 22 | To run the desired flavor either use the launch configuration in VSCode/Android Studio or use the following commands: 23 | 24 | ```sh 25 | # Development 26 | $ flutter run --flavor development --target lib/main.dart --dart-define APP_ENV=dev 27 | 28 | # Staging 29 | $ flutter run --flavor staging --target lib/main.dart --dart-define APP_ENV=stage 30 | 31 | # Production 32 | $ flutter run --flavor production --target lib/main.dart --dart-define APP_ENV=prod 33 | 34 | ``` 35 | 36 | _\*This project is tested on iOS and Android._ 37 | 38 | ## Summary of the Project 39 | 40 | - This project uses Google Books API to fetch books and display them in a list. You can search for books using the search bar and add books to your favorites list. Remove them from the list if you wish. It's created using the [Very Good CLI][very_good_cli_link]. 41 | - This is a project that mainly uses BLoC with clean architecture pattern. 42 | - API tests are written using Mockito. 43 | 44 | ## Used Packages 45 | 46 | - [dio](https://pub.dev/packages/dio) and [retrofit](https://pub.dev/packages/retrofit) for network calls. 47 | - [fancy_dio_inspector](https://pub.dev/packages/fancy_dio_inspector) for network call inspection _(It's written by [me](https://github.com/yakupemeksiz) and [Gökhan Çavuş](https://github.com/gokhancvs))_. 48 | - [equatable](https://pub.dev/packages/equatable) for value equality. 49 | - [flutter_bloc](https://pub.dev/packages/flutter_bloc) for state management. 50 | - [get_it](https://pub.dev/packages/get_it) and [injectable](https://pub.dev/packages/injectable) for dependency injection. 51 | - [mockito](https://pub.dev/packages/mockito) for mocking. 52 | - [easy_localization](https://pub.dev/packages/easy_localization) for localization. 53 | - [either_dart](https://pub.dev/packages/either_dart) for error handling. 54 | - [flutter_screenutil](https://pub.dev/packages/flutter_screenutil) for responsive UI. 55 | - [hive_flutter](https://pub.dev/packages/hive_flutter) for local storage. 56 | 57 | [license_badge]: https://img.shields.io/badge/license-MIT-blue.svg 58 | [license_link]: https://opensource.org/licenses/MIT 59 | [very_good_analysis_badge]: https://img.shields.io/badge/style-very_good_analysis-B22C89.svg 60 | [very_good_analysis_link]: https://pub.dev/packages/very_good_analysis 61 | [very_good_cli_link]: https://github.com/VeryGoodOpenSource/very_good_cli 62 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.lock 4 | *.log 5 | *.pyc 6 | *.swp 7 | .DS_Store 8 | .atom/ 9 | .buildlog/ 10 | .history 11 | .svn/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/* 18 | 19 | # Visual Studio Code related 20 | .classpath 21 | .project 22 | .settings/ 23 | .vscode/* 24 | 25 | # Flutter repo-specific 26 | /bin/cache/ 27 | /bin/mingit/ 28 | /dev/benchmarks/mega_gallery/ 29 | /dev/bots/.recipe_deps 30 | /dev/bots/android_tools/ 31 | /dev/docs/doc/ 32 | /dev/docs/flutter.docs.zip 33 | /dev/docs/lib/ 34 | /dev/docs/pubspec.yaml 35 | /dev/integration_tests/**/xcuserdata 36 | /dev/integration_tests/**/Pods 37 | /packages/flutter/coverage/ 38 | version 39 | 40 | # packages file containing multi-root paths 41 | .packages.generated 42 | 43 | # Flutter/Dart/Pub related 44 | **/doc/api/ 45 | **/ios/Flutter/.last_build_id 46 | .dart_tool/ 47 | .flutter-plugins 48 | .flutter-plugins-dependencies 49 | .packages 50 | .pub-cache/ 51 | .pub/ 52 | build/ 53 | flutter_*.png 54 | linked_*.ds 55 | unlinked.ds 56 | unlinked_spec.ds 57 | .fvm/ 58 | 59 | # Android related 60 | **/android/**/gradle-wrapper.jar 61 | **/android/.gradle 62 | **/android/captures/ 63 | **/android/gradlew 64 | **/android/gradlew.bat 65 | **/android/local.properties 66 | **/android/**/GeneratedPluginRegistrant.java 67 | # **/android/key.properties 68 | **/android/.idea/ 69 | # *.jks 70 | 71 | # iOS/XCode related 72 | **/ios/**/*.mode1v3 73 | **/ios/**/*.mode2v3 74 | **/ios/**/*.moved-aside 75 | **/ios/**/*.pbxuser 76 | **/ios/**/*.perspectivev3 77 | **/ios/**/*sync/ 78 | **/ios/**/.sconsign.dblite 79 | **/ios/**/.tags* 80 | **/ios/**/.vagrant/ 81 | **/ios/**/DerivedData/ 82 | **/ios/**/Icon? 83 | **/ios/**/Pods/ 84 | **/ios/**/.symlinks/ 85 | **/ios/**/profile 86 | **/ios/**/xcuserdata 87 | **/ios/.generated/ 88 | **/ios/Flutter/App.framework 89 | **/ios/Flutter/Flutter.framework 90 | **/ios/Flutter/Flutter.podspec 91 | **/ios/Flutter/Generated.xcconfig 92 | **/ios/Flutter/app.flx 93 | **/ios/Flutter/app.zip 94 | **/ios/Flutter/.last_build_id 95 | **/ios/Flutter/flutter_assets/ 96 | **/ios/Flutter/flutter_export_environment.sh 97 | **/ios/ServiceDefinitions.json 98 | **/ios/Runner/GeneratedPluginRegistrant.* 99 | 100 | # Coverage 101 | coverage/ 102 | 103 | # Submodules 104 | !pubspec.lock 105 | packages/**/pubspec.lock 106 | 107 | # Web related 108 | lib/generated_plugin_registrant.dart 109 | 110 | # Symbolication related 111 | app.*.symbols 112 | 113 | # Obfuscation related 114 | app.*.map.json 115 | 116 | # Exceptions to the above rules. 117 | !**/ios/**/default.mode1v3 118 | !**/ios/**/default.mode2v3 119 | !**/ios/**/default.pbxuser 120 | !**/ios/**/default.perspectivev3 121 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 122 | !/dev/ci/**/Gemfile.lock 123 | !.vscode/extensions.json 124 | !.vscode/launch.json 125 | !.idea/codeStyles/ 126 | !.idea/dictionaries/ 127 | !.idea/runConfigurations/ 128 | .env -------------------------------------------------------------------------------- /test/data/repositories/volumes_repository_impl_test.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:dio/dio.dart'; 4 | import 'package:either_dart/either.dart'; 5 | import 'package:flutter_test/flutter_test.dart'; 6 | import 'package:mockito/mockito.dart'; 7 | import 'package:my_favorite_books/core/error/failure.dart'; 8 | import 'package:my_favorite_books/data/repositories/remote/volumes_repository_impl.dart'; 9 | import 'package:my_favorite_books/domain/entities/volume_response_entity.dart'; 10 | 11 | import '../../helpers/test_helper.dart'; 12 | import '../../helpers/test_helper.mocks.dart'; 13 | 14 | void main() { 15 | late MockVolumesDataSource volumesDataSource; 16 | late VolumesRepositoryImpl volumesRepositoryImpl; 17 | 18 | provideDummy(dummyVolumeResponseModel); 19 | 20 | setUp(() async { 21 | volumesDataSource = MockVolumesDataSource(); 22 | volumesRepositoryImpl = VolumesRepositoryImpl(volumesDataSource); 23 | }); 24 | 25 | group('get volumes', () { 26 | test('should return a volumeResponseEntity', () async { 27 | when( 28 | volumesDataSource.getVolumes( 29 | any, 30 | request: volumesRequestModel, 31 | ), 32 | ).thenAnswer( 33 | (_) async => dummyVolumeResponseModel, 34 | ); 35 | 36 | final result = await volumesRepositoryImpl.getVolumes( 37 | CancelToken(), 38 | request: volumesRequestModel, 39 | ); 40 | 41 | expect( 42 | result, 43 | equals(Right(dummyVolumeResponseEntity)), 44 | ); 45 | }); 46 | 47 | test('should return a failure', () async { 48 | when( 49 | volumesDataSource.getVolumes( 50 | any, 51 | request: volumesRequestModel, 52 | ), 53 | ).thenThrow( 54 | DioException( 55 | requestOptions: RequestOptions(), 56 | type: DioExceptionType.badCertificate, 57 | ), 58 | ); 59 | 60 | final result = await volumesRepositoryImpl.getVolumes( 61 | CancelToken(), 62 | request: volumesRequestModel, 63 | ); 64 | 65 | expect( 66 | result, 67 | equals( 68 | const Left( 69 | ConnectionFailure('Connection failure'), 70 | ), 71 | ), 72 | ); 73 | }); 74 | 75 | test('should return connection failure when the device has no internet', 76 | () async { 77 | when( 78 | volumesDataSource.getVolumes( 79 | any, 80 | request: volumesRequestModel, 81 | ), 82 | ).thenThrow( 83 | const SocketException('Failed to connect to the network'), 84 | ); 85 | 86 | final result = await volumesRepositoryImpl.getVolumes( 87 | CancelToken(), 88 | request: volumesRequestModel, 89 | ); 90 | 91 | expect( 92 | result, 93 | equals( 94 | const Left( 95 | ConnectionFailure('Failed to connect to the network'), 96 | ), 97 | ), 98 | ); 99 | }); 100 | }); 101 | } 102 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/staging.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 60 | 62 | 68 | 69 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/production.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 60 | 62 | 68 | 69 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/development.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 60 | 62 | 68 | 69 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /lib/presentation/views/search/cubit/search_cubit.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:dio/dio.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:injectable/injectable.dart'; 6 | import 'package:my_favorite_books/core/cubit/base_cubit.dart'; 7 | import 'package:my_favorite_books/domain/entities/volume_request_entity.dart'; 8 | import 'package:my_favorite_books/domain/entities/volume_response_entity.dart'; 9 | import 'package:my_favorite_books/domain/use_cases/add_favorite_use_case.dart'; 10 | import 'package:my_favorite_books/domain/use_cases/close_favorite_use_case.dart'; 11 | import 'package:my_favorite_books/domain/use_cases/get_favorites_use_case.dart'; 12 | import 'package:my_favorite_books/domain/use_cases/get_volumes_use_case.dart'; 13 | import 'package:my_favorite_books/domain/use_cases/remove_favorites_use_case.dart'; 14 | import 'package:my_favorite_books/domain/use_cases/stream_favorites_use_case.dart'; 15 | 16 | part 'search_state.dart'; 17 | 18 | @injectable 19 | final class SearchCubit extends BaseCubit { 20 | final GetVolumesUseCase _getVolumesUseCase; 21 | final GetFavoritesUseCase _getFavoritesUseCase; 22 | final AddFavoriteUseCase _addFavoriteUseCase; 23 | final RemoveFavoriteUseCase _removeFavoriteUseCase; 24 | final StreamFavoritesUseCase _streamFavoritesUseCase; 25 | final CloseFavoriteUseCase _closeFavoriteUseCase; 26 | final CancelToken _cancelToken = CancelToken(); 27 | 28 | SearchCubit( 29 | this._getVolumesUseCase, 30 | this._getFavoritesUseCase, 31 | this._addFavoriteUseCase, 32 | this._removeFavoriteUseCase, 33 | this._streamFavoritesUseCase, 34 | this._closeFavoriteUseCase, 35 | ) : super(const SearchInitial()); 36 | 37 | final List _favoriteVolumes = []; 38 | late final StreamSubscription> _subscription; 39 | 40 | @override 41 | void onBindingCreated() { 42 | super.onBindingCreated(); 43 | 44 | _subscription = _streamFavoritesUseCase.call().listen((event) { 45 | if (state is SearchLoaded) { 46 | emit( 47 | (state as SearchLoaded).copyWith(favoriteVolumes: event), 48 | ); 49 | } 50 | }); 51 | } 52 | 53 | Future getVolumes(String text) async { 54 | emit(const SearchLoading()); 55 | _favoriteVolumes 56 | ..clear() 57 | ..addAll(_getFavoritesUseCase.call()); 58 | 59 | final res = await _getVolumesUseCase.call( 60 | request: VolumesRequestEntity(query: text), 61 | cancelToken: _cancelToken, 62 | ); 63 | res.fold( 64 | (left) { 65 | emit(SearchError(message: left?.message ?? '')); 66 | }, 67 | (right) => { 68 | emit( 69 | SearchLoaded( 70 | volumeResponseEntity: right, 71 | favoriteVolumes: _favoriteVolumes, 72 | ), 73 | ), 74 | }, 75 | ); 76 | } 77 | 78 | void addToFavorites(VolumeItemEntity entity) { 79 | _addFavoriteUseCase.call(entity.id, entity); 80 | } 81 | 82 | void removeFromFavorites(VolumeItemEntity entity) { 83 | _removeFavoriteUseCase.call(entity.id); 84 | } 85 | 86 | @override 87 | Future close() { 88 | _cancelToken.cancel(); 89 | _closeFavoriteUseCase.call(); 90 | _subscription.cancel(); 91 | return super.close(); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /windows/runner/Runner.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | #include "resource.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #include "winres.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (United States) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Icon 51 | // 52 | 53 | // Icon with lowest ID value placed first to ensure application icon 54 | // remains consistent on all systems. 55 | IDI_APP_ICON ICON "resources\\app_icon.ico" 56 | 57 | 58 | ///////////////////////////////////////////////////////////////////////////// 59 | // 60 | // Version 61 | // 62 | 63 | #ifdef FLUTTER_BUILD_NUMBER 64 | #define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER 65 | #else 66 | #define VERSION_AS_NUMBER 1,0,0 67 | #endif 68 | 69 | #ifdef FLUTTER_BUILD_NAME 70 | #define VERSION_AS_STRING #FLUTTER_BUILD_NAME 71 | #else 72 | #define VERSION_AS_STRING "1.0.0" 73 | #endif 74 | 75 | VS_VERSION_INFO VERSIONINFO 76 | FILEVERSION VERSION_AS_NUMBER 77 | PRODUCTVERSION VERSION_AS_NUMBER 78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 79 | #ifdef _DEBUG 80 | FILEFLAGS VS_FF_DEBUG 81 | #else 82 | FILEFLAGS 0x0L 83 | #endif 84 | FILEOS VOS__WINDOWS32 85 | FILETYPE VFT_APP 86 | FILESUBTYPE 0x0L 87 | BEGIN 88 | BLOCK "StringFileInfo" 89 | BEGIN 90 | BLOCK "040904e4" 91 | BEGIN 92 | VALUE "CompanyName", "com.emeksiz.my-favorite-books" "\0" 93 | VALUE "FileDescription", "my_favorite_books" "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "my_favorite_books" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2022 com.emeksiz.my-favorite-books. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "my_favorite_books.exe" "\0" 98 | VALUE "ProductName", "My Favorite Books" "\0" 99 | VALUE "ProductVersion", VERSION_AS_STRING "\0" 100 | END 101 | END 102 | BLOCK "VarFileInfo" 103 | BEGIN 104 | VALUE "Translation", 0x409, 1252 105 | END 106 | END 107 | 108 | #endif // English (United States) resources 109 | ///////////////////////////////////////////////////////////////////////////// 110 | 111 | 112 | 113 | #ifndef APSTUDIO_INVOKED 114 | ///////////////////////////////////////////////////////////////////////////// 115 | // 116 | // Generated from the TEXTINCLUDE 3 resource. 117 | // 118 | 119 | 120 | ///////////////////////////////////////////////////////////////////////////// 121 | #endif // not APSTUDIO_INVOKED 122 | -------------------------------------------------------------------------------- /windows/runner/win32_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_WIN32_WINDOW_H_ 2 | #define RUNNER_WIN32_WINDOW_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be 11 | // inherited from by classes that wish to specialize with custom 12 | // rendering and input handling 13 | class Win32Window { 14 | public: 15 | struct Point { 16 | unsigned int x; 17 | unsigned int y; 18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {} 19 | }; 20 | 21 | struct Size { 22 | unsigned int width; 23 | unsigned int height; 24 | Size(unsigned int width, unsigned int height) 25 | : width(width), height(height) {} 26 | }; 27 | 28 | Win32Window(); 29 | virtual ~Win32Window(); 30 | 31 | // Creates and shows a win32 window with |title| and position and size using 32 | // |origin| and |size|. New windows are created on the default monitor. Window 33 | // sizes are specified to the OS in physical pixels, hence to ensure a 34 | // consistent size to will treat the width height passed in to this function 35 | // as logical pixels and scale to appropriate for the default monitor. Returns 36 | // true if the window was created successfully. 37 | bool CreateAndShow(const std::wstring& title, 38 | const Point& origin, 39 | const Size& size); 40 | 41 | // Release OS resources associated with window. 42 | void Destroy(); 43 | 44 | // Inserts |content| into the window tree. 45 | void SetChildContent(HWND content); 46 | 47 | // Returns the backing Window handle to enable clients to set icon and other 48 | // window properties. Returns nullptr if the window has been destroyed. 49 | HWND GetHandle(); 50 | 51 | // If true, closing this window will quit the application. 52 | void SetQuitOnClose(bool quit_on_close); 53 | 54 | // Return a RECT representing the bounds of the current client area. 55 | RECT GetClientArea(); 56 | 57 | protected: 58 | // Processes and route salient window messages for mouse handling, 59 | // size change and DPI. Delegates handling of these to member overloads that 60 | // inheriting classes can handle. 61 | virtual LRESULT MessageHandler(HWND window, 62 | UINT const message, 63 | WPARAM const wparam, 64 | LPARAM const lparam) noexcept; 65 | 66 | // Called when CreateAndShow is called, allowing subclass window-related 67 | // setup. Subclasses should return false if setup fails. 68 | virtual bool OnCreate(); 69 | 70 | // Called when Destroy is called. 71 | virtual void OnDestroy(); 72 | 73 | private: 74 | friend class WindowClassRegistrar; 75 | 76 | // OS callback called by message pump. Handles the WM_NCCREATE message which 77 | // is passed when the non-client area is being created and enables automatic 78 | // non-client DPI scaling so that the non-client area automatically 79 | // responsponds to changes in DPI. All other messages are handled by 80 | // MessageHandler. 81 | static LRESULT CALLBACK WndProc(HWND const window, 82 | UINT const message, 83 | WPARAM const wparam, 84 | LPARAM const lparam) noexcept; 85 | 86 | // Retrieves a class instance pointer for |window| 87 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 88 | 89 | bool quit_on_close_ = false; 90 | 91 | // window handle for top level window. 92 | HWND window_handle_ = nullptr; 93 | 94 | // window handle for hosted content. 95 | HWND child_content_ = nullptr; 96 | }; 97 | 98 | #endif // RUNNER_WIN32_WINDOW_H_ 99 | --------------------------------------------------------------------------------