GraphicsBlock constructor

const GraphicsBlock({
  1. Key? key,
  2. double? width,
  3. GraphicsBlockDevice device = GraphicsBlockDevice.auto,
  4. double breakpoint = 380.0,
  5. bool isCarousel = false,
  6. int pcItemsPerView = 2,
  7. double mobileViewportFraction = 0.86,
  8. double carouselGap = 24.0,
  9. Duration animationDuration = const Duration(milliseconds: 350),
  10. Curve animationCurve = Curves.easeInOutCubic,
  11. ImageProvider<Object>? image,
  12. String? imageUrl,
  13. String? imageAssetPath,
  14. String? videoUrl,
  15. String? videoAssetPath,
  16. VideoPlayerController? videoController,
  17. bool autoPlay = true,
  18. bool playInViewportOnly = true,
  19. Duration autoPlayDelay = const Duration(milliseconds: 1200),
  20. bool loop = true,
  21. bool isMuted = true,
  22. Widget? imageWidget,
  23. List<ImageProvider<Object>>? carouselImages,
  24. List<String>? carouselImageUrls,
  25. List<String>? carouselImageAssetPaths,
  26. List<String>? carouselVideoUrls,
  27. List<String>? carouselVideoAssetPaths,
  28. List<AlterMediaView>? carouselMediaViews,
  29. List<Widget>? carouselItems,
  30. int carouselIndex = 0,
  31. ValueChanged<int>? onCarouselIndexChanged,
  32. VoidCallback? onPrevious,
  33. VoidCallback? onNext,
  34. double aspectRatio = 16 / 9,
  35. BorderRadius? imageBorderRadius,
  36. ValueChanged<int>? onImageTap,
  37. String title = 'Title',
  38. Widget? titleWidget,
  39. bool hasSubtitle = true,
  40. String subtitle = 'Subtitle',
  41. Widget? subtitleWidget,
  42. Widget? logoWidget,
  43. String? logoAssetPath,
  44. VoidCallback? onLogoTap,
  45. bool? hasBadgeBar,
  46. bool hasBadgeOne = false,
  47. String badgeOneLabel = 'Label',
  48. Widget? badgeOneWidget,
  49. bool hasBadgeTwo = true,
  50. String badgeTwoLabel = 'Label',
  51. Widget? badgeTwoWidget,
  52. bool hasBadgeThree = true,
  53. String badgeThreeLabel = 'Label',
  54. Widget? badgeThreeWidget,
  55. List<Widget>? badges,
  56. bool hasDescription = false,
  57. String description = 'Description',
  58. 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.videoController,
  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');