rewardedButton static method

ElevatedButton rewardedButton(
  1. String title,
  2. void onPressed(), {
  3. IconData icon = Icons.star,
  4. Color color = Colors.blue,
})

Implementation

static ElevatedButton rewardedButton(String title, void Function() onPressed,
    {IconData icon = Icons.star, Color color = Colors.blue}) {
  return ElevatedButton.icon(
    style: ElevatedButton.styleFrom(backgroundColor: color),
    onPressed: () {
      AdmobHelper.showRewarded();
      onPressed();
    },
    icon: Icon(icon),
    label: Column(
      children: [
        Text(title, style: TextStyle(fontSize: 17)),
        if (!PurchaseHelper.isPremium) ...{
          Text('Watch ad'.tr, style: TextStyle(fontSize: 11)),
          SizedBox(height: 5)
        },
      ],
    ),
  );
}