diff --git a/.github/workflows/azure-static-web-apps-polite-smoke-017c65c10.yml b/.github/workflows/azure-static-web-apps-polite-smoke-017c65c10.yml index 5cb7a8d3..e28d1bb2 100644 --- a/.github/workflows/azure-static-web-apps-polite-smoke-017c65c10.yml +++ b/.github/workflows/azure-static-web-apps-polite-smoke-017c65c10.yml @@ -31,7 +31,7 @@ jobs: run: flutter pub get - name: Build Flutter Web App - run: flutter build web + run: flutter build web --release --dart-define=FLAVOR=development - name: Build And Deploy id: builddeploy diff --git a/.github/workflows/azure-static-web-apps-salmon-ocean-0c2902310.yml b/.github/workflows/azure-static-web-apps-salmon-ocean-0c2902310.yml deleted file mode 100644 index d556b9e5..00000000 --- a/.github/workflows/azure-static-web-apps-salmon-ocean-0c2902310.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Azure Static Web Apps CI/CD - -on: - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened, closed] - branches: - - main - -jobs: - build_and_deploy_job: - if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') - runs-on: ubuntu-latest - name: Build and Deploy Job - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - submodules: true - lfs: false - - - name: Set up Flutter - uses: subosito/flutter-action@v2 - with: - flutter-version: '3.22.2' # Specify the Flutter version you want to use - - - name: Load Environment Variables - run: | - echo "Loading environment variables from .env.production" - cat .env.production | grep -v '^#' >> $GITHUB_ENV - - - name: Install dependencies - run: flutter pub get - - - name: Build Flutter Web App - run: | - flutter build web --release \ - --dart-define=ENV_NAME=${{ env.ENV_NAME }} \ - --dart-define=BASE_URL=${{ env.BASE_URL }} \ - --dart-define=FLAVOR=production - - - name: Build And Deploy - id: builddeploy - uses: Azure/static-web-apps-deploy@v1 - with: - azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_ZEALOUS_MUSHROOM_0D31A3303 }} - repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) - action: "upload" - app_location: "." # Root of your Flutter project - api_location: "" # API source code path - optional - output_location: "build/web" # Path to the built web app content directory - - close_pull_request_job: - if: github.event_name == 'pull_request' && github.event.action == 'closed' - runs-on: ubuntu-latest - name: Close Pull Request Job - steps: - - name: Close Pull Request - id: closepullrequest - uses: Azure/static-web-apps-deploy@v1 - with: - azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_ZEALOUS_MUSHROOM_0D31A3303 }} - action: "close" diff --git a/.github/workflows/azure-static-web-apps-zealous-mushroom-0d31a3303.yml b/.github/workflows/azure-static-web-apps-zealous-mushroom-0d31a3303.yml deleted file mode 100644 index b8d576b9..00000000 --- a/.github/workflows/azure-static-web-apps-zealous-mushroom-0d31a3303.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Azure Static Web Apps CI/CD - -on: - push: - branches: - - dev - pull_request: - types: [opened, synchronize, reopened, closed] - branches: - - dev - -jobs: - build_and_deploy_job: - if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') - runs-on: ubuntu-latest - name: Build and Deploy Job - steps: - - - name: Checkout Code - uses: actions/checkout@v3 - with: - submodules: true - lfs: false - - - name: Set up Flutter - uses: subosito/flutter-action@v2 - with: - flutter-version: '3.22.2' # Specify the Flutter version you want to use - - - name: Install dependencies - run: flutter pub get - - - name: Build Flutter Web App - run: flutter build web - - - name: Build And Deploy - id: builddeploy - uses: Azure/static-web-apps-deploy@v1 - with: - azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_ZEALOUS_MUSHROOM_0D31A3303 }} - repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) - action: "upload" - ###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### - # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig - app_location: "/build/web" # App source code path - api_location: "" # Api source code path - optional - output_location: "/build/web" # Built app content directory - optional - ###### End of Repository/Build Configurations ###### - - close_pull_request_job: - if: github.event_name == 'pull_request' && github.event.action == 'closed' - runs-on: ubuntu-latest - name: Close Pull Request Job - steps: - - name: Close Pull Request - id: closepullrequest - uses: Azure/static-web-apps-deploy@v1 - with: - azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_ZEALOUS_MUSHROOM_0D31A3303 }} - action: "close" diff --git a/lib/services/access_mang_api.dart b/lib/services/access_mang_api.dart index b99b75a9..103f6121 100644 --- a/lib/services/access_mang_api.dart +++ b/lib/services/access_mang_api.dart @@ -1,5 +1,4 @@ import 'dart:convert'; -import 'package:flutter/cupertino.dart'; import 'package:syncrow_web/pages/access_management/model/password_model.dart'; import 'package:syncrow_web/pages/visitor_password/model/device_model.dart'; import 'package:syncrow_web/pages/visitor_password/model/schedule_model.dart'; diff --git a/lib/services/auth_api.dart b/lib/services/auth_api.dart index a09fa7ba..44a4e7cf 100644 --- a/lib/services/auth_api.dart +++ b/lib/services/auth_api.dart @@ -1,5 +1,4 @@ import 'package:dio/dio.dart'; -import 'package:flutter/foundation.dart'; import 'package:syncrow_web/pages/auth/model/region_model.dart'; import 'package:syncrow_web/pages/auth/model/token.dart'; import 'package:syncrow_web/services/api/http_service.dart'; @@ -25,8 +24,7 @@ class AuthenticationAPI { path: ApiEndpoints.forgetPassword, body: {"email": email, "password": password}, showServerMessage: true, - expectedResponseModel: (json) { - }); + expectedResponseModel: (json) {}); return response; } @@ -64,19 +62,18 @@ class AuthenticationAPI { } static Future verifyOtp({required String email, required String otpCode}) async { - final response = await HTTPService().post( - path: ApiEndpoints.verifyOtp, - body: {"email": email, "type": "PASSWORD", "otpCode": otpCode}, - showServerMessage: true, - expectedResponseModel: (json) { - if (json['message'] == 'Otp Verified Successfully') { - return true; - } else { - return false; - } - }); - return response; - + final response = await HTTPService().post( + path: ApiEndpoints.verifyOtp, + body: {"email": email, "type": "PASSWORD", "otpCode": otpCode}, + showServerMessage: true, + expectedResponseModel: (json) { + if (json['message'] == 'Otp Verified Successfully') { + return true; + } else { + return false; + } + }); + return response; } static Future> fetchRegion() async { diff --git a/lib/utils/constants/api_const.dart b/lib/utils/constants/api_const.dart index cc4fc478..5d24b501 100644 --- a/lib/utils/constants/api_const.dart +++ b/lib/utils/constants/api_const.dart @@ -1,8 +1,7 @@ import 'package:flutter_dotenv/flutter_dotenv.dart'; abstract class ApiEndpoints { - // static String baseUrl = dotenv.env['BASE_URL'] ?? ''; - static String baseUrl = 'https://syncrow-dev.azurewebsites.net'; + static String baseUrl = dotenv.env['BASE_URL'] ?? ''; static const String signUp = '/authentication/user/signup'; static const String login = '/authentication/user/login'; static const String forgetPassword = '/authentication/user/forget-password';