Browse Source

neon: fix blocProvider of notifications app

pull/371/head
Nikolas Rimikis 1 year ago
parent
commit
81fd46a707
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 11
      packages/neon/neon/lib/src/pages/home.dart
  2. 2
      packages/neon/neon_notifications/lib/pages/main.dart

11
packages/neon/neon/lib/src/pages/home.dart

@ -132,9 +132,7 @@ class _HomePageState extends State<HomePage> {
final List<Account> accounts, final List<Account> accounts,
final Account account, final Account account,
) async { ) async {
await Navigator.of(context).push( final page = Scaffold(
MaterialPageRoute(
builder: (final context) => Scaffold(
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
appBar: AppBar( appBar: AppBar(
title: Column( title: Column(
@ -151,6 +149,13 @@ class _HomePageState extends State<HomePage> {
), ),
), ),
body: app.page, body: app.page,
);
await Navigator.of(context).push(
MaterialPageRoute(
builder: (final context) => Provider<NotificationsBlocInterface>(
create: (final context) => app.getBloc(account),
child: page,
), ),
), ),
); );

2
packages/neon/neon_notifications/lib/pages/main.dart

@ -16,7 +16,7 @@ class _NotificationsMainPageState extends State<NotificationsMainPage> {
void initState() { void initState() {
super.initState(); super.initState();
bloc = Provider.of<NotificationsBloc>(context, listen: false); bloc = Provider.of<NotificationsBlocInterface>(context, listen: false) as NotificationsBloc;
bloc.errors.listen((final error) { bloc.errors.listen((final error) {
NeonException.showSnackbar(context, error); NeonException.showSnackbar(context, error);

Loading…
Cancel
Save