import 'package:flutter/material.dart';
import 'package:share_plus/share_plus.dart';

import '../../../../widget/sharePositionOrigin.dart';
import 'qrShareView.dart';

class SelectShareTypeDialog extends StatelessWidget {
  const SelectShareTypeDialog({super.key});

  @override
  Widget build(BuildContext context) => SimpleDialog(
      children: [
        ListTile(
          leading: const Icon(Icons.qr_code_2_outlined),
          title: const Text('Per QR-Code'),
          trailing: const Icon(Icons.arrow_right),
          onTap: () {
            Navigator.of(context).push(MaterialPageRoute(builder: (context) => const QrShareView()));
          },
        ),
        ListTile(
          leading: const Icon(Icons.link_outlined),
          title: const Text('Per Link teilen'),
          trailing: const Icon(Icons.arrow_right),
          onTap: () {
            Share.share(
                sharePositionOrigin: SharePositionOrigin.get(context),
                subject: 'App Teilen',
                'Hol dir die für das Marianum maßgeschneiderte App:'
                    '\n\nAndroid: https://play.google.com/store/apps/details?id=eu.mhsl.marianum.mobile.client '
                    '\niOS: https://apps.apple.com/us/app/marianum-fulda/id6458789560 '
                    '\n\nViel Spaß!'
            );
          },
        )
      ],
    );
}
