Skip to content

Commit

Permalink
fix: species placeholder on search and add plant when external source…
Browse files Browse the repository at this point in the history
… used
  • Loading branch information
MDeLuise committed Oct 17, 2024
1 parent 2dc456c commit 905474c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 22 deletions.
3 changes: 2 additions & 1 deletion frontend/lib/plant_add/header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class _AddPlantImageHeaderState extends State<AddPlantImageHeader> {
@override
Widget build(BuildContext context) {
return CachedNetworkImage(
imageUrl: _url ?? "assets/images/no-image.png",
imageUrl:
_url ?? "${widget.env.http.backendUrl}image/content/non-existing-id",
httpHeaders: {
"Key": widget.env.http.key!,
},
Expand Down
3 changes: 2 additions & 1 deletion frontend/lib/search/header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class _SpeciesImageHeaderState extends State<SpeciesImageHeader> {
@override
Widget build(BuildContext context) {
return CachedNetworkImage(
imageUrl: _url ?? "assets/images/no-image.png",
imageUrl: _url ??
"${widget.env.http.backendUrl}image/content/non-existing-id",
httpHeaders: {
"Key": widget.env.http.key!,
},
Expand Down
31 changes: 11 additions & 20 deletions frontend/lib/search/search_result.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,34 +46,25 @@ class _SearchResultCardState extends State<SearchResultCard> {
@override
Widget build(BuildContext context) {
return CachedNetworkImage(
imageUrl: _url ?? "assets/images/no-image.png",
imageUrl: _url ??
"${widget.env.http.backendUrl}image/content/non-existing-id",
httpHeaders: {
"Key": widget.env.http.key!,
},
imageRenderMethodForWeb: ImageRenderMethodForWeb.HttpGet,
fit: BoxFit.cover,
placeholder: (context, url) => AspectRatio(
aspectRatio: 1,
placeholder: (context, url) => Skeletonizer(
effect: skeletonizerEffect,
enabled: true,
child: Container(
constraints: BoxConstraints(
maxHeight: MediaQuery.of(context).size.height * .4,
minHeight: MediaQuery.of(context).size.height * .4,
maxWidth: MediaQuery.of(context).size.height * .4,
),
child: Skeletonizer(
enabled: true,
effect: skeletonizerEffect,
child: Container(
constraints: BoxConstraints(
maxHeight: MediaQuery.of(context).size.height * .4,
minHeight: MediaQuery.of(context).size.height * .4,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
image: const DecorationImage(
image: AssetImage("assets/images/no-image.png"),
fit: BoxFit.cover,
),
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
image: const DecorationImage(
image: AssetImage("assets/images/no-image.png"),
fit: BoxFit.cover,
),
),
),
Expand Down

0 comments on commit 905474c

Please sign in to comment.