mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: hide keyboard when switching login methods
This commit is contained in:
@@ -456,14 +456,24 @@ class _LoginPageState extends State<LoginPage> {
|
||||
)
|
||||
: null,
|
||||
),
|
||||
body: TabBarView(
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
controller: _loginPageCtr.tabController,
|
||||
children: [
|
||||
tabViewOuter(loginByPassword()),
|
||||
tabViewOuter(loginBySmS()),
|
||||
tabViewOuter(loginByQRCode()),
|
||||
],
|
||||
body: NotificationListener(
|
||||
onNotification: (notification) {
|
||||
if (notification is ScrollUpdateNotification) {
|
||||
if (notification.metrics.axis == Axis.horizontal) {
|
||||
FocusScope.of(context).unfocus();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
child: TabBarView(
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
controller: _loginPageCtr.tabController,
|
||||
children: [
|
||||
tabViewOuter(loginByPassword()),
|
||||
tabViewOuter(loginBySmS()),
|
||||
tabViewOuter(loginByQRCode()),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
@@ -479,5 +489,4 @@ class _LoginPageState extends State<LoginPage> {
|
||||
child: child,
|
||||
)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user