Skip to content

Commit

Permalink
Merge pull request #176 from JordyHers-org/bugfix/175-null-check-oper…
Browse files Browse the repository at this point in the history
…ator-on-nulll-value

fix(#175) : fix details throwing null exception
  • Loading branch information
JordyHers authored Oct 3, 2023
2 parents 29c3343 + 92c904d commit 5a17962
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 13 deletions.
9 changes: 6 additions & 3 deletions lib/app/pages/child_details_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,12 @@ class _ChildDetailsPageState extends State<ChildDetailsPage> {
return [
SliverAppBar(
actions: [
ClipOval(
child: Image.network(model.image!),
).p4
if (model.image != null)
ClipOval(
child: Image.network(model.image!),
).p4
else
const SizedBox.shrink()
],
elevation: 0.5,
shadowColor: CustomColors.indigoLight,
Expand Down
37 changes: 27 additions & 10 deletions lib/common_widgets/child_horizontal_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,34 @@ class Kids extends StatelessWidget {
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Container(
height: 120,
decoration: BoxDecoration(
color: Colors.black.withOpacity(0.14),
image: DecorationImage(
image: NetworkImage(imageLocation!),
fit: BoxFit.cover,
if (imageLocation != null)
Container(
height: 120,
decoration: BoxDecoration(
color: Colors.black.withOpacity(0.14),
image: DecorationImage(
image: NetworkImage(imageLocation!),
fit: BoxFit.cover,
),
borderRadius:
const BorderRadius.all(Radius.circular(16)),
),
borderRadius: const BorderRadius.all(Radius.circular(16)),
),
),
)
else
Container(
height: 120,
width: 120,
decoration: BoxDecoration(
color: Colors.black.withOpacity(0.14),
borderRadius: const BorderRadius.all(
Radius.circular(16),
),
),
child: const Icon(
Icons.person,
size: 40,
),
)
],
),
)
Expand Down

0 comments on commit 5a17962

Please sign in to comment.