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