I am new in flutter,
tried to use web view in flutter, but the the size of the web view is bigger than the screen.
I want to fit the web page size to the phone screen size.
How I can do that?
Here is what I get now:
I want to see:
Here is my code:
import 'package:flutter/material.dart';
import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';
class CoursesInformation extends StatefulWidget {
@override
_WebViewExampleState createState() => _WebViewExampleState();
}
class _WebViewExampleState extends State<CoursesInformation> {
TextEditingController controller = TextEditingController();
FlutterWebviewPlugin flutterWebviewPlugin = FlutterWebviewPlugin();
var urlString = "https://shoham.biu.ac.il/BiuCoursesViewer/MainPage.aspx";
launchUrl() {
setState(() {
urlString = controller.text;
flutterWebviewPlugin.reloadUrl(urlString);
flutterWebviewPlugin.launch(urlString,
rect: new Rect.fromLTWH(
0.0,
0.0,
MediaQuery.of(context).size.width,
300.0));
});
}
@override
void initState() {
super.initState();
flutterWebviewPlugin.onStateChanged.listen((WebViewStateChanged wvs) {
print(wvs.type);
});
}
@override
Widget build(BuildContext context) {
return Directionality(
textDirection: TextDirection.rtl,
child: WebviewScaffold(
appBar: AppBar(
title: Text('מידע על קורסים'),
centerTitle: true
),
url: urlString,
withZoom: true,
scrollBar: true,
withJavascript: true,
useWideViewPort: true,
withLocalStorage: true,
));
}
}



