Base URL change - 2026-04-21

This commit is contained in:
MAGESHWARAN 2026-04-21 12:54:32 +05:30
parent 7d25e77138
commit a27aaf5cdf
13 changed files with 465 additions and 15 deletions

View File

@ -143,7 +143,7 @@ class _EmployeeLoginScreenState extends ConsumerState<EmployeeLoginScreen> {
final termsFontSize = r.fontSize(mobile: 10.5, tablet: 11.34, desktop: 12);
final linkFontSize = r.fontSize(mobile: 13, tablet: 14, desktop: 15);
final otherLoginFontSize = r.fontSize(mobile: 12, tablet: 13, desktop: 14);
final pinTitleFontSize = r.fontSize(mobile: 20, tablet: 24, desktop: 26);
final pinBoxWidth = r.getValue<double>(mobile: 55, tablet: 60, desktop: 68);
final pinBoxHeight = r.getValue<double>(mobile: 55, tablet: 60, desktop: 68);
final pinFontSize = r.fontSize(mobile: 22, tablet: 28, desktop: 32);
@ -219,8 +219,17 @@ class _EmployeeLoginScreenState extends ConsumerState<EmployeeLoginScreen> {
),
),
SizedBox(height: spacingLG),
// Email Input
Align(
alignment: Alignment.centerLeft,
child: Text(
"Enter Your Mail ID *",
style: AppTextStyles.semiBold.copyWith(
fontSize: 14,
color: AppColors.authheading,
),
),
),
SizedBox(height: spacingSM),
CommanTextFormField(
controller: _emailController,
hintText: 'Enter your Email',
@ -233,7 +242,18 @@ class _EmployeeLoginScreenState extends ConsumerState<EmployeeLoginScreen> {
}
},
),
SizedBox(height: spacingMD),
SizedBox(height: spacingSM),
Align(
alignment: Alignment.centerLeft,
child: Text(
"Enter Your Pin *",
style: AppTextStyles.semiBold.copyWith(
fontSize: 14,
color: AppColors.authheading,
),
),
),
SizedBox(height: spacingSM),
// PIN Boxes
Row(
@ -319,7 +339,7 @@ class _EmployeeLoginScreenState extends ConsumerState<EmployeeLoginScreen> {
);
},
child: Text(
"Forgot Password?",
"Forgot PIN?",
style: AppTextStyles.bold.copyWith(
fontSize: linkFontSize,
color: AppColors.authchange,

View File

@ -139,6 +139,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen> {
final logoWidth = r.getValue<double>(mobile: 120, tablet: 141, desktop: 160);
final logoHeight = r.getValue<double>(mobile: 85, tablet: 100, desktop: 115);
final titleFontSize = r.fontSize(mobile: 26, tablet: 32, desktop: 36);
final pinTitleFontSize = r.fontSize(mobile: 20, tablet: 24, desktop: 26);
final subtitleFontSize = r.fontSize(mobile: 13, tablet: 14, desktop: 15);
final termsFontSize = r.fontSize(mobile: 10.5, tablet: 11.34, desktop: 12);
final signupFontSize = r.fontSize(mobile: 13, tablet: 14, desktop: 15);
@ -208,6 +209,17 @@ class _LoginScreenState extends ConsumerState<LoginScreen> {
),
),
SizedBox(height: spacingLG),
Align(
alignment: Alignment.centerLeft,
child: Text(
"Enter Your Mail ID *",
style: AppTextStyles.semiBold.copyWith(
fontSize: 14,
color: AppColors.authheading,
),
),
),
SizedBox(height: spacingSM),
CommanTextFormField(
controller: _emailController,
hintText: 'Enter your Email',
@ -220,8 +232,18 @@ class _LoginScreenState extends ConsumerState<LoginScreen> {
}
},
),
SizedBox(height: spacingMD),
SizedBox(height: spacingSM),
Align(
alignment: Alignment.centerLeft,
child: Text(
"Enter Your Pin *",
style: AppTextStyles.semiBold.copyWith(
fontSize: 14,
color: AppColors.authheading,
),
),
),
SizedBox(height: spacingSM),
// PIN Boxes
Row(
mainAxisAlignment: MainAxisAlignment.center,
@ -306,7 +328,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen> {
);
},
child: Text(
"Forgot Password?",
"Forgot PIN?",
style: AppTextStyles.bold.copyWith(
fontSize: signupFontSize,
color: AppColors.authchange,

View File

@ -40,7 +40,7 @@ class CommonWebSocketService {
/// Connect WS using LOCAL USER ID
Future<void> connect({
required String userId,
String baseUrl = "wss://taxglide.amrithaa.net:443/reverb",
String baseUrl = "wss://app.taxglide.in:443/reverb",
String appKey = "2yj0lyzc9ylw2h03ts6i",
}) async {
try {

View File

@ -40,7 +40,7 @@ class DetailsWebscokect {
/// Connect WS using LOCAL USER ID
Future<void> connect({
required String userId,
String baseUrl = "wss://taxglide.amrithaa.net:443/reverb",
String baseUrl = "wss://app.taxglide.in:443/reverb",
String appKey = "2yj0lyzc9ylw2h03ts6i",
}) async {
try {

View File

@ -10,7 +10,7 @@ import 'package:gal/gal.dart';
import 'package:taxglide/services/notification_service.dart';
class DownloadHelper {
static const String API_BASE_URL = "https://www.taxglide.amrithaa.net/api/";
static const String API_BASE_URL = "https://www.app.taxglide.in/api/";
/// Request storage permission based on Android version
static Future<bool> requestStoragePermission() async {

View File

@ -69,7 +69,7 @@ class NotificationWebSocket {
Future<void> connect({
required String userId,
required ProviderContainer container,
String baseUrl = 'wss://taxglide.amrithaa.net:443/reverb',
String baseUrl = 'wss://app.taxglide.in:443/reverb',
String appKey = '2yj0lyzc9ylw2h03ts6i',
}) async {
if (_isConnected && _userId == userId) {

View File

@ -1,5 +1,5 @@
class ConstsApi {
static const String baseUrl = "https://www.taxglide.amrithaa.net";
static const String baseUrl = "https://www.app.taxglide.in";
static const String login = "$baseUrl/api/otp/sms/request";
static const String verifyOtp = "$baseUrl/api/otp/email/verify";

View File

@ -14,5 +14,6 @@ class ConstRouters {
static const String staff = '/staff';
static const String employeekycdetailslist = '/employeekycdetailslist';
static const String mpinSet = '/mpinSet';
static const String forgotPassword = '/forgotPassword';
static const String forgotPassword = '/forgotPassword';
static const String changePin = '/changePin';
}

View File

@ -15,6 +15,7 @@ import 'package:taxglide/view/screens/profile/kyc_details_list.dart';
import 'package:taxglide/view/screens/profile/policy_screen.dart';
import 'package:taxglide/view/screens/profile/staff_list_screen.dart';
import 'package:taxglide/view/screens/profile/terms_and_condition_screen.dart';
import 'package:taxglide/view/screens/profile/change_pin_screen.dart';
class AppRoutes {
static final routes = [
@ -57,5 +58,9 @@ class AppRoutes {
name: ConstRouters.forgotPassword,
page: () => const ForgotScreen(),
),
GetPage(
name: ConstRouters.changePin,
page: () => const ChangePinScreen(),
),
];
}

View File

@ -39,7 +39,7 @@ class ChatWebSocketService {
/// Connect to WebSocket for a specific chat
Future<void> connect({
required String chatId,
String baseUrl = "wss://taxglide.amrithaa.net:443/reverb",
String baseUrl = "wss://app.taxglide.in:443/reverb",
String appKey = "2yj0lyzc9ylw2h03ts6i",
}) async {
try {

View File

@ -0,0 +1,378 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:get/get.dart';
import 'package:taxglide/consts/app_asstes.dart';
import 'package:taxglide/consts/app_colors.dart';
import 'package:taxglide/consts/comman_button.dart';
import 'package:taxglide/consts/comman_container_auth.dart';
import 'package:taxglide/consts/responsive_helper.dart';
import 'package:taxglide/consts/validation_popup.dart';
import 'package:taxglide/controller/api_contoller.dart';
import 'package:taxglide/view/Main_controller/main_controller.dart';
import 'package:taxglide/consts/app_style.dart';
class ChangePinScreen extends ConsumerStatefulWidget {
const ChangePinScreen({super.key});
@override
ConsumerState<ChangePinScreen> createState() => _ChangePinScreenState();
}
class _ChangePinScreenState extends ConsumerState<ChangePinScreen> {
final ValidationPopup _validationPopup = ValidationPopup();
final int pinLength = 4;
final List<TextEditingController> _controllers = [];
final List<FocusNode> _focusNodes = [];
String pinValue = '';
final List<TextEditingController> _confirmControllers = [];
final List<FocusNode> _confirmFocusNodes = [];
String confirmPinValue = '';
@override
void initState() {
super.initState();
_initControllers();
}
void _initControllers() {
for (var c in _controllers) c.dispose();
for (var f in _focusNodes) f.dispose();
for (var c in _confirmControllers) c.dispose();
for (var f in _confirmFocusNodes) f.dispose();
_controllers.clear();
_focusNodes.clear();
_confirmControllers.clear();
_confirmFocusNodes.clear();
pinValue = '';
confirmPinValue = '';
for (int i = 0; i < pinLength; i++) {
_controllers.add(TextEditingController());
_focusNodes.add(FocusNode());
_confirmControllers.add(TextEditingController());
_confirmFocusNodes.add(FocusNode());
}
}
@override
void dispose() {
for (var c in _controllers) c.dispose();
for (var f in _focusNodes) f.dispose();
for (var c in _confirmControllers) c.dispose();
for (var f in _confirmFocusNodes) f.dispose();
super.dispose();
}
void _handleAction() async {
if (pinValue.length != pinLength) {
_validationPopup.showErrorMessage(context, "Please enter all 4 digits");
return;
}
if (confirmPinValue.length != pinLength) {
_validationPopup.showErrorMessage(context, "Please confirm your PIN");
return;
}
if (pinValue != confirmPinValue) {
_validationPopup.showErrorMessage(context, "PINs do not match");
return;
}
// Call API to set/change PIN
await ref.read(changePinProvider.notifier).changePin(pinValue);
final state = ref.read(changePinProvider);
state.when(
data: (result) {
if (result['success'] == true) {
_validationPopup.showSuccessMessage(
context,
"MPIN Set Successfully!",
);
Future.delayed(const Duration(seconds: 1), () {
Navigator.of(context).pop();
});
} else {
_validationPopup.showErrorMessage(
context,
result['error'] ?? "Failed to set MPIN. Please try again.",
);
}
},
loading: () {},
error: (error, stack) {
_validationPopup.showErrorMessage(
context,
"Failed to set MPIN. Please try again.",
);
},
);
}
void _onPinChange(int index, String value) {
if (value.isNotEmpty && index < pinLength - 1) {
_focusNodes[index + 1].requestFocus();
}
if (value.isEmpty && index > 0) {
_focusNodes[index - 1].requestFocus();
}
setState(() {
pinValue = _controllers.map((c) => c.text).join();
});
}
void _onConfirmPinChange(int index, String value) {
if (value.isNotEmpty && index < pinLength - 1) {
_confirmFocusNodes[index + 1].requestFocus();
}
if (value.isEmpty && index > 0) {
_confirmFocusNodes[index - 1].requestFocus();
}
setState(() {
confirmPinValue = _confirmControllers.map((c) => c.text).join();
});
}
@override
Widget build(BuildContext context) {
final pinState = ref.watch(changePinProvider);
final isLoading = pinState is AsyncLoading;
final r = ResponsiveUtils(context);
final logoWidth = r.getValue<double>(mobile: 120, tablet: 141, desktop: 160);
final logoHeight = r.getValue<double>(mobile: 85, tablet: 100, desktop: 115);
final titleFontSize = r.fontSize(mobile: 26, tablet: 32, desktop: 36);
final subtitleFontSize = r.fontSize(mobile: 13, tablet: 14, desktop: 15);
final boxWidth = r.getValue<double>(mobile: 57, tablet: 60, desktop: 68);
final boxHeight = r.getValue<double>(mobile: 57, tablet: 56, desktop: 64);
final pinFontSize = r.fontSize(mobile: 22, tablet: 28, desktop: 32);
final boxMargin = r.getValue<double>(mobile: 5, tablet: 6, desktop: 8);
final boxRadius = r.getValue<double>(mobile: 5, tablet: 6, desktop: 8);
final spacingSM = r.spacing(mobile: 20, tablet: 20, desktop: 24);
final spacingLG = r.spacing(mobile: 50, tablet: 50, desktop: 50);
return Scaffold(
body: Stack(
children: [
Container(
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color(0xFFFFF8F0),
Color(0xFFEBC894),
Color(0xFFE8DAF2),
Color(0xFFB49EF4),
],
stops: [0.0, 0.3, 0.6, 1.0],
),
),
),
SingleChildScrollView(
child: SizedBox(
height: r.screenHeight,
child: Center(
child: CommonContainerAuth(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
AppAssets.taxgildelogoauth,
width: logoWidth,
height: logoHeight,
fit: BoxFit.contain,
),
SizedBox(height: spacingSM),
Text(
"Change Your PIN",
textAlign: TextAlign.center,
style: AppTextStyles.semiBold.copyWith(
fontSize: titleFontSize,
color: AppColors.authheading,
),
),
SizedBox(height: spacingSM),
Text(
"Set a 4-digit security PIN for your account",
textAlign: TextAlign.center,
style: AppTextStyles.semiBold.copyWith(
fontSize: subtitleFontSize,
color: AppColors.authleading,
),
),
SizedBox(height: spacingLG),
Align(
alignment: Alignment.centerLeft,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: boxMargin * 2),
child: Text(
"Enter PIN *",
style: AppTextStyles.medium.copyWith(
fontSize: subtitleFontSize,
color: AppColors.authheading,
),
),
),
),
const SizedBox(height: 8),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: List.generate(pinLength, (index) {
bool isFilled = _controllers[index].text.isNotEmpty;
return Container(
margin: EdgeInsets.symmetric(horizontal: boxMargin),
width: boxWidth,
height: boxHeight,
decoration: BoxDecoration(
color: isFilled ? AppColors.commanbutton : Colors.white,
borderRadius: BorderRadius.circular(boxRadius),
border: Border.all(color: const Color(0xFFDFDFDF)),
boxShadow: [
BoxShadow(
color: const Color(0xFFBDBDBD).withOpacity(0.25),
blurRadius: 7,
offset: const Offset(0, 1),
),
],
),
child: Center(
child: KeyboardListener(
focusNode: FocusNode(),
onKeyEvent: (event) {
if (event is KeyDownEvent &&
event.logicalKey ==
LogicalKeyboardKey.backspace) {
if (_controllers[index].text.isEmpty &&
index > 0) {
_focusNodes[index - 1].requestFocus();
}
}
},
child: TextField(
controller: _controllers[index],
focusNode: _focusNodes[index],
textAlign: TextAlign.center,
keyboardType: TextInputType.number,
maxLength: 1,
obscureText: true,
enabled: !isLoading,
style: TextStyle(
fontFamily: "Gilroy",
fontWeight: FontWeight.w400,
fontSize: pinFontSize,
color: isFilled ? Colors.white : Colors.black,
),
decoration: const InputDecoration(
counterText: '',
border: InputBorder.none,
),
onChanged: (value) =>
_onPinChange(index, value),
),
),
),
);
}),
),
SizedBox(height: spacingSM),
Align(
alignment: Alignment.centerLeft,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: boxMargin * 2),
child: Text(
"Confirm PIN *",
style: AppTextStyles.medium.copyWith(
fontSize: subtitleFontSize,
color: AppColors.authheading,
),
),
),
),
const SizedBox(height: 8),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: List.generate(pinLength, (index) {
bool isFilled = _confirmControllers[index].text.isNotEmpty;
return Container(
margin: EdgeInsets.symmetric(horizontal: boxMargin),
width: boxWidth,
height: boxHeight,
decoration: BoxDecoration(
color: isFilled ? AppColors.commanbutton : Colors.white,
borderRadius: BorderRadius.circular(boxRadius),
border: Border.all(color: const Color(0xFFDFDFDF)),
boxShadow: [
BoxShadow(
color: const Color(0xFFBDBDBD).withOpacity(0.25),
blurRadius: 7,
offset: const Offset(0, 1),
),
],
),
child: Center(
child: KeyboardListener(
focusNode: FocusNode(),
onKeyEvent: (event) {
if (event is KeyDownEvent &&
event.logicalKey ==
LogicalKeyboardKey.backspace) {
if (_confirmControllers[index].text.isEmpty &&
index > 0) {
_confirmFocusNodes[index - 1].requestFocus();
}
}
},
child: TextField(
controller: _confirmControllers[index],
focusNode: _confirmFocusNodes[index],
textAlign: TextAlign.center,
keyboardType: TextInputType.number,
maxLength: 1,
obscureText: true,
enabled: !isLoading,
style: TextStyle(
fontFamily: "Gilroy",
fontWeight: FontWeight.w400,
fontSize: pinFontSize,
color: isFilled ? Colors.white : Colors.black,
),
decoration: const InputDecoration(
counterText: '',
border: InputBorder.none,
),
onChanged: (value) =>
_onConfirmPinChange(index, value),
),
),
),
);
}),
),
SizedBox(height: spacingLG),
isLoading
? const CircularProgressIndicator()
: CommanButton(
text: "Set PIN",
onPressed: _handleAction,
),
],
),
),
),
),
),
],
),
);
}
}

View File

@ -144,6 +144,18 @@ class _EmployeeProfileScreenState extends ConsumerState<EmployeeProfileScreen> {
},
),
const SizedBox(height: 16),
_buildMenuItem(
id: 'change_pin',
icon: Icons.lock_outline,
title: 'Change PIN',
onTap: () {
setState(() {
selectedItem = 'change_pin';
});
Get.toNamed(ConstRouters.changePin);
},
),
const SizedBox(height: 16),
_buildMenuItem(
id: 'terms',

View File

@ -152,6 +152,18 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
},
),
const SizedBox(height: 16),
_buildMenuItem(
id: 'change_pin',
icon: Icons.lock_outline,
title: 'Change PIN',
onTap: () {
setState(() {
selectedItem = 'change_pin';
});
Get.toNamed(ConstRouters.changePin);
},
),
const SizedBox(height: 16),
if (userRole != "employee")
_buildMenuItem(
id: 'Staff',