Skip to content

Commit

Permalink
fix: 23/01/2024 14:32
Browse files Browse the repository at this point in the history
  • Loading branch information
monkey111111111 committed Jan 23, 2024
1 parent 8a399ac commit 89778e1
Show file tree
Hide file tree
Showing 20 changed files with 416 additions and 415 deletions.
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class MyApp extends StatelessWidget {
return MaterialApp(
debugShowCheckedModeBanner: false,
// home: Login(),
home: DashboardScreen(),
home: const DashboardScreen(),
navigatorKey: navigatorKey,
);
}
Expand Down
2 changes: 2 additions & 0 deletions lib/model/ModelQuery.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: file_names

class ModelQuery {
String key;
dynamic value;
Expand Down
12 changes: 6 additions & 6 deletions lib/screens/autentikasi/login/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ class Login extends StatelessWidget {
body: Container(
color: Colors.blue.shade700,
child: Center(
child: Container(
child: SizedBox(
width: 0.3.w,
height: 0.5.h,
child: Card(
elevation: 8,
child: Padding(
padding: const EdgeInsets.all(24),
child: Column(children: [
Center(
const Center(
child: TextWidget(
"Masuk",
fontSize: 24,
fontWeight: FontWeight.bold,
)),
V(8),
TextWidget("Silahkan login terlebih dahulu"),
const TextWidget("Silahkan login terlebih dahulu"),
V(48),
TextfieldComponent(
hintText: "Email",
Expand All @@ -50,19 +50,19 @@ class Login extends StatelessWidget {
type: TypeTextField.password,
),
V(32),
Container(
SizedBox(
width: 100,
child: ButtonElevatedWidget(
"Masuk",
onPressed: () async {
try {
final emailTxt = emailController.text;
final passTxt = passController.text;
print("$emailTxt => $passTxt");
await fs.signInWithEmailAndPassword(
emailTxt, passTxt);
navigatePush(DashboardScreen());
navigatePush(const DashboardScreen());
} catch (e) {
// ignore: use_build_context_synchronously
context.showFastSnackbar("$e",
color: TypeFastSnackbar.error);
}
Expand Down
25 changes: 12 additions & 13 deletions lib/screens/buku_tamu/buku_tamu.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

class BukuTamu extends StatefulWidget {
const BukuTamu({Key? key}) : super(key: key);
Expand All @@ -23,8 +22,8 @@ class _BukuTamuState extends State<BukuTamu> {
return Expanded(
child: Column(
children: [
Padding(
padding: const EdgeInsets.only(
const Padding(
padding: EdgeInsets.only(
left: 20, right: 20, top: 30, bottom: 10),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
Expand All @@ -39,7 +38,7 @@ class _BukuTamuState extends State<BukuTamu> {
),
),
Padding(
padding: EdgeInsets.only(
padding: const EdgeInsets.only(
left: 10, right: 10, bottom: 40, top: 15),
child: Column(
children: [
Expand All @@ -49,7 +48,7 @@ class _BukuTamuState extends State<BukuTamu> {
headingRowColor:
MaterialStateProperty.resolveWith(
(states) => Colors.blue.shade200),
columns: [
columns: const [
DataColumn(label: Text("No anggota")),
DataColumn(label: Text("Nama")),
DataColumn(label: Text("Alamat")),
Expand All @@ -63,29 +62,29 @@ class _BukuTamuState extends State<BukuTamu> {
snapshot.data!.docs[index];

return DataRow(cells: [
DataCell(Container(
DataCell(SizedBox(
width: sizeColumn,
child: Text(data['no_anggota']))),
DataCell(Container(
DataCell(SizedBox(
width: sizeColumn,
child: Text(data['nama']))),
DataCell(Container(
DataCell(SizedBox(
width: sizeColumn,
child: Text(data['alamat']))),
DataCell(Container(
DataCell(SizedBox(
width: sizeColumn,
child: Text(data['tanggal']))),
DataCell(Container(
DataCell(SizedBox(
width: sizeColumn,
child: Text(data['pekerjaan']))),
DataCell(Container(
DataCell(SizedBox(
width: sizeColumn,
child: Text(data['noHp']))),
]);
})),
),
//Now let's set the pagination
SizedBox(
const SizedBox(
height: 40.0,
),
],
Expand All @@ -95,7 +94,7 @@ class _BukuTamuState extends State<BukuTamu> {
),
);
} else {
return Expanded(
return const Expanded(
child: Center(child: CircularProgressIndicator()),
);
}
Expand Down
174 changes: 85 additions & 89 deletions lib/screens/dashboard_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,108 +24,104 @@ class _DashboardScreenState extends State<DashboardScreen> {
body: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: NavigationRail(
leading: Container(
child: Container(
margin: EdgeInsets.only(top: 5, bottom: 2),
child: Wrap(direction: Axis.vertical, children: [
Wrap(
spacing: 5.0,
runSpacing: 3.0,
direction: Axis.horizontal,
NavigationRail(
leading: Container(
margin: const EdgeInsets.only(top: 5, bottom: 2),
child: Wrap(direction: Axis.vertical, children: [
Wrap(
spacing: 5.0,
runSpacing: 3.0,
direction: Axis.horizontal,
children: [
CircleAvatar(
backgroundColor: Colors.white,
backgroundImage: AssetImage(gambar.logo),
),
const Wrap(
direction: Axis.vertical,
children: [
CircleAvatar(
backgroundColor: Colors.white,
backgroundImage: AssetImage(gambar.logo),
Text(
'Perpustakaan Wilayah',
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.w600,
color: Colors.white,
),
),
Wrap(
direction: Axis.vertical,
children: [
Text(
'Perpustakaan Wilayah',
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.w600,
color: Colors.white,
),
),
Text(
'Sulawesi Selatan',
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.w600,
color: Colors.white,
),
),
],
Text(
'Sulawesi Selatan',
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.w600,
color: Colors.white,
),
),
],
),
SizedBox(
height: 40,
width: 200,
child: Divider(color: Colors.white),
),
]),
],
),
const SizedBox(
height: 40,
width: 200,
child: Divider(color: Colors.white),
),
]),
),
extended: isExpanded,
backgroundColor: Colors.blue.shade700,
unselectedIconTheme:
const IconThemeData(color: Colors.white, opacity: 1),
unselectedLabelTextStyle: const TextStyle(
color: Colors.white,
),
selectedIconTheme: IconThemeData(color: Colors.blue.shade300),
onDestinationSelected: (value) {
setState(() {
index = value;
});
},
destinations: const [
NavigationRailDestination(
icon: Icon(Icons.qr_code),
label: Text("Scan"),
),
extended: isExpanded,
backgroundColor: Colors.blue.shade700,
unselectedIconTheme:
IconThemeData(color: Colors.white, opacity: 1),
unselectedLabelTextStyle: TextStyle(
color: Colors.white,
NavigationRailDestination(
icon: Icon(Icons.book),
label: Text("Data Buku"),
),
selectedIconTheme: IconThemeData(color: Colors.blue.shade300),
onDestinationSelected: (value) {
setState(() {
index = value;
});
},
destinations: [
NavigationRailDestination(
icon: Icon(Icons.qr_code),
label: Text("Scan"),
),
NavigationRailDestination(
icon: Icon(Icons.book),
label: Text("Data Buku"),
),
NavigationRailDestination(
icon: Icon(Icons.bookmark_remove),
label: Text("Peminjaman"),
),
// NavigationRailDestination(
// icon: Icon(Icons.person),
// label: Text("Profile"),
// ),
NavigationRailDestination(
icon: Icon(Icons.bookmark_add),
label: Text("Pengembalian"),
),
NavigationRailDestination(
icon: Icon(Icons.menu_book),
label: Text("Buku tamu"),
),
NavigationRailDestination(
icon: Icon(Icons.group),
label: Text("Data Anggota"),
),
],
selectedIndex: index),
),
NavigationRailDestination(
icon: Icon(Icons.bookmark_remove),
label: Text("Peminjaman"),
),
// NavigationRailDestination(
// icon: Icon(Icons.person),
// label: Text("Profile"),
// ),
NavigationRailDestination(
icon: Icon(Icons.bookmark_add),
label: Text("Pengembalian"),
),
NavigationRailDestination(
icon: Icon(Icons.menu_book),
label: Text("Buku tamu"),
),
NavigationRailDestination(
icon: Icon(Icons.group),
label: Text("Data Anggota"),
),
],
selectedIndex: index),
index == 0
? Scan()
? const Scan()
: index == 1
? DataBuku()
? const DataBuku()
: index == 2
? Peminjaman()
? const Peminjaman()
: index == 3
? Pengembalian()
? const Pengembalian()
: index == 4
? BukuTamu()
: DataAnggota()
? const BukuTamu()
: const DataAnggota()
],
),
);
Expand Down
Loading

0 comments on commit 89778e1

Please sign in to comment.