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

A new Flutter wk_plugin project.

example/lib/main.dart

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

import 'package:wk_plugin/wk_plugin.dart';

void main() {
  runApp(const MyApp());
}

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

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

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

  // Platform messages are asynchronous, so we initialize in an async metho

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(children: [
            TextButton(
                onPressed: () async {
                   var code = await WkPlugin.instance.init(appID: 123456);
                   if (kDebugMode) {
                     print('$code');
                   }
                },
                child: const Text('初始化',
                    style: TextStyle(fontSize: 20, color: Colors.orange))),
            TextButton(
                onPressed: () {
                  WkPlugin.instance.unInit();
                },
                child: const Text('反初始化',
                    style: TextStyle(fontSize: 20, color: Colors.orange))),
          ]),
        ),
      ),
    );
  }
}
1
likes
130
points
0
downloads

Publisher

unverified uploader

Weekly Downloads

A new Flutter wk_plugin project.

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on wk_plugin

Packages that implement wk_plugin