step 4 : home screen
This commit is contained in:
66
app_petty_cash/lib/screen/home/home_screen.dart
Normal file
66
app_petty_cash/lib/screen/home/home_screen.dart
Normal file
@@ -0,0 +1,66 @@
|
||||
import 'package:app_petty_cash/app/route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class HomeScreen extends StatelessWidget {
|
||||
const HomeScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('Home Screen'),
|
||||
),
|
||||
drawer: Drawer(
|
||||
child: ListView(
|
||||
padding: EdgeInsets.zero,
|
||||
children: [
|
||||
DrawerHeader(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.blue,
|
||||
),
|
||||
child: Text(
|
||||
'Drawer Header',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 24,
|
||||
),
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
title: Text('Home'),
|
||||
onTap: () {
|
||||
// Handle navigation to Home screen
|
||||
Navigator.pop(context);
|
||||
Navigator.pushNamed(context, homeRoute);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
title: Text('Transaksi'),
|
||||
onTap: () {
|
||||
// Handle navigation to Transaksi screen
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
title: Text('User'),
|
||||
onTap: () {
|
||||
// Handle navigation to User screen
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
title: Text('Logout'),
|
||||
onTap: () {
|
||||
// Handle logout logic
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
body: Center(
|
||||
child: Text('Home Screen Content'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -311,25 +311,28 @@ class BlockBodyV2 extends HookConsumerWidget {
|
||||
width: Constant.getActualXPhone(context: context, x: 320),
|
||||
height: Constant.getActualYPhone(context: context, y: 50),
|
||||
child: ElevatedButton(
|
||||
onPressed: (isSuccess.value == true)
|
||||
? () {}
|
||||
: () {
|
||||
if (ctrlUsername.text.isEmpty ||
|
||||
ctrlDokterId.text.isEmpty ||
|
||||
ctrlPassword.text.isEmpty) {
|
||||
isLoading.value = true;
|
||||
errorMessage.value = 'Inputan harus diisi';
|
||||
Timer(const Duration(seconds: 3), () {
|
||||
isLoading.value = false;
|
||||
errorMessage.value = "";
|
||||
});
|
||||
} else {
|
||||
ref.read(loginProvider.notifier).login(
|
||||
username: ctrlUsername.text,
|
||||
dokterId: ctrlDokterId.text,
|
||||
password: ctrlPassword.text);
|
||||
}
|
||||
},
|
||||
onPressed: () {
|
||||
Navigator.of(context).pushNamed(homeRoute);
|
||||
},
|
||||
// onPressed: (isSuccess.value == true)
|
||||
// ? () {}
|
||||
// : () {
|
||||
// if (ctrlUsername.text.isEmpty ||
|
||||
// ctrlDokterId.text.isEmpty ||
|
||||
// ctrlPassword.text.isEmpty) {
|
||||
// isLoading.value = true;
|
||||
// errorMessage.value = 'Inputan harus diisi';
|
||||
// Timer(const Duration(seconds: 3), () {
|
||||
// isLoading.value = false;
|
||||
// errorMessage.value = "";
|
||||
// });
|
||||
// } else {
|
||||
// ref.read(loginProvider.notifier).login(
|
||||
// username: ctrlUsername.text,
|
||||
// dokterId: ctrlDokterId.text,
|
||||
// password: ctrlPassword.text);
|
||||
// }
|
||||
// },
|
||||
style: ButtonStyle(
|
||||
backgroundColor: MaterialStateColor.resolveWith((st) =>
|
||||
(isSuccess.value == true)
|
||||
|
||||
10
app_petty_cash/lib/screen/transaksi/transaksi_screen.dart
Normal file
10
app_petty_cash/lib/screen/transaksi/transaksi_screen.dart
Normal file
@@ -0,0 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class TransaksiScreen extends StatelessWidget {
|
||||
const TransaksiScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Placeholder();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user