Initial commit: monorepo Match Live TV.
Rails API, app Flutter, infrastruttura Docker/MediaMTX, sito marketing e documentazione di deploy. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
37
mobile/lib/shared/premium_dialog.dart
Normal file
37
mobile/lib/shared/premium_dialog.dart
Normal file
@@ -0,0 +1,37 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import '../app/theme.dart';
|
||||
|
||||
Future<void> showPremiumRequiredDialog(
|
||||
BuildContext context, {
|
||||
required String message,
|
||||
String? billingUrl,
|
||||
}) async {
|
||||
await showDialog<void>(
|
||||
context: context,
|
||||
builder: (ctx) => AlertDialog(
|
||||
backgroundColor: AppTheme.surface,
|
||||
title: const Text('Premium richiesto'),
|
||||
content: Text(message),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(ctx),
|
||||
child: const Text('Chiudi'),
|
||||
),
|
||||
if (billingUrl != null && billingUrl.isNotEmpty)
|
||||
FilledButton(
|
||||
onPressed: () async {
|
||||
final uri = Uri.parse(billingUrl);
|
||||
if (await canLaunchUrl(uri)) {
|
||||
await launchUrl(uri, mode: LaunchMode.externalApplication);
|
||||
}
|
||||
if (ctx.mounted) Navigator.pop(ctx);
|
||||
},
|
||||
style: FilledButton.styleFrom(backgroundColor: AppTheme.primaryRed),
|
||||
child: const Text('Attiva sul sito'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user