This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HttpRequest { | |
factory HttpRequest({required String baseUrl}) { | |
_instance.baseUrl = baseUrl; | |
return _instance; | |
} | |
HttpRequest._internal(); | |
late String baseUrl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Lists of countries with ISO 3166 codes, presented in various formats. | |
// Last Updated: July 30, 2020 | |
// If you're using PHP, I suggest checking out: | |
// https://github.com/thephpleague/iso3166 | |
// or Laravel: https://github.com/squirephp/squire | |
// | |
// JS developers can check out: | |
// https://www.npmjs.com/package/iso3166-2-db | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Get the instance of TelephonyManager | |
final TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); | |
try { | |
if (tm != null) { | |
Class telephonyManagerClass = Class.forName(tm.getClass().getName()); | |
if (telephonyManagerClass != null) { | |
Method getITelephony = telephonyManagerClass.getDeclaredMethod("getITelephony"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DoubleTextInputFormatter extends TextInputFormatter { | |
final bool positive; | |
final double maxValue; | |
DoubleTextInputFormatter({ | |
this.positive = false, | |
this.maxValue = double.maxFinite, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String? validateIntValue( | |
String value, | |
String errorMsg, { | |
bool positive = false, | |
int maxValue = 9223372036854775807, | |
}) { | |
if (value.isEmpty) { | |
return errorMsg; | |
} else { | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
layout: null | |
permalink: /api/ | |
#So your API will be accessible at <mydomain>/api | |
# newline_to_br - replace each newline (\n) with html break | |
# replace - replace each occurrence e.g. {{ 'foofoo' | replace:'foo','bar' }} #=> 'barbar' | |
# prepend - prepend a string e.g. {{ 'bar' | prepend:'foo' }} #=> 'foobar' | |
# append - append a string e.g. {{ 'foo' | append:'bar' }} #=> 'foobar' | |
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Database { | |
class Db | |
{ | |
private $servername = "localhost"; | |
private $username = "root"; | |
private $password = ""; | |
private $database = ""; | |
public $conn = ""; |