CustomButton class custom button widget
This class is used to create a custom button
If you set your application primary color then it will use that color using CustomColor.kPrimaryColor. Here primary is used to set the button color.
This button has a isDisable property to disable the button. We can set the disableColor to change the disable button color.
Only one required property is label other properties are optional. If you don't set the optional properties then it will use the default value.
This button has a loading property to show the loading indicator in the button. We can set the loadingColor to change the loading indicator color.
We can set the prefixImage and suffixImage to show the image before and after the label. We can set the prefixImageHeight, prefixImageWidth, prefixImageColor, suffixImageHeight, suffixImageWidth, suffixImageColor to change the image properties.
elevation is used to set the elevation of the button. boxShadowColor is used to set the shadow color of the button.
borderColor is used to set the border color of the button. labelColor is used to set the label color of the button.
fontSize is used to set the font size of the label. fontWeight is used to set the font weight of the label.
iconData is used to set the icon before the label. height is used to set the height of the button.
borderWidth is used to set the border width of the button. isBorder is used to set the border of the button.
width is used to set the width of the button. borderRadiusAll is used to set the border radius of the button. borderRadius is used to set custom border radius of the button.
CustomNetworkImage is a custom image widget
isFromAPI is define your image from api or internet
apiUrl if isFromAPI then apiUrl is required
apiUrl if isFromAPI then apiExtraSlag is optional
errorImagePath is your local assets path (optional)/errorIconData is iconData (optional) if your image is not exists or internet connection is failed then this image show to user
Define CustomNetworkImage when is from api url
CustomNetworkImage(
isFromAPI: true,
isPreviewPageNeed: false,
networkImagePathFromAPI: UserController.to.getUserInfo.profilePhotoUrl ?? '',
apiUrl: Service.apiUrl,
width: 70,
height: 70,
errorImagePath: 'images/image/user-default.png',
fit: BoxFit.cover,
)