pSetSettings function
Future<void>
pSetSettings({
- required Color primaryColor,
- required Color secondaryColor,
- String baseUrlLive = '',
- String baseUrlTest = '',
- bool? useDefaultURl,
- bool isLive = true,
- String defaultImage = 'assets/default.png',
- bool defImageIsAsset = true,
- dynamic httpCallsDefaultResponse = true,
- double defaultFontSize = 14.0,
- double defaultRadius = 8.0,
- double defaultBtnHeight = 50,
- bool? txtInputHasBorder,
- bool txtInputHasLabel = false,
- bool txtInputHasLabelOnTop = false,
- bool txtInputHasLabelWithStar = true,
- bool defaultImageClick = true,
- EdgeInsetsGeometry? txtInoutDefaultContentPadding,
- bool httpCallsWithStream = false,
- bool httpResponseUtf8Convert = false,
- bool? showAPILogs,
- String? internetIssueMessage,
- String? localization,
- FontWeight? fontWeight,
- TextStyle? txtStyle,
- TextStyle? labelInputStyle,
- TextStyle? hintInputStyle,
- TextStyle? styleInput,
- TextStyle? prefixInputStyle,
- Color? txtColor,
- Color? txtInputColor,
- String? currencySymbol,
- String? currencyLocale,
- int? currencyDecimal,
- bool isCurrencyCompact = false,
- InputDecoration? inputDecoration,
- Map<
String, String> ? httpHeader, - Map<
String, String> ? httpHeaderAddOns, - InputBorder? txtInputEnabledBorder,
- InputBorder? txtInputFocusedBorder,
- InputBorder? txtInputErrorBorder,
- InputBorder? txtInputBorder,
- Color? txtInputBorderColor,
- double? txtInputLabelPadding,
- double? btnHeight,
- double? btnRadius,
- Color? btnBgColor,
- Color? btnTextColor,
- Color? btnBorderColor,
- bool? appDirectionLeftToRight,
- String? fontFamily,
- int stopDecodingFromErrorCode = 400,
- bool? defaultLoadingProIsIOS,
- Toast defaultToastLength = Toast.LENGTH_SHORT,
- int httpCallTimeoutInSec = 20,
- Matrix4? onHoverDefaultMatrix4,
- double? onHoverDefaultScale,
- Duration? onHoverDefaultAnimatedDuration,
- Color? webDialogBgColor,
- Duration? dialogAnimationDuration,
- String? defaultDateFormat,
- String? defaultDateTimeFormat,
- EdgeInsets? webDialogPadding,
- EdgeInsets? webDialogMargin,
- bool? isHintCapitalizeFirst,
- bool? usePreCheckFunctionInHttpCalls,
- dynamic onHttpCallError(
- dynamic error,
- dynamic response,
- bool? defaultResponse
Implementation
Future<void> pSetSettings({
required Color primaryColor,
required Color secondaryColor,
String baseUrlLive = '',
String baseUrlTest = '',
bool? useDefaultURl,
bool isLive = true,
String defaultImage = 'assets/default.png',
bool defImageIsAsset = true,
httpCallsDefaultResponse = true,
double defaultFontSize = 14.0,
double defaultRadius = 8.0,
double defaultBtnHeight = 50,
bool? txtInputHasBorder,
bool txtInputHasLabel = false,
bool txtInputHasLabelOnTop = false,
bool txtInputHasLabelWithStar = true,
bool defaultImageClick = true,
EdgeInsetsGeometry? txtInoutDefaultContentPadding,
bool httpCallsWithStream = false,
bool httpResponseUtf8Convert = false,
bool? showAPILogs,
String? internetIssueMessage,
String? localization,
FontWeight? fontWeight,
TextStyle? txtStyle,
TextStyle? labelInputStyle,
TextStyle? hintInputStyle,
TextStyle? styleInput,
TextStyle? prefixInputStyle,
Color? txtColor,
Color? txtInputColor,
String? currencySymbol,
String? currencyLocale,
int? currencyDecimal,
bool isCurrencyCompact = false,
InputDecoration? inputDecoration,
Map<String, String>? httpHeader,
Map<String, String>? httpHeaderAddOns,
InputBorder? txtInputEnabledBorder,
InputBorder? txtInputFocusedBorder,
InputBorder? txtInputErrorBorder,
InputBorder? txtInputBorder,
Color? txtInputBorderColor,
double? txtInputLabelPadding,
double? btnHeight,
double? btnRadius,
Color? btnBgColor,
Color? btnTextColor,
Color? btnBorderColor,
bool? appDirectionLeftToRight,
String? fontFamily,
int stopDecodingFromErrorCode = 400,
bool? defaultLoadingProIsIOS,
Toast defaultToastLength = Toast.LENGTH_SHORT,
int httpCallTimeoutInSec = 20,
Matrix4? onHoverDefaultMatrix4,
double? onHoverDefaultScale,
Duration? onHoverDefaultAnimatedDuration,
Color? webDialogBgColor,
Duration? dialogAnimationDuration,
String? defaultDateFormat,
String? defaultDateTimeFormat,
EdgeInsets? webDialogPadding,
EdgeInsets? webDialogMargin,
bool? isHintCapitalizeFirst,
bool? usePreCheckFunctionInHttpCalls,
Function(dynamic error,dynamic response, bool? defaultResponse)? onHttpCallError,
}) async {
await Dates.initializeDateFormat();
Clr.colorPrimary = primaryColor;
Clr.colorSecondary = secondaryColor;
HttpCalls.live = baseUrlLive;
HttpCalls.showAPILogs = showAPILogs;
HttpCalls.testing = baseUrlTest;
HttpCalls.isLive = isLive;
GetImage.defaultImage = defaultImage;
GetImage.defImageIsAsset = defImageIsAsset;
HttpCalls.httpCallsDefaultResponse = httpCallsDefaultResponse;
Siz.defaultRadius = defaultRadius;
Siz.defaultBtnHeight = defaultBtnHeight;
HttpCalls.httpCallsWithStream = httpCallsWithStream;
HttpCalls.httpResponseUtf8Convert = httpResponseUtf8Convert;
if (internetIssueMessage != null) {
HttpCalls.internetIssue = internetIssueMessage;
}
Static.txtInputHasBorder = txtInputHasBorder;
Static.txtInputHasLabel = txtInputHasLabel;
Static.txtInputHasLabelOnTop = txtInputHasLabelOnTop;
Static.txtInputHasLabelWithStar = txtInputHasLabelWithStar;
Static.txtInoutDefaultContentPadding = txtInoutDefaultContentPadding;
Static.fontWeight = fontWeight;
Static.defaultImageClick = defaultImageClick;
Static.defaultFontSize = defaultFontSize;
HttpCalls.localization = localization;
HttpCalls.httpHeader = httpHeader;
HttpCalls.headerAddOns = httpHeaderAddOns;
Clr.colorTxt = txtColor ?? Clr.colorBlack;
Clr.colorTxtInput = txtInputColor ?? Clr.colorBlack;
Style.textStyle = txtStyle;
Style.labelInputStyle = labelInputStyle;
Style.hintInputStyle = hintInputStyle;
Style.styleInput = styleInput;
Style.prefixInputStyle = prefixInputStyle;
Static.currencyLocale = currencyLocale;
Static.currencySymbol = currencySymbol;
Static.isCurrencyCompact = isCurrencyCompact;
Static.inputDecoration = inputDecoration;
Static.enabledBorder = txtInputEnabledBorder;
Static.focusedBorder = txtInputFocusedBorder;
Static.errorBorder = txtInputErrorBorder;
Static.border = txtInputBorder;
Static.borderColor = txtInputBorderColor;
Static.labelPadding = txtInputLabelPadding;
Static.btnHeight = btnHeight;
Static.btnRadius = btnRadius;
Static.btnBgColor = btnBgColor;
Static.btnTextColor = btnTextColor;
Static.btnBorderColor = btnBorderColor;
Static.appDirectionLeftToRight = appDirectionLeftToRight;
Static.useDefaultURl = useDefaultURl;
Static.fontFamily = fontFamily;
Static.stopDecodingFromErrorCode = stopDecodingFromErrorCode;
Static.defaultLoadingProIsIOS = defaultLoadingProIsIOS;
Static.toastLength = defaultToastLength;
HttpCalls.httpCallTimeoutInSec = httpCallTimeoutInSec;
Static.onHoverDefaultMatrix4 = onHoverDefaultMatrix4;
Static.onHoverDefaultScale = onHoverDefaultScale;
Static.onHoverDefaultAnimatedDuration = onHoverDefaultAnimatedDuration;
Static.webDialogBgColor = webDialogBgColor;
Static.dialogAnimationDuration = dialogAnimationDuration;
Static.defaultDateFormat = defaultDateFormat;
Static.defaultDateTimeFormat = defaultDateTimeFormat;
Static.webDialogPadding = webDialogPadding;
Static.webDialogMargin = webDialogMargin;
HttpCalls.onHttpCallError = onHttpCallError;
Static.isHintCapitalizeFirst = isHintCapitalizeFirst??false;
Static.usePreCheckFunctionInHttpCalls = usePreCheckFunctionInHttpCalls;
}