import 'package:flutter/material.dart';

import '../../widget/centeredLeading.dart';
import '../../widget/confirmDialog.dart';

class PrivacyInfo {
  String providerText;
  String privacyUrl;
  String imprintUrl;

  PrivacyInfo({required this.providerText, required this.imprintUrl, required this.privacyUrl});

  void showPopup(BuildContext context) {
    showDialog(context: context, builder: (context) => SimpleDialog(
        title: Text('Betreiberinformation | $providerText'),
        children: [
          ListTile(
            leading: const CenteredLeading(Icon(Icons.person_pin_outlined)),
            title: const Text('Impressum'),
            subtitle: Text(imprintUrl),
            onTap: () => ConfirmDialog.openBrowser(context, imprintUrl),
          ),
          ListTile(
            leading: const CenteredLeading(Icon(Icons.privacy_tip_outlined)),
            title: const Text('Datenschutzerklärung'),
            subtitle: Text(privacyUrl),
            onTap: () => ConfirmDialog.openBrowser(context, privacyUrl),
          ),
        ],
      ));
  }
}
