|
|
@ -127,14 +127,6 @@ class _HomePageState extends State<HomePage> { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Future _openSettings() async { |
|
|
|
|
|
|
|
await Navigator.of(context).push( |
|
|
|
|
|
|
|
MaterialPageRoute( |
|
|
|
|
|
|
|
builder: (final context) => const SettingsPage(), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Future _openNotifications( |
|
|
|
Future _openNotifications( |
|
|
|
final NotificationsAppInterface app, |
|
|
|
final NotificationsAppInterface app, |
|
|
|
final List<Account> accounts, |
|
|
|
final List<Account> accounts, |
|
|
@ -208,7 +200,8 @@ class _HomePageState extends State<HomePage> { |
|
|
|
final account = accounts.find(_account.id)!; |
|
|
|
final account = accounts.find(_account.id)!; |
|
|
|
|
|
|
|
|
|
|
|
final isQuickBar = navigationMode == NavigationMode.quickBar; |
|
|
|
final isQuickBar = navigationMode == NavigationMode.quickBar; |
|
|
|
final drawer = Drawer( |
|
|
|
final drawer = Builder( |
|
|
|
|
|
|
|
builder: (final context) => Drawer( |
|
|
|
width: isQuickBar ? kQuickBarWidth : null, |
|
|
|
width: isQuickBar ? kQuickBarWidth : null, |
|
|
|
child: Container( |
|
|
|
child: Container( |
|
|
|
padding: isQuickBar ? const EdgeInsets.all(5) : null, |
|
|
|
padding: isQuickBar ? const EdgeInsets.all(5) : null, |
|
|
@ -270,15 +263,18 @@ class _HomePageState extends State<HomePage> { |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
if (capabilities.data != null) ...[ |
|
|
|
if (capabilities.data != null) ...[ |
|
|
|
if (capabilities.data!.capabilities.theming?.name != null) ...[ |
|
|
|
if (capabilities.data!.capabilities.theming?.name != |
|
|
|
|
|
|
|
null) ...[ |
|
|
|
Text( |
|
|
|
Text( |
|
|
|
capabilities.data!.capabilities.theming!.name!, |
|
|
|
capabilities.data!.capabilities.theming!.name!, |
|
|
|
style: DefaultTextStyle.of(context).style.copyWith( |
|
|
|
style: DefaultTextStyle.of(context).style.copyWith( |
|
|
|
color: Theme.of(context).appBarTheme.foregroundColor, |
|
|
|
color: |
|
|
|
|
|
|
|
Theme.of(context).appBarTheme.foregroundColor, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
if (capabilities.data!.capabilities.theming?.logo != null) ...[ |
|
|
|
if (capabilities.data!.capabilities.theming?.logo != |
|
|
|
|
|
|
|
null) ...[ |
|
|
|
Flexible( |
|
|
|
Flexible( |
|
|
|
child: NeonCachedUrlImage( |
|
|
|
child: NeonCachedUrlImage( |
|
|
|
url: capabilities.data!.capabilities.theming!.logo!, |
|
|
|
url: capabilities.data!.capabilities.theming!.logo!, |
|
|
@ -309,8 +305,9 @@ class _HomePageState extends State<HomePage> { |
|
|
|
child: NeonAccountTile( |
|
|
|
child: NeonAccountTile( |
|
|
|
account: account, |
|
|
|
account: account, |
|
|
|
dense: true, |
|
|
|
dense: true, |
|
|
|
textColor: |
|
|
|
textColor: Theme.of(context) |
|
|
|
Theme.of(context).appBarTheme.foregroundColor, |
|
|
|
.appBarTheme |
|
|
|
|
|
|
|
.foregroundColor, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
) |
|
|
|
) |
|
|
@ -380,13 +377,11 @@ class _HomePageState extends State<HomePage> { |
|
|
|
minLeadingWidth: 0, |
|
|
|
minLeadingWidth: 0, |
|
|
|
onTap: () async { |
|
|
|
onTap: () async { |
|
|
|
await _appsBloc.setActiveApp(appImplementation.id); |
|
|
|
await _appsBloc.setActiveApp(appImplementation.id); |
|
|
|
if (navigationMode == NavigationMode.drawer) { |
|
|
|
|
|
|
|
// Don't pop when the drawer is always shown |
|
|
|
|
|
|
|
if (!mounted) { |
|
|
|
if (!mounted) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
Navigator.of(context).pop(); |
|
|
|
Scaffold.maybeOf(context)?.closeDrawer(); |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
); |
|
|
|
); |
|
|
|
}, |
|
|
|
}, |
|
|
@ -399,7 +394,7 @@ class _HomePageState extends State<HomePage> { |
|
|
|
), |
|
|
|
), |
|
|
|
if (isQuickBar) ...[ |
|
|
|
if (isQuickBar) ...[ |
|
|
|
IconButton( |
|
|
|
IconButton( |
|
|
|
onPressed: _openSettings, |
|
|
|
onPressed: () => const SettingsRoute().go(context), |
|
|
|
tooltip: AppLocalizations.of(context).settings, |
|
|
|
tooltip: AppLocalizations.of(context).settings, |
|
|
|
icon: Icon( |
|
|
|
icon: Icon( |
|
|
|
Icons.settings, |
|
|
|
Icons.settings, |
|
|
@ -413,16 +408,15 @@ class _HomePageState extends State<HomePage> { |
|
|
|
leading: const Icon(Icons.settings), |
|
|
|
leading: const Icon(Icons.settings), |
|
|
|
minLeadingWidth: 0, |
|
|
|
minLeadingWidth: 0, |
|
|
|
onTap: () async { |
|
|
|
onTap: () async { |
|
|
|
if (navigationMode == NavigationMode.drawer) { |
|
|
|
Scaffold.maybeOf(context)?.closeDrawer(); |
|
|
|
Navigator.of(context).pop(); |
|
|
|
const SettingsRoute().go(context); |
|
|
|
} |
|
|
|
|
|
|
|
await _openSettings(); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
return Row( |
|
|
|
return Row( |
|
|
@ -524,15 +518,8 @@ class _HomePageState extends State<HomePage> { |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
IconButton( |
|
|
|
IconButton( |
|
|
|
onPressed: () async { |
|
|
|
onPressed: () { |
|
|
|
await Navigator.of(context).push( |
|
|
|
AccountSettingsRoute(accountid: account.id).go(context); |
|
|
|
MaterialPageRoute( |
|
|
|
|
|
|
|
builder: (final context) => AccountSettingsPage( |
|
|
|
|
|
|
|
bloc: _accountsBloc, |
|
|
|
|
|
|
|
account: account, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
tooltip: AppLocalizations.of(context).settingsAccount, |
|
|
|
tooltip: AppLocalizations.of(context).settingsAccount, |
|
|
|
icon: IntrinsicWidth( |
|
|
|
icon: IntrinsicWidth( |
|
|
|