Read base url from development, and removed unused lines

This commit is contained in:
Abdullah Alassaf
2024-09-04 17:03:21 +03:00
parent a4b1a9e85d
commit 0db7a9e1ba
6 changed files with 15 additions and 145 deletions

View File

@ -31,7 +31,7 @@ jobs:
run: flutter pub get run: flutter pub get
- name: Build Flutter Web App - name: Build Flutter Web App
run: flutter build web run: flutter build web --release --dart-define=FLAVOR=development
- name: Build And Deploy - name: Build And Deploy
id: builddeploy id: builddeploy

View File

@ -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"

View File

@ -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"

View File

@ -1,5 +1,4 @@
import 'dart:convert'; import 'dart:convert';
import 'package:flutter/cupertino.dart';
import 'package:syncrow_web/pages/access_management/model/password_model.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/device_model.dart';
import 'package:syncrow_web/pages/visitor_password/model/schedule_model.dart'; import 'package:syncrow_web/pages/visitor_password/model/schedule_model.dart';

View File

@ -1,5 +1,4 @@
import 'package:dio/dio.dart'; 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/region_model.dart';
import 'package:syncrow_web/pages/auth/model/token.dart'; import 'package:syncrow_web/pages/auth/model/token.dart';
import 'package:syncrow_web/services/api/http_service.dart'; import 'package:syncrow_web/services/api/http_service.dart';
@ -25,8 +24,7 @@ class AuthenticationAPI {
path: ApiEndpoints.forgetPassword, path: ApiEndpoints.forgetPassword,
body: {"email": email, "password": password}, body: {"email": email, "password": password},
showServerMessage: true, showServerMessage: true,
expectedResponseModel: (json) { expectedResponseModel: (json) {});
});
return response; return response;
} }
@ -64,19 +62,18 @@ class AuthenticationAPI {
} }
static Future verifyOtp({required String email, required String otpCode}) async { static Future verifyOtp({required String email, required String otpCode}) async {
final response = await HTTPService().post( final response = await HTTPService().post(
path: ApiEndpoints.verifyOtp, path: ApiEndpoints.verifyOtp,
body: {"email": email, "type": "PASSWORD", "otpCode": otpCode}, body: {"email": email, "type": "PASSWORD", "otpCode": otpCode},
showServerMessage: true, showServerMessage: true,
expectedResponseModel: (json) { expectedResponseModel: (json) {
if (json['message'] == 'Otp Verified Successfully') { if (json['message'] == 'Otp Verified Successfully') {
return true; return true;
} else { } else {
return false; return false;
} }
}); });
return response; return response;
} }
static Future<List<RegionModel>> fetchRegion() async { static Future<List<RegionModel>> fetchRegion() async {

View File

@ -1,8 +1,7 @@
import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart';
abstract class ApiEndpoints { abstract class ApiEndpoints {
// static String baseUrl = dotenv.env['BASE_URL'] ?? ''; static String baseUrl = dotenv.env['BASE_URL'] ?? '';
static String baseUrl = 'https://syncrow-dev.azurewebsites.net';
static const String signUp = '/authentication/user/signup'; static const String signUp = '/authentication/user/signup';
static const String login = '/authentication/user/login'; static const String login = '/authentication/user/login';
static const String forgetPassword = '/authentication/user/forget-password'; static const String forgetPassword = '/authentication/user/forget-password';