import "dart:core";
//import 'package:flutter_paypal_payment/flutter_paypal_payment.dart';
import 'dart:io' show Platform;

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
//import 'package:flutter_paypal/flutter_paypal.dart';
import 'package:flutter_donation_buttons/flutter_donation_buttons.dart';
import "main.dart";
const IconData paypal = IconData(0xf0545, fontFamily: 'MaterialIcons');

class FormPayPal extends StatefulWidget {
  const FormPayPal({super.key});

  @override
  State<FormPayPal> createState() => _FormPayPalState();
}

class _FormPayPalState extends State<FormPayPal> {
  var cappuEur = "5";
  final _formKey = GlobalKey<FormState>();

  @override
  appTyp() {
    if (Platform.isIOS) {
      return "springcontrol IOS";
    } else if (Platform.isAndroid) {
      return "springcontrol Android";
    } else if (Platform.isLinux) {
      return "springcontrol Linux";
    } else if (Platform.isMacOS) {
      return "springcontrol MacOS";
    } else if (Platform.isWindows) {
      return "springcontrol Windows";
    }
  }

  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(context.sp.cappuccinoUnterstuetzung),
        //centerTitle: true,
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
      ),
      body: Center(
        child: SingleChildScrollView(
          child: Form(
            key: _formKey,
            child: Column(
              //mainAxisAlignment: MainAxisAlignment.start,
              children: [
                Card(
                    child: Padding(
                  padding: const EdgeInsets.all(8),
                  child: Column(
                    children: <Widget>[
                      //   Row(
                      //   mainAxisAlignment: MainAxisAlignment.center,
                      // children: <Widget>[
                      ListTile(
                        title: Text(context.sp.dankeFuerDenCappuccino),
                      ),

                      //  Card(
                      //    child: Padding(
                      //      padding: const EdgeInsets.all(8),
                      //      child: Column(
                      //        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      //        children: <Widget>[
                      // Container(
                      Text(context.sp.derButtonKopiertDieInformation),
                      Text(""),
                      Text(
                        appTyp(),
                        style: TextStyle(fontWeight: FontWeight.bold),
                      ),
                      Text(""),
                      ElevatedButton(
                        onPressed: () async {
                          await Clipboard.setData(
                              ClipboardData(text: appTyp()));
                        },
                        child: Text(context.sp.inZwischenablage),
                      ),
                      Text(""),
                      Text(context.sp.bitteAlsKommentarBeiPayPalEinfuegen),
                      Text(context.sp.gerneAuchVomwwwspringforumde),
                      Text(context.sp.euernUsernamen),
                      Text(""),
                      Text(context.sp.damitIchWeiss),
                      Text(context.sp.woherDerappuccinoKommt),
                      Text(""),

                      //)
                      //         ],
                      //       ),

                      //     ),
                      //     ),

                      //      Card(
                      //        child: Padding(
                      //    padding: const EdgeInsets.all(8),
                      //    child: Column(children: <Widget>[

                      //  )

                      if (Platform.isIOS) ...[
                        Text(
                            context.sp.eigentlichSollteHierEinPaypalDonateButtonSein),
                        Text(
                            context.sp.daDasUeberAppleLaufenMussLohntEsSieNichtFuerMich),
                        Text(
                            context.sp.beiFragenGerneAnMeinePayPalAdresselordvonglencoewebde),
                      ] else ...[
                        Row(
                          mainAxisAlignment: MainAxisAlignment.center,
                          children: <Widget>[
                            PayPalButton(
                                //paypalButtonId: "UN5C44M9S6UU2",
                                paypalButtonId: "S2GNRSL7Y8AJJ",
                                style: ElevatedButton.styleFrom(
                                  foregroundColor: Colors.black, // text color
                                  //backgroundColor: Colors.black),
                                  //style? foregroundColor: Colors. green),
                                  //color: Colors.black
                                )),
                          ],
                        )
                      ],

                      // ]
                      //  )
                      //   ),

                      //  ]
                      // ),// Card Button ende
                      //   ],
                      // ), // row
                      //   ),
                    ],
                  ),
                )),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
