【发布时间】:2020-06-06 19:08:27
【问题描述】:
我是 Flutter 新手,
我在等待网页加载时尝试添加一个 CircularProgressIndicator, 然后页面显示和圆形指示器不显示在屏幕上。
它应该在哪里?也许在下面的 onLoadStart 函数中?
源代码:
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
class CoursesInformation extends StatefulWidget {
@override
_CoursesInformationState createState() => _CoursesInformationState();
}
class _CoursesInformationState extends State<CoursesInformation> {
InAppWebViewController webView;
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return Directionality(
textDirection: TextDirection.rtl,
child: Scaffold(
appBar: AppBar(
title: const Text('מידע על קורסים'),
centerTitle: true,
),
body: Container(
child: Column(children: <Widget>[
Expanded(
child: InAppWebView(
initialUrl:
"https://shoham.biu.ac.il/BiuCoursesViewer/MainPage.aspx",
initialHeaders: {},
initialOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(
debuggingEnabled: true,
preferredContentMode: UserPreferredContentMode.DESKTOP),
),
onWebViewCreated: (InAppWebViewController controller) {
webView = controller;
},
onLoadStart: (InAppWebViewController controller, String url) {
},
onLoadStop: (InAppWebViewController controller, String url) async {
},
))
])),
),
);
}
}
【问题讨论】: