kyrmann_pay 1.0.0 copy "kyrmann_pay: ^1.0.0" to clipboard
kyrmann_pay: ^1.0.0 copied to clipboard

discontinued
outdated

Kyrmann_pay plugin.

example/lib/main.dart

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

// import 'package:flutter/services.dart';
// import 'package:kyrmann_pay/kyrmann_pay.dart';
import 'package:get/get.dart';
import 'package:kyrmann_pay_example/utils/colors.dart';

import 'ui/home.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';

void main() async{
  await dotenv.load(fileName: ".env");
  runApp(const MyApp());
}

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  // String _platformVersion = 'Unknown';
  // final _kyrmannPayPlugin = KyrmannPay();

  // @override
  // void initState() {
  //   super.initState();
  //   // initPlatformState();
  // }

  // Platform messages are asynchronous, so we initialize in an async method.
  // Future<void> initPlatformState() async {
  //   String platformVersion;
  //   // Platform messages may fail, so we use a try/catch PlatformException.
  //   // We also handle the message potentially returning null.
  //   try {
  //     platformVersion =
  //         await _kyrmannPayPlugin.getPlatformVersion() ?? 'Unknown platform version';
  //   } on PlatformException {
  //     platformVersion = 'Failed to get platform version.';
  //   }

  //   // If the widget was removed from the tree while the asynchronous platform
  //   // message was in flight, we want to discard the reply rather than calling
  //   // setState to update our non-existent appearance.
  //   if (!mounted) return;

  //   // setState(() {
  //   //   _platformVersion = platformVersion;
  //   // });
  // }

  @override
  Widget build(BuildContext context) {
    
    return GetMaterialApp(
      theme: ThemeData(
        primarySwatch: mainColor,
        fontFamily: 'Montserrat'
      ),
      home: Home(
        paymentData: const {
          'login': 'smsmarketing',
          'password': '\$2a\$12\$3vQmuhxiJfV2REV7J9E/KeWE51SDqdhHytJh7i6hCkbowpUkdcNRS',
          'amount': 5,
          'afid': 601,
          'offerId': 6010,
          'key': '18NH74J6M5U56MVK',
          'iv': '18NH74J6M5U56MVK'
        },
        callbackUrl: 'https://flutter.dev',
        onPaymentError: (error){},
        onPaymentSuccess: (data){},
      ),
      debugShowCheckedModeBanner: false,
    );
  }
}