Skip to content

Commit

Permalink
01/10/2023
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjerry committed Oct 1, 2023
1 parent 482064a commit 5e33b20
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/screens/data_buku/data_buku.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'dart:collection';
import 'dart:io';

import 'package:cloud_firestore/cloud_firestore.dart';
Expand Down Expand Up @@ -67,13 +66,17 @@ class _DataBukuState extends State<DataBuku> {
}

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
Expand Down Expand Up @@ -1006,7 +1009,7 @@ class _DataBukuState extends State<DataBuku> {
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(
Expand Down

0 comments on commit 5e33b20

Please sign in to comment.