DailyLimitRemainingCard static method
Implementation
static Widget DailyLimitRemainingCard(
int dailyLimit, int remaining, String message,
{Color color = Colors.blue}) {
return Container(
padding: EdgeInsets.all(16),
decoration: BoxDecoration(
border: Border.all(
color: Color(
0xAACCCCCC), // You can change the color to your desired color
width: 1.0),
color: Colors.white,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Daily Limit'.tr, // Localization for 'Daily Limit'
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: color,
),
),
SizedBox(height: 16),
Text(
message,
style: TextStyle(fontSize: 16, color: Colors.black87),
),
SizedBox(height: 16),
LinearProgressIndicator(
backgroundColor: Colors.grey[300],
value: dailyLimit == 0 ? 0 : remaining / dailyLimit,
valueColor: AlwaysStoppedAnimation<Color>(color),
),
SizedBox(height: 16),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'Remaining'.tr, // Localization for 'Remaining'
style: TextStyle(fontSize: 16, color: Colors.black87),
),
Text(
remaining.toString(),
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: color,
),
),
],
),
SizedBox(height: 16),
ElevatedButton.icon(
icon: Icon(Icons.emoji_emotions),
onPressed: () {
PurchaseHelper.showPaywall(analyticKey: "remove_limits");
},
label: Text(
'Remove Limits'.tr, // Localization for 'Remove Limits'
style: TextStyle(fontSize: 18),
),
),
],
),
);
}