Skip to content

Commit

Permalink
fix: 17/01/2024 20:53
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomjerry12345 committed Jan 17, 2024
1 parent fb3b1af commit 6b1ca86
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 46 deletions.
6 changes: 4 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:admin_perpustakaan/screens/autentikasi/login/login.dart';
// import 'package:admin_perpustakaan/screens/autentikasi/login/login.dart';
import 'package:admin_perpustakaan/screens/dashboard_screen.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:admin_perpustakaan/utils/global_utils.dart';
Expand All @@ -24,7 +25,8 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Login(),
// home: Login(),
home: DashboardScreen(),
navigatorKey: navigatorKey,
);
}
Expand Down
93 changes: 52 additions & 41 deletions lib/screens/buku_tamu/buku_tamu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class BukuTamu extends StatefulWidget {
class _BukuTamuState extends State<BukuTamu> {
FirebaseFirestore firestore = FirebaseFirestore.instance;

final double sizeColumn = 200;

@override
Widget build(BuildContext context) {
return StreamBuilder<QuerySnapshot>(
Expand All @@ -36,48 +38,57 @@ class _BukuTamuState extends State<BukuTamu> {
],
),
),
Card(
color: Colors.black54,
child: Padding(
padding: EdgeInsets.only(
left: 10, right: 10, bottom: 40, top: 15),
child: Column(
children: [
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: DataTable(
headingRowColor:
MaterialStateProperty.resolveWith(
(states) => Colors.blue.shade200),
columns: [
DataColumn(label: Text("No anggota")),
DataColumn(label: Text("Nama")),
DataColumn(label: Text("Alamat")),
DataColumn(label: Text("Tanggal berkunjung")),
DataColumn(label: Text("Pekerjaan")),
DataColumn(label: Text("No Hp")),
],
rows: List<DataRow>.generate(
snapshot.data!.docs.length, (index) {
DocumentSnapshot data =
snapshot.data!.docs[index];
Padding(
padding: EdgeInsets.only(
left: 10, right: 10, bottom: 40, top: 15),
child: Column(
children: [
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: DataTable(
headingRowColor:
MaterialStateProperty.resolveWith(
(states) => Colors.blue.shade200),
columns: [
DataColumn(label: Text("No anggota")),
DataColumn(label: Text("Nama")),
DataColumn(label: Text("Alamat")),
DataColumn(label: Text("Tanggal berkunjung")),
DataColumn(label: Text("Pekerjaan")),
DataColumn(label: Text("No Hp")),
],
rows: List<DataRow>.generate(
snapshot.data!.docs.length, (index) {
DocumentSnapshot data =
snapshot.data!.docs[index];

return DataRow(cells: [
DataCell(Text(data['no_anggota'])),
DataCell(Text(data['nama'])),
DataCell(Text(data['alamat'])),
DataCell(Text(data['tanggal'])),
DataCell(Text(data['pekerjaan'])),
DataCell(Text(data['noHp'])),
]);
})),
),
//Now let's set the pagination
SizedBox(
height: 40.0,
),
],
),
return DataRow(cells: [
DataCell(Container(
width: sizeColumn,
child: Text(data['no_anggota']))),
DataCell(Container(
width: sizeColumn,
child: Text(data['nama']))),
DataCell(Container(
width: sizeColumn,
child: Text(data['alamat']))),
DataCell(Container(
width: sizeColumn,
child: Text(data['tanggal']))),
DataCell(Container(
width: sizeColumn,
child: Text(data['pekerjaan']))),
DataCell(Container(
width: sizeColumn,
child: Text(data['noHp']))),
]);
})),
),
//Now let's set the pagination
SizedBox(
height: 40.0,
),
],
),
),
],
Expand Down
6 changes: 3 additions & 3 deletions lib/screens/dashboard_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,19 @@ class _DashboardScreenState extends State<DashboardScreen> {
label: Text("Data Buku"),
),
NavigationRailDestination(
icon: Icon(Icons.book),
icon: Icon(Icons.bookmark_remove),
label: Text("Peminjaman"),
),
// NavigationRailDestination(
// icon: Icon(Icons.person),
// label: Text("Profile"),
// ),
NavigationRailDestination(
icon: Icon(Icons.library_books),
icon: Icon(Icons.bookmark_add),
label: Text("Pengembalian"),
),
NavigationRailDestination(
icon: Icon(Icons.menu),
icon: Icon(Icons.menu_book),
label: Text("Buku tamu"),
),
NavigationRailDestination(
Expand Down

0 comments on commit 6b1ca86

Please sign in to comment.