Update login_page.dart

This commit is contained in:
jyuesong
2022-01-24 14:59:35 +08:00
parent d0ee140a44
commit 490bc0f597

View File

@@ -371,35 +371,37 @@ class _LoginPageState extends ConsumerState<LoginPage> {
), ),
Positioned( Positioned(
bottom: 10, bottom: 10,
child: SizedBox( child: (getIt<UserInfoViewModel>().historyAccounts.isEmpty)
width: MediaQuery.of(context).size.width, ? const SizedBox.shrink()
child: Center( : SizedBox(
child: Material( width: MediaQuery.of(context).size.width,
color: Colors.transparent, child: Center(
child: PopupMenuButton<UserInfoBean>( child: Material(
onSelected: (UserInfoBean result) { color: Colors.transparent,
selected(result); child: PopupMenuButton<UserInfoBean>(
}, onSelected: (UserInfoBean result) {
itemBuilder: (BuildContext context) => <PopupMenuEntry<UserInfoBean>>[ selected(result);
...getIt<UserInfoViewModel>() },
.historyAccounts itemBuilder: (BuildContext context) => <PopupMenuEntry<UserInfoBean>>[
.map((e) => PopupMenuItem<UserInfoBean>( ...getIt<UserInfoViewModel>()
value: e, .historyAccounts
child: buildCell(e), .map((e) => PopupMenuItem<UserInfoBean>(
)) value: e,
.toList(), child: buildCell(e),
], ))
child: Text( .toList(),
"切换账号", ],
style: TextStyle( child: Text(
color: ref.watch(themeProvider).primaryColor, "切换账号",
fontSize: 14, style: TextStyle(
color: ref.watch(themeProvider).primaryColor,
fontSize: 14,
),
),
),
), ),
), ),
), ),
),
),
),
), ),
], ],
), ),