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,
|
: null,
|
||||||
),
|
),
|
||||||
body: TabBarView(
|
body: NotificationListener(
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
onNotification: (notification) {
|
||||||
controller: _loginPageCtr.tabController,
|
if (notification is ScrollUpdateNotification) {
|
||||||
children: [
|
if (notification.metrics.axis == Axis.horizontal) {
|
||||||
tabViewOuter(loginByPassword()),
|
FocusScope.of(context).unfocus();
|
||||||
tabViewOuter(loginBySmS()),
|
}
|
||||||
tabViewOuter(loginByQRCode()),
|
}
|
||||||
],
|
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,
|
child: child,
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user