Skip to content

Commit 3baffc4

Browse files
committed
fix: use proper navigator when popping
1 parent 0c237e5 commit 3baffc4

3 files changed

Lines changed: 17 additions & 15 deletions

File tree

packages/flutter_catalog/lib/src/views/catalog_modify_view.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ class CatalogModifyView extends HookWidget {
110110
content: Text(localizations.itemCreatePageDeleteConfirmationMessage),
111111
actions: [
112112
TextButton(
113-
onPressed: () => navigator.pop(false),
113+
onPressed: () => Navigator.of(context).pop(false),
114114
child: Text(localizations.itemCreatePageDeleteConfirmationCancel),
115115
),
116116
TextButton(
117-
onPressed: () => navigator.pop(true),
117+
onPressed: () => Navigator.of(context).pop(true),
118118
child: Text(
119119
localizations.itemCreatePageDeleteConfirmationConfirm,
120120
style: TextStyle(color: Theme.of(context).colorScheme.error),

packages/flutter_catalog/lib/src/widgets/catalog_grid_item.dart

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,32 @@ class CatalogGridItem extends StatelessWidget {
3333
onTap: onTap,
3434
child: Card(
3535
clipBehavior: Clip.antiAlias,
36-
shape: RoundedRectangleBorder(
37-
borderRadius: BorderRadius.circular(16.0),
38-
),
39-
elevation: 0,
40-
color: colorScheme.surface,
4136
child: Column(
4237
crossAxisAlignment: CrossAxisAlignment.stretch,
4338
children: [
4439
if (item.imageUrls.isNotEmpty) ...[
4540
/// The item image, which expands to fill the available space.
4641
Expanded(
47-
child: CachedNetworkImage(
48-
imageUrl: item.imageUrls.first,
49-
fit: BoxFit.cover,
50-
placeholder: (context, url) =>
51-
const Center(child: CircularProgressIndicator.adaptive()),
52-
errorWidget: (context, url, error) =>
53-
const Icon(Icons.broken_image),
42+
child: Padding(
43+
padding: EdgeInsets.all(6.0),
44+
child: ClipRRect(
45+
borderRadius: BorderRadius.circular(12),
46+
child: CachedNetworkImage(
47+
imageUrl: item.imageUrls.first,
48+
fit: BoxFit.cover,
49+
placeholder: (context, url) => const Center(
50+
child: CircularProgressIndicator.adaptive()),
51+
errorWidget: (context, url, error) =>
52+
const Icon(Icons.broken_image),
53+
),
54+
),
5455
),
5556
),
5657
],
5758

5859
/// The details section at the bottom of the card.
5960
Padding(
60-
padding: const EdgeInsets.all(8.0),
61+
padding: const EdgeInsets.all(8.0).copyWith(bottom: 16.0),
6162
child: Column(
6263
crossAxisAlignment: CrossAxisAlignment.start,
6364
children: [

packages/flutter_catalog_rest_api/lib/src/rest_catalog_repository.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ class RestCatalogRepository<T extends CatalogItem>
167167
Future<void> deleteCatalogItem(String itemId) async {
168168
var deleteEndpoint = _baseEndpoint
169169
.child(deleteCatalogItemEndpoint)
170+
.withConverter(NoOpConverter())
170171
.authenticate()
171172
.withVariables({"id": itemId});
172173

0 commit comments

Comments
 (0)