Flutter 如何在使用Flatter webview显示web时自动登录?
在上面的代码中,url地址使用webview显示为App。 有没有办法自动登录Flutter 如何在使用Flatter webview显示web时自动登录?,flutter,authentication,webview,Flutter,Authentication,Webview,在上面的代码中,url地址使用webview显示为App。 有没有办法自动登录 @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( body: Center( child: SafeArea( child: WebView( initialUrl: 'login pag
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
child: SafeArea(
child: WebView(
initialUrl: 'login page url',
javascriptMode: JavascriptMode.unrestricted,
),
),
),
floatingActionButton: FloatingActionButton(
onPressed: _showNotification,
tooltip: 'Increment',
child: Icon(Icons.access_alarms),
),
),
);
}
}
我想你可以在第一次登录后尝试使用cookie。我正在使用flatter“CookieManager”从我的webview url获取参数令牌。我认为您可以在首次登录后尝试使用cookie。我正在使用flatter“CookieManager”从我的webview url获取参数令牌