part of user_wrong_des;


class UserWrongDesPage extends StatefulWidget {
  final CourseModel model;
  const UserWrongDesPage({
    Key? key,
    required this.model
  }) : super(key: key);

  @override
  State<UserWrongDesPage> createState() => _UserWrongDesPageState();
}

class _UserWrongDesPageState extends State<UserWrongDesPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: const Text('错题详情'),
        ),
        body: InAppWebView(
          initialUrlRequest: URLRequest(
            // url: Uri.parse(kUserWrongDes),
              url: WebUri.uri(Uri.parse(kUserWrongDes))
          ),
          initialSettings:InAppWebViewSettings(
            // http的请求也不做限制
              mixedContentMode:MixedContentMode.MIXED_CONTENT_ALWAYS_ALLOW
          ),
          onLoadStop: (controller, url) {
            String str = '$kServerUrl,${widget.model.bookId},${UserStore.to.token}';
            Console.log('传给前端的参数--------------------------------$str');
            controller.evaluateJavascript(source: 'callbackInFlutterComponent("$str");');
          }
        )
    );
  }
}
