chnages and bug fixes

This commit is contained in:
Raj.Ghag
2026-04-24 10:35:13 +05:30
parent 3ca76d0c26
commit 092fa1215f
3 changed files with 14 additions and 4 deletions

View File

@@ -234,9 +234,10 @@ class _PaymentCardState extends State<PaymentCard> {
} catch (e) {
// ✅ Show error message
if (context.mounted) {
String errorMessage = e.toString().replaceFirst('Exception: ', '');
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text('Failed to proceed: ${e.toString()}'),
content: Text(errorMessage),
backgroundColor: Colors.red,
behavior: SnackBarBehavior.floating,
duration: Duration(seconds: 3),

View File

@@ -1,3 +1,4 @@
import '../../localPreference/local_preference.dart';
import '../models/my_passes_model.dart';
import '../../networkApiServices/network_api_services.dart';
import '../../networkApiServices/api_urls.dart';
@@ -9,10 +10,17 @@ class MyPassesRepository {
String cardMode = "",
String sort = "",
}) async {
final cityId = await LocalPreference.getSelectedCityId();
String url = ApiUrls.myPasses;
List<String> queryParams = [];
// ✅ ADD THIS (MANDATORY)
if (cityId != null) {
queryParams.add("cityXid=$cityId");
}
if (cardMode.isNotEmpty) {
queryParams.add("cardMode=$cardMode");
}
@@ -21,6 +29,7 @@ class MyPassesRepository {
queryParams.add("sort=$sort");
}
// ✅ Attach all params
if (queryParams.isNotEmpty) {
url += "?${queryParams.join("&")}";
}
@@ -29,4 +38,4 @@ class MyPassesRepository {
return MyPassesModel.fromJson(response.data);
}
}
}

View File

@@ -1,8 +1,8 @@
class ApiUrls {
// static const baseUrl = "https://devapi.citycards.betadelivery.com";//Normal API
// static const baseUrl = "https://testingapi.citycards.betadelivery.com";// Test API
static const baseUrl = "https://uatapi.citycard.betadelivery.com";// Production Lvl API
static const baseUrl = "https://testingapi.citycards.betadelivery.com";// Test API
// static const baseUrl = "https://uatapi.citycard.betadelivery.com";// Production Lvl API
static const refreshToken = "$baseUrl/auth/refresh";