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

outdated

Simple way to share a message, link or files from your flutter app

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:flutter_share/flutter_share.dart';
import 'package:documents_picker/documents_picker.dart';

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

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

class _MyAppState extends State<MyApp> {
  String _platformVersion = 'Unknown';

  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    bool teste;
    // Platform messages may fail, so we use a try/catch PlatformException.
    try {

      List<dynamic> docs = await DocumentsPicker.pickDocuments;
      teste = await FlutterShare.share(title: 'teste', fileUrl: docs[0] as String);

    } on PlatformException {

    }

    if (!mounted) return;

    setState(() {
    });
  }

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: const Text('Plugin example app'),
        ),
        body: new Center(
          child: new Text('Running on: $_platformVersion\n'),
        ),
      ),
    );
  }
}
283
likes
0
pub points
99%
popularity

Publisher

verified publisherbritto.dev

Simple way to share a message, link or files from your flutter app

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

documents_picker, flutter

More

Packages that depend on flutter_share