flutter_intent_forzzh 0.0.2 copy "flutter_intent_forzzh: ^0.0.2" to clipboard
flutter_intent_forzzh: ^0.0.2 copied to clipboard

A plug-in for launching native android or ios.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_intent_forzzh/native_intent_lib.dart';

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

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

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

class _MyAppState extends State<MyApp> {


  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body:Center(
          child: Column(

            children: [

              buildButton("启动淘宝", (){
                // String uri = "taobao://s.click.taobao.com/NMJ5nJu";
                NativeIntent intent = NativeIntent(
                  action: Settings.ACTION_ACCESSIBILITY_SETTINGS,
                  // data: uri,
                );
                intent.launch();


                // NativeIntent intent =   const NativeIntent(
                //   // data: uri,
                //   action: IOSIntent.APPSTORE,//跳转app store
                // );
                // intent.launch();
              }),
            ],
          ),
        ),
      ),
    );
  }

  Widget buildButton(String title,Function function){

    return GestureDetector(
      onTap: (){
        function.call();
      },
      child:  Container(
        width: 200,
        height: 35,
        margin: const EdgeInsets.only(top: 20),
        alignment: Alignment.center,
        decoration: const BoxDecoration(
            color: Colors.lightBlueAccent,
            borderRadius: BorderRadius.all(Radius.circular(10))
        ),
        child: Text(title),
      ),
    );
  }

}
1
likes
120
points
24
downloads

Publisher

unverified uploader

Weekly Downloads

A plug-in for launching native android or ios.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_web_plugins, plugin_platform_interface

More

Packages that depend on flutter_intent_forzzh