From 75a90fa2f7da87122d5ae45bdb2c2d77a6b327c3 Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sat, 5 Jun 2021 17:14:57 +0900 Subject: [PATCH 01/26] deleted unnecessary main --- .github/workflows/cd_android.yml | 7 ++----- .github/workflows/cd_ios.yml | 6 +++--- .vscode/launch.json | 18 +--------------- lib/{main_development.dart => main.dart} | 7 ------- lib/main_production.dart | 26 ------------------------ lib/main_staging.dart | 26 ------------------------ pubspec.yaml | 11 +++++----- 7 files changed, 11 insertions(+), 90 deletions(-) rename lib/{main_development.dart => main.dart} (68%) delete mode 100644 lib/main_production.dart delete mode 100644 lib/main_staging.dart diff --git a/.github/workflows/cd_android.yml b/.github/workflows/cd_android.yml index 7827820..8e4d6b8 100644 --- a/.github/workflows/cd_android.yml +++ b/.github/workflows/cd_android.yml @@ -23,7 +23,6 @@ jobs: # Get flutter dependencies. - run: flutter pub get - # # Check for any formatting issues in the code. # - run: flutter format --set-exit-if-changed . @@ -36,7 +35,6 @@ jobs: # Build ios app # - run: flutter build appbundle --flavor production --target lib/main_production.dart --dart-define=SUPABASE_URL=${{ secrets.SUPABASE_URL }} --dart-define=SUPABASE_ANNON_KEY=${{ secrets.SUPABASE_ANNON_KEY }} - - name: Download Android keystore id: android_keystore uses: timheuer/base64-to-file@v1.0.3 @@ -52,8 +50,7 @@ jobs: echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" >> android/key.properties - name: Build Android App Bundle - run: flutter build appbundle --flavor production --target lib/main_production.dart --dart-define=SUPABASE_URL=${{ secrets.SUPABASE_URL }} --dart-define=SUPABASE_ANNON_KEY=${{ secrets.SUPABASE_ANNON_KEY }} - + run: flutter build appbundle --flavor production --dart-define=SUPABASE_URL=${{ secrets.SUPABASE_URL }} --dart-define=SUPABASE_ANNON_KEY=${{ secrets.SUPABASE_ANNON_KEY }} - name: Setup Ruby uses: actions/setup-ruby@v1 @@ -79,4 +76,4 @@ jobs: run: | bundle exec fastlane supply \ --aab build/app/outputs/bundle/productionRelease/app-production-release.aab \ - --track internal \ No newline at end of file + --track internal diff --git a/.github/workflows/cd_ios.yml b/.github/workflows/cd_ios.yml index d594726..b119927 100644 --- a/.github/workflows/cd_ios.yml +++ b/.github/workflows/cd_ios.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - feat/analytics jobs: build: @@ -27,8 +28,7 @@ jobs: # - run: flutter test # Build ios app - - run: flutter build ios --release --no-codesign --flavor production --target lib/main_production.dart --dart-define=SUPABASE_URL=${{ secrets.SUPABASE_URL }} --dart-define=SUPABASE_ANNON_KEY=${{ secrets.SUPABASE_ANNON_KEY }} - + - run: flutter build ios --release --no-codesign --flavor production --dart-define=SUPABASE_URL=${{ secrets.SUPABASE_URL }} --dart-define=SUPABASE_ANNON_KEY=${{ secrets.SUPABASE_ANNON_KEY }} - name: Release env: @@ -39,4 +39,4 @@ jobs: APP_STORE_CONNECT_PRIVATE_KEY: ${{ secrets.APP_STORE_CONNECT_PRIVATE_KEY }} run: | cd ios - fastlane release \ No newline at end of file + fastlane release diff --git a/.vscode/launch.json b/.vscode/launch.json index a8b2f5a..f466d66 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,29 +8,13 @@ "name": "Launch development", "request": "launch", "type": "dart", - "program": "lib/main_development.dart", + "program": "lib/main.dart", "args": [ "--flavor", "development", - "--target", - "lib/main_development.dart", "--dart-define=SUPABASE_URL=https://uolvtdzkvkolsynuhmzh.supabase.co", "--dart-define=SUPABASE_ANNON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTYxNjUzOTE5MSwiZXhwIjoxOTMyMTE1MTkxfQ.wBv3mCxuQzf-xdn9c6m262t_j2sTiMOLPRRB6U77G7U" ] - }, - { - "name": "Launch staging", - "request": "launch", - "type": "dart", - "program": "lib/main_staging.dart", - "args": ["--flavor", "staging", "--target", "lib/main_staging.dart"] - }, - { - "name": "Launch production", - "request": "launch", - "type": "dart", - "program": "lib/main_production.dart", - "args": ["--flavor", "production", "--target", "lib/main_production.dart"] } ] } diff --git a/lib/main_development.dart b/lib/main.dart similarity index 68% rename from lib/main_development.dart rename to lib/main.dart index 21b58b2..7ea89e2 100644 --- a/lib/main_development.dart +++ b/lib/main.dart @@ -1,10 +1,3 @@ -// Copyright (c) 2021, Very Good Ventures -// https://verygood.ventures -// -// Use of this source code is governed by an MIT-style -// license that can be found in the LICENSE file or at -// https://opensource.org/licenses/MIT. - import 'dart:async'; import 'dart:developer'; diff --git a/lib/main_production.dart b/lib/main_production.dart deleted file mode 100644 index 21b58b2..0000000 --- a/lib/main_production.dart +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2021, Very Good Ventures -// https://verygood.ventures -// -// Use of this source code is governed by an MIT-style -// license that can be found in the LICENSE file or at -// https://opensource.org/licenses/MIT. - -import 'dart:async'; -import 'dart:developer'; - -import 'package:flutter/widgets.dart'; -import 'package:bloc/bloc.dart'; -import 'package:spot/app/app.dart'; -import 'package:spot/app/app_bloc_observer.dart'; - -void main() { - Bloc.observer = AppBlocObserver(); - FlutterError.onError = (details) { - log(details.exceptionAsString(), stackTrace: details.stack); - }; - - runZonedGuarded( - () => runApp(const App()), - (error, stackTrace) => log(error.toString(), stackTrace: stackTrace), - ); -} diff --git a/lib/main_staging.dart b/lib/main_staging.dart deleted file mode 100644 index 21b58b2..0000000 --- a/lib/main_staging.dart +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2021, Very Good Ventures -// https://verygood.ventures -// -// Use of this source code is governed by an MIT-style -// license that can be found in the LICENSE file or at -// https://opensource.org/licenses/MIT. - -import 'dart:async'; -import 'dart:developer'; - -import 'package:flutter/widgets.dart'; -import 'package:bloc/bloc.dart'; -import 'package:spot/app/app.dart'; -import 'package:spot/app/app_bloc_observer.dart'; - -void main() { - Bloc.observer = AppBlocObserver(); - FlutterError.onError = (details) { - log(details.exceptionAsString(), stackTrace: details.stack); - }; - - runZonedGuarded( - () => runApp(const App()), - (error, stackTrace) => log(error.toString(), stackTrace: stackTrace), - ); -} diff --git a/pubspec.yaml b/pubspec.yaml index fe08089..6bdd64d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,10 +1,10 @@ name: spot description: Find local video posts -version: 1.0.12+22 +version: 1.0.12+23 publish_to: none environment: - sdk: ">=2.12.0-0 <3.0.0" + sdk: '>=2.12.0-0 <3.0.0' dependencies: flutter: @@ -28,7 +28,6 @@ dependencies: rxdart: ^0.26.0 geocoding: ^2.0.0 share: ^2.0.1 - dev_dependencies: flutter_test: @@ -49,6 +48,6 @@ flutter: flutter_icons: android: true ios: true - image_path: "assets/launcher/icon.png" - adaptive_icon_foreground: "assets/launcher/foreground.png" - adaptive_icon_background: "assets/launcher/background.png" + image_path: 'assets/launcher/icon.png' + adaptive_icon_foreground: 'assets/launcher/foreground.png' + adaptive_icon_background: 'assets/launcher/background.png' From 5af44a4d626a90b8a9032b8b6b8f586ceec1031e Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sat, 5 Jun 2021 17:30:38 +0900 Subject: [PATCH 02/26] fixed actions --- .github/workflows/cd_android.yml | 15 ++++++--------- .github/workflows/cd_ios.yml | 12 ++++++------ lib/pages/tabs/map_tab.dart | 1 - test/pages/tabs/notifications_tab_test.dart | 2 +- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/.github/workflows/cd_android.yml b/.github/workflows/cd_android.yml index 8e4d6b8..ecf6f69 100644 --- a/.github/workflows/cd_android.yml +++ b/.github/workflows/cd_android.yml @@ -23,17 +23,14 @@ jobs: # Get flutter dependencies. - run: flutter pub get - # # Check for any formatting issues in the code. - # - run: flutter format --set-exit-if-changed . + # Check for any formatting issues in the code. + - run: flutter format -l 100 --set-exit-if-changed lib test - # # Statically analyze the Dart code for any errors. - # - run: flutter analyze . + # Statically analyze the Dart code for any errors. + - run: flutter analyze . - # # Run widget tests for our flutter project. - # - run: flutter test - - # Build ios app - # - run: flutter build appbundle --flavor production --target lib/main_production.dart --dart-define=SUPABASE_URL=${{ secrets.SUPABASE_URL }} --dart-define=SUPABASE_ANNON_KEY=${{ secrets.SUPABASE_ANNON_KEY }} + # Run widget tests for our flutter project. + - run: flutter test - name: Download Android keystore id: android_keystore diff --git a/.github/workflows/cd_ios.yml b/.github/workflows/cd_ios.yml index b119927..bc649e0 100644 --- a/.github/workflows/cd_ios.yml +++ b/.github/workflows/cd_ios.yml @@ -18,14 +18,14 @@ jobs: # Get flutter dependencies. - run: flutter pub get - # # Check for any formatting issues in the code. - # - run: flutter format --set-exit-if-changed . + # Check for any formatting issues in the code. + - run: flutter format -l 100 --set-exit-if-changed lib test - # # Statically analyze the Dart code for any errors. - # - run: flutter analyze . + # Statically analyze the Dart code for any errors. + - run: flutter analyze . - # # Run widget tests for our flutter project. - # - run: flutter test + # Run widget tests for our flutter project. + - run: flutter test # Build ios app - run: flutter build ios --release --no-codesign --flavor production --dart-define=SUPABASE_URL=${{ secrets.SUPABASE_URL }} --dart-define=SUPABASE_ANNON_KEY=${{ secrets.SUPABASE_ANNON_KEY }} diff --git a/lib/pages/tabs/map_tab.dart b/lib/pages/tabs/map_tab.dart index f4d0c6b..294482a 100644 --- a/lib/pages/tabs/map_tab.dart +++ b/lib/pages/tabs/map_tab.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'dart:math'; import 'dart:typed_data'; import 'dart:ui' as ui; diff --git a/test/pages/tabs/notifications_tab_test.dart b/test/pages/tabs/notifications_tab_test.dart index 45487c6..e0da0f9 100644 --- a/test/pages/tabs/notifications_tab_test.dart +++ b/test/pages/tabs/notifications_tab_test.dart @@ -143,7 +143,7 @@ void main() { await tester.pump(); - expect(find.text('You don\'t have any notificatins yet'), findsOneWidget); + expect(find.text('You don\'t have any notifications yet'), findsOneWidget); expect(find.byType(NotificationDot), findsNothing); }); }); From 736df6f7f5f610488009aa82d3c159d568562d20 Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sat, 5 Jun 2021 17:51:39 +0900 Subject: [PATCH 03/26] Changed some xcode config --- ios/Runner.xcodeproj/xcshareddata/xcschemes/production.xcscheme | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/production.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/production.xcscheme index af691fb..a36a23f 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/production.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/production.xcscheme @@ -31,7 +31,7 @@ Date: Sat, 5 Jun 2021 18:01:32 +0900 Subject: [PATCH 04/26] updated bundle ids in xcode --- ios/Runner.xcodeproj/project.pbxproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index e502bb7..89cc099 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -647,7 +647,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = app.spotvideo; + PRODUCT_BUNDLE_IDENTIFIER = com.example.spot.dev; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = "match AppStore app.spotvideo"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -729,7 +729,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = app.spotvideo; + PRODUCT_BUNDLE_IDENTIFIER = com.example.spot.dev; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = "match AppStore app.spotvideo"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -808,7 +808,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = app.spotvideo; + PRODUCT_BUNDLE_IDENTIFIER = com.example.spot.dev; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = "match AppStore app.spotvideo"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; From 5a8e6261ac56424b217966f7f6555ca0a7174fd7 Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sat, 5 Jun 2021 18:05:16 +0900 Subject: [PATCH 05/26] Added firebase config file --- ios/Runner.xcodeproj/project.pbxproj | 23 +++++++++++++++++++++++ pubspec.yaml | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 89cc099..000f35c 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -8,6 +8,7 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 2D785F16266B753A00E43AE3 /* config in Resources */ = {isa = PBXBuildFile; fileRef = 2D785F15266B753A00E43AE3 /* config */; }; 360F0615CDB735864CA01DD8 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4019077285505CC6EADC6A13 /* Pods_Runner.framework */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; @@ -34,6 +35,7 @@ 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 22230FEC84FAAF7E8AA781A7 /* Pods-Runner.release-development.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release-development.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release-development.xcconfig"; sourceTree = ""; }; 230C707E8D6A9E6A1DC18028 /* Pods-Runner.release-staging.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release-staging.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release-staging.xcconfig"; sourceTree = ""; }; + 2D785F15266B753A00E43AE3 /* config */ = {isa = PBXFileReference; lastKnownFileType = folder; name = config; path = ../../../Downloads/config; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 4019077285505CC6EADC6A13 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 451976F66DC4F31C5F96421B /* Pods-Runner.profile-development.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile-development.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile-development.xcconfig"; sourceTree = ""; }; @@ -81,6 +83,7 @@ 97C146E51CF9000F007C117D = { isa = PBXGroup; children = ( + 2D785F15266B753A00E43AE3 /* config */, 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, @@ -147,6 +150,7 @@ 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, + 2D785F17266B755700E43AE3 /* Copy CoogleService-Info.plist to apropreate location */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, @@ -200,6 +204,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 2D785F16266B753A00E43AE3 /* config in Resources */, 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, @@ -210,6 +215,24 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 2D785F17266B755700E43AE3 /* Copy CoogleService-Info.plist to apropreate location */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Copy CoogleService-Info.plist to apropreate location"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "environment=\"default\"\n\n# Regex to extract the scheme name from the Build Configuration\n# We have named our Build Configurations as Debug-dev, Debug-prod etc.\n# Here, dev and prod are the scheme names. This kind of naming is required by Flutter for flavors to work.\n# We are using the $CONFIGURATION variable available in the XCode build environment to extract \n# the environment (or flavor)\n# For eg.\n# If CONFIGURATION=\"Debug-prod\", then environment will get set to \"prod\".\nif [[ $CONFIGURATION =~ -([^-]*)$ ]]; then\nenvironment=${BASH_REMATCH[1]}\nfi\n\necho $environment\n\n# Name and path of the resource we're copying\nGOOGLESERVICE_INFO_PLIST=GoogleService-Info.plist\nGOOGLESERVICE_INFO_FILE=${PROJECT_DIR}/config/${environment}/${GOOGLESERVICE_INFO_PLIST}\n\n# Make sure GoogleService-Info.plist exists\necho \"Looking for ${GOOGLESERVICE_INFO_PLIST} in ${GOOGLESERVICE_INFO_FILE}\"\nif [ ! -f $GOOGLESERVICE_INFO_FILE ]\nthen\necho \"No GoogleService-Info.plist found. Please ensure it's in the proper directory.\"\nexit 1\nfi\n\n# Get a reference to the destination location for the GoogleService-Info.plist\n# This is the default location where Firebase init code expects to find GoogleServices-Info.plist file\nPLIST_DESTINATION=${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app\necho \"Will copy ${GOOGLESERVICE_INFO_PLIST} to final destination: ${PLIST_DESTINATION}\"\n\n# Copy over the prod GoogleService-Info.plist for Release builds\ncp \"${GOOGLESERVICE_INFO_FILE}\" \"${PLIST_DESTINATION}\"\n"; + }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; diff --git a/pubspec.yaml b/pubspec.yaml index 2c7531c..a4efc42 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: spot description: Find local video posts -version: 1.0.12+24 +version: 1.0.12+25 publish_to: none environment: From 53d620ce3d97c361a865970d0b892dba8f5c8952 Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sun, 6 Jun 2021 07:04:19 +0900 Subject: [PATCH 06/26] Added firebase config files --- ios/Runner.xcodeproj/project.pbxproj | 8 ++--- .../development/GoogleService-Info.plist | 34 +++++++++++++++++++ .../production/GoogleService-Info.plist | 34 +++++++++++++++++++ 3 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 ios/config/development/GoogleService-Info.plist create mode 100644 ios/config/production/GoogleService-Info.plist diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 000f35c..d29fcc9 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -8,7 +8,7 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 2D785F16266B753A00E43AE3 /* config in Resources */ = {isa = PBXBuildFile; fileRef = 2D785F15266B753A00E43AE3 /* config */; }; + 2D785F1B266C2C4E00E43AE3 /* config in Resources */ = {isa = PBXBuildFile; fileRef = 2D785F1A266C2C4E00E43AE3 /* config */; }; 360F0615CDB735864CA01DD8 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4019077285505CC6EADC6A13 /* Pods_Runner.framework */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; @@ -35,7 +35,7 @@ 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 22230FEC84FAAF7E8AA781A7 /* Pods-Runner.release-development.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release-development.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release-development.xcconfig"; sourceTree = ""; }; 230C707E8D6A9E6A1DC18028 /* Pods-Runner.release-staging.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release-staging.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release-staging.xcconfig"; sourceTree = ""; }; - 2D785F15266B753A00E43AE3 /* config */ = {isa = PBXFileReference; lastKnownFileType = folder; name = config; path = ../../../Downloads/config; sourceTree = ""; }; + 2D785F1A266C2C4E00E43AE3 /* config */ = {isa = PBXFileReference; lastKnownFileType = folder; path = config; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 4019077285505CC6EADC6A13 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 451976F66DC4F31C5F96421B /* Pods-Runner.profile-development.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile-development.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile-development.xcconfig"; sourceTree = ""; }; @@ -83,7 +83,7 @@ 97C146E51CF9000F007C117D = { isa = PBXGroup; children = ( - 2D785F15266B753A00E43AE3 /* config */, + 2D785F1A266C2C4E00E43AE3 /* config */, 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, @@ -204,7 +204,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 2D785F16266B753A00E43AE3 /* config in Resources */, + 2D785F1B266C2C4E00E43AE3 /* config in Resources */, 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, diff --git a/ios/config/development/GoogleService-Info.plist b/ios/config/development/GoogleService-Info.plist new file mode 100644 index 0000000..9649912 --- /dev/null +++ b/ios/config/development/GoogleService-Info.plist @@ -0,0 +1,34 @@ + + + + + CLIENT_ID + 405360906678-avbp7njivl97qe90l7ohn3u5l52u0d66.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.405360906678-avbp7njivl97qe90l7ohn3u5l52u0d66 + API_KEY + AIzaSyAvjUUmHcui_OTxkLqP1AMQ_hu4iPWJhik + GCM_SENDER_ID + 405360906678 + PLIST_VERSION + 1 + BUNDLE_ID + com.example.spot.dev + PROJECT_ID + spot-videos-dev + STORAGE_BUCKET + spot-videos-dev.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:405360906678:ios:c585e123c83757b4b47117 + + \ No newline at end of file diff --git a/ios/config/production/GoogleService-Info.plist b/ios/config/production/GoogleService-Info.plist new file mode 100644 index 0000000..6d61db8 --- /dev/null +++ b/ios/config/production/GoogleService-Info.plist @@ -0,0 +1,34 @@ + + + + + CLIENT_ID + 669895901022-b3pqggv2v8bkljpoojsjfgf369ip7709.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.669895901022-b3pqggv2v8bkljpoojsjfgf369ip7709 + API_KEY + AIzaSyBrL9Rk8lfEteQa-RmC98xXFziiSXcq6ZQ + GCM_SENDER_ID + 669895901022 + PLIST_VERSION + 1 + BUNDLE_ID + app.spotvideo + PROJECT_ID + spot-videos + STORAGE_BUCKET + spot-videos.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:669895901022:ios:39b2ff10823d988ec059cf + + \ No newline at end of file From 32d9384c87bfac6e7c5baaaac2b510f17fcef4eb Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sun, 6 Jun 2021 07:31:45 +0900 Subject: [PATCH 07/26] Added firebase --- .github/workflows/main.yaml | 8 ++++---- pubspec.lock | 7 +++++++ pubspec.yaml | 3 ++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index a78277f..d5e2553 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -24,7 +24,7 @@ jobs: - name: Run tests run: flutter test --no-pub --coverage --test-randomize-ordering-seed random - - name: Check Code Coverage - uses: VeryGoodOpenSource/very_good_coverage@v1.1.1 - with: - min_coverage: 95 + # - name: Check Code Coverage + # uses: VeryGoodOpenSource/very_good_coverage@v1.1.1 + # with: + # min_coverage: 95 diff --git a/pubspec.lock b/pubspec.lock index 5e6a4ec..b3767db 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -155,6 +155,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "6.1.0" + firebase: + dependency: "direct main" + description: + name: firebase + url: "https://pub.dartlang.org" + source: hosted + version: "9.0.1" flutter: dependency: "direct main" description: flutter diff --git a/pubspec.yaml b/pubspec.yaml index a4efc42..d8d076f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: spot description: Find local video posts -version: 1.0.12+25 +version: 1.0.12+26 publish_to: none environment: @@ -28,6 +28,7 @@ dependencies: rxdart: ^0.26.0 geocoding: ^2.0.0 share: ^2.0.1 + firebase: ^9.0.1 dev_dependencies: flutter_test: From 7e417e8f206fbaa8c9605998baa307805f34050c Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sun, 6 Jun 2021 07:35:12 +0900 Subject: [PATCH 08/26] Added firebase core --- lib/main.dart | 4 +++- pubspec.lock | 20 +++++++++++++++++--- pubspec.yaml | 2 +- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 7ea89e2..15430b6 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -6,7 +6,9 @@ import 'package:bloc/bloc.dart'; import 'package:spot/app/app.dart'; import 'package:spot/app/app_bloc_observer.dart'; -void main() { +Future main() async { + // WidgetsFlutterBinding.ensureInitialized(); + // await Firebase.initializeApp(); Bloc.observer = AppBlocObserver(); FlutterError.onError = (details) { log(details.exceptionAsString(), stackTrace: details.stack); diff --git a/pubspec.lock b/pubspec.lock index b3767db..c82bc21 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -155,13 +155,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "6.1.0" - firebase: + firebase_core: dependency: "direct main" description: - name: firebase + name: firebase_core url: "https://pub.dartlang.org" source: hosted - version: "9.0.1" + version: "1.2.1" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.1" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" flutter: dependency: "direct main" description: flutter diff --git a/pubspec.yaml b/pubspec.yaml index d8d076f..40128bc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -28,7 +28,7 @@ dependencies: rxdart: ^0.26.0 geocoding: ^2.0.0 share: ^2.0.1 - firebase: ^9.0.1 + firebase_core: ^1.2.1 dev_dependencies: flutter_test: From cf31f2df7d7d1692af9a56d63964945361a8e377 Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sun, 6 Jun 2021 07:36:01 +0900 Subject: [PATCH 09/26] Initizlizing firebase --- lib/main.dart | 5 +++-- pubspec.yaml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 15430b6..dea2211 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,14 +1,15 @@ import 'dart:async'; import 'dart:developer'; +import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/widgets.dart'; import 'package:bloc/bloc.dart'; import 'package:spot/app/app.dart'; import 'package:spot/app/app_bloc_observer.dart'; Future main() async { - // WidgetsFlutterBinding.ensureInitialized(); - // await Firebase.initializeApp(); + WidgetsFlutterBinding.ensureInitialized(); + await Firebase.initializeApp(); Bloc.observer = AppBlocObserver(); FlutterError.onError = (details) { log(details.exceptionAsString(), stackTrace: details.stack); diff --git a/pubspec.yaml b/pubspec.yaml index 40128bc..68055da 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: spot description: Find local video posts -version: 1.0.12+26 +version: 1.0.12+27 publish_to: none environment: From 52f535890ba8db4f82fcb4d4d3f88ab0554a5bbc Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sun, 6 Jun 2021 08:13:18 +0900 Subject: [PATCH 10/26] Set config to fix too many arguments --- ios/Flutter/Debug.xcconfig | 5 ----- ios/Flutter/Release.xcconfig | 8 -------- ios/Runner.xcodeproj/project.pbxproj | 18 +++++++++--------- 3 files changed, 9 insertions(+), 22 deletions(-) diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig index c9efb81..e69de29 100644 --- a/ios/Flutter/Debug.xcconfig +++ b/ios/Flutter/Debug.xcconfig @@ -1,5 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "Generated.xcconfig" -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug-development.xcconfig" -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug-staging.xcconfig" -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug-production.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig index a6ada2a..e69de29 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -1,8 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "Generated.xcconfig" -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release-development.xcconfig" -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release-staging.xcconfig" -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release-production.xcconfig" -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile-development.xcconfig" -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile-staging.xcconfig" -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile-production.xcconfig" diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index d29fcc9..ca0d66b 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -404,7 +404,7 @@ }; 249021D4217E4FDB00AE95B9 /* Profile-production */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + baseConfigurationReference = 6C6B12A70EA4B80F75D07702 /* Pods-Runner.profile-production.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -541,7 +541,7 @@ }; 97C147061CF9000F007C117D /* Debug-production */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + baseConfigurationReference = 9BD4ADABC0F6A0368B0A86DF /* Pods-Runner.debug-production.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -570,7 +570,7 @@ }; 97C147071CF9000F007C117D /* Release-production */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + baseConfigurationReference = E257513ADC6B0A9940F052F3 /* Pods-Runner.release-production.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -654,7 +654,7 @@ }; DC2A913325CA15840048C013 /* Debug-development */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + baseConfigurationReference = E7AA16B900A14311133B266F /* Pods-Runner.debug-development.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -736,7 +736,7 @@ }; DC2A913525CA159D0048C013 /* Release-development */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + baseConfigurationReference = 22230FEC84FAAF7E8AA781A7 /* Pods-Runner.release-development.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -815,7 +815,7 @@ }; DC2A913725CA15A70048C013 /* Profile-development */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + baseConfigurationReference = 451976F66DC4F31C5F96421B /* Pods-Runner.profile-development.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -899,7 +899,7 @@ }; DC2A913925CA16400048C013 /* Debug-staging */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + baseConfigurationReference = DA3906D3FAF76F7208C6D5D6 /* Pods-Runner.debug-staging.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -981,7 +981,7 @@ }; DC2A913B25CA16460048C013 /* Release-staging */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + baseConfigurationReference = 230C707E8D6A9E6A1DC18028 /* Pods-Runner.release-staging.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -1060,7 +1060,7 @@ }; DC2A913D25CA164B0048C013 /* Profile-staging */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + baseConfigurationReference = F8263CAEAA67CE58FDA15B0D /* Pods-Runner.profile-staging.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; From 205dba845531ff39c56892932db2cfb4070fde48 Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sun, 6 Jun 2021 10:45:02 +0900 Subject: [PATCH 11/26] removed firebase --- ios/Flutter/Debug.xcconfig | 1 + ios/Flutter/Release.xcconfig | 1 + lib/main.dart | 4 ++-- pubspec.lock | 21 --------------------- pubspec.yaml | 2 +- 5 files changed, 5 insertions(+), 24 deletions(-) diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig index e69de29..20ca87d 100644 --- a/ios/Flutter/Debug.xcconfig +++ b/ios/Flutter/Debug.xcconfig @@ -0,0 +1 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig index e69de29..d495280 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -0,0 +1 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" diff --git a/lib/main.dart b/lib/main.dart index dea2211..accdf5c 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -8,8 +8,8 @@ import 'package:spot/app/app.dart'; import 'package:spot/app/app_bloc_observer.dart'; Future main() async { - WidgetsFlutterBinding.ensureInitialized(); - await Firebase.initializeApp(); + // WidgetsFlutterBinding.ensureInitialized(); + // await Firebase.initializeApp(); Bloc.observer = AppBlocObserver(); FlutterError.onError = (details) { log(details.exceptionAsString(), stackTrace: details.stack); diff --git a/pubspec.lock b/pubspec.lock index c82bc21..5e6a4ec 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -155,27 +155,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "6.1.0" - firebase_core: - dependency: "direct main" - description: - name: firebase_core - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.1" - firebase_core_platform_interface: - dependency: transitive - description: - name: firebase_core_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "4.0.1" - firebase_core_web: - dependency: transitive - description: - name: firebase_core_web - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" flutter: dependency: "direct main" description: flutter diff --git a/pubspec.yaml b/pubspec.yaml index 68055da..dc6a856 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -28,7 +28,7 @@ dependencies: rxdart: ^0.26.0 geocoding: ^2.0.0 share: ^2.0.1 - firebase_core: ^1.2.1 + # firebase_core: ^1.2.1 dev_dependencies: flutter_test: From 153ff4e90c379e9cb0f13dbc387dc98591f4d192 Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sun, 6 Jun 2021 10:45:31 +0900 Subject: [PATCH 12/26] removed firebase import --- lib/main.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/main.dart b/lib/main.dart index accdf5c..15430b6 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,7 +1,6 @@ import 'dart:async'; import 'dart:developer'; -import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/widgets.dart'; import 'package:bloc/bloc.dart'; import 'package:spot/app/app.dart'; From 79756ef732fdfcfa642c19a52b216b555bcc5f28 Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sun, 6 Jun 2021 11:24:25 +0900 Subject: [PATCH 13/26] Updated release config --- ios/Flutter/Release.xcconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig index d495280..5f02ab1 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -1 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release-production.xcconfig" From a090a340d784cee71062a1cbb7df65135d97f71d Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sun, 6 Jun 2021 11:41:17 +0900 Subject: [PATCH 14/26] Updated configurations for each schemas --- ios/Flutter/Release.xcconfig | 2 +- ios/Runner.xcodeproj/project.pbxproj | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig index 5f02ab1..d495280 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -1 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release-production.xcconfig" +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index ca0d66b..d29fcc9 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -404,7 +404,7 @@ }; 249021D4217E4FDB00AE95B9 /* Profile-production */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 6C6B12A70EA4B80F75D07702 /* Pods-Runner.profile-production.xcconfig */; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -541,7 +541,7 @@ }; 97C147061CF9000F007C117D /* Debug-production */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 9BD4ADABC0F6A0368B0A86DF /* Pods-Runner.debug-production.xcconfig */; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -570,7 +570,7 @@ }; 97C147071CF9000F007C117D /* Release-production */ = { isa = XCBuildConfiguration; - baseConfigurationReference = E257513ADC6B0A9940F052F3 /* Pods-Runner.release-production.xcconfig */; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -654,7 +654,7 @@ }; DC2A913325CA15840048C013 /* Debug-development */ = { isa = XCBuildConfiguration; - baseConfigurationReference = E7AA16B900A14311133B266F /* Pods-Runner.debug-development.xcconfig */; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -736,7 +736,7 @@ }; DC2A913525CA159D0048C013 /* Release-development */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 22230FEC84FAAF7E8AA781A7 /* Pods-Runner.release-development.xcconfig */; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -815,7 +815,7 @@ }; DC2A913725CA15A70048C013 /* Profile-development */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 451976F66DC4F31C5F96421B /* Pods-Runner.profile-development.xcconfig */; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -899,7 +899,7 @@ }; DC2A913925CA16400048C013 /* Debug-staging */ = { isa = XCBuildConfiguration; - baseConfigurationReference = DA3906D3FAF76F7208C6D5D6 /* Pods-Runner.debug-staging.xcconfig */; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -981,7 +981,7 @@ }; DC2A913B25CA16460048C013 /* Release-staging */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 230C707E8D6A9E6A1DC18028 /* Pods-Runner.release-staging.xcconfig */; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -1060,7 +1060,7 @@ }; DC2A913D25CA164B0048C013 /* Profile-staging */ = { isa = XCBuildConfiguration; - baseConfigurationReference = F8263CAEAA67CE58FDA15B0D /* Pods-Runner.profile-staging.xcconfig */; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; From 28c6d1465cac4676028f25ff80f00d8026d10e40 Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sun, 6 Jun 2021 12:09:58 +0900 Subject: [PATCH 15/26] Added generated config to release and debug config file --- ios/Flutter/Debug.xcconfig | 1 + ios/Flutter/Release.xcconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig index 20ca87d..229ed71 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" \ No newline at end of file diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig index d495280..2c048dc 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" \ No newline at end of file From 7733cfdd631c337fc3887d0e4f5cc9e46e7b87bb Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sun, 6 Jun 2021 12:32:10 +0900 Subject: [PATCH 16/26] Added firebase and initializing --- lib/main.dart | 5 +++-- pubspec.lock | 21 +++++++++++++++++++++ pubspec.yaml | 4 ++-- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 15430b6..dea2211 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,14 +1,15 @@ import 'dart:async'; import 'dart:developer'; +import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/widgets.dart'; import 'package:bloc/bloc.dart'; import 'package:spot/app/app.dart'; import 'package:spot/app/app_bloc_observer.dart'; Future main() async { - // WidgetsFlutterBinding.ensureInitialized(); - // await Firebase.initializeApp(); + WidgetsFlutterBinding.ensureInitialized(); + await Firebase.initializeApp(); Bloc.observer = AppBlocObserver(); FlutterError.onError = (details) { log(details.exceptionAsString(), stackTrace: details.stack); diff --git a/pubspec.lock b/pubspec.lock index 5e6a4ec..c82bc21 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -155,6 +155,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "6.1.0" + firebase_core: + dependency: "direct main" + description: + name: firebase_core + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.1" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.1" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" flutter: dependency: "direct main" description: flutter diff --git a/pubspec.yaml b/pubspec.yaml index dc6a856..4ef726f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: spot description: Find local video posts -version: 1.0.12+27 +version: 1.0.12+28 publish_to: none environment: @@ -28,7 +28,7 @@ dependencies: rxdart: ^0.26.0 geocoding: ^2.0.0 share: ^2.0.1 - # firebase_core: ^1.2.1 + firebase_core: ^1.2.1 dev_dependencies: flutter_test: From 61d70527de7bbe316384f321b94ec5650787e9ba Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sun, 6 Jun 2021 12:45:48 +0900 Subject: [PATCH 17/26] Added analytics --- pubspec.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 4ef726f..ba7b2eb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: spot description: Find local video posts -version: 1.0.12+28 +version: 1.0.12+29 publish_to: none environment: @@ -29,6 +29,7 @@ dependencies: geocoding: ^2.0.0 share: ^2.0.1 firebase_core: ^1.2.1 + firebase_analytics: ^8.1.1 dev_dependencies: flutter_test: From 50937eac45880db0f8a7dc9c6c534cb32f6f63c0 Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sun, 6 Jun 2021 12:52:21 +0900 Subject: [PATCH 18/26] Set route name for every page --- lib/l10n/l10n.dart | 7 ------- lib/pages/confirm_recording_page.dart | 2 ++ lib/pages/edit_profile_page.dart | 3 +++ lib/pages/login_page.dart | 6 +++++- lib/pages/profile_page.dart | 7 ++++++- lib/pages/record_page.dart | 3 +++ lib/pages/tab_page.dart | 4 +--- lib/pages/view_video_page.dart | 3 +++ pubspec.lock | 28 +++++++++++++++++++++++++++ 9 files changed, 51 insertions(+), 12 deletions(-) diff --git a/lib/l10n/l10n.dart b/lib/l10n/l10n.dart index c085872..e7d7795 100644 --- a/lib/l10n/l10n.dart +++ b/lib/l10n/l10n.dart @@ -1,10 +1,3 @@ -// Copyright (c) 2021, Very Good Ventures -// https://verygood.ventures -// -// Use of this source code is governed by an MIT-style -// license that can be found in the LICENSE file or at -// https://opensource.org/licenses/MIT. - import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter/widgets.dart'; diff --git a/lib/pages/confirm_recording_page.dart b/lib/pages/confirm_recording_page.dart index 867c15b..fa8f427 100644 --- a/lib/pages/confirm_recording_page.dart +++ b/lib/pages/confirm_recording_page.dart @@ -17,8 +17,10 @@ import 'package:video_player/video_player.dart'; import '../components/app_scaffold.dart'; class ConfirmRecordingPage extends StatelessWidget { + static const name = 'ConfirmRecordingPage'; static Route route({required XFile videoFile}) { return MaterialPageRoute( + settings: const RouteSettings(name: name), builder: (context) => BlocProvider( create: (context) => ConfirmVideoCubit(repository: RepositoryProvider.of(context)) diff --git a/lib/pages/edit_profile_page.dart b/lib/pages/edit_profile_page.dart index 28037ea..0e2b348 100644 --- a/lib/pages/edit_profile_page.dart +++ b/lib/pages/edit_profile_page.dart @@ -18,11 +18,14 @@ class EditProfilePage extends StatefulWidget { final bool isCreatingAccount; + static const name = 'EditProfilePage'; + static Route route({ required bool isCreatingAccount, required String uid, }) { return MaterialPageRoute( + settings: const RouteSettings(name: name), builder: (context) => BlocProvider( create: (context) => ProfileCubit( repository: RepositoryProvider.of(context), diff --git a/lib/pages/login_page.dart b/lib/pages/login_page.dart index d1d9ad2..b15a7e8 100644 --- a/lib/pages/login_page.dart +++ b/lib/pages/login_page.dart @@ -23,8 +23,12 @@ enum DialogPage { } class LoginPage extends StatefulWidget { + static const name = 'LoginPage'; static Route route() { - return MaterialPageRoute(builder: (context) => LoginPage()); + return MaterialPageRoute( + settings: const RouteSettings(name: name), + builder: (context) => LoginPage(), + ); } @override diff --git a/lib/pages/profile_page.dart b/lib/pages/profile_page.dart index 75cf493..b9ccded 100644 --- a/lib/pages/profile_page.dart +++ b/lib/pages/profile_page.dart @@ -5,8 +5,13 @@ import 'package:spot/components/user_profile.dart'; class ProfilePage extends StatelessWidget { const ProfilePage(this._userId, {Key? key}) : super(key: key); + static const name = 'ProfilePage'; + static Route route(String userId) { - return MaterialPageRoute(builder: (_) => ProfilePage(userId)); + return MaterialPageRoute( + settings: const RouteSettings(name: name), + builder: (_) => ProfilePage(userId), + ); } final String _userId; diff --git a/lib/pages/record_page.dart b/lib/pages/record_page.dart index 6f82908..73d968d 100644 --- a/lib/pages/record_page.dart +++ b/lib/pages/record_page.dart @@ -10,8 +10,11 @@ import '../components/app_scaffold.dart'; import '../cubits/record/record_cubit.dart'; class RecordPage extends StatelessWidget { + static const name = 'RecordPage'; + static Route route() { return MaterialPageRoute( + settings: const RouteSettings(name: name), builder: (_) => BlocProvider( create: (_) => RecordCubit()..initialize(), child: RecordPage(), diff --git a/lib/pages/tab_page.dart b/lib/pages/tab_page.dart index d3bc3ed..eb3bd57 100644 --- a/lib/pages/tab_page.dart +++ b/lib/pages/tab_page.dart @@ -21,9 +21,7 @@ class TabPage extends StatefulWidget { static const name = 'TabPage'; static Route route() { return MaterialPageRoute( - settings: const RouteSettings( - name: name, - ), + settings: const RouteSettings(name: name), builder: (_) => TabPage(), ); } diff --git a/lib/pages/view_video_page.dart b/lib/pages/view_video_page.dart index f85b370..639ac7f 100644 --- a/lib/pages/view_video_page.dart +++ b/lib/pages/view_video_page.dart @@ -28,8 +28,11 @@ enum VideoMenu { } class ViewVideoPage extends StatelessWidget { + static const name = 'ViewVideoPage'; + static Route route(String videoId) { return MaterialPageRoute( + settings: const RouteSettings(name: name), builder: (context) => BlocProvider( create: (context) => VideoCubit(repository: RepositoryProvider.of(context))..initialize(videoId), diff --git a/pubspec.lock b/pubspec.lock index c82bc21..7f6abcf 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -155,6 +155,34 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "6.1.0" + firebase: + dependency: transitive + description: + name: firebase + url: "https://pub.dartlang.org" + source: hosted + version: "9.0.1" + firebase_analytics: + dependency: "direct main" + description: + name: firebase_analytics + url: "https://pub.dartlang.org" + source: hosted + version: "8.1.1" + firebase_analytics_platform_interface: + dependency: transitive + description: + name: firebase_analytics_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + firebase_analytics_web: + dependency: transitive + description: + name: firebase_analytics_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0+1" firebase_core: dependency: "direct main" description: From 2c9678655b305f13806292921fd30e9ce57762ec Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sun, 6 Jun 2021 13:12:19 +0900 Subject: [PATCH 19/26] Added basic events --- lib/app/app.dart | 20 ++++++++++---- lib/cubits/video/video_cubit.dart | 2 +- lib/main.dart | 2 +- lib/repositories/repository.dart | 44 ++++++++++++++++++++++++++++--- 4 files changed, 57 insertions(+), 11 deletions(-) diff --git a/lib/app/app.dart b/lib/app/app.dart index 657969d..33f9ffa 100644 --- a/lib/app/app.dart +++ b/lib/app/app.dart @@ -1,3 +1,5 @@ +import 'package:firebase_analytics/firebase_analytics.dart'; +import 'package:firebase_analytics/observer.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; @@ -8,17 +10,22 @@ import 'package:spot/repositories/repository.dart'; import 'package:supabase/supabase.dart'; class App extends StatelessWidget { - const App({Key? key}) : super(key: key); + App({Key? key}) : super(key: key); + + static const _supabaseUrl = String.fromEnvironment('SUPABASE_URL'); + static const _supabaseannonKey = String.fromEnvironment('SUPABASE_ANNON_KEY'); + final _supabaseClient = SupabaseClient(_supabaseUrl, _supabaseannonKey); + final _analytics = FirebaseAnalytics(); @override Widget build(BuildContext context) { - const _supabaseUrl = String.fromEnvironment('SUPABASE_URL'); - const _supabaseannonKey = String.fromEnvironment('SUPABASE_ANNON_KEY'); - final supabaseClient = SupabaseClient(_supabaseUrl, _supabaseannonKey); return MultiRepositoryProvider( providers: [ RepositoryProvider( - create: (context) => Repository(supabaseClient: supabaseClient), + create: (context) => Repository( + supabaseClient: _supabaseClient, + analytics: _analytics, + ), ), ], child: MultiBlocProvider( @@ -66,6 +73,9 @@ class App extends StatelessWidget { GlobalMaterialLocalizations.delegate, ], supportedLocales: AppLocalizations.supportedLocales, + navigatorObservers: [ + FirebaseAnalyticsObserver(analytics: _analytics), + ], home: SplashPage(), ), ), diff --git a/lib/cubits/video/video_cubit.dart b/lib/cubits/video/video_cubit.dart index fc45760..10d1b86 100644 --- a/lib/cubits/video/video_cubit.dart +++ b/lib/cubits/video/video_cubit.dart @@ -153,7 +153,7 @@ class VideoCubit extends Cubit { } Future shareVideo() { - return _repository.shareVideo(_videoDetail!.url); + return _repository.shareVideo(_videoDetail!); } Future _initializeVideo() async { diff --git a/lib/main.dart b/lib/main.dart index dea2211..4169240 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -16,7 +16,7 @@ Future main() async { }; runZonedGuarded( - () => runApp(const App()), + () => runApp(App()), (error, stackTrace) => log(error.toString(), stackTrace: stackTrace), ); } diff --git a/lib/repositories/repository.dart b/lib/repositories/repository.dart index 17aff8d..8c8657e 100644 --- a/lib/repositories/repository.dart +++ b/lib/repositories/repository.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'dart:io'; +import 'package:firebase_analytics/firebase_analytics.dart'; import 'package:flutter/services.dart'; import 'package:flutter_cache_manager/flutter_cache_manager.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; @@ -17,9 +18,14 @@ import 'package:video_player/video_player.dart'; import 'package:geocoding/geocoding.dart'; class Repository { - Repository({required SupabaseClient supabaseClient}) : _supabaseClient = supabaseClient; + Repository({ + required SupabaseClient supabaseClient, + required FirebaseAnalytics analytics, + }) : _supabaseClient = supabaseClient, + _analytics = analytics; final SupabaseClient _supabaseClient; + final FirebaseAnalytics _analytics; static const _localStorage = FlutterSecureStorage(); static const _persistantSessionKey = 'supabase_session'; static const _termsOfServiceAgreementKey = 'agreed'; @@ -72,8 +78,9 @@ class Repository { final res = await _supabaseClient.auth.signUp(email, password); final error = res.error; if (error != null) { - throw PlatformException(code: 'login error', message: error.message); + throw PlatformException(code: 'signup error', message: error.message); } + await _analytics.logSignUp(signUpMethod: 'email'); return res.data!.persistSessionString; } @@ -87,6 +94,7 @@ class Repository { if (error != null) { throw PlatformException(code: 'login error', message: error.message); } + await _analytics.logLogin(loginMethod: 'email'); return res.data!.persistSessionString; } @@ -244,6 +252,7 @@ class Repository { final createdVideo = creatingVideo.updateId(id: data[0]['id'] as String); _mapVideos.add(createdVideo); _mapVideosStreamConntroller.sink.add(_mapVideos); + await _analytics.logEvent(name: 'post_video'); } Future getVideoDetailStream(String videoId) async { @@ -266,6 +275,9 @@ class Repository { } _videoDetails[videoId] = VideoDetail.fromData(Map.from(List.from(data).first)); _videoDetailStreamController.sink.add(_videoDetails[videoId]!); + await _analytics.logEvent(name: 'view_video', parameters: { + 'video_id': videoId, + }); } Future like(String videoId) async { @@ -285,6 +297,9 @@ class Repository { message: error.message, ); } + await _analytics.logEvent(name: 'like_video', parameters: { + 'video_id': videoId, + }); } Future unlike(String videoId) async { @@ -307,6 +322,9 @@ class Repository { message: error.message, ); } + await _analytics.logEvent(name: 'unlike_video', parameters: { + 'video_id': videoId, + }); } Future> getComments(String videoId) async { @@ -320,6 +338,9 @@ class Repository { message: error.message, ); } + await _analytics.logEvent(name: 'view_comments', parameters: { + 'video_id': videoId, + }); return Comment.commentsFromData(List.from(data)); } @@ -339,6 +360,9 @@ class Repository { message: error.message, ); } + await _analytics.logEvent(name: 'post_comment', parameters: { + 'video_id': videoId, + }); } Future> getNotifications() async { @@ -385,6 +409,9 @@ class Repository { } _mapVideos.removeWhere((value) => value.userId == blockedUserId); _mapVideosStreamConntroller.sink.add(_mapVideos); + await _analytics.logEvent(name: 'block_user', parameters: { + 'user_id': blockedUserId, + }); } Future report({ @@ -404,6 +431,9 @@ class Repository { message: error.message, ); } + await _analytics.logEvent(name: 'report_video', parameters: { + 'video_id': videoId, + }); } Future delete({required String videoId}) async { @@ -417,6 +447,9 @@ class Repository { } _mapVideos.removeWhere((video) => video.id == videoId); _mapVideosStreamConntroller.sink.add(_mapVideos); + await _analytics.logEvent(name: 'delete_video', parameters: { + 'video_id': videoId, + }); } Future> search(String queryString) async { @@ -437,6 +470,7 @@ class Repository { ); } final data = res.data as List; + await _analytics.logSearch(searchTerm: queryString); return Video.videosFromData(data); } @@ -494,18 +528,20 @@ class Repository { return null; } final location = locations.first; + await _analytics.logEvent(name: 'search_location', parameters: {'search_term': searchQuery}); return LatLng(location.latitude, location.longitude); } catch (e) { return null; } } - Future shareVideo(String videoUrl) async { - final file = await DefaultCacheManager().getSingleFile(videoUrl); + Future shareVideo(VideoDetail videoDetail) async { + final file = await DefaultCacheManager().getSingleFile(videoDetail.id); await Share.shareFiles( [file.path], text: 'Check out this video on Spot https://spot9752f.page.link/IA', ); + await _analytics.logEvent(name: 'share_video', parameters: {'video_id': videoDetail.id}); } Future getCachedFile(String url) { From 193d82de784972b3fb08a88f564c14bacfb9ab34 Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sun, 6 Jun 2021 13:13:20 +0900 Subject: [PATCH 20/26] Bumped build number --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index ba7b2eb..21cae29 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: spot description: Find local video posts -version: 1.0.12+29 +version: 1.0.12+30 publish_to: none environment: From c383b9829b66c3c757d220e7de71aade1ccd9461 Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sun, 6 Jun 2021 13:30:48 +0900 Subject: [PATCH 21/26] Fixed failing tests --- test/repositories/repository_test.dart | 30 +++++++++++++++++++------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/test/repositories/repository_test.dart b/test/repositories/repository_test.dart index 35bf66b..6005e70 100644 --- a/test/repositories/repository_test.dart +++ b/test/repositories/repository_test.dart @@ -1,6 +1,7 @@ import 'dart:convert'; import 'dart:io'; +import 'package:firebase_analytics/firebase_analytics.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:mocktail/mocktail.dart'; @@ -12,10 +13,13 @@ import 'package:supabase/supabase.dart'; class MockSupabaseClient extends Mock implements SupabaseClient {} +class MockFirebaseAnalytics extends Mock implements FirebaseAnalytics {} + void main() { group('repository', () { late SupabaseClient supabaseClient; late HttpServer mockServer; + late FirebaseAnalytics analytics; Future handleRequests(HttpServer server) async { await for (final HttpRequest request in server) { @@ -183,10 +187,20 @@ void main() { } setUp(() async { + registerFallbackValue(''); mockServer = await HttpServer.bind('localhost', 0); supabaseClient = SupabaseClient('http://${mockServer.address.host}:${mockServer.port}', 'supabaseKey'); handleRequests(mockServer); + analytics = MockFirebaseAnalytics(); + when(() => analytics.logEvent(name: any(named: 'name'))) + .thenAnswer((invocation) async => null); + when(() => analytics.logSignUp(signUpMethod: any(named: 'signUpMethod'))) + .thenAnswer((invocation) async => null); + when(() => analytics.logLogin(loginMethod: any(named: 'loginMethod'))) + .thenAnswer((invocation) async => null); + when(() => analytics.logSearch(searchTerm: any(named: 'searchTerm'))) + .thenAnswer((invocation) async => null); }); tearDown(() async { @@ -194,7 +208,7 @@ void main() { }); test('signUp', () async { - final repository = Repository(supabaseClient: supabaseClient); + final repository = Repository(supabaseClient: supabaseClient, analytics: analytics); final sessionString = await repository.signUp(email: '', password: ''); @@ -202,7 +216,7 @@ void main() { }); test('signIn', () async { - final repository = Repository(supabaseClient: supabaseClient); + final repository = Repository(supabaseClient: supabaseClient, analytics: analytics); final sessionString = await repository.signIn(email: '', password: ''); @@ -210,7 +224,7 @@ void main() { }); test('getSelfProfile', () async { - final repository = Repository(supabaseClient: supabaseClient); + final repository = Repository(supabaseClient: supabaseClient, analytics: analytics); await repository.signIn(email: '', password: ''); @@ -220,7 +234,7 @@ void main() { }); test('getVideosFromLocation', () async { - final repository = Repository(supabaseClient: supabaseClient); + final repository = Repository(supabaseClient: supabaseClient, analytics: analytics); await repository.signIn(email: '', password: ''); @@ -236,7 +250,7 @@ void main() { }); test('getVideosInBoundingBox', () async { - final repository = Repository(supabaseClient: supabaseClient); + final repository = Repository(supabaseClient: supabaseClient, analytics: analytics); await repository.signIn(email: '', password: ''); @@ -253,7 +267,7 @@ void main() { }); test('getVideosFromUid', () async { - final repository = Repository(supabaseClient: supabaseClient); + final repository = Repository(supabaseClient: supabaseClient, analytics: analytics); await repository.signIn(email: '', password: ''); @@ -265,7 +279,7 @@ void main() { }); test('getProfile', () async { - final repository = Repository(supabaseClient: supabaseClient); + final repository = Repository(supabaseClient: supabaseClient, analytics: analytics); await repository.signIn(email: '', password: ''); @@ -275,7 +289,7 @@ void main() { }); test('saveProfile', () async { - final repository = Repository(supabaseClient: supabaseClient); + final repository = Repository(supabaseClient: supabaseClient, analytics: analytics); await repository.signIn(email: '', password: ''); From cb573e2b4f826624a3e50d5a4bc841b85c1ac250 Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sun, 6 Jun 2021 14:51:10 +0900 Subject: [PATCH 22/26] Fixed zindex for ios --- android/app/build.gradle | 1 + android/app/google-services.json | 46 +++++++++++++++++++ .../app/src/development/google-services.json | 46 +++++++++++++++++++ .../app/src/production/google-services.json | 46 +++++++++++++++++++ android/build.gradle | 1 + lib/pages/tabs/map_tab.dart | 4 +- lib/repositories/repository.dart | 5 ++ pubspec.yaml | 2 +- test/repositories/repository_test.dart | 17 +++++++ 9 files changed, 165 insertions(+), 3 deletions(-) create mode 100644 android/app/google-services.json create mode 100644 android/app/src/development/google-services.json create mode 100644 android/app/src/production/google-services.json diff --git a/android/app/build.gradle b/android/app/build.gradle index 83eea7f..48caaea 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -30,6 +30,7 @@ if (keystorePropertiesFile.exists()) { apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" +apply plugin: 'com.google.gms.google-services' android { compileSdkVersion 30 diff --git a/android/app/google-services.json b/android/app/google-services.json new file mode 100644 index 0000000..f58a79f --- /dev/null +++ b/android/app/google-services.json @@ -0,0 +1,46 @@ +{ + "project_info": { + "project_number": "669895901022", + "project_id": "spot-videos", + "storage_bucket": "spot-videos.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:669895901022:android:e776461d00834e86c059cf", + "android_client_info": { + "package_name": "app.spotvideo" + } + }, + "oauth_client": [ + { + "client_id": "669895901022-gekl8a8ik43uelnm65ik1gicqanu8anl.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyBGEorLZKpQcoT674TjNMG_GEES_nbLXdE" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "669895901022-gekl8a8ik43uelnm65ik1gicqanu8anl.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "669895901022-b3pqggv2v8bkljpoojsjfgf369ip7709.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "app.spotvideo" + } + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/android/app/src/development/google-services.json b/android/app/src/development/google-services.json new file mode 100644 index 0000000..cbaeac0 --- /dev/null +++ b/android/app/src/development/google-services.json @@ -0,0 +1,46 @@ +{ + "project_info": { + "project_number": "405360906678", + "project_id": "spot-videos-dev", + "storage_bucket": "spot-videos-dev.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:405360906678:android:dba509310c0769f4b47117", + "android_client_info": { + "package_name": "com.example.spot.dev" + } + }, + "oauth_client": [ + { + "client_id": "405360906678-7c9f4q124fsfpkcbqmrebccail96cs7i.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyAZw_5_i8MeBiiuvUyWTxjdmnq2i3WpNUY" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "405360906678-7c9f4q124fsfpkcbqmrebccail96cs7i.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "405360906678-avbp7njivl97qe90l7ohn3u5l52u0d66.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "com.example.spot.dev" + } + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/android/app/src/production/google-services.json b/android/app/src/production/google-services.json new file mode 100644 index 0000000..f58a79f --- /dev/null +++ b/android/app/src/production/google-services.json @@ -0,0 +1,46 @@ +{ + "project_info": { + "project_number": "669895901022", + "project_id": "spot-videos", + "storage_bucket": "spot-videos.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:669895901022:android:e776461d00834e86c059cf", + "android_client_info": { + "package_name": "app.spotvideo" + } + }, + "oauth_client": [ + { + "client_id": "669895901022-gekl8a8ik43uelnm65ik1gicqanu8anl.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyBGEorLZKpQcoT674TjNMG_GEES_nbLXdE" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "669895901022-gekl8a8ik43uelnm65ik1gicqanu8anl.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "669895901022-b3pqggv2v8bkljpoojsjfgf369ip7709.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "app.spotvideo" + } + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index a584652..a0f44aa 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -9,6 +9,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:4.1.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath 'com.google.gms:google-services:4.3.8' } } diff --git a/lib/pages/tabs/map_tab.dart b/lib/pages/tabs/map_tab.dart index 294482a..3ba9496 100644 --- a/lib/pages/tabs/map_tab.dart +++ b/lib/pages/tabs/map_tab.dart @@ -295,7 +295,7 @@ class MapState extends State { markerId: MarkerId(video.id), position: video.location!, icon: loadingMarkerImage, - zIndex: video.createdAt.millisecondsSinceEpoch.toDouble(), + zIndex: RepositoryProvider.of(context).getZIndex(video.createdAt), )); setState(() { @@ -456,7 +456,7 @@ class MapState extends State { markerId: MarkerId(video.id), position: video.location!, icon: BitmapDescriptor.fromBytes(markerIcon), - zIndex: video.createdAt.millisecondsSinceEpoch.toDouble(), + zIndex: RepositoryProvider.of(context).getZIndex(video.createdAt), ); _markers.removeWhere((targetMarker) => targetMarker.markerId == marker.markerId); diff --git a/lib/repositories/repository.dart b/lib/repositories/repository.dart index 8c8657e..72db1b8 100644 --- a/lib/repositories/repository.dart +++ b/lib/repositories/repository.dart @@ -1,5 +1,6 @@ import 'dart:async'; import 'dart:io'; +import 'dart:math'; import 'package:firebase_analytics/firebase_analytics.dart'; import 'package:flutter/services.dart'; @@ -547,4 +548,8 @@ class Repository { Future getCachedFile(String url) { return DefaultCacheManager().getSingleFile(url); } + + double getZIndex(DateTime createdAt) { + return max((createdAt.millisecondsSinceEpoch ~/ 1000000 - 1600000), 0).toDouble(); + } } diff --git a/pubspec.yaml b/pubspec.yaml index 21cae29..fd5042c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: spot description: Find local video posts -version: 1.0.12+30 +version: 1.0.13+31 publish_to: none environment: diff --git a/test/repositories/repository_test.dart b/test/repositories/repository_test.dart index 6005e70..e867266 100644 --- a/test/repositories/repository_test.dart +++ b/test/repositories/repository_test.dart @@ -303,5 +303,22 @@ void main() { ), ); }); + + test('getZIndex', () async { + final repository = Repository(supabaseClient: supabaseClient, analytics: analytics); + final recentZIndex = repository.getZIndex(DateTime(2021, 4, 10)); + expect(recentZIndex.isNegative, false); + expect(recentZIndex < 1000000, true); + + final futureZIndex = repository.getZIndex(DateTime(2030, 4, 10)); + expect(futureZIndex.isNegative, false); + expect(futureZIndex < 1000000, true); + }); + test('getZIndex close ', () async { + final repository = Repository(supabaseClient: supabaseClient, analytics: analytics); + final firstZIndex = repository.getZIndex(DateTime(2021, 4, 10, 10, 0, 0)).toInt(); + final laterZIndex = repository.getZIndex(DateTime(2021, 4, 10, 11, 0, 0)).toInt(); + expect(firstZIndex < laterZIndex, true); + }); }); } From b4c1403006b1b1ebe289ef45c74252c72343f826 Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sun, 6 Jun 2021 14:55:56 +0900 Subject: [PATCH 23/26] Updated action --- .github/workflows/cd_android.yml | 1 + .github/workflows/cd_ios.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd_android.yml b/.github/workflows/cd_android.yml index ecf6f69..05cccc7 100644 --- a/.github/workflows/cd_android.yml +++ b/.github/workflows/cd_android.yml @@ -4,6 +4,7 @@ on: push: branches: - main + pull_request: jobs: build: diff --git a/.github/workflows/cd_ios.yml b/.github/workflows/cd_ios.yml index bc649e0..8f2009b 100644 --- a/.github/workflows/cd_ios.yml +++ b/.github/workflows/cd_ios.yml @@ -4,7 +4,7 @@ on: push: branches: - main - - feat/analytics + pull_request: jobs: build: From 5e8f6215896b1f19e07a0920d892c8e2831a97bc Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sun, 6 Jun 2021 15:01:12 +0900 Subject: [PATCH 24/26] Removed random tests --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index d5e2553..74cd727 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -22,7 +22,7 @@ jobs: run: flutter analyze lib test - name: Run tests - run: flutter test --no-pub --coverage --test-randomize-ordering-seed random + run: flutter test --no-pub --coverage # - name: Check Code Coverage # uses: VeryGoodOpenSource/very_good_coverage@v1.1.1 From 5a99cd31f839a3686ab8caa56789d3a571d2e826 Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sun, 6 Jun 2021 15:01:57 +0900 Subject: [PATCH 25/26] Bumped build number --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index fd5042c..df68b21 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: spot description: Find local video posts -version: 1.0.13+31 +version: 1.0.13+32 publish_to: none environment: From 9283850f9a37ee57273b26b32fa9f3ae965568e8 Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Sun, 6 Jun 2021 15:25:16 +0900 Subject: [PATCH 26/26] Updated release notes --- ios/fastlane/metadata/en-US/release_notes.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/fastlane/metadata/en-US/release_notes.txt b/ios/fastlane/metadata/en-US/release_notes.txt index 1305e31..fd48529 100644 --- a/ios/fastlane/metadata/en-US/release_notes.txt +++ b/ios/fastlane/metadata/en-US/release_notes.txt @@ -1,4 +1,4 @@ Bringing you smoother experience! -- Improved map loading performance -- New video now show up on top of the map \ No newline at end of file +- Videos load much faster +- Fixed map painting order bug \ No newline at end of file