part of bai_ke;

class BaiKePage extends StatefulWidget {
  final String keyword;
  const BaiKePage({
    Key? key,
    required this.keyword
  }) : super(key: key);

  @override
  State<BaiKePage> createState() => _BaiKePageState();
}

class _BaiKePageState extends State<BaiKePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        centerTitle: false,
        title: Text('${widget.keyword}百度百科',style: TextStyle(fontSize: 14.w,fontWeight: Fonts.medium,color: Colours.c3),),
      ),
      body: InAppWebView(
        initialUrlRequest: URLRequest(
          // url: Uri.parse('https://baike.baidu.com/item/${widget.keyword}?fromModule=lemma_search-box'),
            url: WebUri.uri(Uri.parse('https://baike.baidu.com/item/${widget.keyword}?fromModule=lemma_search-box'))
        ),
        initialSettings:InAppWebViewSettings(
          // http的请求也不做限制
          mixedContentMode:MixedContentMode.MIXED_CONTENT_ALWAYS_ALLOW
        ),
      ),
    );
  }
}
