mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 14:47:23 +00:00
Added env files and dotenv package
This commit is contained in:
2
.env.development
Normal file
2
.env.development
Normal file
@ -0,0 +1,2 @@
|
||||
ENV_NAME=development
|
||||
BASE_URL=https://syncrow-dev.azurewebsites.net
|
2
.env.production
Normal file
2
.env.production
Normal file
@ -0,0 +1,2 @@
|
||||
ENV_NAME=production
|
||||
BASE_URL=https://syncrow-staging.azurewebsites.net
|
2
.env.staging
Normal file
2
.env.staging
Normal file
@ -0,0 +1,2 @@
|
||||
ENV_NAME=staging
|
||||
BASE_URL=https://syncrow-staging.azurewebsites.net
|
61
.vscode/launch.json
vendored
Normal file
61
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
{
|
||||
"configurations": [
|
||||
|
||||
{
|
||||
|
||||
"name": "DEVELOPMENT",
|
||||
|
||||
"request": "launch",
|
||||
|
||||
"type": "dart",
|
||||
|
||||
"args": [
|
||||
|
||||
"--dart-define",
|
||||
|
||||
"FLAVOR=development"
|
||||
|
||||
],
|
||||
|
||||
"flutterMode": "debug"
|
||||
|
||||
},{
|
||||
|
||||
"name": "STAGING",
|
||||
|
||||
"request": "launch",
|
||||
|
||||
"type": "dart",
|
||||
|
||||
"args": [
|
||||
|
||||
"--dart-define",
|
||||
|
||||
"FLAVOR=staging"
|
||||
|
||||
],
|
||||
|
||||
"flutterMode": "debug"
|
||||
|
||||
},{
|
||||
|
||||
"name": "PRODUCTION",
|
||||
|
||||
"request": "launch",
|
||||
|
||||
"type": "dart",
|
||||
|
||||
"args": [
|
||||
|
||||
"--dart-define",
|
||||
|
||||
"FLAVOR=production"
|
||||
|
||||
],
|
||||
|
||||
"flutterMode": "debug"
|
||||
|
||||
},
|
||||
|
||||
]
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'package:syncrow_web/pages/auth/bloc/auth_bloc.dart';
|
||||
import 'package:syncrow_web/pages/home/bloc/home_bloc.dart';
|
||||
import 'package:syncrow_web/pages/visitor_password/bloc/visitor_password_bloc.dart';
|
||||
@ -11,8 +12,12 @@ import 'package:syncrow_web/utils/constants/routes_const.dart';
|
||||
import 'package:syncrow_web/utils/theme/theme.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
initialSetup();
|
||||
try {
|
||||
const environment = String.fromEnvironment('FLAVOR', defaultValue: 'production');
|
||||
await dotenv.load(fileName: '.env.$environment');
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
initialSetup();
|
||||
} catch (_) {}
|
||||
runApp(MyApp());
|
||||
}
|
||||
|
||||
|
@ -1,16 +0,0 @@
|
||||
|
||||
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SpaseManagementicon extends StatelessWidget {
|
||||
const SpaseManagementicon({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Container(),
|
||||
);
|
||||
}
|
||||
}
|
@ -1,41 +1,35 @@
|
||||
abstract class ApiEndpoints {
|
||||
static const String baseUrl = 'https://syncrow-dev.azurewebsites.net';
|
||||
// static const String baseUrl = 'http://100.107.182.63:4001'; //Localhost
|
||||
//https://syncrow-staging.azurewebsites.net
|
||||
////////////////////////////////////// Authentication ///////////////////////////////
|
||||
static const String signUp = '$baseUrl/authentication/user/signup';
|
||||
static const String login = '$baseUrl/authentication/user/login';
|
||||
static const String forgetPassword =
|
||||
'$baseUrl/authentication/user/forget-password';
|
||||
static const String sendOtp = '$baseUrl/authentication/user/send-otp';
|
||||
static const String verifyOtp = '$baseUrl/authentication/user/verify-otp';
|
||||
static const String getRegion = '$baseUrl/region';
|
||||
static const String visitorPassword = '$baseUrl/visitor-password';
|
||||
static const String getDevices = '$baseUrl/visitor-password/devices';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
|
||||
static const String sendOnlineOneTime =
|
||||
'$baseUrl/visitor-password/temporary-password/online/one-time';
|
||||
abstract class ApiEndpoints {
|
||||
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';
|
||||
static const String sendOtp = '/authentication/user/send-otp';
|
||||
static const String verifyOtp = '/authentication/user/verify-otp';
|
||||
static const String getRegion = '/region';
|
||||
static const String visitorPassword = '/visitor-password';
|
||||
static const String getDevices = '/visitor-password/devices';
|
||||
|
||||
static const String sendOnlineOneTime = '/visitor-password/temporary-password/online/one-time';
|
||||
static const String sendOnlineMultipleTime =
|
||||
'$baseUrl/visitor-password/temporary-password/online/multiple-time';
|
||||
'/visitor-password/temporary-password/online/multiple-time';
|
||||
|
||||
//offline Password
|
||||
static const String sendOffLineOneTime =
|
||||
'$baseUrl/visitor-password/temporary-password/offline/one-time';
|
||||
static const String sendOffLineOneTime = '/visitor-password/temporary-password/offline/one-time';
|
||||
static const String sendOffLineMultipleTime =
|
||||
'$baseUrl/visitor-password/temporary-password/offline/multiple-time';
|
||||
'/visitor-password/temporary-password/offline/multiple-time';
|
||||
|
||||
static const String getUser = '$baseUrl/user/{userUuid}';
|
||||
static const String getUser = '/user/{userUuid}';
|
||||
|
||||
////// Devices Management ////////////////
|
||||
|
||||
static const String getAllDevices = '$baseUrl/device';
|
||||
static const String getDeviceStatus =
|
||||
'$baseUrl/device/{uuid}/functions/status';
|
||||
static const String getAllDevices = '/device';
|
||||
static const String getDeviceStatus = '/device/{uuid}/functions/status';
|
||||
|
||||
static const String deviceControl = '$baseUrl/device/{uuid}/control';
|
||||
static const String deviceControl = '/device/{uuid}/control';
|
||||
static const String gatewayApi = '/device/gateway/{gatewayUuid}/devices';
|
||||
static const String openDoorLock = '/door-lock/open/{doorLockUuid}';
|
||||
|
||||
static const String getDeviceLogs =
|
||||
'$baseUrl/device/report-logs/{uuid}?code={code}';
|
||||
static const String getDeviceLogs = '/device/report-logs/{uuid}?code={code}';
|
||||
}
|
||||
|
@ -150,6 +150,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "8.1.5"
|
||||
flutter_dotenv:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_dotenv
|
||||
sha256: "9357883bdd153ab78cbf9ffa07656e336b8bbb2b5a3ca596b0b27e119f7c7d77"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.1.0"
|
||||
flutter_lints:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
|
@ -48,6 +48,8 @@ dependencies:
|
||||
go_router:
|
||||
intl: ^0.19.0
|
||||
dropdown_search: ^5.0.6
|
||||
flutter_dotenv: ^5.1.0
|
||||
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
@ -77,6 +79,9 @@ flutter:
|
||||
- assets/icons/
|
||||
- assets/images/
|
||||
- assets/
|
||||
- .env.development
|
||||
- .env.staging
|
||||
- .env.production
|
||||
|
||||
|
||||
# An image asset can refer to one or more resolution-specific "variants", see
|
||||
|
Reference in New Issue
Block a user