DiveTopicCard.sample constructor

DiveTopicCard.sample({
  1. int sampleNumber = 1,
})

Implementation

factory DiveTopicCard.sample({int sampleNumber = 1}) {
  Widget? richMedia;
  List<String>? buttonTitles;
  String headerText = 'Card title';
  String subheadText = 'Secondary text';
  String supportingText = 'Greyhound divisively hello coldly wonderfully marginally far upon excluding.';
  switch (sampleNumber) {
    case 1:
      richMedia = Image.memory(base64Decode(demoImageUrl));
      // richMedia = Image.network(
      //     'https://bakingmischief.com/wp-content/uploads/2019/09/crispy-waffles-image-square.jpg');
      buttonTitles = ['Action 1', 'Action 2'];
      break;
    case 2:
      richMedia = Text('Centered Text');
      break;
    case 3:
      richMedia = Container(
        width: 180,
        height: 220,
        decoration: BoxDecoration(border: Border.all(color: Colors.purpleAccent.shade100)),
        child: Center(child: Text('Centered Text')),
      );
      break;
  }
  return DiveTopicCard(
      richMedia: richMedia,
      headerText: headerText,
      subheadText: subheadText,
      supportingText: supportingText,
      buttonTitles: buttonTitles);
}