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(