Skip to content

Commit

Permalink
fix: closes #429
Browse files Browse the repository at this point in the history
  • Loading branch information
lucien144 committed Feb 14, 2024
1 parent 75a4dfe commit 75b65c1
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions lib/pages/tab_bar/MailboxTab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import 'package:hive_flutter/hive_flutter.dart';

class MailboxTabArguments {
final int? mailId;

MailboxTabArguments({this.mailId});
}

Expand Down Expand Up @@ -55,22 +56,23 @@ class _MailboxTabState extends State<MailboxTab> {
SyntaxHighlighter.languageContext = '';
SkinColors colors = Skin.of(context).theme.colors;

MailboxTabArguments? tabArguments = ModalRoute.of(context)?.settings.arguments as MailboxTabArguments?;
MailboxTabArguments? tabArguments =
ModalRoute.of(context)?.settings.arguments is MailboxTabArguments ? ModalRoute.of(context)?.settings.arguments as MailboxTabArguments : null;

return CupertinoTabView(builder: (context) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
leading: Visibility(
visible: tabArguments?.mailId != null,
child: CupertinoNavigationBarBackButton(
color: colors.primary,
onPressed: () => Navigator.of(context, rootNavigator: true).pop(),
leading: Visibility(
visible: tabArguments?.mailId != null,
child: CupertinoNavigationBarBackButton(
color: colors.primary,
onPressed: () => Navigator.of(context, rootNavigator: true).pop(),
),
),
),
middle: Text(
'Pošta',
style: TextStyle(color: colors.text),
)),
'Pošta',
style: TextStyle(color: colors.text),
)),
child: Stack(children: [
PullToRefreshList(
rebuild: _refreshData,
Expand Down

0 comments on commit 75b65c1

Please sign in to comment.