From 5e33b2072568ad0a4d99d9be91dac13c8e540f18 Mon Sep 17 00:00:00 2001 From: tomjerry Date: Sun, 1 Oct 2023 21:34:00 +0800 Subject: [PATCH] 01/10/2023 --- lib/screens/data_buku/data_buku.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/screens/data_buku/data_buku.dart b/lib/screens/data_buku/data_buku.dart index a4a1a58..94a4181 100644 --- a/lib/screens/data_buku/data_buku.dart +++ b/lib/screens/data_buku/data_buku.dart @@ -1,4 +1,3 @@ -import 'dart:collection'; import 'dart:io'; import 'package:cloud_firestore/cloud_firestore.dart'; @@ -67,13 +66,17 @@ class _DataBukuState extends State { } Future addBooks(BuildContext context, Function setLoad) async { + SettableMetadata metadata = SettableMetadata( + contentType: 'image/jpg' + ); + setLoad(true); try { var snapshot = await FirebaseStorage.instance .ref() .child("images") .child('${DateTime.now()}-${judul}-${barcode}.jpg') - .putData(image); + .putData(image, metadata); var downloadUrl = await snapshot.ref.getDownloadURL(); var snapshotBuku = await FirebaseStorage.instance @@ -1006,7 +1009,7 @@ class _DataBukuState extends State { Container TextInput(String? label, bool? multiline, String? value, Function? onChanged) { return Container( margin: EdgeInsets.only(right: 20), - width: 250, + width: 230, child: Column( children: [ Row(