Skip to content

Commit

Permalink
update: 02/06/2024
Browse files Browse the repository at this point in the history
  • Loading branch information
monkey111111111 committed Jun 2, 2024
1 parent 3873aba commit 612d414
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 87 deletions.
4 changes: 2 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Login(),
// home: const DashboardScreen(),
// home: Login(),
home: const DashboardScreen(),
navigatorKey: navigatorKey,
);
}
Expand Down
16 changes: 8 additions & 8 deletions lib/screens/dashboard_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
selectedIconTheme: IconThemeData(color: Colors.blue.shade300),
onDestinationSelected: (value) {
log("index", v: value);
if (value == 6) {
if (value == 5) {
navigatePushAndRemove(const Login());
}
setState(() {
Expand Down Expand Up @@ -109,10 +109,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
icon: Icon(Icons.bookmark_add),
label: Text("Pengembalian"),
),
NavigationRailDestination(
icon: Icon(Icons.menu_book),
label: Text("Buku tamu"),
),
// NavigationRailDestination(
// icon: Icon(Icons.menu_book),
// label: Text("Buku tamu"),
// ),
NavigationRailDestination(
icon: Icon(Icons.group),
label: Text("Data Anggota"),
Expand All @@ -131,9 +131,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
? const Peminjaman()
: index == 3
? const Pengembalian()
: index == 4
? const BukuTamu()
: const DataAnggota()
// : index == 4
// ? const BukuTamu()
: const DataAnggota()
],
),
);
Expand Down
156 changes: 79 additions & 77 deletions lib/screens/data_anggota/data_anggota.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,86 +60,88 @@ class _DataAnggotaState extends State<DataAnggota> {
if (snapshot.hasData) {
allData = snapshot.data!.docs;
return Expanded(
child: Column(
children: [
Padding(
padding: EdgeInsets.only(
left: 20, right: 20, top: 30, bottom: 10),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Data Anggota",
style: TextStyle(
fontSize: 25, fontWeight: FontWeight.w600),
),
Container(
height: 40,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(5)),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: Colors.greenAccent,
textStyle: const TextStyle(fontSize: 16)),
onPressed: () {
onExport();
},
child: const Text(
'Export',
style: TextStyle(color: Colors.white),
)),
),
],
child: SingleChildScrollView(
child: Column(
children: [
Padding(
padding: EdgeInsets.only(
left: 20, right: 20, top: 30, bottom: 10),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Data Anggota",
style: TextStyle(
fontSize: 25, fontWeight: FontWeight.w600),
),
Container(
height: 40,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(5)),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: Colors.greenAccent,
textStyle: const TextStyle(fontSize: 16)),
onPressed: () {
onExport();
},
child: const Text(
'Export',
style: TextStyle(color: Colors.white),
)),
),
],
),
),
),
Padding(
padding: const 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: const [
DataColumn(label: Text("No Anggota")),
DataColumn(label: Text("Nama")),
DataColumn(label: Text("Email")),
DataColumn(label: Text("Pekerjaan")),
DataColumn(label: Text("Alamat")),
DataColumn(label: Text("No Hp")),
DataColumn(label: Text("Nama Ibu")),
DataColumn(label: Text("No Hp Ibu")),
],
rows: List<DataRow>.generate(
snapshot.data!.docs.length, (index) {
DocumentSnapshot data =
snapshot.data!.docs[index];
Padding(
padding: const 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: const [
DataColumn(label: Text("No Anggota")),
DataColumn(label: Text("Nama")),
DataColumn(label: Text("Email")),
DataColumn(label: Text("Pekerjaan")),
DataColumn(label: Text("Alamat")),
DataColumn(label: Text("No Hp")),
DataColumn(label: Text("Nama Ibu")),
DataColumn(label: Text("No Hp Ibu")),
],
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['email'])),
DataCell(Text(data['pekerjaan'])),
DataCell(Text(data['alamat'])),
DataCell(Text(data['hp'])),
DataCell(Text(data['ibu_kandung'])),
DataCell(Text(data['no_hp_ibu_kandung'])),
]);
})),
),
//Now let's set the pagination
const SizedBox(
height: 40.0,
),
],
return DataRow(cells: [
DataCell(Text(data['no_anggota'])),
DataCell(Text(data['nama'])),
DataCell(Text(data['email'])),
DataCell(Text(data['pekerjaan'])),
DataCell(Text(data['alamat'])),
DataCell(Text(data['hp'])),
DataCell(Text(data['ibu_kandung'])),
DataCell(Text(data['no_hp_ibu_kandung'])),
]);
})),
),
//Now let's set the pagination
const SizedBox(
height: 40.0,
),
],
),
),
),
],
],
),
),
);
} else {
Expand Down

0 comments on commit 612d414

Please sign in to comment.