Skip to content

Commit

Permalink
feat(neon_dashboard): Use custom background
Browse files Browse the repository at this point in the history
Signed-off-by: jld3103 <[email protected]>
  • Loading branch information
provokateurin committed Dec 22, 2023
1 parent 3ed148f commit 9fd27dd
Showing 1 changed file with 34 additions and 32 deletions.
66 changes: 34 additions & 32 deletions packages/neon/neon_dashboard/lib/src/pages/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,41 +16,43 @@ class DashboardMainPage extends StatelessWidget {
Widget build(final BuildContext context) {
final bloc = NeonProvider.of<DashboardBloc>(context);

return ResultBuilder.behaviorSubject(
subject: bloc.widgets,
builder: (final context, final snapshot) {
Widget? child;
if (snapshot.hasData) {
child = Wrap(
alignment: WrapAlignment.center,
spacing: 8,
runSpacing: 8,
children: snapshot.requireData.entries
.map(
(final widget) => DashboardWidget(
widget: widget.key,
items: widget.value,
),
)
.toList(),
);
}
return NeonCustomBackground(
child: ResultBuilder.behaviorSubject(
subject: bloc.widgets,
builder: (final context, final snapshot) {
Widget? child;
if (snapshot.hasData) {
child = Wrap(
alignment: WrapAlignment.center,
spacing: 8,
runSpacing: 8,
children: snapshot.requireData.entries
.map(
(final widget) => DashboardWidget(
widget: widget.key,
items: widget.value,
),
)
.toList(),
);
}

return Center(
child: NeonListView.custom(
scrollKey: 'dashboard',
isLoading: snapshot.isLoading,
error: snapshot.error,
onRefresh: bloc.refresh,
sliver: SliverFillRemaining(
hasScrollBody: false,
child: Center(
child: child,
return Center(
child: NeonListView.custom(
scrollKey: 'dashboard',
isLoading: snapshot.isLoading,
error: snapshot.error,
onRefresh: bloc.refresh,
sliver: SliverFillRemaining(
hasScrollBody: false,
child: Center(
child: child,
),
),
),
),
);
},
);
},
),
);
}
}

0 comments on commit 9fd27dd

Please sign in to comment.