diff --git a/.fvm/fvm_config.json b/.fvm/fvm_config.json
deleted file mode 100644
index d8abe1b9..00000000
--- a/.fvm/fvm_config.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "flutterSdkVersion": "3.13.9",
- "flavors": {}
-}
\ No newline at end of file
diff --git a/.fvmrc b/.fvmrc
new file mode 100644
index 00000000..05b430ce
--- /dev/null
+++ b/.fvmrc
@@ -0,0 +1,3 @@
+{
+ "flutter": "3.13.9"
+}
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 1be2d875..d5a84108 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,6 +30,8 @@
.pub-cache/
.pub/
/build/
+**/build/
+**/*.mocks.dart
# Web related
lib/generated_plugin_registrant.dart
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 5d0f1d3e..376bcb43 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -5,9 +5,28 @@
"version": "0.2.0",
"configurations": [
{
- "name": "app",
+ "name": "app-dev",
"request": "launch",
- "type": "dart"
- }
+ "type": "dart",
+ "program": "${workspaceFolder}\/lib\/main_dev.dart",
+ },
+ {
+ "name": "app-prod",
+ "request": "launch",
+ "type": "dart",
+ "program": "${workspaceFolder}\/lib\/main_prod.dart",
+ },
+ {
+ "name": "app-dev-windows",
+ "request": "launch",
+ "type": "dart",
+ "program": "${workspaceFolder}\\lib\\main_dev.dart",
+ },
+ {
+ "name": "app-prod-windows",
+ "request": "launch",
+ "type": "dart",
+ "program": "${workspaceFolder}\\lib\\main_prod.dart",
+ },
]
}
\ No newline at end of file
diff --git a/.vscode/settings.json b/.vscode/settings.json
index f285aa4a..5cc2e6d0 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,9 +1,11 @@
{
"dart.flutterSdkPath": ".fvm/flutter_sdk",
- "search.exclude": {
- "**/.fvm": true
- },
- "files.watcherExclude": {
- "**/.fvm": true
- }
+ // Remove .fvm files from search
+ "search.exclude": {
+ "**/.fvm": true
+ },
+ // Remove from file watching
+ "files.watcherExclude": {
+ "**/.fvm": true
+ }
}
\ No newline at end of file
diff --git a/README.md b/README.md
index 6c2ea7c9..effdcce4 100644
--- a/README.md
+++ b/README.md
@@ -181,3 +181,52 @@ Just create a new issue in this repo and we will respond and get back to you qui
## Review
The coding challenge is a take-home test upon which we'll be conducting a thorough code review once complete. The review will consist of meeting some more of our mobile engineers and giving a review of the solution you have designed. Please be prepared to share your screen and run/demo the application to the group. During this process, the engineers will be asking questions.
+
+---
+
+## Clear documentation on the structure and architecture of your application.
+
+I based the app structure on a mix of "package by layer" and "package by feature" called as "package by convenience" on [this book](https://www.kodeco.com/14214369-infinite-scrolling-pagination-in-flutter).
+
+Basically follow similar rules:
+### 1 Features get their own package
+
+In this project a feature can be considered as any screen
+
+### 2 Features don't know each other
+
+The navigation responsability is designated to the [AppRouter](lib\app_router.dart)
+
+### 3 Repositories get their own package
+
+In this project, repository was understood as data sources and each one got their own package
+- [YelpRepository](packages\yelp_repository\lib\src\yelp_repository.dart): Responsible to retrieve data from yelp api
+- [LocalStorage](packages\local_storage\lib\src\local_storage.dart): Responsible to store data in the device
+
+### 4 Specialized packages
+
+Code that are meant for one specific purpose, but can be used in more than one place
+- [Component Library](packages\component_library): Widgets that were made by design team and are meant to be used in more than one place
+- [Domain Models](packages\domain_models): Data classes that will be used in the features (screens). Other packages that handle other data type must use the other data type only internally.
+
+## Tests
+
+The tests were made in the following files:
+- [unit test](packages\features\restaurant_detail\test\unit\restaurant_detail_cubit_test.dart)
+- [widget/flow test](test\widget_test.dart)
+
+## Environment setup
+If you are using a mac you can:
+- update the [.env_prod](assets\env\/.env_prod) file with the yelp api key
+ - the other file was created to showcase the ability to work on a different environment and do not impact production
+- open the terminal at the project folder and execute: `make setup;`
+- execute the project
+ - the vs code is already setup to launch the correct files, so you can find the runner at the top left on yours and choose `app-prod` and run it
+ - in android studio is necessary to setup the corrent files:
+ - Open your project in Android Studio.
+ - Go to Run -> Edit Configurations....
+ - Click on the + button at the top left of the Run/Debug Configurations dialog to add a new configuration.
+ - Select Flutter.
+ - In the Name field, enter the name of the configuration (e.g., "app-dev").
+ - In the Dart entrypoint field, enter the path to the Dart file you want to run (e.g., "lib/main_dev.dart").
+ - Click OK to save the configuration.
\ No newline at end of file
diff --git a/android/app/build.gradle b/android/app/build.gradle
index e47cb81d..48e4ccd6 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
- compileSdkVersion flutter.compileSdkVersion
+ compileSdkVersion 34
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
diff --git a/android/build.gradle b/android/build.gradle
index 24047dce..705e0375 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -1,12 +1,12 @@
buildscript {
- ext.kotlin_version = '1.3.50'
+ ext.kotlin_version = '1.9.23'
repositories {
google()
mavenCentral()
}
dependencies {
- classpath 'com.android.tools.build:gradle:4.1.0'
+ classpath 'com.android.tools.build:gradle:4.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
@@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}
-task clean(type: Delete) {
+tasks.register("clean", Delete) {
delete rootProject.buildDir
}
diff --git a/android/gradle.properties b/android/gradle.properties
index 94adc3a3..40d43bcf 100644
--- a/android/gradle.properties
+++ b/android/gradle.properties
@@ -1,3 +1,9 @@
-org.gradle.jvmargs=-Xmx1536M
+# Fix made following instruction from: https://stackoverflow.com/a/69179997/10507546
+org.gradle.jvmargs=-Xmx1536M \
+--add-exports=java.base/sun.nio.ch=ALL-UNNAMED \
+--add-opens=java.base/java.lang=ALL-UNNAMED \
+--add-opens=java.base/java.lang.reflect=ALL-UNNAMED \
+--add-opens=java.base/java.io=ALL-UNNAMED \
+--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED
android.useAndroidX=true
android.enableJetifier=true
diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties
index bc6a58af..cfe88f69 100644
--- a/android/gradle/wrapper/gradle-wrapper.properties
+++ b/android/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
diff --git a/assets/env/.env_dev b/assets/env/.env_dev
new file mode 100644
index 00000000..5e98a47e
--- /dev/null
+++ b/assets/env/.env_dev
@@ -0,0 +1 @@
+yelpApiKey=YOUR_API_KEY_HERE
\ No newline at end of file
diff --git a/assets/env/.env_prod b/assets/env/.env_prod
new file mode 100644
index 00000000..5e98a47e
--- /dev/null
+++ b/assets/env/.env_prod
@@ -0,0 +1 @@
+yelpApiKey=YOUR_API_KEY_HERE
\ No newline at end of file
diff --git a/assets/fonts/Lora/Lora-Bold.ttf b/assets/fonts/Lora/Lora-Bold.ttf
new file mode 100644
index 00000000..530c9e11
Binary files /dev/null and b/assets/fonts/Lora/Lora-Bold.ttf differ
diff --git a/assets/fonts/Lora/Lora-BoldItalic.ttf b/assets/fonts/Lora/Lora-BoldItalic.ttf
new file mode 100644
index 00000000..6bcc76b0
Binary files /dev/null and b/assets/fonts/Lora/Lora-BoldItalic.ttf differ
diff --git a/assets/fonts/Lora/Lora-Italic.ttf b/assets/fonts/Lora/Lora-Italic.ttf
new file mode 100644
index 00000000..d93bc5fc
Binary files /dev/null and b/assets/fonts/Lora/Lora-Italic.ttf differ
diff --git a/assets/fonts/Lora/Lora-Medium.ttf b/assets/fonts/Lora/Lora-Medium.ttf
new file mode 100644
index 00000000..85ca5a27
Binary files /dev/null and b/assets/fonts/Lora/Lora-Medium.ttf differ
diff --git a/assets/fonts/Lora/Lora-MediumItalic.ttf b/assets/fonts/Lora/Lora-MediumItalic.ttf
new file mode 100644
index 00000000..42208fbe
Binary files /dev/null and b/assets/fonts/Lora/Lora-MediumItalic.ttf differ
diff --git a/assets/fonts/Lora/Lora-Regular.ttf b/assets/fonts/Lora/Lora-Regular.ttf
new file mode 100644
index 00000000..2b1dab45
Binary files /dev/null and b/assets/fonts/Lora/Lora-Regular.ttf differ
diff --git a/assets/fonts/Lora/Lora-SemiBold.ttf b/assets/fonts/Lora/Lora-SemiBold.ttf
new file mode 100644
index 00000000..3a7c6d75
Binary files /dev/null and b/assets/fonts/Lora/Lora-SemiBold.ttf differ
diff --git a/assets/fonts/Lora/Lora-SemiBoldItalic.ttf b/assets/fonts/Lora/Lora-SemiBoldItalic.ttf
new file mode 100644
index 00000000..16c8254d
Binary files /dev/null and b/assets/fonts/Lora/Lora-SemiBoldItalic.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans-Bold.ttf b/assets/fonts/OpenSans/OpenSans-Bold.ttf
new file mode 100644
index 00000000..98c74e0a
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans-Bold.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans-BoldItalic.ttf b/assets/fonts/OpenSans/OpenSans-BoldItalic.ttf
new file mode 100644
index 00000000..85589283
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans-BoldItalic.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans-ExtraBold.ttf b/assets/fonts/OpenSans/OpenSans-ExtraBold.ttf
new file mode 100644
index 00000000..4eb33935
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans-ExtraBold.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans-ExtraBoldItalic.ttf b/assets/fonts/OpenSans/OpenSans-ExtraBoldItalic.ttf
new file mode 100644
index 00000000..75789b42
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans-ExtraBoldItalic.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans-Italic.ttf b/assets/fonts/OpenSans/OpenSans-Italic.ttf
new file mode 100644
index 00000000..29ff6938
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans-Italic.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans-Light.ttf b/assets/fonts/OpenSans/OpenSans-Light.ttf
new file mode 100644
index 00000000..ea175cc3
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans-Light.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans-LightItalic.ttf b/assets/fonts/OpenSans/OpenSans-LightItalic.ttf
new file mode 100644
index 00000000..edbfe0b7
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans-LightItalic.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans-Medium.ttf b/assets/fonts/OpenSans/OpenSans-Medium.ttf
new file mode 100644
index 00000000..ae716936
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans-Medium.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans-MediumItalic.ttf b/assets/fonts/OpenSans/OpenSans-MediumItalic.ttf
new file mode 100644
index 00000000..6d1e09b2
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans-MediumItalic.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans-Regular.ttf b/assets/fonts/OpenSans/OpenSans-Regular.ttf
new file mode 100644
index 00000000..67803bb6
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans-Regular.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans-SemiBold.ttf b/assets/fonts/OpenSans/OpenSans-SemiBold.ttf
new file mode 100644
index 00000000..e5ab4644
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans-SemiBold.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans-SemiBoldItalic.ttf b/assets/fonts/OpenSans/OpenSans-SemiBoldItalic.ttf
new file mode 100644
index 00000000..cd23e154
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans-SemiBoldItalic.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans_Condensed-Bold.ttf b/assets/fonts/OpenSans/OpenSans_Condensed-Bold.ttf
new file mode 100644
index 00000000..525397da
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans_Condensed-Bold.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans_Condensed-BoldItalic.ttf b/assets/fonts/OpenSans/OpenSans_Condensed-BoldItalic.ttf
new file mode 100644
index 00000000..d6c9bc0a
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans_Condensed-BoldItalic.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans_Condensed-ExtraBold.ttf b/assets/fonts/OpenSans/OpenSans_Condensed-ExtraBold.ttf
new file mode 100644
index 00000000..3e600b9a
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans_Condensed-ExtraBold.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans_Condensed-ExtraBoldItalic.ttf b/assets/fonts/OpenSans/OpenSans_Condensed-ExtraBoldItalic.ttf
new file mode 100644
index 00000000..03936508
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans_Condensed-ExtraBoldItalic.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans_Condensed-Italic.ttf b/assets/fonts/OpenSans/OpenSans_Condensed-Italic.ttf
new file mode 100644
index 00000000..fdf0a52e
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans_Condensed-Italic.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans_Condensed-Light.ttf b/assets/fonts/OpenSans/OpenSans_Condensed-Light.ttf
new file mode 100644
index 00000000..459be7b4
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans_Condensed-Light.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans_Condensed-LightItalic.ttf b/assets/fonts/OpenSans/OpenSans_Condensed-LightItalic.ttf
new file mode 100644
index 00000000..5f05d08e
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans_Condensed-LightItalic.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans_Condensed-Medium.ttf b/assets/fonts/OpenSans/OpenSans_Condensed-Medium.ttf
new file mode 100644
index 00000000..802200d2
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans_Condensed-Medium.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans_Condensed-MediumItalic.ttf b/assets/fonts/OpenSans/OpenSans_Condensed-MediumItalic.ttf
new file mode 100644
index 00000000..b43786bb
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans_Condensed-MediumItalic.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans_Condensed-Regular.ttf b/assets/fonts/OpenSans/OpenSans_Condensed-Regular.ttf
new file mode 100644
index 00000000..a2a83ac6
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans_Condensed-Regular.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans_Condensed-SemiBold.ttf b/assets/fonts/OpenSans/OpenSans_Condensed-SemiBold.ttf
new file mode 100644
index 00000000..75bcd43c
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans_Condensed-SemiBold.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans_Condensed-SemiBoldItalic.ttf b/assets/fonts/OpenSans/OpenSans_Condensed-SemiBoldItalic.ttf
new file mode 100644
index 00000000..9fcaa52e
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans_Condensed-SemiBoldItalic.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans_SemiCondensed-Bold.ttf b/assets/fonts/OpenSans/OpenSans_SemiCondensed-Bold.ttf
new file mode 100644
index 00000000..dc927fc9
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans_SemiCondensed-Bold.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans_SemiCondensed-BoldItalic.ttf b/assets/fonts/OpenSans/OpenSans_SemiCondensed-BoldItalic.ttf
new file mode 100644
index 00000000..7601048e
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans_SemiCondensed-BoldItalic.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans_SemiCondensed-ExtraBold.ttf b/assets/fonts/OpenSans/OpenSans_SemiCondensed-ExtraBold.ttf
new file mode 100644
index 00000000..d6864b1d
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans_SemiCondensed-ExtraBold.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans_SemiCondensed-ExtraBoldItalic.ttf b/assets/fonts/OpenSans/OpenSans_SemiCondensed-ExtraBoldItalic.ttf
new file mode 100644
index 00000000..ec7ade58
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans_SemiCondensed-ExtraBoldItalic.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans_SemiCondensed-Italic.ttf b/assets/fonts/OpenSans/OpenSans_SemiCondensed-Italic.ttf
new file mode 100644
index 00000000..7fc00c82
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans_SemiCondensed-Italic.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans_SemiCondensed-Light.ttf b/assets/fonts/OpenSans/OpenSans_SemiCondensed-Light.ttf
new file mode 100644
index 00000000..5936496a
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans_SemiCondensed-Light.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans_SemiCondensed-LightItalic.ttf b/assets/fonts/OpenSans/OpenSans_SemiCondensed-LightItalic.ttf
new file mode 100644
index 00000000..7ced21a7
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans_SemiCondensed-LightItalic.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans_SemiCondensed-Medium.ttf b/assets/fonts/OpenSans/OpenSans_SemiCondensed-Medium.ttf
new file mode 100644
index 00000000..25b1aadf
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans_SemiCondensed-Medium.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans_SemiCondensed-MediumItalic.ttf b/assets/fonts/OpenSans/OpenSans_SemiCondensed-MediumItalic.ttf
new file mode 100644
index 00000000..fd87f785
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans_SemiCondensed-MediumItalic.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans_SemiCondensed-Regular.ttf b/assets/fonts/OpenSans/OpenSans_SemiCondensed-Regular.ttf
new file mode 100644
index 00000000..5b09b35b
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans_SemiCondensed-Regular.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans_SemiCondensed-SemiBold.ttf b/assets/fonts/OpenSans/OpenSans_SemiCondensed-SemiBold.ttf
new file mode 100644
index 00000000..fff3a372
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans_SemiCondensed-SemiBold.ttf differ
diff --git a/assets/fonts/OpenSans/OpenSans_SemiCondensed-SemiBoldItalic.ttf b/assets/fonts/OpenSans/OpenSans_SemiCondensed-SemiBoldItalic.ttf
new file mode 100644
index 00000000..3874205d
Binary files /dev/null and b/assets/fonts/OpenSans/OpenSans_SemiCondensed-SemiBoldItalic.ttf differ
diff --git a/assets/svg/app_got_lost.svg b/assets/svg/app_got_lost.svg
new file mode 100644
index 00000000..1fe9c479
--- /dev/null
+++ b/assets/svg/app_got_lost.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/issue.svg b/assets/svg/issue.svg
new file mode 100644
index 00000000..b77e9a18
--- /dev/null
+++ b/assets/svg/issue.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/svg/no_chef_appreciated_yet.svg b/assets/svg/no_chef_appreciated_yet.svg
new file mode 100644
index 00000000..389f25a5
--- /dev/null
+++ b/assets/svg/no_chef_appreciated_yet.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig
index 592ceee8..ec97fc6f 100644
--- a/ios/Flutter/Debug.xcconfig
+++ b/ios/Flutter/Debug.xcconfig
@@ -1 +1,2 @@
+#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig
index 592ceee8..c4855bfe 100644
--- a/ios/Flutter/Release.xcconfig
+++ b/ios/Flutter/Release.xcconfig
@@ -1 +1,2 @@
+#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
diff --git a/ios/Podfile b/ios/Podfile
new file mode 100644
index 00000000..d7fc3bde
--- /dev/null
+++ b/ios/Podfile
@@ -0,0 +1,51 @@
+# Uncomment this line to define a global platform for your project
+platform :ios, '12.0'
+
+# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
+ENV['COCOAPODS_DISABLE_STATS'] = 'true'
+
+project 'Runner', {
+ 'Debug' => :debug,
+ 'Profile' => :release,
+ 'Release' => :release,
+}
+
+def flutter_root
+ generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
+ unless File.exist?(generated_xcode_build_settings_path)
+ raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
+ end
+
+ File.foreach(generated_xcode_build_settings_path) do |line|
+ matches = line.match(/FLUTTER_ROOT\=(.*)/)
+ return matches[1].strip if matches
+ end
+ raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
+end
+
+require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
+
+flutter_ios_podfile_setup
+
+target 'Runner' do
+ use_frameworks!
+ use_modular_headers!
+
+ flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
+ target 'RunnerTests' do
+ inherit! :search_paths
+ end
+end
+
+post_install do |installer|
+ installer.pods_project.targets.each do |target|
+ # https://github.com/CocoaPods/CocoaPods/issues/12012#issuecomment-1653051943
+ target.build_configurations.each do |config|
+ xcconfig_path = config.base_configuration_reference.real_path
+ xcconfig = File.read(xcconfig_path)
+ xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR")
+ File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
+ end
+ flutter_additional_ios_build_settings(target)
+ end
+end
diff --git a/ios/Podfile.lock b/ios/Podfile.lock
new file mode 100644
index 00000000..0d8b0171
--- /dev/null
+++ b/ios/Podfile.lock
@@ -0,0 +1,43 @@
+PODS:
+ - Flutter (1.0.0)
+ - ObjectBox (1.9.2)
+ - objectbox_flutter_libs (0.0.1):
+ - Flutter
+ - ObjectBox (= 1.9.2)
+ - path_provider_foundation (0.0.1):
+ - Flutter
+ - FlutterMacOS
+ - sqflite (0.0.3):
+ - Flutter
+ - FlutterMacOS
+
+DEPENDENCIES:
+ - Flutter (from `Flutter`)
+ - objectbox_flutter_libs (from `.symlinks/plugins/objectbox_flutter_libs/ios`)
+ - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
+ - sqflite (from `.symlinks/plugins/sqflite/darwin`)
+
+SPEC REPOS:
+ trunk:
+ - ObjectBox
+
+EXTERNAL SOURCES:
+ Flutter:
+ :path: Flutter
+ objectbox_flutter_libs:
+ :path: ".symlinks/plugins/objectbox_flutter_libs/ios"
+ path_provider_foundation:
+ :path: ".symlinks/plugins/path_provider_foundation/darwin"
+ sqflite:
+ :path: ".symlinks/plugins/sqflite/darwin"
+
+SPEC CHECKSUMS:
+ Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
+ ObjectBox: 46757a559717ab49b1cc0612eaff82b705acf394
+ objectbox_flutter_libs: 103f3a273b594cb664255086a386740bc179f97d
+ path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
+ sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
+
+PODFILE CHECKSUM: 42c92566d5242878ca32fa04ae2b7002854ec459
+
+COCOAPODS: 1.11.3
diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj
index 73cf3f6d..f73f9b3b 100644
--- a/ios/Runner.xcodeproj/project.pbxproj
+++ b/ios/Runner.xcodeproj/project.pbxproj
@@ -8,13 +8,26 @@
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
+ 27B2B69F4F528801D31E4221 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2EC8FFB785943631E6DAAE7B /* Pods_RunnerTests.framework */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
+ D45975ABB65572E60A7DE381 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 445083E4E4E1F31CC10529AA /* Pods_Runner.framework */; };
+ FF4BDE782BEE83B7003AC0E6 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF4BDE772BEE83B7003AC0E6 /* RunnerTests.swift */; };
/* End PBXBuildFile section */
+/* Begin PBXContainerItemProxy section */
+ FF4BDE792BEE83B7003AC0E6 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 97C146E61CF9000F007C117D /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 97C146ED1CF9000F007C117D;
+ remoteInfo = Runner;
+ };
+/* End PBXContainerItemProxy section */
+
/* Begin PBXCopyFilesBuildPhase section */
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
@@ -31,10 +44,16 @@
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
+ 2EC8FFB785943631E6DAAE7B /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
+ 445083E4E4E1F31CC10529AA /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ 465FF8388E2F9BF083C3C86A /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; };
+ 734002476802E6293C8EFA65 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
+ 7C21E76A019CE4C169FD3141 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; };
+ 965236B055DD3D800B1D5FB3 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -42,6 +61,10 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ BC2D277017879990F31E1D04 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; };
+ DF59BF3B908830DF6D981809 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; };
+ FF4BDE752BEE83B7003AC0E6 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+ FF4BDE772BEE83B7003AC0E6 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -49,12 +72,30 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ D45975ABB65572E60A7DE381 /* Pods_Runner.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ FF4BDE722BEE83B7003AC0E6 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 27B2B69F4F528801D31E4221 /* Pods_RunnerTests.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
+ 3D12DCF291EC50950AAC15CD /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 445083E4E4E1F31CC10529AA /* Pods_Runner.framework */,
+ 2EC8FFB785943631E6DAAE7B /* Pods_RunnerTests.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "";
+ };
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
@@ -71,7 +112,10 @@
children = (
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
+ FF4BDE762BEE83B7003AC0E6 /* RunnerTests */,
97C146EF1CF9000F007C117D /* Products */,
+ E41CCC2180D851D22E7B492C /* Pods */,
+ 3D12DCF291EC50950AAC15CD /* Frameworks */,
);
sourceTree = "";
};
@@ -79,6 +123,7 @@
isa = PBXGroup;
children = (
97C146EE1CF9000F007C117D /* Runner.app */,
+ FF4BDE752BEE83B7003AC0E6 /* RunnerTests.xctest */,
);
name = Products;
sourceTree = "";
@@ -98,6 +143,28 @@
path = Runner;
sourceTree = "";
};
+ E41CCC2180D851D22E7B492C /* Pods */ = {
+ isa = PBXGroup;
+ children = (
+ DF59BF3B908830DF6D981809 /* Pods-Runner.debug.xcconfig */,
+ 465FF8388E2F9BF083C3C86A /* Pods-Runner.release.xcconfig */,
+ 734002476802E6293C8EFA65 /* Pods-Runner.profile.xcconfig */,
+ BC2D277017879990F31E1D04 /* Pods-RunnerTests.debug.xcconfig */,
+ 965236B055DD3D800B1D5FB3 /* Pods-RunnerTests.release.xcconfig */,
+ 7C21E76A019CE4C169FD3141 /* Pods-RunnerTests.profile.xcconfig */,
+ );
+ name = Pods;
+ path = Pods;
+ sourceTree = "";
+ };
+ FF4BDE762BEE83B7003AC0E6 /* RunnerTests */ = {
+ isa = PBXGroup;
+ children = (
+ FF4BDE772BEE83B7003AC0E6 /* RunnerTests.swift */,
+ );
+ path = RunnerTests;
+ sourceTree = "";
+ };
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -105,12 +172,14 @@
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
+ 60A65498CC328DE8E4CC5442 /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
+ B070597A623337A9F80BF63A /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@@ -121,12 +190,32 @@
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
productType = "com.apple.product-type.application";
};
+ FF4BDE742BEE83B7003AC0E6 /* RunnerTests */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = FF4BDE7E2BEE83B7003AC0E6 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
+ buildPhases = (
+ 5CB8A8538F0A92267E4CEFA9 /* [CP] Check Pods Manifest.lock */,
+ FF4BDE712BEE83B7003AC0E6 /* Sources */,
+ FF4BDE722BEE83B7003AC0E6 /* Frameworks */,
+ FF4BDE732BEE83B7003AC0E6 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ FF4BDE7A2BEE83B7003AC0E6 /* PBXTargetDependency */,
+ );
+ name = RunnerTests;
+ productName = RunnerTests;
+ productReference = FF4BDE752BEE83B7003AC0E6 /* RunnerTests.xctest */;
+ productType = "com.apple.product-type.bundle.unit-test";
+ };
/* End PBXNativeTarget section */
/* Begin PBXProject section */
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
+ LastSwiftUpdateCheck = 1520;
LastUpgradeCheck = 1430;
ORGANIZATIONNAME = "";
TargetAttributes = {
@@ -134,6 +223,10 @@
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 1100;
};
+ FF4BDE742BEE83B7003AC0E6 = {
+ CreatedOnToolsVersion = 15.2;
+ TestTargetID = 97C146ED1CF9000F007C117D;
+ };
};
};
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
@@ -150,6 +243,7 @@
projectRoot = "";
targets = (
97C146ED1CF9000F007C117D /* Runner */,
+ FF4BDE742BEE83B7003AC0E6 /* RunnerTests */,
);
};
/* End PBXProject section */
@@ -166,6 +260,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ FF4BDE732BEE83B7003AC0E6 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
@@ -185,6 +286,50 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
+ 5CB8A8538F0A92267E4CEFA9 /* [CP] Check Pods Manifest.lock */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
+ "${PODS_ROOT}/Manifest.lock",
+ );
+ name = "[CP] Check Pods Manifest.lock";
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
+ showEnvVarsInLog = 0;
+ };
+ 60A65498CC328DE8E4CC5442 /* [CP] Check Pods Manifest.lock */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
+ "${PODS_ROOT}/Manifest.lock",
+ );
+ name = "[CP] Check Pods Manifest.lock";
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
+ showEnvVarsInLog = 0;
+ };
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
@@ -200,6 +345,23 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
+ B070597A623337A9F80BF63A /* [CP] Embed Pods Frameworks */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
+ );
+ name = "[CP] Embed Pods Frameworks";
+ outputFileListPaths = (
+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
+ showEnvVarsInLog = 0;
+ };
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@@ -212,8 +374,24 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ FF4BDE712BEE83B7003AC0E6 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ FF4BDE782BEE83B7003AC0E6 /* RunnerTests.swift in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXSourcesBuildPhase section */
+/* Begin PBXTargetDependency section */
+ FF4BDE7A2BEE83B7003AC0E6 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 97C146ED1CF9000F007C117D /* Runner */;
+ targetProxy = FF4BDE792BEE83B7003AC0E6 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
/* Begin PBXVariantGroup section */
97C146FA1CF9000F007C117D /* Main.storyboard */ = {
isa = PBXVariantGroup;
@@ -455,6 +633,99 @@
};
name = Release;
};
+ FF4BDE7B2BEE83B7003AC0E6 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = BC2D277017879990F31E1D04 /* Pods-RunnerTests.debug.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 1;
+ ENABLE_USER_SCRIPT_SANDBOXING = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu17;
+ GENERATE_INFOPLIST_FILE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 17.2;
+ LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
+ MARKETING_VERSION = 1.0;
+ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+ MTL_FAST_MATH = YES;
+ PRODUCT_BUNDLE_IDENTIFIER = orgId.RunnerTests;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
+ SWIFT_EMIT_LOC_STRINGS = NO;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
+ };
+ name = Debug;
+ };
+ FF4BDE7C2BEE83B7003AC0E6 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 965236B055DD3D800B1D5FB3 /* Pods-RunnerTests.release.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 1;
+ ENABLE_USER_SCRIPT_SANDBOXING = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu17;
+ GENERATE_INFOPLIST_FILE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 17.2;
+ LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
+ MARKETING_VERSION = 1.0;
+ MTL_FAST_MATH = YES;
+ PRODUCT_BUNDLE_IDENTIFIER = orgId.RunnerTests;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_EMIT_LOC_STRINGS = NO;
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
+ };
+ name = Release;
+ };
+ FF4BDE7D2BEE83B7003AC0E6 /* Profile */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 7C21E76A019CE4C169FD3141 /* Pods-RunnerTests.profile.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 1;
+ ENABLE_USER_SCRIPT_SANDBOXING = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu17;
+ GENERATE_INFOPLIST_FILE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 17.2;
+ LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
+ MARKETING_VERSION = 1.0;
+ MTL_FAST_MATH = YES;
+ PRODUCT_BUNDLE_IDENTIFIER = orgId.RunnerTests;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_EMIT_LOC_STRINGS = NO;
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
+ };
+ name = Profile;
+ };
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
@@ -478,6 +749,16 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
+ FF4BDE7E2BEE83B7003AC0E6 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ FF4BDE7B2BEE83B7003AC0E6 /* Debug */,
+ FF4BDE7C2BEE83B7003AC0E6 /* Release */,
+ FF4BDE7D2BEE83B7003AC0E6 /* Profile */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
/* End XCConfigurationList section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
index a6b826db..200649d9 100644
--- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
+++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -37,6 +37,17 @@
+
+
+
+
+
+
diff --git a/ios/RunnerTests/RunnerTests.swift b/ios/RunnerTests/RunnerTests.swift
new file mode 100644
index 00000000..7736a6f0
--- /dev/null
+++ b/ios/RunnerTests/RunnerTests.swift
@@ -0,0 +1,35 @@
+//
+// RunnerTests.swift
+// RunnerTests
+//
+// Created by Matheus Massula on 10/05/24.
+//
+
+import XCTest
+
+final class RunnerTests: XCTestCase {
+
+ override func setUpWithError() throws {
+ // Put setup code here. This method is called before the invocation of each test method in the class.
+ }
+
+ override func tearDownWithError() throws {
+ // Put teardown code here. This method is called after the invocation of each test method in the class.
+ }
+
+ func testExample() throws {
+ // This is an example of a functional test case.
+ // Use XCTAssert and related functions to verify your tests produce the correct results.
+ // Any test you write for XCTest can be annotated as throws and async.
+ // Mark your test throws to produce an unexpected failure when your test encounters an uncaught error.
+ // Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards.
+ }
+
+ func testPerformanceExample() throws {
+ // This is an example of a performance test case.
+ measure {
+ // Put the code you want to measure the time of here.
+ }
+ }
+
+}
diff --git a/lib/app_router.dart b/lib/app_router.dart
new file mode 100644
index 00000000..54f5cb6e
--- /dev/null
+++ b/lib/app_router.dart
@@ -0,0 +1,56 @@
+import 'package:domain_models/domain_models.dart';
+import 'package:flutter/material.dart';
+import 'package:local_storage/local_storage.dart';
+import 'package:lost_app/lost_app.dart';
+import 'package:restaurant_detail/restaurant_detail.dart';
+import 'package:restaurant_list/restaurant_list.dart';
+import 'package:yelp_repository/yelp_repository.dart';
+
+class AppRouter {
+ static Route generateRoute(
+ RouteSettings settings, {
+ required YelpRepository yelpRepository,
+ required LocalStorage localStorage,
+ }) {
+ final args = settings.arguments;
+
+ switch (settings.name) {
+ case PageName.restaurantList:
+ return MaterialPageRoute(
+ builder: (context) => RestaurantListView(
+ yelpRepository: yelpRepository,
+ localStorage: localStorage,
+ onRestaurantTapped: (restaurant) => Navigator.of(context).pushNamed(
+ PageName.restaurantDetail,
+ arguments: restaurant,
+ ),
+ ),
+ );
+
+ case PageName.restaurantDetail:
+ final restaurant = args as Restaurant;
+ return MaterialPageRoute(
+ builder: (context) => RestaurantDetailView(
+ yelpRepository: yelpRepository,
+ localStorage: localStorage,
+ restaurant: restaurant,
+ ),
+ );
+
+ default:
+ return MaterialPageRoute(
+ builder: (context) => LostAppView(
+ onTapStartOver: () => Navigator.of(context).pushNamedAndRemoveUntil(
+ PageName.restaurantList,
+ (route) => false,
+ ),
+ ),
+ );
+ }
+ }
+}
+
+class PageName {
+ static const String restaurantList = 'restaurantList';
+ static const String restaurantDetail = 'restaurantDetail';
+}
diff --git a/lib/app_theme.dart b/lib/app_theme.dart
new file mode 100644
index 00000000..9fa5be42
--- /dev/null
+++ b/lib/app_theme.dart
@@ -0,0 +1,125 @@
+import 'package:flutter/material.dart';
+
+class AppTheme {
+ static ThemeData get lightTheme => themeData(
+ colorScheme: lightColorScheme,
+ focusColor: Colors.black.withOpacity(0.12),
+ );
+
+ static ThemeData themeData({
+ required ColorScheme colorScheme,
+ required Color focusColor,
+ }) =>
+ ThemeData(
+ useMaterial3: true,
+ colorScheme: colorScheme,
+ textTheme: _textTheme,
+ primaryColor: colorScheme.primary,
+ canvasColor: colorScheme.background,
+ scaffoldBackgroundColor: colorScheme.background,
+ highlightColor: Colors.transparent,
+ focusColor: focusColor,
+ tabBarTheme: TabBarTheme(labelColor: colorScheme.primary),
+ dividerTheme: const DividerThemeData(
+ color: Color(0xffeeeeee),
+ thickness: 1.0,
+ space: 0.0,
+ ),
+ );
+
+ static const ColorScheme lightColorScheme = ColorScheme(
+ primary: Color(0xff000000),
+ secondary: Color(0xFFEFF3F3),
+ background: Color(0xfffafafa),
+ surface: Colors.white,
+ onBackground: Colors.white,
+ error: Colors.red,
+ onError: Colors.redAccent,
+ onPrimary: Colors.black,
+ onSecondary: Colors.blue,
+ onSurface: Color(0xff000000),
+ brightness: Brightness.light,
+ );
+
+ // TODO: Figma file referenciate deprecated theme attributes,
+ // comunicate to design team
+ static final TextTheme _textTheme = TextTheme(
+ headline6: TextStyle(
+ fontFamily: loraFontFamily,
+ fontSize: 18.0,
+ height: calcFontHeight(
+ fontSize: 18.0,
+ desiredHeightInPixels: 24.0,
+ ),
+ fontWeight: bold,
+ ),
+ subtitle1: TextStyle(
+ fontFamily: loraFontFamily,
+ fontSize: 16.0,
+ fontWeight: medium,
+ height: calcFontHeight(
+ fontSize: 16.0,
+ desiredHeightInPixels: 24.0,
+ ),
+ ),
+ caption: TextStyle(
+ fontFamily: openSansFontFamily,
+ fontSize: 12.0,
+ fontWeight: regular,
+ height: calcFontHeight(
+ fontSize: 12.0,
+ desiredHeightInPixels: 20.0,
+ ),
+ ),
+ overline: TextStyle(
+ fontFamily: openSansFontFamily,
+ fontSize: 12.0,
+ fontWeight: regular,
+ fontStyle: FontStyle.italic,
+ height: calcFontHeight(
+ fontSize: 12.0,
+ desiredHeightInPixels: 12.0,
+ ),
+ ),
+ button: TextStyle(
+ fontFamily: openSansFontFamily,
+ fontSize: 14.0,
+ height: calcFontHeight(
+ fontSize: 14.0,
+ desiredHeightInPixels: 24.0,
+ ),
+ fontWeight: semiBold,
+ ),
+ bodyText1: TextStyle(
+ fontFamily: openSansFontFamily,
+ fontSize: 16.0,
+ height: calcFontHeight(
+ fontSize: 16.0,
+ desiredHeightInPixels: 24.0,
+ ),
+ fontWeight: regular,
+ ),
+ );
+
+ static double calcFontHeight({
+ required double fontSize,
+ required double desiredHeightInPixels,
+ }) =>
+ desiredHeightInPixels / fontSize;
+
+ static const loraFontFamily = 'Lora';
+
+ static const openSansFontFamily = 'OpenSans';
+
+ /// FontWeight.w700
+ static const bold = FontWeight.w700;
+
+ /// FontWeight.w600
+ static const semiBold = FontWeight.w600;
+
+ /// FontWeight.w500
+ static const medium = FontWeight.w500;
+
+ /// FontWeight.w400
+ static const regular = FontWeight.w400;
+}
diff --git a/lib/main.dart b/lib/main.dart
deleted file mode 100644
index c6ce7473..00000000
--- a/lib/main.dart
+++ /dev/null
@@ -1,57 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:restaurantour/repositories/yelp_repository.dart';
-
-void main() {
- runApp(const Restaurantour());
-}
-
-class Restaurantour extends StatelessWidget {
- // This widget is the root of your application.
- const Restaurantour({Key? key}) : super(key: key);
-
- @override
- Widget build(BuildContext context) {
- return MaterialApp(
- title: 'RestauranTour',
- theme: ThemeData(
- visualDensity: VisualDensity.adaptivePlatformDensity,
- ),
- home: const HomePage(),
- );
- }
-}
-
-class HomePage extends StatelessWidget {
- const HomePage({Key? key}) : super(key: key);
-
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- body: Center(
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- const Text('Restaurantour'),
- ElevatedButton(
- child: const Text('Fetch Restaurants'),
- onPressed: () async {
- final yelpRepo = YelpRepository();
-
- try {
- final result = await yelpRepo.getRestaurants();
- if (result != null) {
- print('Fetched ${result.restaurants!.length} restaurants');
- } else {
- print('No restaurants fetched');
- }
- } catch (e) {
- print('Failed to fetch restaurants: $e');
- }
- },
- ),
- ],
- ),
- ),
- );
- }
-}
diff --git a/lib/main_dev.dart b/lib/main_dev.dart
new file mode 100644
index 00000000..783aaf5e
--- /dev/null
+++ b/lib/main_dev.dart
@@ -0,0 +1,18 @@
+import 'package:domain_models/domain_models.dart';
+import 'package:flutter_dotenv/flutter_dotenv.dart';
+import 'package:get_it/get_it.dart';
+import 'package:restaurantour/start.dart';
+
+void main() async {
+ await dotenv.load(fileName: "assets/env/.env_dev");
+ GetIt.instance.registerSingleton(
+ const AppConfig(
+ environemnt: Environment.dev,
+ networkConfig: NetworkConfig(
+ yelpBaseUrl: 'mock.server.com',
+ yelpGraphqlEndpoint: 'mock-endpoint',
+ ),
+ ),
+ );
+ start();
+}
diff --git a/lib/main_prod.dart b/lib/main_prod.dart
new file mode 100644
index 00000000..610b275d
--- /dev/null
+++ b/lib/main_prod.dart
@@ -0,0 +1,18 @@
+import 'package:domain_models/domain_models.dart';
+import 'package:flutter_dotenv/flutter_dotenv.dart';
+import 'package:get_it/get_it.dart';
+import 'package:restaurantour/start.dart';
+
+void main() async {
+ await dotenv.load(fileName: "assets/env/.env_prod");
+ GetIt.instance.registerSingleton(
+ const AppConfig(
+ environemnt: Environment.prod,
+ networkConfig: NetworkConfig(
+ yelpBaseUrl: 'https://api.yelp.com',
+ yelpGraphqlEndpoint: 'v3/graphql',
+ ),
+ ),
+ );
+ start();
+}
diff --git a/lib/models/restaurant.dart b/lib/models/restaurant.dart
deleted file mode 100644
index 87c7aab5..00000000
--- a/lib/models/restaurant.dart
+++ /dev/null
@@ -1,155 +0,0 @@
-import 'package:json_annotation/json_annotation.dart';
-
-part 'restaurant.g.dart';
-
-@JsonSerializable()
-class Category {
- final String? alias;
- final String? title;
-
- Category({
- this.alias,
- this.title,
- });
-
- factory Category.fromJson(Map json) =>
- _$CategoryFromJson(json);
-
- Map toJson() => _$CategoryToJson(this);
-}
-
-@JsonSerializable()
-class Hours {
- @JsonKey(name: 'is_open_now')
- final bool? isOpenNow;
-
- const Hours({
- this.isOpenNow,
- });
-
- factory Hours.fromJson(Map json) => _$HoursFromJson(json);
-
- Map toJson() => _$HoursToJson(this);
-}
-
-@JsonSerializable()
-class User {
- final String? id;
- @JsonKey(name: 'image_url')
- final String? imageUrl;
- final String? name;
-
- const User({
- this.id,
- this.imageUrl,
- this.name,
- });
-
- factory User.fromJson(Map json) => _$UserFromJson(json);
-
- Map toJson() => _$UserToJson(this);
-}
-
-@JsonSerializable()
-class Review {
- final String? id;
- final int? rating;
- final User? user;
-
- const Review({
- this.id,
- this.rating,
- this.user,
- });
-
- factory Review.fromJson(Map json) => _$ReviewFromJson(json);
-
- Map toJson() => _$ReviewToJson(this);
-}
-
-@JsonSerializable()
-class Location {
- @JsonKey(name: 'formatted_address')
- final String? formattedAddress;
-
- Location({
- this.formattedAddress,
- });
-
- factory Location.fromJson(Map json) =>
- _$LocationFromJson(json);
-
- Map toJson() => _$LocationToJson(this);
-}
-
-@JsonSerializable()
-class Restaurant {
- final String? id;
- final String? name;
- final String? price;
- final double? rating;
- final List? photos;
- final List? categories;
- final List? hours;
- final List? reviews;
- final Location? location;
-
- const Restaurant({
- this.id,
- this.name,
- this.price,
- this.rating,
- this.photos,
- this.categories,
- this.hours,
- this.reviews,
- this.location,
- });
-
- factory Restaurant.fromJson(Map json) =>
- _$RestaurantFromJson(json);
-
- Map toJson() => _$RestaurantToJson(this);
-
- /// Use the first category for the category shown to the user
- String get displayCategory {
- if (categories != null && categories!.isNotEmpty) {
- return categories!.first.title ?? '';
- }
- return '';
- }
-
- /// Use the first image as the image shown to the user
- String get heroImage {
- if (photos != null && photos!.isNotEmpty) {
- return photos!.first;
- }
- return '';
- }
-
- /// This logic is probably not correct in all cases but it is ok
- /// for this application
- bool get isOpen {
- if (hours != null && hours!.isNotEmpty) {
- return hours!.first.isOpenNow ?? false;
- }
- return false;
- }
-}
-
-@JsonSerializable()
-class RestaurantQueryResult {
- final int? total;
- @JsonKey(name: 'business')
- final List? restaurants;
-
- const RestaurantQueryResult({
- this.total,
- this.restaurants,
- });
-
- factory RestaurantQueryResult.fromJson(Map json) =>
- _$RestaurantQueryResultFromJson(json);
-
- Map toJson() => _$RestaurantQueryResultToJson(this);
-}
diff --git a/lib/models/restaurant.g.dart b/lib/models/restaurant.g.dart
deleted file mode 100644
index 3ed33f9a..00000000
--- a/lib/models/restaurant.g.dart
+++ /dev/null
@@ -1,109 +0,0 @@
-// GENERATED CODE - DO NOT MODIFY BY HAND
-
-part of 'restaurant.dart';
-
-// **************************************************************************
-// JsonSerializableGenerator
-// **************************************************************************
-
-Category _$CategoryFromJson(Map json) => Category(
- alias: json['alias'] as String?,
- title: json['title'] as String?,
- );
-
-Map _$CategoryToJson(Category instance) => {
- 'alias': instance.alias,
- 'title': instance.title,
- };
-
-Hours _$HoursFromJson(Map json) => Hours(
- isOpenNow: json['is_open_now'] as bool?,
- );
-
-Map _$HoursToJson(Hours instance) => {
- 'is_open_now': instance.isOpenNow,
- };
-
-User _$UserFromJson(Map json) => User(
- id: json['id'] as String?,
- imageUrl: json['image_url'] as String?,
- name: json['name'] as String?,
- );
-
-Map _$UserToJson(User instance) => {
- 'id': instance.id,
- 'image_url': instance.imageUrl,
- 'name': instance.name,
- };
-
-Review _$ReviewFromJson(Map json) => Review(
- id: json['id'] as String?,
- rating: json['rating'] as int?,
- user: json['user'] == null
- ? null
- : User.fromJson(json['user'] as Map),
- );
-
-Map _$ReviewToJson(Review instance) => {
- 'id': instance.id,
- 'rating': instance.rating,
- 'user': instance.user,
- };
-
-Location _$LocationFromJson(Map json) => Location(
- formattedAddress: json['formatted_address'] as String?,
- );
-
-Map _$LocationToJson(Location instance) => {
- 'formatted_address': instance.formattedAddress,
- };
-
-Restaurant _$RestaurantFromJson(Map json) => Restaurant(
- id: json['id'] as String?,
- name: json['name'] as String?,
- price: json['price'] as String?,
- rating: (json['rating'] as num?)?.toDouble(),
- photos:
- (json['photos'] as List?)?.map((e) => e as String).toList(),
- categories: (json['categories'] as List?)
- ?.map((e) => Category.fromJson(e as Map))
- .toList(),
- hours: (json['hours'] as List?)
- ?.map((e) => Hours.fromJson(e as Map))
- .toList(),
- reviews: (json['reviews'] as List?)
- ?.map((e) => Review.fromJson(e as Map))
- .toList(),
- location: json['location'] == null
- ? null
- : Location.fromJson(json['location'] as Map),
- );
-
-Map _$RestaurantToJson(Restaurant instance) =>
- {
- 'id': instance.id,
- 'name': instance.name,
- 'price': instance.price,
- 'rating': instance.rating,
- 'photos': instance.photos,
- 'categories': instance.categories,
- 'hours': instance.hours,
- 'reviews': instance.reviews,
- 'location': instance.location,
- };
-
-RestaurantQueryResult _$RestaurantQueryResultFromJson(
- Map json) =>
- RestaurantQueryResult(
- total: json['total'] as int?,
- restaurants: (json['business'] as List?)
- ?.map((e) => Restaurant.fromJson(e as Map))
- .toList(),
- );
-
-Map _$RestaurantQueryResultToJson(
- RestaurantQueryResult instance) =>
- {
- 'total': instance.total,
- 'business': instance.restaurants,
- };
diff --git a/lib/repositories/yelp_repository.dart b/lib/repositories/yelp_repository.dart
deleted file mode 100644
index f251d7b4..00000000
--- a/lib/repositories/yelp_repository.dart
+++ /dev/null
@@ -1,108 +0,0 @@
-import 'package:dio/dio.dart';
-import 'package:flutter/foundation.dart';
-import 'package:restaurantour/models/restaurant.dart';
-
-const _apiKey = '';
-
-class YelpRepository {
- late Dio dio;
-
- YelpRepository({
- @visibleForTesting Dio? dio,
- }) : dio = dio ??
- Dio(
- BaseOptions(
- baseUrl: 'https://api.yelp.com',
- headers: {
- 'Authorization': 'Bearer $_apiKey',
- 'Content-Type': 'application/graphql',
- },
- ),
- );
-
- /// Returns a response in this shape
- /// {
- /// "data": {
- /// "search": {
- /// "total": 5056,
- /// "business": [
- /// {
- /// "id": "faPVqws-x-5k2CQKDNtHxw",
- /// "name": "Yardbird Southern Table & Bar",
- /// "price": "$$",
- /// "rating": 4.5,
- /// "photos": [
- /// "https:///s3-media4.fl.yelpcdn.com/bphoto/_zXRdYX4r1OBfF86xKMbDw/o.jpg"
- /// ],
- /// "reviews": [
- /// {
- /// "id": "sjZoO8wcK1NeGJFDk5i82Q",
- /// "rating": 5,
- /// "user": {
- /// "id": "BuBCkWFNT_O2dbSnBZvpoQ",
- /// "image_url": "https:///s3-media2.fl.yelpcdn.com/photo/v8tbTjYaFvkzh1d7iE-pcQ/o.jpg",
- /// "name": "Gina T."
- /// }
- /// },
- /// {
- /// "id": "okpO9hfpxQXssbTZTKq9hA",
- /// "rating": 5,
- /// "user": {
- /// "id": "0x9xu_b0Ct_6hG6jaxpztw",
- /// "image_url": "https:///s3-media3.fl.yelpcdn.com/photo/gjz8X6tqE3e4praK4HfCiA/o.jpg",
- /// "name": "Crystal L."
- /// }
- /// },
- /// ...
- /// ]
- /// }
- /// }
- ///
- Future getRestaurants({int offset = 0}) async {
- try {
- final response = await dio.post