overhaul using a trip struct that notifies its ui dependencies
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:anyway/structs/landmark.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
@@ -31,9 +32,10 @@ class _LandmarkCardState extends State<LandmarkCard> {
|
||||
height: double.infinity,
|
||||
// force a fixed width
|
||||
width: 160,
|
||||
child: Image.network(
|
||||
widget.landmark.imageURL ?? '',
|
||||
errorBuilder: (context, error, stackTrace) => Icon(Icons.question_mark_outlined),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: widget.landmark.imageURL ?? '',
|
||||
placeholder: (context, url) => CircularProgressIndicator(),
|
||||
errorWidget: (context, error, stackTrace) => Icon(Icons.question_mark_outlined),
|
||||
// TODO: make this a switch statement to load a placeholder if null
|
||||
// cover the whole container meaning the image will be cropped
|
||||
fit: BoxFit.cover,
|
||||
|
Reference in New Issue
Block a user