Compare commits

..

No commits in common. 'master' and 'coc-into-ensat' have entirely different histories.

@ -90,7 +90,7 @@ class AppState {
String get getHuaweiPushToken => _huaweiPushToken;
final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 10.0, mobileType: Platform.isAndroid ? "android" : "ios");
final PostParamsModel _postParamsInitConfig = PostParamsModel(channel: 31, versionID: 9.9, mobileType: Platform.isAndroid ? "android" : "ios");
void setPostParamsInitConfig() {
isAuthenticated = false;

@ -4,12 +4,12 @@ class ApiConsts {
// static String baseUrl = "http://10.200.204.11"; // Local server
// static String baseUrl = "https://erptstapp.srca.org.sa"; // SRCA server
// static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver
static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver
// static String baseUrl = "http://10.201.204.101:2024";
// static String baseUrl = "https://webservices.hmg.com"; // PreProd
// static String baseUrl = "https://hmgwebservices.com"; // Live server
static String baseUrl = "https://mohemm.hmg.com"; // New Live server
// static String baseUrl = "https://mohemm.hmg.com"; // New Live server
static String ssoBaseUrl = "https://sso.hmg.com"; // New Live server
//
// static String baseUrl = "https://uat.hmgwebservices.com"; // UAT ser343622ver

@ -241,7 +241,7 @@ class _ITGAdsScreenState extends State<ITGAdsScreen> {
// Build end date text
Widget _buildEndDateText({bool isLargeText = false}) {
String label = _getLocalizedText("تاريخ الانتهاء: ", "End Date: ");
String fullText = label + advertisementPayload!.deadline ?? "";
String fullText = label + advertisementPayload!.deadline!;
return isLargeText ? fullText.toText16(color: MyColors.darkTextColor) : fullText.toText14(color: MyColors.darkTextColor);
}
@ -335,7 +335,7 @@ class _ITGAdsScreenState extends State<ITGAdsScreen> {
if (advertisementData != null) {
checkFileType();
if (isTextURL) {
if (advertisementPayload?.deadline != null && deadlineTimerController == null) {
if (deadlineTimerController == null) {
initDeadlineTimer();
}
} else {
@ -561,13 +561,7 @@ class _ITGAdsScreenState extends State<ITGAdsScreen> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
_buildAdvertisementContent(),
24.height,
if (advertisementPayload != null && advertisementPayload!.deadline != null) _buildDeadlineSection(),
if (advertisementPayload != null && advertisementPayload!.deadline != null) 24.height,
_buildActionButtons(),
],
children: [_buildAdvertisementContent(), 24.height, _buildDeadlineSection(), 24.height, _buildActionButtons()],
),
),
],

@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
import 'package:webview_flutter/webview_flutter.dart';
// Enum for SSO types
@ -20,19 +19,6 @@ class SsoLoginWebView extends StatefulWidget {
class _SsoLoginWebViewState extends State<SsoLoginWebView> {
late final WebViewController _controller;
String? url;
bool _isTicketLoadingVisible = false;
void _showTicketLoading() {
if (widget.ssoType != SsoType.forTicket || _isTicketLoadingVisible || !mounted) return;
_isTicketLoadingVisible = true;
Utils.showLoading(context);
}
void _hideTicketLoading() {
if (widget.ssoType != SsoType.forTicket || !_isTicketLoadingVisible || !mounted) return;
_isTicketLoadingVisible = false;
Utils.hideLoading(context);
}
@override
void initState() {
@ -53,19 +39,15 @@ class _SsoLoginWebViewState extends State<SsoLoginWebView> {
},
onPageStarted: (String url) {
print("Page started loading: $url");
_showTicketLoading();
},
onPageFinished: (String url) {
print("Page finished loading: $url");
_hideTicketLoading();
},
onHttpError: (HttpResponseError error) {
print("HTTP error: ${error.toString()} for URL: ${error.response!.statusCode}");
_hideTicketLoading();
},
onWebResourceError: (WebResourceError error) {
print("Web resource error: ${error.description} for URL: ${error.errorType}");
_hideTicketLoading();
},
),
);
@ -75,11 +57,6 @@ class _SsoLoginWebViewState extends State<SsoLoginWebView> {
// For ENSAT, just load the URL directly (GET request)
_controller.loadRequest(Uri.parse(url!));
} else {
if (widget.ssoType == SsoType.forTicket) {
WidgetsBinding.instance.addPostFrameCallback((_) {
_showTicketLoading();
});
}
// For Paxes (Ticket, Courses), use HTML form POST
_controller.loadHtmlString(_buildHtmlContent());
}
@ -87,12 +64,8 @@ class _SsoLoginWebViewState extends State<SsoLoginWebView> {
// Build HTML content for the SSO form
String _buildHtmlContent() {
String formAction;
if (widget.ssoType == SsoType.forTicket) {
formAction = "https://www.paxes.com/sso/hmg";
} else {
formAction = url ?? "";
}
String formAction = url ?? "https://www.paxes.com/sso/hmg";
return '''
<!DOCTYPE html>
<html>
@ -105,14 +78,8 @@ class _SsoLoginWebViewState extends State<SsoLoginWebView> {
</html>''';
}
@override
void dispose() {
_hideTicketLoading();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(appBar: AppBarWidget(context, title: "MoheM", showWorkListSettingButton: false), body: SafeArea(child: WebViewWidget(controller: _controller)));
return Scaffold(appBar: null, body: SafeArea(child: WebViewWidget(controller: _controller)));
}
}

Loading…
Cancel
Save