diff --git a/.env b/.env
index 359dfdf..267d625 100644
--- a/.env
+++ b/.env
@@ -1,4 +1,4 @@
API_URL=https://venbait.in/nhance/dev/employeeRest/
-TICKET_API_URL=https://venbait.in/nhance/helpdesk/dev/api/
+TICKET_API_URL=https://venbait.in/nhance/helpdesk/dev/api
BASE_HREF=/nhance/employee/dev/
ENV=development
\ No newline at end of file
diff --git a/.env.development b/.env.development
index 359dfdf..267d625 100644
--- a/.env.development
+++ b/.env.development
@@ -1,4 +1,4 @@
API_URL=https://venbait.in/nhance/dev/employeeRest/
-TICKET_API_URL=https://venbait.in/nhance/helpdesk/dev/api/
+TICKET_API_URL=https://venbait.in/nhance/helpdesk/dev/api
BASE_HREF=/nhance/employee/dev/
ENV=development
\ No newline at end of file
diff --git a/.env.production b/.env.production
index a96bf9f..f0ed597 100644
--- a/.env.production
+++ b/.env.production
@@ -1,4 +1,4 @@
API_URL=https://venbait.in/nhance/uat/employeeRest/
-TICKET_API_URL=https://venbait.in/nhance/helpdesk/uat/api/
+TICKET_API_URL=https://venbait.in/nhance/helpdesk/uat/api
BASE_HREF=/nhance/employee/uat/
ENV=production
\ No newline at end of file
diff --git a/.env.test b/.env.test
index 6bf47a1..96bf094 100644
--- a/.env.test
+++ b/.env.test
@@ -1,4 +1,4 @@
API_URL=https://venbait.in/nhance/test/employeeRest/
-TICKET_API_URL=https://venbait.in/nhance/helpdesk/test/api/
+TICKET_API_URL=https://venbait.in/nhance/helpdesk/test/api
BASE_HREF=/nhance/employee/test/
ENV=test
\ No newline at end of file
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 399f32a..3008e9c 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -5,6 +5,7 @@
diff --git a/build_web_dev.sh b/build_web_dev.sh
index f7d52b3..ad8a027 100755
--- a/build_web_dev.sh
+++ b/build_web_dev.sh
@@ -11,24 +11,29 @@ fi
# Copy the .env.development file to .env
cp $ENV_FILE_PATH .env
+echo "Copied $ENV_FILE_PATH to .env"
-# Check if the BASE_HREF variable exists in the .env file
-if ! grep -q BASE_HREF .env; then
- echo "BASE_HREF not found in .env file"
+# Source the .env file to load the environment variables
+source .env
+
+# Check if the required variables are set
+if [ -z "$BASE_HREF" ] || [ -z "$API_URL" ] || [ -z "$TICKET_API_URL" ]; then
+ echo "Environment variables not set correctly in .env"
exit 1
fi
-# Extract the BASE_HREF value
-BASE_HREF=$(grep BASE_HREF .env | cut -d '=' -f2)
-
-# Check if the BASE_HREF value is empty
-if [ -z "$BASE_HREF" ]; then
- echo "BASE_HREF value is empty"
- exit 1
-fi
+# Print the loaded variables for verification
+echo "Loaded BASE_HREF: $BASE_HREF"
+echo "Loaded API_URL: $API_URL"
+echo "Loaded TICKET_API_URL: $TICKET_API_URL"
# Build the web app for development with base href
flutter build web --release --base-href "$BASE_HREF"
-# Optionally, remove the .env file after the build
-# rm .env
+# Check if the build was successful
+if [ $? -ne 0 ]; then
+ echo "Flutter dev build failed"
+ exit 1
+fi
+
+echo "Flutter dev build succeeded"
diff --git a/build_web_production.sh b/build_web_production.sh
index 7463034..2d06463 100755
--- a/build_web_production.sh
+++ b/build_web_production.sh
@@ -1,34 +1,39 @@
#!/bin/bash
-# Define the path to the .env file for production
+# Define the path to the .env.production file
ENV_FILE_PATH=".env.production"
-# Check if the .env file exists
+# Check if the .env.production file exists
if [ ! -f $ENV_FILE_PATH ]; then
echo "$ENV_FILE_PATH does not exist"
exit 1
fi
-# Copy the .env file for production to .env
+# Copy the .env.production file to .env
cp $ENV_FILE_PATH .env
+echo "Copied $ENV_FILE_PATH to .env"
-# Check if the BASE_HREF variable exists in the .env file
-if ! grep -q BASE_HREF .env; then
- echo "BASE_HREF not found in .env file"
+# Source the .env file to load the environment variables
+source .env
+
+# Check if the required variables are set
+if [ -z "$BASE_HREF" ] || [ -z "$API_URL" ] || [ -z "$TICKET_API_URL" ]; then
+ echo "Environment variables not set correctly in .env"
exit 1
fi
-# Extract the BASE_HREF value
-BASE_HREF=$(grep BASE_HREF .env | cut -d '=' -f2)
+# Print the loaded variables for verification
+echo "Loaded BASE_HREF: $BASE_HREF"
+echo "Loaded API_URL: $API_URL"
+echo "Loaded TICKET_API_URL: $TICKET_API_URL"
-# Check if the BASE_HREF value is empty
-if [ -z "$BASE_HREF" ]; then
- echo "BASE_HREF value is empty"
- exit 1
-fi
-
-# Build the web app for production environment with base href
+# Build the web app for production with base href
flutter build web --release --base-href "$BASE_HREF"
-# Optionally, remove the .env file after the build
-# rm .env
+# Check if the build was successful
+if [ $? -ne 0 ]; then
+ echo "Flutter prod build failed"
+ exit 1
+fi
+
+echo "Flutter prod build succeeded"
diff --git a/build_web_test.sh b/build_web_test.sh
index cee690d..b764d8c 100755
--- a/build_web_test.sh
+++ b/build_web_test.sh
@@ -1,34 +1,39 @@
#!/bin/bash
-# Define the path to the .env file for testing
+# Define the path to the .env.test file
ENV_FILE_PATH=".env.test"
-# Check if the .env file exists
+# Check if the .env.test file exists
if [ ! -f $ENV_FILE_PATH ]; then
echo "$ENV_FILE_PATH does not exist"
exit 1
fi
-# Copy the .env file for testing to .env
+# Copy the .env.test file to .env
cp $ENV_FILE_PATH .env
+echo "Copied $ENV_FILE_PATH to .env"
-# Check if the BASE_HREF variable exists in the .env file
-if ! grep -q BASE_HREF .env; then
- echo "BASE_HREF not found in .env file"
+# Source the .env file to load the environment variables
+source .env
+
+# Check if the required variables are set
+if [ -z "$BASE_HREF" ] || [ -z "$API_URL" ] || [ -z "$TICKET_API_URL" ]; then
+ echo "Environment variables not set correctly in .env"
exit 1
fi
-# Extract the BASE_HREF value
-BASE_HREF=$(grep BASE_HREF .env | cut -d '=' -f2)
+# Print the loaded variables for verification
+echo "Loaded BASE_HREF: $BASE_HREF"
+echo "Loaded API_URL: $API_URL"
+echo "Loaded TICKET_API_URL: $TICKET_API_URL"
-# Check if the BASE_HREF value is empty
-if [ -z "$BASE_HREF" ]; then
- echo "BASE_HREF value is empty"
- exit 1
-fi
-
-# Build the web app for test environment with base href
+# Build the web app for the test environment with base href
flutter build web --release --base-href "$BASE_HREF"
-# Optionally, remove the .env file after the build
-# rm .env
+# Check if the build was successful
+if [ $? -ne 0 ]; then
+ echo "Flutter test build failed"
+ exit 1
+fi
+
+echo "Flutter test build succeeded"
diff --git a/lib/customAppBar/customAppBar.dart b/lib/customAppBar/customAppBar.dart
index f9b7246..bb80d9c 100644
--- a/lib/customAppBar/customAppBar.dart
+++ b/lib/customAppBar/customAppBar.dart
@@ -9,36 +9,28 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
Future logout(BuildContext context) async {
final prefs = await SharedPreferences.getInstance();
- final String? hrtoken = prefs.getString('hrtoken');
final String? token = prefs.getString('token');
if (token != null && token.isNotEmpty) {
- if (hrtoken != null && hrtoken.isNotEmpty) {
- prefs.remove('token');
- Navigator.pushNamed(context, 'hrDashboard');
- } else {
- await prefs.clear();
- Navigator.pushNamed(context, 'phone');
- }
- } else if (hrtoken != null && hrtoken.isNotEmpty) {
await prefs.clear();
- Navigator.pushNamed(context, 'hrLogin');
+ Navigator.pushNamed(context, 'phone');
}
}
@override
Widget build(BuildContext context) {
final sw = MediaQuery.of(context).size.width;
-
+ final isPoliciesPage = Uri.base.fragment == 'policies';
return ClipRRect(
- borderRadius: Responsive.isDesktop(context)
+ borderRadius: Responsive.isDesktop(context) || isPoliciesPage
? BorderRadius.zero
: BorderRadius.only(
bottomLeft: Radius.circular(32.0),
bottomRight: Radius.circular(32.0),
),
child: AppBar(
- backgroundColor: Color(0xFFFFFBDE), // Set background color for AppBar
+ backgroundColor: const Color(0xFFFFFBDE),
+ elevation: 0, // Set background color for AppBar
toolbarHeight: kToolbarHeight,
titleSpacing: 0.0,
automaticallyImplyLeading: false,
@@ -76,7 +68,7 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
flex: Responsive.isDesktop(context) ? 9 : 3,
child: AdaptiveNavBar(
screenWidth: sw,
- backgroundColor: Color(0xFFFFFBDE),
+ backgroundColor: const Color(0xFFFFFBDE),
leading:
Container(), // Set an empty container as we have the logo separately
title: Text(''),
diff --git a/lib/customAppBar/enrollmentAppBar.dart b/lib/customAppBar/enrollmentAppBar.dart
new file mode 100644
index 0000000..78b663f
--- /dev/null
+++ b/lib/customAppBar/enrollmentAppBar.dart
@@ -0,0 +1,101 @@
+import 'package:flutter/material.dart';
+import 'package:adaptive_navbar/adaptive_navbar.dart';
+import 'package:nhance_app_pwa/customAppBar/responsive.dart';
+import 'package:shared_preferences/shared_preferences.dart';
+
+class CustomAppBar extends StatefulWidget implements PreferredSizeWidget {
+ @override
+ _CustomAppBarState createState() => _CustomAppBarState();
+
+ @override
+ Size get preferredSize => Size.fromHeight(kToolbarHeight);
+}
+
+class _CustomAppBarState extends State {
+ bool showBackToHR = true;
+ bool hideInactiveStatus = true;
+
+ @override
+ void initState() {
+ super.initState();
+ }
+
+ Future logout(BuildContext context) async {
+ final prefs = await SharedPreferences.getInstance();
+ final String? token = prefs.getString('token');
+
+ if (token != null && token.isNotEmpty) {
+ await prefs.clear();
+ Navigator.pushNamed(context, 'login');
+ }
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final sw = MediaQuery.of(context).size.width;
+
+ return Scaffold(
+ backgroundColor: Color(0xFFFFFCE5), // Set background color for AppBar
+ appBar: PreferredSize(
+ preferredSize: widget.preferredSize,
+ child: SafeArea(
+ child: Container(
+ padding: Responsive.isDesktop(context)
+ ? EdgeInsets.symmetric(horizontal: 16.0)
+ : EdgeInsets.symmetric(horizontal: 0),
+ child: Row(
+ children: [
+ // Logo Column
+ Expanded(
+ flex: Responsive.isDesktop(context) ? 3 : 9,
+ child: Row(
+ mainAxisAlignment: Responsive.isDesktop(context)
+ ? MainAxisAlignment.spaceEvenly
+ : MainAxisAlignment.start,
+ children: [
+ Container(
+ margin: EdgeInsets.only(top: 10, bottom: 10),
+ width: 230,
+ height: 230,
+ child: Image.asset(
+ 'assets/nhance_client_logo.png',
+ fit: BoxFit.contain,
+ ),
+ ),
+ ],
+ ),
+ ),
+ // AdaptiveNavBar Column
+ Expanded(
+ flex: Responsive.isDesktop(context) ? 9 : 3,
+ child: AdaptiveNavBar(
+ screenWidth: sw,
+ backgroundColor: Color(0xFFFFFCE5),
+ leading:
+ Container(), // Set an empty container as we have the logo separately
+ title: Text(''),
+ navBarItems: [
+ if (Responsive.isDesktop(context))
+ NavBarItem(
+ text: "Inactive Policy",
+ onTap: () {
+ Navigator.pushNamed(context, 'oldPolicy');
+ },
+ ),
+ NavBarItem(
+ text: "Logout",
+ onTap: () async {
+ logout(context);
+ },
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/main.dart b/lib/main.dart
index a9376ae..248c268 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -1,17 +1,23 @@
import 'package:flutter/material.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
-import 'package:nhance_app_pwa/pages/claimprocess.dart';
-import 'package:nhance_app_pwa/pages/claims.dart';
-import 'package:nhance_app_pwa/pages/claimtracklist.dart';
-import 'package:nhance_app_pwa/pages/generalexclusionsdeductibles.dart';
-import 'package:nhance_app_pwa/pages/help.dart';
-import 'package:nhance_app_pwa/pages/home.dart';
+import 'package:nhance_app_pwa/pages/enrollment/addons.dart';
+import 'package:nhance_app_pwa/pages/enrollment/empDetails.dart';
+import 'package:nhance_app_pwa/pages/enrollment/empReview.dart';
+
import 'package:nhance_app_pwa/pages/login.dart';
-import 'package:nhance_app_pwa/pages/planclaimsform.dart';
-import 'package:nhance_app_pwa/pages/policies.dart';
-import 'package:nhance_app_pwa/pages/privacypolicy.dart';
-import 'package:nhance_app_pwa/pages/profile.dart';
-import 'package:nhance_app_pwa/pages/termsofuse.dart';
+import 'package:nhance_app_pwa/pages/postEnrollment/chatbot.dart';
+import 'package:nhance_app_pwa/pages/postEnrollment/claimprocess.dart';
+import 'package:nhance_app_pwa/pages/postEnrollment/claims.dart';
+import 'package:nhance_app_pwa/pages/postEnrollment/claimtracklist.dart';
+import 'package:nhance_app_pwa/pages/postEnrollment/generalexclusionsdeductibles.dart';
+import 'package:nhance_app_pwa/pages/postEnrollment/help.dart';
+import 'package:nhance_app_pwa/pages/postEnrollment/home.dart';
+import 'package:nhance_app_pwa/pages/postEnrollment/planclaimsform.dart';
+import 'package:nhance_app_pwa/pages/postEnrollment/policies.dart';
+import 'package:nhance_app_pwa/pages/postEnrollment/privacypolicy.dart';
+import 'package:nhance_app_pwa/pages/postEnrollment/profile.dart';
+import 'package:nhance_app_pwa/pages/postEnrollment/termsofuse.dart';
+
import 'package:nhance_app_pwa/pages/verify.dart';
import 'models/environment.dart';
@@ -35,8 +41,12 @@ Future main() async {
'claimtracklist': (context) => claimtracklist(),
'privacypolicy': (context) => privacypolicy(),
'termsofuse': (context) => termsofuse(),
+ 'chatbot': (context) => chatbot(),
'generalExclusionsDeductibles': (context) =>
generalExclusionsDeductibles(),
+ 'empDetails': (context) => empDetails(),
+ 'addOnsDetails': (context) => addOnsDetails(),
+ 'empReviewDetails': (context) => empReviewDetails(),
},
));
}
diff --git a/lib/models/environment.dart b/lib/models/environment.dart
index 0d144de..b4479ad 100644
--- a/lib/models/environment.dart
+++ b/lib/models/environment.dart
@@ -1,12 +1,14 @@
+import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
+import '../pages/postEnrollment/home.dart';
+
class Environment {
static String get fileName {
const bool isProduction =
bool.fromEnvironment('dart.vm.product', defaultValue: false);
- const bool isTest =
- bool.fromEnvironment('dart.vm.environment', defaultValue: false);
+ const bool isTest = bool.fromEnvironment('ENV', defaultValue: false);
if (isProduction) {
return '.env.production';
@@ -37,3 +39,38 @@ class Environment {
return 'uncp8FvG310bEyYdV9MmStlo7KDRZ65fLWTeXCI2JzwPrNHjBqQhUiAgxsaO';
}
}
+
+Future main() async {
+ await dotenv.load(fileName: Environment.fileName);
+ runApp(MyApp());
+}
+
+// class Environment {
+// static String get fileName {
+// if (kReleaseMode) {
+// return '.env.production';
+// } else {
+// return '.env.development';
+// }
+// }
+//
+// static String get apiUrl {
+// return dotenv.env['API_URL'] ?? 'API_URL not found!';
+// }
+//
+// static String get baseHref {
+// return dotenv.env['BASE_HREF'] ?? 'BASE_HREF not found!';
+// }
+//
+// static String get env {
+// return dotenv.env['ENV'] ?? 'ENV not found!';
+// }
+//
+// static String get apiUrlTicket {
+// return dotenv.env['TICKET_API_URL'] ?? 'API_URL not found!';
+// }
+//
+// static String get ticketToken {
+// return 'uncp8FvG310bEyYdV9MmStlo7KDRZ65fLWTeXCI2JzwPrNHjBqQhUiAgxsaO';
+// }
+// }
diff --git a/lib/pages/claimtracklist.dart b/lib/pages/claimtracklist.dart
deleted file mode 100644
index 5513108..0000000
--- a/lib/pages/claimtracklist.dart
+++ /dev/null
@@ -1,512 +0,0 @@
-import 'dart:convert';
-import 'package:flutter/material.dart';
-import 'package:google_fonts/google_fonts.dart';
-import 'package:intl/intl.dart';
-import 'package:jwt_decode/jwt_decode.dart';
-import 'package:shared_preferences/shared_preferences.dart';
-import '../customAppBar/customAppBar.dart';
-import '../customAppBar/customFooter.dart';
-import '../customAppBar/tabs.dart';
-import '../customAppBar/responsive.dart';
-import '../customAppBar/toastHelper.dart';
-import '../models/environment.dart';
-import 'package:http/http.dart' as http;
-
-import '../service/api_service.dart';
-
-class claimtracklist extends StatefulWidget {
- const claimtracklist({Key? key}) : super(key: key);
-
- @override
- State createState() => _claimtracklistformState();
-}
-
-class _claimtracklistformState extends State {
- late ApiService apiService;
- dynamic _token;
- dynamic empCodeString;
- dynamic empPrimaryId;
- dynamic client_id;
- dynamic policyList;
- dynamic policyDataIsEmpty = 1;
- dynamic policyHeading;
- dynamic policyName;
- dynamic EmployeePolicy;
- List