d_platform_sdk 0.0.1 copy "d_platform_sdk: ^0.0.1" to clipboard
d_platform_sdk: ^0.0.1 copied to clipboard

outdated

A new Flutter plugin.

example/lib/main.dart

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

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

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

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    DPlatformSdk.listener((data) {
      // 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;
      if (data is Map) {
        if ("login" == data['action']) {
          //
        }
      }
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('d platform plugin example app'),
        ),
        body: Column(
          children: <Widget>[
            RaisedButton(
              onPressed: () {
                DPlatformSdk.call(
                  "dflatformdemo1",
                  "login",
                  "xxx.xxx.xxx",
                  params: {},
                  downloadUrl: "www.360.com",
                );
              },
              child: Text('获取token登录'),
            )
          ],
        ),
      ),
    );
  }
}
0
likes
20
pub points
0%
popularity

Publisher

unverified uploader

A new Flutter plugin.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on d_platform_sdk