Skip to content

Commit

Permalink
fix: 17/3/2024 10:00
Browse files Browse the repository at this point in the history
  • Loading branch information
monkey111111111 committed Mar 17, 2024
1 parent acc3c62 commit 940d51f
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 85 deletions.
17 changes: 9 additions & 8 deletions lib/screens/buku_tamu/buku_tamu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class BukuTamu extends StatefulWidget {
}

class _BukuTamuState extends State<BukuTamu> {
final scrollController = ScrollController();
FirebaseFirestore firestore = FirebaseFirestore.instance;

final double sizeColumn = 200;
Expand Down Expand Up @@ -40,9 +41,13 @@ class _BukuTamuState extends State<BukuTamu> {
Padding(
padding: const EdgeInsets.only(
left: 10, right: 10, bottom: 40, top: 15),
child: Column(
children: [
SingleChildScrollView(
child: InteractiveViewer(
scaleEnabled: false,
// constrained: false,
child: Scrollbar(
controller: scrollController,
child: SingleChildScrollView(
controller: scrollController,
scrollDirection: Axis.horizontal,
child: DataTable(
headingRowColor:
Expand Down Expand Up @@ -88,11 +93,7 @@ class _BukuTamuState extends State<BukuTamu> {
]);
})),
),
//Now let's set the pagination
const SizedBox(
height: 40.0,
),
],
),
),
),
],
Expand Down
9 changes: 6 additions & 3 deletions lib/screens/data_buku/data_buku.dart
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ class _DataBukuState extends State<DataBuku> {
judul = data['judul_buku'];
pengarang = data['pengarang'];
penerbit = data['penerbit'];
tahunTerbit = "";
tahunTerbit = data["tahun_terbit"];
rak = data['rak'];
halaman = data['halaman'];
sinopsis = data['sinopsis'];
Expand All @@ -290,7 +290,7 @@ class _DataBukuState extends State<DataBuku> {
children: [
Container(
width: double.infinity,
height: 600,
height: 620,
padding: const EdgeInsets.all(20),
child: Column(
children: [
Expand Down Expand Up @@ -449,7 +449,10 @@ class _DataBukuState extends State<DataBuku> {
strokeWidth: 2.0,
color: Colors.white,
)
: const Text("Submit"),
: const Text(
"Submit",
style: TextStyle(color: Colors.white),
),
),
],
)
Expand Down
1 change: 0 additions & 1 deletion lib/screens/peminjaman/section/detail_peminjaman.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class _DetailPeminjamanState extends State<DetailPeminjaman> {

@override
Widget build(BuildContext context) {
log("id", v: widget.id);
return StreamBuilder<QuerySnapshot<Map<String, dynamic>>>(
stream: fs
.query("peminjaman", [ModelQuery(key: "email", value: widget.id)]),
Expand Down
160 changes: 87 additions & 73 deletions lib/screens/pengembalian/section/detail_pengembalian.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class DetailPengembalian extends StatefulWidget {
}

class _DetailPengembalianState extends State<DetailPengembalian> {
final scrollController = ScrollController();

final fs = FirebaseServices();
final time = Time();

Expand All @@ -36,82 +38,94 @@ class _DetailPengembalianState extends State<DetailPengembalian> {
final snapDocs = snapshot.data?.docs;
final size = snapshot.data!.size;

return DataTable(
headingRowColor: MaterialStateProperty.resolveWith(
(states) => Colors.blue.shade200),
columns: [
DataColumn(
label: TextWidget(
"No.",
fontSize: fontSizeDataCell,
)),
DataColumn(
label: TextWidget("Judul Buku",
fontSize: fontSizeDataCell,
fontWeight: FontWeight.bold)),
DataColumn(
label: TextWidget("Tgl Peminjaman",
fontSize: fontSizeDataCell,
fontWeight: FontWeight.bold)),
DataColumn(
label: TextWidget("Tgl Pengembalian",
fontSize: fontSizeDataCell,
fontWeight: FontWeight.bold)),
DataColumn(
label: TextWidget("Sisa hari",
fontSize: fontSizeDataCell,
fontWeight: FontWeight.bold)),
DataColumn(
label: TextWidget("Denda",
fontSize: fontSizeDataCell,
fontWeight: FontWeight.bold)),
DataColumn(
label: TextWidget("Gambar",
return InteractiveViewer(
scaleEnabled: false,
// constrained: false,
child: Scrollbar(
controller: scrollController,
child: SingleChildScrollView(
controller: scrollController,
scrollDirection: Axis.horizontal,
child: DataTable(
headingRowColor: MaterialStateProperty.resolveWith(
(states) => Colors.blue.shade200),
columns: [
DataColumn(
label: TextWidget(
"No.",
fontSize: fontSizeDataCell,
fontWeight: FontWeight.bold)),
// DataColumn(label: Text("")),
],
rows: List<DataRow>.generate(size, (index) {
Map<String, dynamic> data = snapDocs![index].data();
final number = index + 1;
)),
DataColumn(
label: TextWidget("Judul Buku",
fontSize: fontSizeDataCell,
fontWeight: FontWeight.bold)),
DataColumn(
label: TextWidget("Tgl Peminjaman",
fontSize: fontSizeDataCell,
fontWeight: FontWeight.bold)),
DataColumn(
label: TextWidget("Tgl Pengembalian",
fontSize: fontSizeDataCell,
fontWeight: FontWeight.bold)),
DataColumn(
label: TextWidget("Sisa hari",
fontSize: fontSizeDataCell,
fontWeight: FontWeight.bold)),
DataColumn(
label: TextWidget("Denda",
fontSize: fontSizeDataCell,
fontWeight: FontWeight.bold)),
DataColumn(
label: TextWidget("Gambar",
fontSize: fontSizeDataCell,
fontWeight: FontWeight.bold)),
// DataColumn(label: Text("")),
],
rows: List<DataRow>.generate(size, (index) {
Map<String, dynamic> data = snapDocs![index].data();
final number = index + 1;

return DataRow(cells: [
DataCell(Text(number.toString())),
DataCell(TextWidget(
data['judul_buku']!,
fontSize: fontSizeDataCell,
)),
DataCell(TextWidget(
data['tanggal_peminjaman']!,
fontSize: fontSizeDataCell,
)),
DataCell(TextWidget(
data['tanggal_pengembalian']!,
fontSize: fontSizeDataCell,
)),
return DataRow(cells: [
DataCell(Text(number.toString())),
DataCell(TextWidget(
data['judul_buku']!,
fontSize: fontSizeDataCell,
)),
DataCell(TextWidget(
data['tanggal_peminjaman']!,
fontSize: fontSizeDataCell,
)),
DataCell(TextWidget(
data['tanggal_pengembalian']!,
fontSize: fontSizeDataCell,
)),

DataCell(TextWidget(data['sisa_hari'] ?? "-",
color: Colors.black, fontSize: fontSizeDataCell)),
DataCell(TextWidget("${data['denda'] ?? "-"}",
fontSize: fontSizeDataCell)),
DataCell(Container(
padding: const EdgeInsets.symmetric(vertical: 8),
child: Image.network(
data["image"]!,
width: 50,
height: 100,
),
)),
// DataCell(ButtonElevatedWidget(
// "Hapus",
// fontSize: fontSizeDataCell,
// backgroundColor: Colors.red,
// onPressed: () {
// oHapus(id);
// },
// )),
]);
}));
DataCell(TextWidget(data['sisa_hari'] ?? "-",
color: Colors.black,
fontSize: fontSizeDataCell)),
DataCell(TextWidget("${data['denda'] ?? "-"}",
fontSize: fontSizeDataCell)),
DataCell(Container(
padding: const EdgeInsets.symmetric(vertical: 8),
child: Image.network(
data["image"]!,
width: 50,
height: 100,
),
)),
// DataCell(ButtonElevatedWidget(
// "Hapus",
// fontSize: fontSizeDataCell,
// backgroundColor: Colors.red,
// onPressed: () {
// oHapus(id);
// },
// )),
]);
})),
),
),
);
}

return const Expanded(
Expand Down

0 comments on commit 940d51f

Please sign in to comment.