sum_up_plugin 0.0.8 copy "sum_up_plugin: ^0.0.8" to clipboard
sum_up_plugin: ^0.0.8 copied to clipboard

A new Flutter plugin.

example/lib/main.dart

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

String _clientId = "";
String _clientSecret = "";

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {

  SumUpPlugin sumUpPlugin = new SumUpPlugin(
      clientId: _clientId, clientSecret: _clientSecret);

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Builder(builder: (BuildContext context) =>
            Center(
                child: Column(children: [
                  RaisedButton(
                      child: Text("Login"),
                      onPressed: () {
                        this.sumUpPlugin.login(context)
                            .then((String s) => print(s))
                            .catchError((e) => print(e));
                      }),
                  RaisedButton(
                    child: Text("prepareTransaction"),
                    onPressed: () =>
                        SumUpPlugin.prepareTransaction(100.toString(),title:"",email:"",number:"",foreignId:""), //You can test here
                  ),
                  RaisedButton(
                    child: Text("islog"),
                    onPressed: () =>
                        SumUpPlugin.isSumUpTokenValid().then((value){print(value);}),
                  ),
                  RaisedButton(
                    child: Text("paymentPreference"),
                    onPressed: () => SumUpPlugin.paymentPreferences(),
                  )
                ]))),
      ),
    );
  }
}
1
likes
20
pub points
0%
popularity

Publisher

unverified uploader

A new Flutter plugin.

Homepage

License

unknown (LICENSE)

Dependencies

flutter, flutter_webview_plugin, http, shared_preferences

More

Packages that depend on sum_up_plugin