step 16 : add M_CompanyID for trans, menu drawer, fix bug overflow btn
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
|
import '../screen/change_company/change_company.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import '../screen/home/home_screen.dart';
|
import '../screen/home/home_screen.dart';
|
||||||
|
import '../screen/transaksi/history_transaksi_screen.dart';
|
||||||
import '../screen/transaksi/transaksi_screen.dart';
|
import '../screen/transaksi/transaksi_screen.dart';
|
||||||
import '../screen/login/login_screen.dart';
|
import '../screen/login/login_screen.dart';
|
||||||
import '../screen/splash/splash_screen.dart';
|
import '../screen/splash/splash_screen.dart';
|
||||||
@@ -16,6 +17,8 @@ const homeRoute = "/homeRoute";
|
|||||||
const transaksiRoute = "/transaksiRoute";
|
const transaksiRoute = "/transaksiRoute";
|
||||||
const userRoute = "/userRoute";
|
const userRoute = "/userRoute";
|
||||||
const reportRoute = "/reportRoute";
|
const reportRoute = "/reportRoute";
|
||||||
|
const changeCompanyRoute = "/changeCompanyRoute";
|
||||||
|
const historyTransaksiRoute = "/historyTransaksiRoute";
|
||||||
|
|
||||||
// test screen
|
// test screen
|
||||||
const testFilePickerRoute = "/testFilePickerRoute";
|
const testFilePickerRoute = "/testFilePickerRoute";
|
||||||
@@ -35,6 +38,32 @@ class AppRoute {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// change Company
|
||||||
|
if (settings.name == changeCompanyRoute) {
|
||||||
|
return MaterialPageRoute(builder: (context) {
|
||||||
|
return MediaQuery(
|
||||||
|
data: MediaQuery.of(context).copyWith(
|
||||||
|
textScaleFactor: 1.0,
|
||||||
|
padding: EdgeInsets.all(0),
|
||||||
|
),
|
||||||
|
child: ChangeCompanyScreen(),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// history transaksi
|
||||||
|
if (settings.name == historyTransaksiRoute) {
|
||||||
|
return MaterialPageRoute(builder: (context) {
|
||||||
|
return MediaQuery(
|
||||||
|
data: MediaQuery.of(context).copyWith(
|
||||||
|
textScaleFactor: 1.0,
|
||||||
|
padding: EdgeInsets.all(0),
|
||||||
|
),
|
||||||
|
child: HistoryTransaksiScreen(),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// report screen
|
// report screen
|
||||||
if (settings.name == reportRoute) {
|
if (settings.name == reportRoute) {
|
||||||
return MaterialPageRoute(builder: (context) {
|
return MaterialPageRoute(builder: (context) {
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
import '../app/constant.dart';
|
import '../app/constant.dart';
|
||||||
import '../model/auth_model.dart';
|
import '../model/auth_model.dart';
|
||||||
import 'base_repository.dart';
|
import 'base_repository.dart';
|
||||||
|
|||||||
@@ -2,11 +2,33 @@ import 'dart:convert';
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
|
import '../app/constant.dart';
|
||||||
|
|
||||||
abstract class BaseRepository {
|
abstract class BaseRepository {
|
||||||
final Dio dio;
|
final Dio dio;
|
||||||
BaseRepository({required this.dio});
|
BaseRepository({required this.dio});
|
||||||
|
|
||||||
|
Future<String> getCompanyID() async {
|
||||||
|
final shared = await SharedPreferences.getInstance();
|
||||||
|
String M_CompanyID = "0";
|
||||||
|
|
||||||
|
if (shared != null) {
|
||||||
|
final bearerString = shared.get(Constant.bearerName).toString();
|
||||||
|
final xmodel = jsonDecode(bearerString);
|
||||||
|
if (xmodel != null) {
|
||||||
|
M_CompanyID = xmodel["model"]["M_CompanyID"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (M_CompanyID == "0") {
|
||||||
|
throw BaseRepositoryException(message: 'Invalid Company ID');
|
||||||
|
}
|
||||||
|
|
||||||
|
return M_CompanyID;
|
||||||
|
}
|
||||||
|
|
||||||
Future<Map<String, dynamic>> post({
|
Future<Map<String, dynamic>> post({
|
||||||
required Map<String, dynamic> param,
|
required Map<String, dynamic> param,
|
||||||
required String service,
|
required String service,
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ class TransaksiRepository extends BaseRepository {
|
|||||||
String sender,
|
String sender,
|
||||||
String url) async {
|
String url) async {
|
||||||
String paramPostInUrl = "";
|
String paramPostInUrl = "";
|
||||||
|
String M_CompanyID = await getCompanyID();
|
||||||
if (tipe == "DEBIT") {
|
if (tipe == "DEBIT") {
|
||||||
sender = "";
|
sender = "";
|
||||||
paramPostInUrl =
|
paramPostInUrl =
|
||||||
@@ -69,6 +70,8 @@ class TransaksiRepository extends BaseRepository {
|
|||||||
"?tanggal=$tanggal&tipe=$tipe&kategoriid=$kategoriid&jumlah=$jumlah&catatan=$catatan&url=$url&userid=$userid&sender=$sender";
|
"?tanggal=$tanggal&tipe=$tipe&kategoriid=$kategoriid&jumlah=$jumlah&catatan=$catatan&url=$url&userid=$userid&sender=$sender";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
paramPostInUrl += "&companyid=$M_CompanyID";
|
||||||
// /?tanggal=2023-12-29&tipe=KREDIT&kategoriid=3&jumlah=5000&catatan=Lakban%20Besar&url=&userid=1&sender=
|
// /?tanggal=2023-12-29&tipe=KREDIT&kategoriid=3&jumlah=5000&catatan=Lakban%20Besar&url=&userid=1&sender=
|
||||||
|
|
||||||
final service =
|
final service =
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ class ChangeCompanyScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
drawer: CustomDrawer(),
|
drawer: CustomDrawer(),
|
||||||
|
body: Text('Under Construction'),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
import '../../widget/sankbar_widget.dart';
|
import '../../widget/sankbar_widget.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
@@ -25,6 +29,26 @@ class ReportScreen extends HookConsumerWidget {
|
|||||||
|
|
||||||
final tglAkhir = useState<DateTime>(DateTime.now());
|
final tglAkhir = useState<DateTime>(DateTime.now());
|
||||||
final tglAkhirTmp = useState<String>("");
|
final tglAkhirTmp = useState<String>("");
|
||||||
|
String M_CompanyID = "0";
|
||||||
|
|
||||||
|
Future<String> getCompanyID() async {
|
||||||
|
final shared = await SharedPreferences.getInstance();
|
||||||
|
String M_CompanyID = "0";
|
||||||
|
|
||||||
|
if (shared != null) {
|
||||||
|
final bearerString = shared.get(Constant.bearerName).toString();
|
||||||
|
final xmodel = jsonDecode(bearerString);
|
||||||
|
if (xmodel != null) {
|
||||||
|
M_CompanyID = xmodel["model"]["M_CompanyID"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (M_CompanyID == "0") {
|
||||||
|
// throw BaseRepositoryException(message: 'Invalid Company ID');
|
||||||
|
}
|
||||||
|
|
||||||
|
return M_CompanyID;
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() {
|
useEffect(() {
|
||||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
|
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
|
||||||
@@ -58,355 +82,361 @@ class ReportScreen extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
drawer: CustomDrawer(),
|
drawer: CustomDrawer(),
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: SingleChildScrollView(
|
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsets.all(20),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'Tanggal Awal',
|
|
||||||
style: Constant.body1(context: context).copyWith(
|
|
||||||
fontWeight: FontWeight.w600, color: Constant.textBlack),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: Constant.getActualYPhone(context: context, y: 10),
|
|
||||||
),
|
|
||||||
// Tanggal Awal
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: TextField(
|
|
||||||
controller: ctrlTglAwal,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
hintStyle:
|
|
||||||
Constant.body2_400(context: context).copyWith(
|
|
||||||
color: Colors.orange,
|
|
||||||
),
|
|
||||||
labelStyle:
|
|
||||||
Constant.body2_400(context: context).copyWith(
|
|
||||||
color: Colors.orange,
|
|
||||||
),
|
|
||||||
border: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: Colors.orange,
|
|
||||||
width: 1,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: Colors.orange,
|
|
||||||
width: 1,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
// labelText: "Tanggal Awal",
|
|
||||||
hintText: 'Tanggal Awal',
|
|
||||||
// suffixIcon: isLoadingFilterScope.value
|
|
||||||
// ? SizedBox(
|
|
||||||
// width: Constant.getActualXPhone(
|
|
||||||
// context: context,
|
|
||||||
// x: 4,
|
|
||||||
// ),
|
|
||||||
// height: Constant.getActualYPhone(
|
|
||||||
// context: context,
|
|
||||||
// y: 4,
|
|
||||||
// ),
|
|
||||||
// child: CircularProgressIndicator(
|
|
||||||
// color: Constant.textRed,
|
|
||||||
// ),
|
|
||||||
// )
|
|
||||||
// : Icon(
|
|
||||||
// Icons.calendar_month_sharp,
|
|
||||||
// color: Constant.colorIconDate,
|
|
||||||
// ),
|
|
||||||
),
|
|
||||||
onTap: () async {
|
|
||||||
final selectedDateAwal = await showDatePicker(
|
|
||||||
// locale: const Locale("en-CA"),
|
|
||||||
// locale: ,
|
|
||||||
context: context,
|
|
||||||
initialEntryMode:
|
|
||||||
DatePickerEntryMode.calendarOnly,
|
|
||||||
firstDate: DateTime(2000),
|
|
||||||
lastDate: DateTime(2100),
|
|
||||||
|
|
||||||
initialDate: (ctrlTglAwal.text.isEmpty)
|
|
||||||
? DateTime.now()
|
|
||||||
: tglAwal.value,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (selectedDateAwal != null) {
|
|
||||||
String formattedDate = DateFormat('dd-MM-yyyy')
|
|
||||||
.format(selectedDateAwal);
|
|
||||||
// ctrlTglAwal.text =
|
|
||||||
// selectedDateAwal.toString().split(' ')[0];
|
|
||||||
ctrlTglAwal.text = formattedDate;
|
|
||||||
tglAwal.value = selectedDateAwal;
|
|
||||||
tglAwalTmp.value = selectedDateAwal.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (selectedDateAwal == null) {
|
|
||||||
print('cancel button');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
|
|
||||||
SizedBox(
|
|
||||||
height: Constant.getActualYPhone(context: context, y: 20),
|
|
||||||
),
|
|
||||||
|
|
||||||
Text(
|
|
||||||
'Tanggal Akhir',
|
|
||||||
style: Constant.body1(context: context).copyWith(
|
|
||||||
fontWeight: FontWeight.w600, color: Constant.textBlack),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: Constant.getActualYPhone(context: context, y: 10),
|
|
||||||
),
|
|
||||||
// Tanggal Akhir
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: TextField(
|
|
||||||
controller: ctrlTglAkhir,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
hintStyle:
|
|
||||||
Constant.body2_400(context: context).copyWith(
|
|
||||||
color: Colors.orange,
|
|
||||||
),
|
|
||||||
labelStyle:
|
|
||||||
Constant.body2_400(context: context).copyWith(
|
|
||||||
color: Colors.orange,
|
|
||||||
),
|
|
||||||
border: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: Colors.orange,
|
|
||||||
width: 1,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: Colors.orange,
|
|
||||||
width: 1,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
// labelText: "Tanggal Awal",
|
|
||||||
hintText: 'Tanggal Akhir',
|
|
||||||
// suffixIcon: isLoadingFilterScope.value
|
|
||||||
// ? SizedBox(
|
|
||||||
// width: Constant.getActualXPhone(
|
|
||||||
// context: context,
|
|
||||||
// x: 4,
|
|
||||||
// ),
|
|
||||||
// height: Constant.getActualYPhone(
|
|
||||||
// context: context,
|
|
||||||
// y: 4,
|
|
||||||
// ),
|
|
||||||
// child: CircularProgressIndicator(
|
|
||||||
// color: Constant.textRed,
|
|
||||||
// ),
|
|
||||||
// )
|
|
||||||
// : Icon(
|
|
||||||
// Icons.calendar_month_sharp,
|
|
||||||
// color: Constant.colorIconDate,
|
|
||||||
// ),
|
|
||||||
),
|
|
||||||
onTap: () async {
|
|
||||||
final selectedDateAkhir = await showDatePicker(
|
|
||||||
// locale: const Locale("en-CA"),
|
|
||||||
// locale: ,
|
|
||||||
context: context,
|
|
||||||
initialEntryMode:
|
|
||||||
DatePickerEntryMode.calendarOnly,
|
|
||||||
firstDate: DateTime(2000),
|
|
||||||
lastDate: DateTime(2100),
|
|
||||||
|
|
||||||
initialDate: (ctrlTglAkhir.text.isEmpty)
|
|
||||||
? DateTime.now()
|
|
||||||
: tglAkhir.value,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (selectedDateAkhir != null) {
|
|
||||||
String formattedDate = DateFormat('dd-MM-yyyy')
|
|
||||||
.format(selectedDateAkhir);
|
|
||||||
// ctrlTglAkhir.text =
|
|
||||||
// selectedDateAkhir.toString().split(' ')[0];
|
|
||||||
ctrlTglAkhir.text = formattedDate;
|
|
||||||
tglAkhir.value = selectedDateAkhir;
|
|
||||||
tglAkhirTmp.value = selectedDateAkhir.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (selectedDateAkhir == null) {
|
|
||||||
print('cancel button');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
bottomNavigationBar: Container(
|
|
||||||
// height: 150,
|
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.all(20),
|
||||||
// right: Constant.getActualXPhone(context: context, x: 27),
|
|
||||||
// left: Constant.getActualXPhone(context: context, x: 27),
|
|
||||||
// bottom: Constant.getActualYPhone(context: context, y: 32),
|
|
||||||
top: Constant.getActualYPhone(context: context, y: 24),
|
|
||||||
),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
// Excel
|
Text(
|
||||||
Container(
|
'Tanggal Awal',
|
||||||
width: Constant.getActualXPhone(context: context, x: 336),
|
style: Constant.body1(context: context).copyWith(
|
||||||
height: Constant.getActualYPhone(context: context, y: 42),
|
fontWeight: FontWeight.w600, color: Constant.textBlack),
|
||||||
child: ElevatedButton(
|
),
|
||||||
style: ButtonStyle(
|
SizedBox(
|
||||||
backgroundColor: MaterialStateColor.resolveWith(
|
height: Constant.getActualYPhone(context: context, y: 10),
|
||||||
(states) => Colors.white),
|
),
|
||||||
// side: MaterialStateBorderSide.resolveWith(
|
// Tanggal Awal
|
||||||
// (states) => BorderSide(color: Colors.green),
|
Row(
|
||||||
// ),
|
children: [
|
||||||
|
Expanded(
|
||||||
// backgroundColor: MaterialStateColor.resolveWith(
|
child: TextField(
|
||||||
// (st) => Constant.pcBtnBackgroundColor),
|
controller: ctrlTglAwal,
|
||||||
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
|
decoration: InputDecoration(
|
||||||
RoundedRectangleBorder(
|
hintStyle:
|
||||||
borderRadius: BorderRadius.circular(8),
|
Constant.body2_400(context: context).copyWith(
|
||||||
side: BorderSide(
|
color: Colors.orange,
|
||||||
color: Colors.green,
|
|
||||||
),
|
),
|
||||||
|
labelStyle:
|
||||||
|
Constant.body2_400(context: context).copyWith(
|
||||||
|
color: Colors.orange,
|
||||||
|
),
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Colors.orange,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Colors.orange,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// labelText: "Tanggal Awal",
|
||||||
|
hintText: 'Tanggal Awal',
|
||||||
|
// suffixIcon: isLoadingFilterScope.value
|
||||||
|
// ? SizedBox(
|
||||||
|
// width: Constant.getActualXPhone(
|
||||||
|
// context: context,
|
||||||
|
// x: 4,
|
||||||
|
// ),
|
||||||
|
// height: Constant.getActualYPhone(
|
||||||
|
// context: context,
|
||||||
|
// y: 4,
|
||||||
|
// ),
|
||||||
|
// child: CircularProgressIndicator(
|
||||||
|
// color: Constant.textRed,
|
||||||
|
// ),
|
||||||
|
// )
|
||||||
|
// : Icon(
|
||||||
|
// Icons.calendar_month_sharp,
|
||||||
|
// color: Constant.colorIconDate,
|
||||||
|
// ),
|
||||||
),
|
),
|
||||||
|
onTap: () async {
|
||||||
|
final selectedDateAwal = await showDatePicker(
|
||||||
|
// locale: const Locale("en-CA"),
|
||||||
|
// locale: ,
|
||||||
|
context: context,
|
||||||
|
initialEntryMode: DatePickerEntryMode.calendarOnly,
|
||||||
|
firstDate: DateTime(2000),
|
||||||
|
lastDate: DateTime(2100),
|
||||||
|
|
||||||
|
initialDate: (ctrlTglAwal.text.isEmpty)
|
||||||
|
? DateTime.now()
|
||||||
|
: tglAwal.value,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (selectedDateAwal != null) {
|
||||||
|
String formattedDate = DateFormat('dd-MM-yyyy')
|
||||||
|
.format(selectedDateAwal);
|
||||||
|
// ctrlTglAwal.text =
|
||||||
|
// selectedDateAwal.toString().split(' ')[0];
|
||||||
|
ctrlTglAwal.text = formattedDate;
|
||||||
|
tglAwal.value = selectedDateAwal;
|
||||||
|
tglAwalTmp.value = selectedDateAwal.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selectedDateAwal == null) {
|
||||||
|
print('cancel button');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
shadowColor:
|
|
||||||
MaterialStateProperty.all(Color(0xffff48423d)),
|
|
||||||
elevation: MaterialStateProperty.all(4.0),
|
|
||||||
),
|
),
|
||||||
child: Row(
|
],
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
width:
|
|
||||||
Constant.getActualXPhone(context: context, x: 16),
|
|
||||||
height:
|
|
||||||
Constant.getActualYPhone(context: context, y: 16),
|
|
||||||
// decoration: BoxDecoration(color: Colors.grey),
|
|
||||||
child: Image.asset(
|
|
||||||
"images/logo_excel.png",
|
|
||||||
fit: BoxFit.fill,
|
|
||||||
// scale: 1,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height:
|
|
||||||
Constant.getActualXPhone(context: context, x: 8),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
'Download Report (xls) ',
|
|
||||||
style: Constant.body1(context: context).copyWith(
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
color: Colors.green,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
onPressed: () async {
|
|
||||||
// Awal
|
|
||||||
DateTime parsedDateAwal = DateFormat('dd-MM-yyyy').parse(
|
|
||||||
ctrlTglAwal.value.text.toString(),
|
|
||||||
);
|
|
||||||
String formattedDateAwal =
|
|
||||||
DateFormat('yyyy-MM-dd').format(parsedDateAwal);
|
|
||||||
|
|
||||||
// Akhir
|
|
||||||
DateTime parsedDateAkhir = DateFormat('dd-MM-yyyy').parse(
|
|
||||||
ctrlTglAwal.value.text.toString(),
|
|
||||||
);
|
|
||||||
String formattedDateAkhir =
|
|
||||||
DateFormat('yyyy-MM-dd').format(parsedDateAkhir);
|
|
||||||
|
|
||||||
String url =
|
|
||||||
"https://${Constant.baseUrlDevoneReport}/birt/run?__report=report/one/pettycash/rpt_r_pt_001.rptdesign&__format=pdf&PStartDate=$formattedDateAwal&PEndDate=$formattedDateAkhir&PCompanyID=0&username=adminsas%20";
|
|
||||||
if (!await launchUrl(Uri.parse(url))) {
|
|
||||||
// throw Exception('Could not launch $url');
|
|
||||||
SanckbarWidget(context, 'Could not launch $url',
|
|
||||||
snackbarType.error);
|
|
||||||
}
|
|
||||||
// https://devone.aplikasi.web.id/birt/run?__report=report/one/pettycash/rpt_r_pt_001.rptdesign&__format=pdf&PStartDate=2023-11-01&PEndDate=2023-12-30&PCompanyID=0&username=adminsas%20&tm=1701327096267
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: Constant.getActualYPhone(context: context, y: 20),
|
height: Constant.getActualYPhone(context: context, y: 20),
|
||||||
),
|
),
|
||||||
|
|
||||||
// PDF
|
Text(
|
||||||
Container(
|
'Tanggal Akhir',
|
||||||
width: Constant.getActualXPhone(context: context, x: 336),
|
style: Constant.body1(context: context).copyWith(
|
||||||
height: Constant.getActualYPhone(context: context, y: 42),
|
fontWeight: FontWeight.w600, color: Constant.textBlack),
|
||||||
child: ElevatedButton(
|
),
|
||||||
style: ButtonStyle(
|
SizedBox(
|
||||||
backgroundColor: MaterialStateColor.resolveWith(
|
height: Constant.getActualYPhone(context: context, y: 10),
|
||||||
(st) => Constant.pcBtnBackgroundColor),
|
),
|
||||||
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
|
// Tanggal Akhir
|
||||||
RoundedRectangleBorder(
|
Row(
|
||||||
borderRadius: BorderRadius.circular(8),
|
children: [
|
||||||
side: BorderSide(
|
Expanded(
|
||||||
color: Constant.pcBtnBackgroundColor,
|
child: TextField(
|
||||||
|
controller: ctrlTglAkhir,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
hintStyle:
|
||||||
|
Constant.body2_400(context: context).copyWith(
|
||||||
|
color: Colors.orange,
|
||||||
),
|
),
|
||||||
|
labelStyle:
|
||||||
|
Constant.body2_400(context: context).copyWith(
|
||||||
|
color: Colors.orange,
|
||||||
|
),
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Colors.orange,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Colors.orange,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// labelText: "Tanggal Awal",
|
||||||
|
hintText: 'Tanggal Akhir',
|
||||||
|
// suffixIcon: isLoadingFilterScope.value
|
||||||
|
// ? SizedBox(
|
||||||
|
// width: Constant.getActualXPhone(
|
||||||
|
// context: context,
|
||||||
|
// x: 4,
|
||||||
|
// ),
|
||||||
|
// height: Constant.getActualYPhone(
|
||||||
|
// context: context,
|
||||||
|
// y: 4,
|
||||||
|
// ),
|
||||||
|
// child: CircularProgressIndicator(
|
||||||
|
// color: Constant.textRed,
|
||||||
|
// ),
|
||||||
|
// )
|
||||||
|
// : Icon(
|
||||||
|
// Icons.calendar_month_sharp,
|
||||||
|
// color: Constant.colorIconDate,
|
||||||
|
// ),
|
||||||
),
|
),
|
||||||
|
onTap: () async {
|
||||||
|
final selectedDateAkhir = await showDatePicker(
|
||||||
|
// locale: const Locale("en-CA"),
|
||||||
|
// locale: ,
|
||||||
|
context: context,
|
||||||
|
initialEntryMode: DatePickerEntryMode.calendarOnly,
|
||||||
|
firstDate: DateTime(2000),
|
||||||
|
lastDate: DateTime(2100),
|
||||||
|
|
||||||
|
initialDate: (ctrlTglAkhir.text.isEmpty)
|
||||||
|
? DateTime.now()
|
||||||
|
: tglAkhir.value,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (selectedDateAkhir != null) {
|
||||||
|
String formattedDate = DateFormat('dd-MM-yyyy')
|
||||||
|
.format(selectedDateAkhir);
|
||||||
|
// ctrlTglAkhir.text =
|
||||||
|
// selectedDateAkhir.toString().split(' ')[0];
|
||||||
|
ctrlTglAkhir.text = formattedDate;
|
||||||
|
tglAkhir.value = selectedDateAkhir;
|
||||||
|
tglAkhirTmp.value = selectedDateAkhir.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selectedDateAkhir == null) {
|
||||||
|
print('cancel button');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
shadowColor:
|
|
||||||
MaterialStateProperty.all(Color(0xffff48423d)),
|
|
||||||
elevation: MaterialStateProperty.all(4.0),
|
|
||||||
),
|
),
|
||||||
child: Row(
|
],
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
),
|
||||||
children: [
|
|
||||||
Container(
|
Spacer(),
|
||||||
width:
|
|
||||||
Constant.getActualXPhone(context: context, x: 16),
|
Row(
|
||||||
height:
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
Constant.getActualYPhone(context: context, y: 16),
|
children: [
|
||||||
// decoration: BoxDecoration(color: Colors.grey),
|
ElevatedButton(
|
||||||
child: Image.asset(
|
style: ButtonStyle(
|
||||||
"images/logo_pdf.png",
|
backgroundColor: MaterialStateColor.resolveWith(
|
||||||
fit: BoxFit.fill,
|
(states) => Colors.white),
|
||||||
// scale: 1,
|
// side: MaterialStateBorderSide.resolveWith(
|
||||||
|
// (states) => BorderSide(color: Colors.green),
|
||||||
|
// ),
|
||||||
|
|
||||||
|
// backgroundColor: MaterialStateColor.resolveWith(
|
||||||
|
// (st) => Constant.pcBtnBackgroundColor),
|
||||||
|
shape:
|
||||||
|
MaterialStateProperty.all<RoundedRectangleBorder>(
|
||||||
|
RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
side: BorderSide(
|
||||||
|
color: Colors.green,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(
|
shadowColor:
|
||||||
height:
|
MaterialStateProperty.all(Color(0xffff48423d)),
|
||||||
Constant.getActualXPhone(context: context, x: 8),
|
elevation: MaterialStateProperty.all(4.0),
|
||||||
),
|
),
|
||||||
Text(
|
child: Row(
|
||||||
'Download Report (PDF)',
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
style: Constant.body1(context: context).copyWith(
|
children: [
|
||||||
|
Container(
|
||||||
|
width: Constant.getActualXPhone(
|
||||||
|
context: context, x: 16),
|
||||||
|
height: Constant.getActualYPhone(
|
||||||
|
context: context, y: 16),
|
||||||
|
// decoration: BoxDecoration(color: Colors.grey),
|
||||||
|
child: Image.asset(
|
||||||
|
"images/logo_excel.png",
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
// scale: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualXPhone(
|
||||||
|
context: context, x: 8),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Download Report (xls) ',
|
||||||
|
style: Constant.body1(context: context).copyWith(
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: Constant.white),
|
color: Colors.green,
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
onPressed: () async {
|
||||||
|
M_CompanyID = await getCompanyID();
|
||||||
|
if(M_CompanyID == "0"){
|
||||||
|
SanckbarWidget(context, 'Invalid Company', snackbarType.error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Awal
|
||||||
|
DateTime parsedDateAwal =
|
||||||
|
DateFormat('dd-MM-yyyy').parse(
|
||||||
|
ctrlTglAwal.value.text.toString(),
|
||||||
|
);
|
||||||
|
String formattedDateAwal =
|
||||||
|
DateFormat('yyyy-MM-dd').format(parsedDateAwal);
|
||||||
|
|
||||||
|
// Akhir
|
||||||
|
DateTime parsedDateAkhir =
|
||||||
|
DateFormat('dd-MM-yyyy').parse(
|
||||||
|
ctrlTglAwal.value.text.toString(),
|
||||||
|
);
|
||||||
|
String formattedDateAkhir =
|
||||||
|
DateFormat('yyyy-MM-dd').format(parsedDateAkhir);
|
||||||
|
|
||||||
|
String url =
|
||||||
|
"https://${Constant.baseUrlDevoneReport}/birt/run?__report=report/one/pettycash/rpt_r_pt_001.rptdesign&__format=xls&PStartDate=$formattedDateAwal&PEndDate=$formattedDateAkhir&PCompanyID=$M_CompanyID&username=adminsas%20";
|
||||||
|
if (!await launchUrl(Uri.parse(url))) {
|
||||||
|
// throw Exception('Could not launch $url');
|
||||||
|
SanckbarWidget(context, 'Could not launch $url',
|
||||||
|
snackbarType.error);
|
||||||
|
}
|
||||||
|
// https://devone.aplikasi.web.id/birt/run?__report=report/one/pettycash/rpt_r_pt_001.rptdesign&__format=pdf&PStartDate=2023-11-01&PEndDate=2023-12-30&PCompanyID=0&username=adminsas%20&tm=1701327096267
|
||||||
|
},
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
|
||||||
// String url =
|
// PDF
|
||||||
// "https://pub.dev/packages?q=url+launcher";
|
ElevatedButton(
|
||||||
// if (!await launchUrl(Uri.parse(url))) {
|
style: ButtonStyle(
|
||||||
// // throw Exception('Could not launch $url');
|
backgroundColor: MaterialStateColor.resolveWith(
|
||||||
// SanckbarWidget(context, 'Could not launch $url',
|
(st) => Constant.pcBtnBackgroundColor),
|
||||||
// snackbarType.error);
|
shape:
|
||||||
// }
|
MaterialStateProperty.all<RoundedRectangleBorder>(
|
||||||
},
|
RoundedRectangleBorder(
|
||||||
),
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
side: BorderSide(
|
||||||
|
color: Constant.pcBtnBackgroundColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
shadowColor:
|
||||||
|
MaterialStateProperty.all(Color(0xffff48423d)),
|
||||||
|
elevation: MaterialStateProperty.all(4.0),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: Constant.getActualXPhone(
|
||||||
|
context: context, x: 16),
|
||||||
|
height: Constant.getActualYPhone(
|
||||||
|
context: context, y: 16),
|
||||||
|
// decoration: BoxDecoration(color: Colors.grey),
|
||||||
|
child: Image.asset(
|
||||||
|
"images/logo_pdf.png",
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
// scale: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: Constant.getActualXPhone(
|
||||||
|
context: context, x: 8),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Download Report (PDF)',
|
||||||
|
style: Constant.body1(context: context).copyWith(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Constant.white),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
onPressed: () async {
|
||||||
|
M_CompanyID = await getCompanyID();
|
||||||
|
if(M_CompanyID == "0"){
|
||||||
|
SanckbarWidget(context, 'Invalid Company', snackbarType.error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Awal
|
||||||
|
DateTime parsedDateAwal =
|
||||||
|
DateFormat('dd-MM-yyyy').parse(
|
||||||
|
ctrlTglAwal.value.text.toString(),
|
||||||
|
);
|
||||||
|
String formattedDateAwal =
|
||||||
|
DateFormat('yyyy-MM-dd').format(parsedDateAwal);
|
||||||
|
|
||||||
|
// Akhir
|
||||||
|
DateTime parsedDateAkhir =
|
||||||
|
DateFormat('dd-MM-yyyy').parse(
|
||||||
|
ctrlTglAwal.value.text.toString(),
|
||||||
|
);
|
||||||
|
String formattedDateAkhir =
|
||||||
|
DateFormat('yyyy-MM-dd').format(parsedDateAkhir);
|
||||||
|
|
||||||
|
String url =
|
||||||
|
"https://${Constant.baseUrlDevoneReport}/birt/run?__report=report/one/pettycash/rpt_r_pt_001.rptdesign&__format=pdf&PStartDate=$formattedDateAwal&PEndDate=$formattedDateAkhir&PCompanyID=$M_CompanyID&username=adminsas%20";
|
||||||
|
if (!await launchUrl(Uri.parse(url))) {
|
||||||
|
// throw Exception('Could not launch $url');
|
||||||
|
SanckbarWidget(context, 'Could not launch $url',
|
||||||
|
snackbarType.error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -0,0 +1,91 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
|
|
||||||
|
import '../../app/constant.dart';
|
||||||
|
import '../../widget/custom_drawer.dart';
|
||||||
|
|
||||||
|
class HistoryTransaksiScreen extends HookConsumerWidget {
|
||||||
|
const HistoryTransaksiScreen({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
top: Constant.getActualYPhone(context: context, y: 30),
|
||||||
|
),
|
||||||
|
child: Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: Text(
|
||||||
|
'History Transaksi',
|
||||||
|
style: TextStyle(color: Constant.textWhite),
|
||||||
|
),
|
||||||
|
backgroundColor: Constant.pcBtnBackgroundColor,
|
||||||
|
iconTheme: IconThemeData(
|
||||||
|
color: Constant.textWhite,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
drawer: CustomDrawer(),
|
||||||
|
body: SafeArea(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(20),
|
||||||
|
child: Container(
|
||||||
|
height: MediaQuery.of(context).size.height - 10,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Card(
|
||||||
|
margin: EdgeInsets.all(16.0),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(16.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text('Tipe Catatan: DEBIT'),
|
||||||
|
SizedBox(height: 8.0),
|
||||||
|
Text('Tanggal: 15-12-2023'),
|
||||||
|
SizedBox(height: 8.0),
|
||||||
|
Text('Nominal: 100.000'),
|
||||||
|
SizedBox(height: 8.0),
|
||||||
|
Text('Kategori: Jumat Sehat'),
|
||||||
|
SizedBox(height: 8.0),
|
||||||
|
Chip(
|
||||||
|
label: Text('Verify'),
|
||||||
|
backgroundColor: Constant.green_600,
|
||||||
|
labelStyle: TextStyle(color: Colors.white),
|
||||||
|
),
|
||||||
|
SizedBox(height: 16.0),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: () {
|
||||||
|
// Handle delete button tap
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
'Delete',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Constant.textWhite
|
||||||
|
),
|
||||||
|
),
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
backgroundColor: Colors
|
||||||
|
.red, // Ganti dengan warna delete button yang diinginkan
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -70,22 +70,22 @@ class CustomDrawer extends HookConsumerWidget {
|
|||||||
|
|
||||||
return Drawer(
|
return Drawer(
|
||||||
child: ListView(
|
child: ListView(
|
||||||
padding: EdgeInsets.only(
|
// padding: EdgeInsets.only(
|
||||||
top: Constant.getActualYPhone(context: context, y: 10),
|
// top: Constant.getActualYPhone(context: context, y: 10),
|
||||||
),
|
// ),
|
||||||
children: [
|
children: [
|
||||||
// DrawerHeader(
|
DrawerHeader(
|
||||||
// decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
// color: Colors.blue,
|
color: Colors.blue,
|
||||||
// ),
|
),
|
||||||
// child: Text(
|
child: Text(
|
||||||
// 'Drawer Header',
|
'Drawer Header',
|
||||||
// style: TextStyle(
|
style: TextStyle(
|
||||||
// color: Colors.white,
|
color: Colors.white,
|
||||||
// fontSize: 24,
|
fontSize: 24,
|
||||||
// ),
|
),
|
||||||
// ),
|
),
|
||||||
// ),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
'Home',
|
'Home',
|
||||||
@@ -126,7 +126,7 @@ class CustomDrawer extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
'Report',
|
'History Transaksi',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: (currentMenu == 2)
|
color: (currentMenu == 2)
|
||||||
? Constant.textWhite
|
? Constant.textWhite
|
||||||
@@ -137,15 +137,15 @@ class CustomDrawer extends HookConsumerWidget {
|
|||||||
? Constant.pcBtnBackgroundColor
|
? Constant.pcBtnBackgroundColor
|
||||||
: Colors.transparent,
|
: Colors.transparent,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
// Handle navigation to Transaksi screen
|
// Handle navigation to User screen
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
ref.read(currentPageProvider.state).update((state) => 2);
|
ref.read(currentPageProvider.state).update((state) => 2);
|
||||||
Navigator.pushNamed(context, reportRoute);
|
Navigator.pushNamed(context, historyTransaksiRoute);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
'User',
|
'Report',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: (currentMenu == 3)
|
color: (currentMenu == 3)
|
||||||
? Constant.textWhite
|
? Constant.textWhite
|
||||||
@@ -156,12 +156,50 @@ class CustomDrawer extends HookConsumerWidget {
|
|||||||
? Constant.pcBtnBackgroundColor
|
? Constant.pcBtnBackgroundColor
|
||||||
: Colors.transparent,
|
: Colors.transparent,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
// Handle navigation to User screen
|
// Handle navigation to Transaksi screen
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
ref.read(currentPageProvider.state).update((state) => 3);
|
ref.read(currentPageProvider.state).update((state) => 3);
|
||||||
|
Navigator.pushNamed(context, reportRoute);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
title: Text(
|
||||||
|
'User',
|
||||||
|
style: TextStyle(
|
||||||
|
color: (currentMenu == 4)
|
||||||
|
? Constant.textWhite
|
||||||
|
: Constant.textBlack,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
tileColor: (currentMenu == 4)
|
||||||
|
? Constant.pcBtnBackgroundColor
|
||||||
|
: Colors.transparent,
|
||||||
|
onTap: () {
|
||||||
|
// Handle navigation to User screen
|
||||||
|
Navigator.pop(context);
|
||||||
|
ref.read(currentPageProvider.state).update((state) => 4);
|
||||||
Navigator.pushNamed(context, userRoute);
|
Navigator.pushNamed(context, userRoute);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
ListTile(
|
||||||
|
title: Text(
|
||||||
|
'Change Company',
|
||||||
|
style: TextStyle(
|
||||||
|
color: (currentMenu == 5)
|
||||||
|
? Constant.textWhite
|
||||||
|
: Constant.textBlack,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
tileColor: (currentMenu == 5)
|
||||||
|
? Constant.pcBtnBackgroundColor
|
||||||
|
: Colors.transparent,
|
||||||
|
onTap: () {
|
||||||
|
// Handle navigation to User screen
|
||||||
|
Navigator.pop(context);
|
||||||
|
ref.read(currentPageProvider.state).update((state) => 5);
|
||||||
|
Navigator.pushNamed(context, changeCompanyRoute);
|
||||||
|
},
|
||||||
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
'Logout',
|
'Logout',
|
||||||
|
|||||||
Reference in New Issue
Block a user