Skip to content

Commit

Permalink
1箇所でしか参照していなかったので直接ref.watchを書くように修正
Browse files Browse the repository at this point in the history
  • Loading branch information
naokiwakata committed Aug 6, 2023
1 parent ba938f7 commit 8dc3c4a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class _FirebaseStorageSampleState
final controller = ref.watch(firebaseStorageControllerProvider);
final pickedImageFile = ref.watch(pickedImageFileStateProvider);
final uploadedImageUrl = ref.watch(uploadedImageUrlStateProvider);
final uploadedImagePath = ref.watch(uploadedImagePathStateProvider);

return Scaffold(
appBar: AppBar(
Expand Down Expand Up @@ -98,7 +97,9 @@ class _FirebaseStorageSampleState
Column(
children: [
ElevatedButton(
onPressed: () => controller.deleteImage(uploadedImagePath),
onPressed: () => controller.deleteImage(
ref.watch(uploadedImagePathStateProvider),
),
child: const Text('DELETE'),
),
Text(uploadedImageUrl),
Expand Down

0 comments on commit 8dc3c4a

Please sign in to comment.