AmazonImage constructor
AmazonImage(
- String asin, {
- Key? key,
- ImageSize imageSize = ImageSize.Middle,
- Function? onTap,
- Function? onDoubleTap,
- Function? onLongTap,
- FunctionBeforeLaunch? functionBeforeLaunch,
- FunctionAfterLaunch? functionAfterLaunch,
- BoxFit? boxFit,
- BuildContext? context,
- String? linkUrl,
- FractionalOffset offset = FractionalOffset.center,
- bool isLaunchAfterTap = false,
- bool isLaunchAfterDoubleTap = true,
- bool isLaunchAfterLongTap = false,
- AmazonImageHolder? holder,
AmazonImage is a widget to display an image from amazon.
asin is a amazon's key to specify product. Let's go to amazon's product page and check the url. (Example) https://www.amazon.com/gp/product/B003O2SHKG?pf_rd_r .................. asin must be "B003O2SHKG"
Implementation
AmazonImage(
this.asin, {
Key? key,
this.imageSize = ImageSize.Middle,
this.onTap,
this.onDoubleTap,
this.onLongTap,
this.functionBeforeLaunch,
this.functionAfterLaunch,
this.boxFit,
this.context,
String? linkUrl,
this.offset = FractionalOffset.center,
this.isLaunchAfterTap = false,
this.isLaunchAfterDoubleTap = true,
this.isLaunchAfterLongTap = false,
this.holder,
}) : super(key: key) {
assert(onTap == null || !isLaunchAfterTap,
'onTap must be null when isLaunchAfterTap is true');
assert(onDoubleTap == null || !isLaunchAfterDoubleTap,
'onDoubleTap must be null when isLaunchAfterDoubleTap is true');
assert(onLongTap == null || !isLaunchAfterLongTap,
'onLongTap must be null when isLaunchAfterLongTap is true');
setting.CountryKey countryKey =
setting.countryLocale[setting.AmazonImageSetting().defaultCountry] ??
setting.CountryKey.USA;
countryCode = setting.codes[countryKey]!;
domain = setting.domains[countryKey]!;
if (linkUrl == null) {
_linkUrl = getLinkUrl();
} else {
_linkUrl = linkUrl;
}
}