GraphicsBlock constructor
const
GraphicsBlock({
- Key? key,
- double? width,
- GraphicsBlockDevice device = GraphicsBlockDevice.auto,
- double breakpoint = 380.0,
- bool isCarousel = false,
- int pcItemsPerView = 2,
- double mobileViewportFraction = 0.86,
- double carouselGap = 24.0,
- Duration animationDuration = const Duration(milliseconds: 350),
- Curve animationCurve = Curves.easeInOutCubic,
- ImageProvider<
Object> ? image, - String? imageUrl,
- String? imageAssetPath,
- String? videoUrl,
- String? videoAssetPath,
- Widget mediaBuilder(
- BuildContext context
- bool autoPlay = true,
- bool playInViewportOnly = true,
- Duration autoPlayDelay = const Duration(milliseconds: 1200),
- bool loop = true,
- bool isMuted = true,
- Widget? imageWidget,
- List<
ImageProvider< ? carouselImages,Object> > - List<
String> ? carouselImageUrls, - List<
String> ? carouselImageAssetPaths, - List<
String> ? carouselVideoUrls, - List<
String> ? carouselVideoAssetPaths, - List<
AlterMediaView> ? carouselMediaViews, - List<
Widget> ? carouselItems, - int carouselIndex = 0,
- ValueChanged<
int> ? onCarouselIndexChanged, - VoidCallback? onPrevious,
- VoidCallback? onNext,
- double aspectRatio = 16 / 9,
- BorderRadius? imageBorderRadius,
- ValueChanged<
int> ? onImageTap, - String title = 'Title',
- Widget? titleWidget,
- bool hasSubtitle = true,
- String subtitle = 'Subtitle',
- Widget? subtitleWidget,
- bool? hasLogo,
- ImageProvider<
Object> ? logo, - Widget? logoWidget,
- String? logoAssetPath,
- VoidCallback? onLogoTap,
- bool? hasBadgeBar,
- bool hasBadgeOne = false,
- String badgeOneLabel = 'Label',
- Widget? badgeOneWidget,
- bool hasBadgeTwo = true,
- String badgeTwoLabel = 'Label',
- Widget? badgeTwoWidget,
- bool hasBadgeThree = true,
- String badgeThreeLabel = 'Label',
- Widget? badgeThreeWidget,
- List<
Widget> ? badges, - bool hasDescription = false,
- String description = 'Description',
- Widget? descriptionWidget,
Creates a GraphicsBlock instance.
Implementation
const GraphicsBlock({
super.key,
this.width,
this.device = GraphicsBlockDevice.auto,
this.breakpoint = 380.0,
this.isCarousel = false,
this.pcItemsPerView = 2,
this.mobileViewportFraction = 0.86,
this.carouselGap = 24.0,
this.animationDuration = const Duration(milliseconds: 350),
this.animationCurve = Curves.easeInOutCubic,
this.image,
this.imageUrl,
this.imageAssetPath,
this.videoUrl,
this.videoAssetPath,
this.mediaBuilder,
this.autoPlay = true,
this.playInViewportOnly = true,
this.autoPlayDelay = const Duration(milliseconds: 1200),
this.loop = true,
this.isMuted = true,
this.imageWidget,
this.carouselImages,
this.carouselImageUrls,
this.carouselImageAssetPaths,
this.carouselVideoUrls,
this.carouselVideoAssetPaths,
this.carouselMediaViews,
this.carouselItems,
this.carouselIndex = 0,
this.onCarouselIndexChanged,
this.onPrevious,
this.onNext,
this.aspectRatio = 16 / 9,
this.imageBorderRadius,
this.onImageTap,
this.title = 'Title',
this.titleWidget,
this.hasSubtitle = true,
this.subtitle = 'Subtitle',
this.subtitleWidget,
this.hasLogo,
this.logo,
this.logoWidget,
this.logoAssetPath,
this.onLogoTap,
this.hasBadgeBar,
this.hasBadgeOne = false,
this.badgeOneLabel = 'Label',
this.badgeOneWidget,
this.hasBadgeTwo = true,
this.badgeTwoLabel = 'Label',
this.badgeTwoWidget,
this.hasBadgeThree = true,
this.badgeThreeLabel = 'Label',
this.badgeThreeWidget,
this.badges,
this.hasDescription = false,
this.description = 'Description',
this.descriptionWidget,
}) : assert(pcItemsPerView >= 1, 'pcItemsPerView must be at least 1');