|
|
|
|
@ -28,7 +28,13 @@ class Utils {
|
|
|
|
|
static bool get isLoading => _isLoadingVisible;
|
|
|
|
|
|
|
|
|
|
static void showToast(String message) {
|
|
|
|
|
Fluttertoast.showToast(msg: message, toastLength: Toast.LENGTH_SHORT, gravity: ToastGravity.BOTTOM, timeInSecForIosWeb: 2, backgroundColor: Colors.black54, textColor: Colors.white, fontSize: 16.0);
|
|
|
|
|
Fluttertoast.showToast(msg: message,
|
|
|
|
|
toastLength: Toast.LENGTH_SHORT,
|
|
|
|
|
gravity: ToastGravity.BOTTOM,
|
|
|
|
|
timeInSecForIosWeb: 2,
|
|
|
|
|
backgroundColor: Colors.black54,
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
fontSize: 16.0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static Future<void> openNumberViaCaller({required String phoneNumber}) async {
|
|
|
|
|
@ -71,7 +77,11 @@ class Utils {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ("${timeOfDay.hour.toString().length == 1 ? "0" : ""}${timeOfDay.hour}:${timeOfDay.minute.toString().length == 1 ? "0" : ""}${timeOfDay.minute}").toString();
|
|
|
|
|
return ("${timeOfDay.hour
|
|
|
|
|
.toString()
|
|
|
|
|
.length == 1 ? "0" : ""}${timeOfDay.hour}:${timeOfDay.minute
|
|
|
|
|
.toString()
|
|
|
|
|
.length == 1 ? "0" : ""}${timeOfDay.minute}").toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static dynamic getNotNullValue(List<dynamic> list, int index) {
|
|
|
|
|
@ -512,7 +522,7 @@ class Utils {
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: w, //
|
|
|
|
|
color: color // <--- border width here
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
borderRadius: BorderRadius.circular(radius),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
@ -535,7 +545,7 @@ class Utils {
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1, //
|
|
|
|
|
color: color // <--- border width here
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
borderRadius: BorderRadius.circular(radius),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
@ -553,7 +563,8 @@ class Utils {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static String getAdsPaymentBrowserForm({required int paymentId, required int adId}) {
|
|
|
|
|
return '<html> <head></head><body><form id="paymentForm" action="${ApiConsts.paymentWebViewUrl}" method="post"><input type="hidden" name="PaymentType" value="$paymentId"><input type="hidden" name="AdsID" value="$adId"></form><script type="text/javascript"> document.getElementById("paymentForm").submit(); </script></body></html>';
|
|
|
|
|
return '<html> <head></head><body><form id="paymentForm" action="${ApiConsts
|
|
|
|
|
.paymentWebViewUrl}" method="post"><input type="hidden" name="PaymentType" value="$paymentId"><input type="hidden" name="AdsID" value="$adId"></form><script type="text/javascript"> document.getElementById("paymentForm").submit(); </script></body></html>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// BOTTOM SHEETS
|
|
|
|
|
@ -577,15 +588,27 @@ class Utils {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static Widget buildStatusContainer(String text) {
|
|
|
|
|
static Widget buildStatusContainer(String text, {double marginAll = 8, double fontSize = 14}) {
|
|
|
|
|
return Center(
|
|
|
|
|
child: text.toText(color: MyColors.lightTextColor, fontSize: 14),
|
|
|
|
|
child: text.toText(color: MyColors.lightTextColor, fontSize: fontSize),
|
|
|
|
|
).toContainer(
|
|
|
|
|
marginAll: 8,
|
|
|
|
|
marginAll: marginAll,
|
|
|
|
|
paddingAll: 15,
|
|
|
|
|
borderRadius: 8,
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
backgroundColor: MyColors.grey98Color.withOpacity(0.1),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static Future<void> openLocationInMaps({required double latitude, required double longitude}) async {
|
|
|
|
|
final Uri googleMapsUrl = Uri.parse('https://www.google.com/maps/search/?api=1&query=$latitude,$longitude');
|
|
|
|
|
|
|
|
|
|
if (await canLaunchUrl(googleMapsUrl)) {
|
|
|
|
|
try {
|
|
|
|
|
await launchUrl(googleMapsUrl);
|
|
|
|
|
} catch (e) {
|
|
|
|
|
await launchUrl(googleMapsUrl);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|