How to open and PDF or word document in the [Flutter]
You can do this by opening google docs in a web browser :
In pubspec.yaml you need :
url_launcher: ^0.4.2+5
Includes :
import 'package:flutter/src/gestures/tap.dart';import 'package:url_launcher/url_launcher.dart';
Code snippet :
new RichText( text: new LinkTextSpan( url: 'http://docs.google.com/viewer?url=http://www.pdf995.com/samples/pdf.pdf', text: 'Show My Pdf'),),
LinkTextSpan class :
class LinkTextSpan extends TextSpan { LinkTextSpan({TextStyle style, String url, String text}) : super( style: style, text: text ?? url, recognizer: new TapGestureRecognizer() ..onTap = () { launch(url); });}