fluwx_pay_only 1.1.0

Flutter Android iOS

This package is a branch of Fluwx and it only supports WeChatPay. See Fluwx for more details.

example/lib/main.dart

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:fluwx_pay_only/fluwx_pay_only.dart' as fluwx;

import 'pay_page.dart';

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

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

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    _initFluwx();
  }

  _initFluwx() async {
    await fluwx.register(
        appId: "wxd930ea5d5a258f4f",
        doOnAndroid: true,
        doOnIOS: true,
        universalLink: "https://your.univerallink.com/link/");
    var result = await fluwx.isWeChatInstalled();
    print("is installed $result");
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {}

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      routes: <String, WidgetBuilder>{
        "pay": (context) => PayPage(),
      },
      home: new Scaffold(
          appBar: new AppBar(
            title: const Text('Plugin example app'),
          ),
          body: ShareSelectorPage()),
    );
  }
}

class ShareSelectorPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Center(
      child: new ListView(
        children: <Widget>[
          Padding(
            padding: const EdgeInsets.all(8.0),
            child: new OutlineButton(
                onPressed: () {
                  Navigator.of(context).pushNamed("pay");
                },
                child: const Text("pay")),
          ),
        ],
      ),
    );
  }
}
0
likes
90
pub points
37%
popularity

This package is a branch of Fluwx and it only supports WeChatPay. See Fluwx for more details.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

jarvan.mo@gmail.com

License

Apache 2.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on fluwx_pay_only