|
|
|
@ -327,19 +327,26 @@ class _HomePageState extends State<HomePage> with tray.TrayListener, WindowListe
|
|
|
|
|
_scaffoldKey.currentState!.openDrawer(); |
|
|
|
|
return false; |
|
|
|
|
}, |
|
|
|
|
child: Scaffold( |
|
|
|
|
child: Builder( |
|
|
|
|
builder: (final context) { |
|
|
|
|
if (accountsSnapshot.hasData) { |
|
|
|
|
final accounts = accountsSnapshot.data!; |
|
|
|
|
final account = accounts.singleWhere((final account) => account.id == widget.account.id); |
|
|
|
|
return Scaffold( |
|
|
|
|
key: _scaffoldKey, |
|
|
|
|
resizeToAvoidBottomInset: false, |
|
|
|
|
appBar: AppBar( |
|
|
|
|
title: Row( |
|
|
|
|
title: Column( |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Expanded( |
|
|
|
|
child: Row( |
|
|
|
|
Row( |
|
|
|
|
children: [ |
|
|
|
|
if (appsData != null && activeAppIDSnapshot.hasData) ...[ |
|
|
|
|
Flexible( |
|
|
|
|
child: Text( |
|
|
|
|
appsData.singleWhere((final a) => a.id == activeAppIDSnapshot.data!).name(context), |
|
|
|
|
appsData |
|
|
|
|
.singleWhere((final a) => a.id == activeAppIDSnapshot.data!) |
|
|
|
|
.name(context), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
@ -366,14 +373,17 @@ class _HomePageState extends State<HomePage> with tray.TrayListener, WindowListe
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
const SizedBox( |
|
|
|
|
width: 8, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
if (accounts.length > 1) ...[ |
|
|
|
|
Text( |
|
|
|
|
account.client.humanReadableID, |
|
|
|
|
style: Theme.of(context).textTheme.bodySmall, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
Row( |
|
|
|
|
children: [ |
|
|
|
|
actions: [ |
|
|
|
|
if (appsData != null && activeAppIDSnapshot.hasData) ...[ |
|
|
|
|
IconButton( |
|
|
|
|
icon: const Icon(Icons.settings), |
|
|
|
@ -388,30 +398,25 @@ class _HomePageState extends State<HomePage> with tray.TrayListener, WindowListe
|
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
|
Builder( |
|
|
|
|
builder: (final context) { |
|
|
|
|
if (accountsSnapshot.hasData) { |
|
|
|
|
final matches = accountsSnapshot.data! |
|
|
|
|
.where( |
|
|
|
|
(final account) => account.id == widget.account.id, |
|
|
|
|
) |
|
|
|
|
.toList(); |
|
|
|
|
if (matches.length == 1) { |
|
|
|
|
return AccountAvatar( |
|
|
|
|
account: matches[0], |
|
|
|
|
IconButton( |
|
|
|
|
icon: AccountAvatar( |
|
|
|
|
account: account, |
|
|
|
|
requestManager: _requestManager, |
|
|
|
|
), |
|
|
|
|
onPressed: () async { |
|
|
|
|
await Navigator.of(context).push( |
|
|
|
|
MaterialPageRoute( |
|
|
|
|
builder: (final context) => AccountSpecificSettingsPage( |
|
|
|
|
bloc: accountsBloc, |
|
|
|
|
account: account, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return Container(); |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
drawer: Drawer( |
|
|
|
|
child: Column( |
|
|
|
|
children: [ |
|
|
|
@ -472,6 +477,7 @@ class _HomePageState extends State<HomePage> with tray.TrayListener, WindowListe
|
|
|
|
|
value: account.id, |
|
|
|
|
child: AccountTile( |
|
|
|
|
account: account, |
|
|
|
|
dense: true, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
@ -515,7 +521,8 @@ class _HomePageState extends State<HomePage> with tray.TrayListener, WindowListe
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
|
children: [ |
|
|
|
|
Text(appImplementation.name(context)), |
|
|
|
|
if (unreadCounterSnapshot.hasData && unreadCounterSnapshot.data! > 0) ...[ |
|
|
|
|
if (unreadCounterSnapshot.hasData && |
|
|
|
|
unreadCounterSnapshot.data! > 0) ...[ |
|
|
|
|
Text( |
|
|
|
|
unreadCounterSnapshot.data!.toString(), |
|
|
|
|
style: TextStyle( |
|
|
|
@ -591,6 +598,10 @@ class _HomePageState extends State<HomePage> with tray.TrayListener, WindowListe
|
|
|
|
|
], |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
return Container(); |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|