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

Share text easily with android and ios.

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:share_android_ios/share_android_ios.dart';

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

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

class _MyAppState extends State<MyApp> {
  String text = "chưa share";

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Share!!'),
        ),
        body: Center(
          child: Column(
            children: [
              Text(text),
              ElevatedButton(
                child: Text('Share'),
                onPressed: () async {
                  String t =
                      await ShareAndroidIos.share('hello flutter engage!!!');
                  setState(() {
                    text = t;
                  });
                },
              ),
            ],
          ),
        ),
      ),
    );
  }
}
0
likes
110
pub points
0%
popularity

Publisher

unverified uploader

Share text easily with android and ios.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on share_android_ios