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. 39
      packages/neon/neon/lib/src/pages/home.dart
  2. 2
      packages/neon/neon_notifications/lib/pages/main.dart

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

@ -132,25 +132,30 @@ class _HomePageState extends State<HomePage> {
final List<Account> accounts, final List<Account> accounts,
final Account account, final Account account,
) async { ) async {
final page = Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
title: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(app.name(context)),
if (accounts.length > 1) ...[
Text(
account.client.humanReadableID,
style: Theme.of(context).textTheme.bodySmall,
),
],
],
),
),
body: app.page,
);
await Navigator.of(context).push( await Navigator.of(context).push(
MaterialPageRoute( MaterialPageRoute(
builder: (final context) => Scaffold( builder: (final context) => Provider<NotificationsBlocInterface>(
resizeToAvoidBottomInset: false, create: (final context) => app.getBloc(account),
appBar: AppBar( child: page,
title: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(app.name(context)),
if (accounts.length > 1) ...[
Text(
account.client.humanReadableID,
style: Theme.of(context).textTheme.bodySmall,
),
],
],
),
),
body: app.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