I am working on Flutter webview apps using Flutter Webview.
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'package:url_launcher/url_launcher.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: SafeArea(
child : const WebView(
initialUrl: 'https://google.com',
javascriptMode: JavascriptMode.unrestricted,
),
)
)
);
}
}
I try to use launchURL plugin but that will open predefined url in external browser window.
if (url.contains('.pdf')) {
launchURL(url);
}
What I want is to download the file in-app webview.
question from:
https://stackoverflow.com/questions/65919309/how-to-download-files-in-flutter-webview 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…