Commit 14d01f4d authored by Sai Srinivas's avatar Sai Srinivas
Browse files

31-07-2025 By Sai Srinivas

Finance Module
parent 29665037
<svg width="37" height="37" viewBox="0 0 37 37" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="18.21" cy="18.208" r="18.208" transform="rotate(180 18.21 18.208)" fill="#E7FFE5"/>
<path d="M25.1251 13.3927C25.5156 13.0021 25.5156 12.369 25.1251 11.9784C24.7346 11.5879 24.1014 11.5879 23.7109 11.9784L24.418 12.6855L25.1251 13.3927ZM11.6875 24.4161C11.6875 24.9683 12.1352 25.4161 12.6875 25.4161L21.6875 25.4161C22.2398 25.4161 22.6875 24.9683 22.6875 24.4161C22.6875 23.8638 22.2398 23.4161 21.6875 23.4161L13.6875 23.4161L13.6875 15.4161C13.6875 14.8638 13.2398 14.4161 12.6875 14.4161C12.1352 14.4161 11.6875 14.8638 11.6875 15.4161L11.6875 24.4161ZM24.418 12.6855L23.7109 11.9784L11.9804 23.7089L12.6875 24.4161L13.3946 25.1232L25.1251 13.3927L24.418 12.6855Z" fill="#4CAF50"/>
</svg>
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="20" cy="20" r="20" fill="white"/>
<path d="M13.2929 26.0234C12.9024 26.4139 12.9024 27.0471 13.2929 27.4376C13.6834 27.8281 14.3166 27.8281 14.7071 27.4376L14 26.7305L13.2929 26.0234ZM26.7305 15C26.7305 14.4477 26.2828 14 25.7305 14L16.7305 14C16.1782 14 15.7305 14.4477 15.7305 15C15.7305 15.5522 16.1782 16 16.7305 16H24.7305V24C24.7305 24.5522 25.1782 25 25.7305 25C26.2828 25 26.7305 24.5522 26.7305 24L26.7305 15ZM14 26.7305L14.7071 27.4376L26.4376 15.7071L25.7305 15L25.0234 14.2929L13.2929 26.0234L14 26.7305Z" fill="#ED3424"/>
</svg>
<svg width="37" height="37" viewBox="0 0 37 37" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="18.208" cy="18.208" r="18.208" fill="#FFEFEF"/>
<path d="M11.2929 23.0234C10.9024 23.4139 10.9024 24.0471 11.2929 24.4376C11.6834 24.8281 12.3166 24.8281 12.7071 24.4376L12 23.7305L11.2929 23.0234ZM24.7305 12C24.7305 11.4477 24.2828 11 23.7305 11L14.7305 11C14.1782 11 13.7305 11.4477 13.7305 12C13.7305 12.5522 14.1782 13 14.7305 13H22.7305V21C22.7305 21.5522 23.1782 22 23.7305 22C24.2828 22 24.7305 21.5522 24.7305 21L24.7305 12ZM12 23.7305L12.7071 24.4376L24.4376 12.7071L23.7305 12L23.0234 11.2929L11.2929 23.0234L12 23.7305Z" fill="#ED3424"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="11" height="16" viewBox="0 0 11 16" fill="none">
<path d="M10.6467 4.40373C10.6467 4.5603 10.5845 4.7105 10.4738 4.8212C10.3631 4.9319 10.2129 4.99413 10.0563 4.99413H7.68735C7.68735 5.09007 7.69473 5.19339 7.69473 5.28933C7.69473 6.46369 7.2282 7.59 6.3978 8.4204C5.5674 9.25079 4.4411 9.71733 3.26673 9.71733H2.13759L7.50285 14.5955C7.56089 14.6473 7.60794 14.7102 7.6413 14.7805C7.67466 14.8507 7.69361 14.927 7.69709 15.0047C7.70052 15.0824 7.68835 15.16 7.66137 15.233C7.63433 15.3059 7.593 15.3727 7.53975 15.4294C7.48443 15.4899 7.41718 15.5381 7.3422 15.5712C7.26728 15.6042 7.18628 15.6213 7.10433 15.6213C6.95709 15.6199 6.81539 15.5648 6.70581 15.4663L0.211411 9.56235C0.123678 9.48199 0.0622587 9.37702 0.0352065 9.26118C0.00814851 9.14535 0.0167269 9.02402 0.0598084 8.91314C0.102884 8.80227 0.178461 8.70698 0.276627 8.63973C0.374793 8.57254 0.490966 8.53659 0.609931 8.53653H3.26673C4.12795 8.53653 4.95386 8.19439 5.56286 7.58545C6.17179 6.97646 6.51393 6.15054 6.51393 5.28933C6.51393 5.19339 6.50655 5.09007 6.49917 4.99413H0.609931C0.453345 4.99413 0.303177 4.9319 0.192453 4.8212C0.0817356 4.7105 0.0195312 4.5603 0.0195312 4.40373C0.0195312 4.24714 0.0817356 4.09697 0.192453 3.98625C0.303177 3.87553 0.453345 3.81333 0.609931 3.81333H6.15969C5.88693 3.28066 5.47258 2.83351 4.96218 2.52103C4.45184 2.20856 3.86516 2.04285 3.26673 2.04213H0.609931C0.453345 2.04213 0.303177 1.97992 0.192453 1.86921C0.0817356 1.75848 0.0195312 1.60831 0.0195312 1.45173C0.0195312 1.29514 0.0817356 1.14497 0.192453 1.03425C0.303177 0.923533 0.453345 0.861328 0.609931 0.861328H10.0563C10.2129 0.861328 10.3631 0.923533 10.4738 1.03425C10.5845 1.14497 10.6467 1.29514 10.6467 1.45173C10.6467 1.60831 10.5845 1.75848 10.4738 1.86921C10.3631 1.97992 10.2129 2.04213 10.0563 2.04213H6.27039C6.79904 2.52894 7.20169 3.13671 7.44381 3.81333H10.0563C10.2129 3.81333 10.3631 3.87553 10.4738 3.98625C10.5845 4.09697 10.6467 4.24714 10.6467 4.40373Z" fill="#2D2D2D"/>
</svg>
\ No newline at end of file
class commonAccountdetailsResponse { class commonAccountdetailsResponse {
AccountDetails? accountDetails; AccountDetails? accountDetails;
BalanceDetails? balanceDetails;
List<LedgerList>? ledgerList; List<LedgerList>? ledgerList;
String? error; String? error;
String? message; String? message;
commonAccountdetailsResponse( commonAccountdetailsResponse(
{this.accountDetails, this.ledgerList, this.error, this.message}); {this.accountDetails,
this.balanceDetails,
this.ledgerList,
this.error,
this.message});
commonAccountdetailsResponse.fromJson(Map<String, dynamic> json) { commonAccountdetailsResponse.fromJson(Map<String, dynamic> json) {
accountDetails = json['account_details'] != null accountDetails = json['account_details'] != null
? new AccountDetails.fromJson(json['account_details']) ? new AccountDetails.fromJson(json['account_details'])
: null; : null;
balanceDetails = json['balance_details'] != null
? new BalanceDetails.fromJson(json['balance_details'])
: null;
if (json['ledger_list'] != null) { if (json['ledger_list'] != null) {
ledgerList = <LedgerList>[]; ledgerList = <LedgerList>[];
json['ledger_list'].forEach((v) { json['ledger_list'].forEach((v) {
...@@ -26,6 +34,9 @@ class commonAccountdetailsResponse { ...@@ -26,6 +34,9 @@ class commonAccountdetailsResponse {
if (this.accountDetails != null) { if (this.accountDetails != null) {
data['account_details'] = this.accountDetails!.toJson(); data['account_details'] = this.accountDetails!.toJson();
} }
if (this.balanceDetails != null) {
data['balance_details'] = this.balanceDetails!.toJson();
}
if (this.ledgerList != null) { if (this.ledgerList != null) {
data['ledger_list'] = this.ledgerList!.map((v) => v.toJson()).toList(); data['ledger_list'] = this.ledgerList!.map((v) => v.toJson()).toList();
} }
...@@ -108,6 +119,28 @@ class AccountDetails { ...@@ -108,6 +119,28 @@ class AccountDetails {
} }
} }
class BalanceDetails {
String? totalDebit;
String? totalCredit;
String? balance;
BalanceDetails({this.totalDebit, this.totalCredit, this.balance});
BalanceDetails.fromJson(Map<String, dynamic> json) {
totalDebit = json['total_debit'];
totalCredit = json['total_credit'];
balance = json['balance'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['total_debit'] = this.totalDebit;
data['total_credit'] = this.totalCredit;
data['balance'] = this.balance;
return data;
}
}
class LedgerList { class LedgerList {
String? id; String? id;
String? accountId; String? accountId;
......
...@@ -6,9 +6,11 @@ import 'package:generp/Utils/SharedpreferencesService.dart'; ...@@ -6,9 +6,11 @@ import 'package:generp/Utils/SharedpreferencesService.dart';
import 'package:generp/screens/LoginScreen.dart'; import 'package:generp/screens/LoginScreen.dart';
import 'package:generp/services/api_calling.dart'; import 'package:generp/services/api_calling.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
import '../Models/AttendanceListResponse.dart'; import '../Models/AttendanceListResponse.dart';
import '../Utils/commonServices.dart'; import '../Utils/commonServices.dart';
import 'HomeScreenNotifier.dart';
class AttendanceNotifier extends ChangeNotifier { class AttendanceNotifier extends ChangeNotifier {
List<dynamic> _attHistory = []; List<dynamic> _attHistory = [];
...@@ -93,16 +95,17 @@ class AttendanceNotifier extends ChangeNotifier { ...@@ -93,16 +95,17 @@ class AttendanceNotifier extends ChangeNotifier {
_selectedDate = value; _selectedDate = value;
} }
Future<void> init(homeprov, context) async { Future<void> init(context) async {
_month = DateTime.now(); _month = DateTime.now();
_present_month = _month; _present_month = _month;
await getMonth(DateFormat('MMMM').format(_month), homeprov, context); await getMonth(DateFormat('MMMM').format(_month), context);
String formattedDate = DateFormat('yyyy-MM-dd').format(DateTime.now()); String formattedDate = DateFormat('yyyy-MM-dd').format(DateTime.now());
dateWiseAttendance(homeprov, formattedDate, context); dateWiseAttendance(formattedDate, context);
} }
Future<void> getAttendanceList(homeprov, BuildContext context) async { Future<void> getAttendanceList(BuildContext context) async {
try { try {
final homeprov = Provider.of<HomescreenNotifier>(context, listen: false);
final data = await ApiCalling.AttendanceListApi( final data = await ApiCalling.AttendanceListApi(
homeprov.empId, homeprov.empId,
homeprov.session, homeprov.session,
...@@ -111,8 +114,11 @@ class AttendanceNotifier extends ChangeNotifier { ...@@ -111,8 +114,11 @@ class AttendanceNotifier extends ChangeNotifier {
if (data.sessionExists == 1) { if (data.sessionExists == 1) {
// _attHistory = data.attHistory!; // _attHistory = data.attHistory!;
_attendanceStatus = data.attStatus!; _attendanceStatus = data.attStatus!;
Future.delayed(Duration(milliseconds: 400),() {
_isLoading = false; _isLoading = false;
notifyListeners(); notifyListeners();
},);
notifyListeners();
} else { } else {
_isLoading = true; _isLoading = true;
// SharedpreferencesService().clearPreferences(); // SharedpreferencesService().clearPreferences();
...@@ -130,11 +136,11 @@ class AttendanceNotifier extends ChangeNotifier { ...@@ -130,11 +136,11 @@ class AttendanceNotifier extends ChangeNotifier {
} }
Future<void> dateWiseAttendance( Future<void> dateWiseAttendance(
homeprov,
Selecteddate, Selecteddate,
BuildContext context, BuildContext context,
) async { ) async {
try { try {
final homeprov = Provider.of<HomescreenNotifier>(context, listen: false);
final data = await ApiCalling.DateWiseAttendanceApi( final data = await ApiCalling.DateWiseAttendanceApi(
homeprov.empId, homeprov.empId,
homeprov.session, homeprov.session,
...@@ -156,8 +162,9 @@ class AttendanceNotifier extends ChangeNotifier { ...@@ -156,8 +162,9 @@ class AttendanceNotifier extends ChangeNotifier {
} }
} }
Future<void> loadAttendanceDetails(homeprov, BuildContext context) async { Future<void> loadAttendanceDetails(BuildContext context) async {
try { try {
final homeprov = Provider.of<HomescreenNotifier>(context, listen: false);
final data = await ApiCalling.LoadAttendanceDetails( final data = await ApiCalling.LoadAttendanceDetails(
homeprov.empId, homeprov.empId,
homeprov.session, homeprov.session,
...@@ -202,11 +209,13 @@ class AttendanceNotifier extends ChangeNotifier { ...@@ -202,11 +209,13 @@ class AttendanceNotifier extends ChangeNotifier {
: 0; : 0;
_penalityArrayList.add({dateKey: penalty}); _penalityArrayList.add({dateKey: penalty});
} }
print(_dateArrayList); // print(_dateArrayList);
print(_penalityArrayList); // print(_penalityArrayList);
Future.delayed(Duration(milliseconds: 400),() {
_isLoading = false; _isLoading = false;
notifyListeners(); notifyListeners();
},);
notifyListeners();
} else { } else {
toast(context, "Null response from server."); toast(context, "Null response from server.");
} }
...@@ -216,7 +225,7 @@ class AttendanceNotifier extends ChangeNotifier { ...@@ -216,7 +225,7 @@ class AttendanceNotifier extends ChangeNotifier {
} }
} }
Future<void> getMonth(String monthName, homeprov, context) async { Future<void> getMonth(String monthName, context) async {
switch (monthName) { switch (monthName) {
case "January": case "January":
_monthNo = 1; _monthNo = 1;
...@@ -261,24 +270,24 @@ class AttendanceNotifier extends ChangeNotifier { ...@@ -261,24 +270,24 @@ class AttendanceNotifier extends ChangeNotifier {
_year = DateFormat('yyyy').format(month); _year = DateFormat('yyyy').format(month);
notifyListeners(); notifyListeners();
await loadAttendanceDetails(homeprov, context); await loadAttendanceDetails(context);
} }
Future<void> refresh(homeprov, context) async { Future<void> refresh(context) async {
await Future.delayed(const Duration(seconds: 2)); await Future.delayed(const Duration(seconds: 2));
_isLoading = true; _isLoading = true;
_dateArrayList = []; _dateArrayList = [];
_penalityArrayList = []; _penalityArrayList = [];
_initialRenderDone = true; _initialRenderDone = true;
_month = DateTime.now(); _month = DateTime.now();
await getMonth(DateFormat('MMMM').format(_month), homeprov, context); await getMonth(DateFormat('MMMM').format(_month), context);
String formattedDate = DateFormat('yyyy-MM-dd').format(DateTime.now()); String formattedDate = DateFormat('yyyy-MM-dd').format(DateTime.now());
dateWiseAttendance(homeprov, formattedDate, context); dateWiseAttendance(formattedDate, context);
_present_month = month; _present_month = month;
notifyListeners(); notifyListeners();
} }
void setPreviousMonth(homeprov, context) { void setPreviousMonth(context) {
_month = DateTime(month.year, month.month - 1); _month = DateTime(month.year, month.month - 1);
resetForNewMonth(); resetForNewMonth();
if (DateFormat('MMMM').format(_present_month) == if (DateFormat('MMMM').format(_present_month) ==
...@@ -288,10 +297,10 @@ class AttendanceNotifier extends ChangeNotifier { ...@@ -288,10 +297,10 @@ class AttendanceNotifier extends ChangeNotifier {
_initialRenderDone = true; _initialRenderDone = true;
_month = present_month; _month = present_month;
} }
getMonth(DateFormat('MMMM').format(_month), homeprov, context); getMonth(DateFormat('MMMM').format(_month), context);
} }
void setNextMonth(homeprov, context) { void setNextMonth(context) {
_month = DateTime(month.year, month.month + 1); _month = DateTime(month.year, month.month + 1);
resetForNewMonth(); resetForNewMonth();
if (DateFormat('MMMM').format(_present_month) == if (DateFormat('MMMM').format(_present_month) ==
...@@ -301,7 +310,7 @@ class AttendanceNotifier extends ChangeNotifier { ...@@ -301,7 +310,7 @@ class AttendanceNotifier extends ChangeNotifier {
_initialRenderDone = true; _initialRenderDone = true;
_month = present_month; _month = present_month;
} }
getMonth(DateFormat('MMMM').format(_month), homeprov, context); getMonth(DateFormat('MMMM').format(_month), context);
} }
void resetForNewMonth() { void resetForNewMonth() {
......
...@@ -6,15 +6,28 @@ import 'package:provider/provider.dart'; ...@@ -6,15 +6,28 @@ import 'package:provider/provider.dart';
import '../../Models/commonModels/commonAccountdetailsResponse.dart'; import '../../Models/commonModels/commonAccountdetailsResponse.dart';
class Accountdetailsprovider extends ChangeNotifier{ class Accountdetailsprovider extends ChangeNotifier{
bool _showMoreDetails = false;
AccountDetails _accountDetails = AccountDetails(); AccountDetails _accountDetails = AccountDetails();
BalanceDetails _balanceDetails = BalanceDetails();
List<LedgerList> _ledgerList = []; List<LedgerList> _ledgerList = [];
bool get showMoreDetails => _showMoreDetails;
AccountDetails get accountDetails => _accountDetails; AccountDetails get accountDetails => _accountDetails;
BalanceDetails get balanceDetails => _balanceDetails;
List<LedgerList> get ledgerList => _ledgerList; List<LedgerList> get ledgerList => _ledgerList;
double totalCredit = 0.0; double totalCredit = 0.0;
double totalDebit = 0.0; double totalDebit = 0.0;
double totalRunningBalance = 0.0; double totalRunningBalance = 0.0;
List<double> runningBalances = []; List<double> runningBalances = [];
set showMoreDetails(bool value){
_showMoreDetails = value;
notifyListeners();
}
Future<void> accountdetailsAPIFunction(context,accountID) async { Future<void> accountdetailsAPIFunction(context,accountID) async {
try{ try{
var prov = Provider.of<HomescreenNotifier>(context,listen: false); var prov = Provider.of<HomescreenNotifier>(context,listen: false);
...@@ -22,6 +35,7 @@ class Accountdetailsprovider extends ChangeNotifier{ ...@@ -22,6 +35,7 @@ class Accountdetailsprovider extends ChangeNotifier{
if(data!=null){ if(data!=null){
if(data.error=="0"){ if(data.error=="0"){
_accountDetails = data.accountDetails!; _accountDetails = data.accountDetails!;
_balanceDetails = data.balanceDetails!;
_ledgerList = data.ledgerList!; _ledgerList = data.ledgerList!;
for (var item in _ledgerList) { for (var item in _ledgerList) {
double credit = double.tryParse(item.creditAmount.toString()) ?? 0; double credit = double.tryParse(item.creditAmount.toString()) ?? 0;
......
...@@ -571,6 +571,15 @@ class Accountslistprovider extends ChangeNotifier { ...@@ -571,6 +571,15 @@ class Accountslistprovider extends ChangeNotifier {
notifyListeners(); notifyListeners();
} }
void onChangedMobileNum(value){
notifyListeners();
}
void onChangedCompanyName(value){
notifyListeners();
}
Future<void> commonAccountListAPIFunction(context) async { Future<void> commonAccountListAPIFunction(context) async {
try { try {
var prov = Provider.of<HomescreenNotifier>(context, listen: false); var prov = Provider.of<HomescreenNotifier>(context, listen: false);
......
...@@ -20,8 +20,8 @@ class AttendanceScreen extends StatefulWidget { ...@@ -20,8 +20,8 @@ class AttendanceScreen extends StatefulWidget {
} }
class _AttendanceScreenState extends State<AttendanceScreen> { class _AttendanceScreenState extends State<AttendanceScreen> {
var att_provider;
var homeProvider; // var homeProvider;
Map _source = {ConnectivityResult.mobile: true}; Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance; final MyConnectivity _connectivity = MyConnectivity.instance;
...@@ -32,11 +32,11 @@ class _AttendanceScreenState extends State<AttendanceScreen> { ...@@ -32,11 +32,11 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
_connectivity.myStream.listen((source) { _connectivity.myStream.listen((source) {
setState(() => _source = source); setState(() => _source = source);
}); });
homeProvider = Provider.of<HomescreenNotifier>(context, listen: false); final homeProvider = Provider.of<HomescreenNotifier>(context, listen: false);
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
att_provider = Provider.of<AttendanceNotifier>(context, listen: false); final att_provider = Provider.of<AttendanceNotifier>(context, listen: false);
att_provider.getAttendanceList(homeProvider, context); att_provider.getAttendanceList(context);
att_provider.init(homeProvider, context); att_provider.init(context);
}); });
} }
...@@ -101,8 +101,6 @@ class _AttendanceScreenState extends State<AttendanceScreen> { ...@@ -101,8 +101,6 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
String formattedTime2 = match2?.group(1) ?? "-"; String formattedTime2 = match2?.group(1) ?? "-";
String period2 = match2?.group(2)?.toUpperCase() ?? ""; String period2 = match2?.group(2)?.toUpperCase() ?? "";
print(attendance.attendanceHistory.firstOrNull);
final dateArrayList = attendance.dateArrayList; final dateArrayList = attendance.dateArrayList;
final penalityArrayList = attendance.penalityArrayList; final penalityArrayList = attendance.penalityArrayList;
var selectedIndex = attendance.selectedIndex; var selectedIndex = attendance.selectedIndex;
...@@ -140,16 +138,15 @@ class _AttendanceScreenState extends State<AttendanceScreen> { ...@@ -140,16 +138,15 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
onRefresh: () async { onRefresh: () async {
await Future.delayed(const Duration(milliseconds: 600)); await Future.delayed(const Duration(milliseconds: 600));
attendance.getAttendanceList(homeProvider, context); attendance.getAttendanceList(context);
attendance.init(homeProvider, context); attendance.init(context);
attendance.loadAttendanceDetails(homeProvider, context); attendance.loadAttendanceDetails(context);
}, },
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
appBar: appbarNew(context, "Attendance", 0xFFFFFFFF), appBar: appbarNew(context, "Attendance", 0xFFFFFFFF),
body: Container( body:SingleChildScrollView(
child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
...@@ -174,7 +171,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> { ...@@ -174,7 +171,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
final heads = ["Check-in", "Check-out"]; final heads = ["Check-in", "Check-out"];
return Expanded( return Expanded(
child: Text( child: Text(
"Check-in", heads[j],
style: TextStyle( style: TextStyle(
color: AppColors.grey_thick, color: AppColors.grey_thick,
fontSize: 14, fontSize: 14,
...@@ -192,12 +189,12 @@ class _AttendanceScreenState extends State<AttendanceScreen> { ...@@ -192,12 +189,12 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
final times = [formattedTime, formattedTime2]; final times = [formattedTime, formattedTime2];
final periods = [period, period2]; final periods = [period, period2];
final locations = [ final locations = [
attendance attendance.attendanceHistory.isNotEmpty? attendance
.attendanceHistory .attendanceHistory
.first['check_in_location'].toString()??"-", .first['check_in_location'].toString()??"-":"-",
attendance attendance.attendanceHistory.isNotEmpty? attendance
.attendanceHistory .attendanceHistory
.first['check_out_location'].toString()??"-", .first['check_out_location'].toString()??"-":"-",
]; ];
return Expanded( return Expanded(
child: Container( child: Container(
...@@ -206,7 +203,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> { ...@@ -206,7 +203,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
vertical: 15, vertical: 15,
), ),
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(
horizontal: 10, horizontal: 5,
vertical: 5, vertical: 5,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
...@@ -398,15 +395,18 @@ class _AttendanceScreenState extends State<AttendanceScreen> { ...@@ -398,15 +395,18 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
GestureDetector( GestureDetector(
onTap: () { onTap: () {
attendance.setPreviousMonth( attendance.setPreviousMonth(
homeProvider, context, );
context,
);
}, },
child: Padding(
padding: const EdgeInsets.all(4.0),
child: SvgPicture.asset( child: SvgPicture.asset(
"assets/svg/arrow_left.svg", "assets/svg/crm/calendar_left.svg",
), ),
), ),
Text( ),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 5.0),
child: Text(
monthLabel, monthLabel,
style: TextStyle( style: TextStyle(
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
...@@ -414,15 +414,18 @@ class _AttendanceScreenState extends State<AttendanceScreen> { ...@@ -414,15 +414,18 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
color: Color(0xFF2D2D2D), color: Color(0xFF2D2D2D),
), ),
), ),
),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
attendance.setNextMonth( attendance.setNextMonth(
homeProvider,
context, context,
); );
}, },
child: Padding(
padding: const EdgeInsets.all(4.0),
child: SvgPicture.asset( child: SvgPicture.asset(
"assets/svg/arrow_right_new.svg", "assets/svg/crm/calendar_right.svg",
),
), ),
), ),
], ],
...@@ -559,7 +562,6 @@ class _AttendanceScreenState extends State<AttendanceScreen> { ...@@ -559,7 +562,6 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
selectedIndex = index; selectedIndex = index;
if (penaltyKey != null) { if (penaltyKey != null) {
attendance.dateWiseAttendance( attendance.dateWiseAttendance(
homeProvider,
penaltyKey, penaltyKey,
context, context,
); );
...@@ -671,7 +673,6 @@ class _AttendanceScreenState extends State<AttendanceScreen> { ...@@ -671,7 +673,6 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
], ],
), ),
), ),
),
bottomNavigationBar: bottomNavigationBar:
attendance.attendanceStatus == 0 || attendance.attendanceStatus == 0 ||
attendance.attendanceStatus == 1 attendance.attendanceStatus == 1
...@@ -695,12 +696,11 @@ class _AttendanceScreenState extends State<AttendanceScreen> { ...@@ -695,12 +696,11 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
); );
if (res == true) { if (res == true) {
attendance.getAttendanceList( attendance.getAttendanceList(
homeProvider,
context, context,
); );
attendance.init(homeProvider, context); attendance.init( context);
attendance.loadAttendanceDetails( attendance.loadAttendanceDetails(
homeProvider,
context, context,
); );
} }
......
...@@ -136,16 +136,16 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -136,16 +136,16 @@ class _MyHomePageState extends State<MyHomePage> {
return (connection == 'Online') return (connection == 'Online')
? Consumer2<HomescreenNotifier, ProfileNotifer>( ? Consumer2<HomescreenNotifier, ProfileNotifer>(
builder: (context, homescreen, profile, child) { builder: (context, homescreen, profile, child) {
final coreRequiredRoles = ["430", "430","433", "434", ]; final coreRequiredRoles = ["12", "540","433", "434", ];
final requiredRoles = ["430", "430", "431", "431"]; final requiredRoles = ["430", "430", "431", "431"];
final coreNames = ["CRM", "Orders","Service", "Gen Tracker", ]; final coreNames = ["CRM", "Orders","Service", "Gen Tracker", ];
final names = ["Attendance", "Finance", "ERP", "Whizzdom"]; final names = ["Attendance", "Finance", "ERP", "Whizzdom"];
final subtitles = [ final subtitles = [
"Check-in,Check-out", "Check-in,Check-out",
"Payments, expense tracking", "Payment Requests, Transactions",
"Centralized data and reports", "Centralized data and reports",
"Training, Assessments", "Page guidance, Learn to use",
]; ];
final coreIcons = [ final coreIcons = [
"assets/svg/home/home_crm_ic.svg", "assets/svg/home/home_crm_ic.svg",
...@@ -214,8 +214,14 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -214,8 +214,14 @@ class _MyHomePageState extends State<MyHomePage> {
children: [ children: [
Expanded( Expanded(
flex: 3, flex: 3,
child: InkResponse(
onTap: () {
_showProfileBottomSheet(
context,
);
},
child: Container( child: Container(
padding: EdgeInsets.symmetric(vertical: 5), // padding: EdgeInsets.symmetric(vertical: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.vertical( borderRadius: BorderRadius.vertical(
...@@ -229,9 +235,9 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -229,9 +235,9 @@ class _MyHomePageState extends State<MyHomePage> {
right: 15, right: 15,
top: 30, top: 30,
), ),
padding: EdgeInsets.only(bottom: 15, right: 10), padding: EdgeInsets.only(bottom: 1, right: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30), borderRadius: BorderRadius.circular(20),
gradient: LinearGradient( gradient: LinearGradient(
colors: [ colors: [
AppColors.profile_card, AppColors.profile_card,
...@@ -241,84 +247,23 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -241,84 +247,23 @@ class _MyHomePageState extends State<MyHomePage> {
), ),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
flex: 2, flex: 8,
child: Padding( child: Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets.only(
vertical: 15, left: 25,
top: 15,
bottom: 15
), ),
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.center, MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox(
width: 60,
height: 60,
child: ClipRRect(
borderRadius:
BorderRadius.circular(50),
child: CachedNetworkImage(
cacheKey:
profile.profileImage,
fit: BoxFit.cover,
imageUrl:
"${profile.profileImage}",
useOldImageOnUrlChange: false,
placeholder:
(context, url) =>
CircularProgressIndicator.adaptive(),
errorWidget:
(context, url, error) =>
Icon(Icons.error),
),
),
),
Spacer(),
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Container(
width: 13,
height: 13,
decoration: BoxDecoration(
shape: BoxShape.circle,
color:
homescreen.onlineStatus ==
"Online"
? Colors.green
: Colors.yellow,
),
),
SizedBox(width: 6),
Text(
"${homescreen.onlineStatus}",
style: TextStyle(
fontSize: 16,
fontFamily: "JakartaMedium",
color: Color(0xFF2D2D2D),
),
),
],
),
],
),
),
),
Expanded(
flex: 3,
child: Container(
padding: EdgeInsets.symmetric(
vertical: 15,
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.center,
children: [
// Text( // Text(
// "${profile.employeeName}", // "${profile.employeeName}",
// maxLines: 1, // maxLines: 1,
...@@ -367,48 +312,77 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -367,48 +312,77 @@ class _MyHomePageState extends State<MyHomePage> {
fontSize: 14, fontSize: 14,
), ),
), ),
Spacer(), SizedBox(height: 12,),
InkResponse( Row(
onTap: () {
_showProfileBottomSheet(
context,
);
},
child: Padding(
padding:
const EdgeInsets.symmetric(
vertical: 3.0,
),
child: Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.start, MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [ children: [
Container(
width: 12,
height: 12,
decoration: BoxDecoration(
shape: BoxShape.circle,
color:
homescreen.onlineStatus ==
"Online"
? AppColors.approved_text_color
: AppColors.rejected_text_color,
),
),
SizedBox(width: 6),
Text( Text(
"View Profile", "${homescreen.onlineStatus}",
style: TextStyle( style: TextStyle(
color:
AppColors.app_blue,
fontFamily:
"JakartaRegular",
fontSize: 14, fontSize: 14,
fontFamily: "JakartaRegular",
color: Color(0xFF2D2D2D),
), ),
), ),
SizedBox(width: 5),
SizedBox(
width: 13, ],
height: 13, ),
child: Center( ],
child: SvgPicture.asset(
"assets/svg/next_button.svg",
), ),
), ),
), ),
], Spacer(),
Expanded(
flex: 2,
child: Container(
padding: EdgeInsets.symmetric(
vertical: 15,
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.center,
children: [
SizedBox(
width: 60,
height: 60,
child: ClipRRect(
borderRadius:
BorderRadius.circular(50),
child: CachedNetworkImage(
cacheKey:
profile.profileImage,
fit: BoxFit.cover,
imageUrl:
"${profile.profileImage}",
useOldImageOnUrlChange: false,
placeholder:
(context, url) =>
CircularProgressIndicator.adaptive(),
errorWidget:
(context, url, error) =>
Icon(Icons.error),
), ),
), ),
), ),
], ],
), ),
), ),
...@@ -418,8 +392,9 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -418,8 +392,9 @@ class _MyHomePageState extends State<MyHomePage> {
), ),
), ),
), ),
),
Expanded( Expanded(
flex: 10, flex: 12,
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: LinearGradient( gradient: LinearGradient(
...@@ -565,14 +540,21 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -565,14 +540,21 @@ class _MyHomePageState extends State<MyHomePage> {
// ), // ),
// ], // ],
if (homescreen.roleStatus.contains(
"432",
)) ...[
if (filteredItems.isNotEmpty) ...[ if (filteredItems.isNotEmpty) ...[
Container( Container(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
top: 10, top: 10,
bottom: 5, bottom: 5,
), ),
margin: EdgeInsets.symmetric( margin: EdgeInsets.only(
horizontal: 10, left: 10,
bottom: 5,
top: 10
), ),
child: Text( child: Text(
"Workforce & Operations", "Workforce & Operations",
...@@ -585,7 +567,7 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -585,7 +567,7 @@ class _MyHomePageState extends State<MyHomePage> {
), ),
Container( Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 10, vertical: 15,
horizontal: 15, horizontal: 15,
), ),
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(
...@@ -733,14 +715,12 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -733,14 +715,12 @@ class _MyHomePageState extends State<MyHomePage> {
), ),
), ),
], ],
if (homescreen.roleStatus.contains(
"432",
)) ...[
Container( Container(
margin: EdgeInsets.symmetric( margin: EdgeInsets.only(
horizontal: 10, left: 10,
bottom: 5,
top: 10
), ),
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
top: 10, top: 10,
...@@ -830,6 +810,217 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -830,6 +810,217 @@ class _MyHomePageState extends State<MyHomePage> {
), ),
), ),
), ),
]
else...[
if (filteredItems.isNotEmpty) ...[
Container(
margin: EdgeInsets.only(
left: 10,
bottom: 5,
top: 10
),
padding: const EdgeInsets.only(
top: 10,
bottom: 5,
),
child: Text(
"Workforce & Operations",
style: TextStyle(
color: AppColors.grey_thick,
fontSize: 14,
fontFamily: "JakartaMedium",
),
),
),
Container(
margin: EdgeInsets.symmetric(
horizontal: 5,
),
child: GridView.builder(
shrinkWrap: true,
itemCount: filteredItems.length,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
childAspectRatio: 2 / 1.1,
),
itemBuilder: (context, ci) {
return InkResponse(
onTap: () async {
var res;
switch (filteredItems[ci]['name']) {
case "Attendance":
res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
AttendanceScreen(),
settings: RouteSettings(
arguments:
'AttendanceScreen',
),
),
);
break;
case "ERP":
bool isGpsEnabled =
await Geolocator.isLocationServiceEnabled();
if (isGpsEnabled) {
if (Platform.isAndroid) {
res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(
context,
) => WebErpScreen(
erp_url:
homescreen
.webPageUrl,
),
),
);
} else {
res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(
context,
) => WebERPIOS(
url:
homescreen
.webPageUrl,
),
),
);
}
} else {
requestGpsPermission();
}
break;
case "Whizzdom":
bool isGpsEnabled =
await Geolocator.isLocationServiceEnabled();
if (isGpsEnabled) {
res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(
context,
) => WebWhizzdomScreen(
whizzdom_url:
homescreen
.whizzdomPageUrl,
),
),
);
} else {
requestGpsPermission();
}
break;
case "Finance":
res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Financedashboard(),
settings: RouteSettings(
arguments:
'Financedashboard',
),
),
);
break;
default:
print("111");
break;
}
if (res == true) {
homescreen.DashboardApiFunction(
context,
);
}
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 5,
horizontal: 15,
),
margin: EdgeInsets.symmetric(
vertical: 7,
horizontal: 5,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius:
BorderRadius.circular(14),
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Expanded(
flex: 2,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
mainAxisAlignment:
MainAxisAlignment
.center,
children: [
Text(
filteredItems[ci]['name'] ??
"-",
style: TextStyle(
fontSize: 14,
color:
AppColors
.app_blue,
fontFamily:
"JakartaMedium",
),
),
Text(
filteredItems[ci]['subtitle'] ??
"-",
style: TextStyle(
fontSize: 12,
color:
AppColors
.grey_semi,
fontFamily:
"JakartaMedium",
),
),
],
),
),
),
SizedBox(width: 10),
Expanded(
flex: 1,
child: SvgPicture.asset(
filteredItems[ci]['icon'] ??
"-",
),
),
],
),
),
);
},
),
),
],
], ],
// if (filteredItems.isNotEmpty) ...[ // if (filteredItems.isNotEmpty) ...[
...@@ -1042,8 +1233,10 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -1042,8 +1233,10 @@ class _MyHomePageState extends State<MyHomePage> {
if (coreFilteredItems.isNotEmpty) ...[ if (coreFilteredItems.isNotEmpty) ...[
Container( Container(
margin: EdgeInsets.symmetric( margin: EdgeInsets.only(
horizontal: 10, left: 10,
bottom: 5,
top: 10
), ),
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
top: 10, top: 10,
......
...@@ -33,6 +33,7 @@ class _LoginScreenState extends State<LoginScreen> ...@@ -33,6 +33,7 @@ class _LoginScreenState extends State<LoginScreen>
'assets/images/logo_4.png', 'assets/images/logo_4.png',
'assets/images/logo_5.png', 'assets/images/logo_5.png',
'assets/images/logo_6.png', 'assets/images/logo_6.png',
'assets/images/logo_7.png',
]; ];
TextEditingController password = TextEditingController(); TextEditingController password = TextEditingController();
TextEditingController email = TextEditingController(); TextEditingController email = TextEditingController();
...@@ -159,7 +160,7 @@ class _LoginScreenState extends State<LoginScreen> ...@@ -159,7 +160,7 @@ class _LoginScreenState extends State<LoginScreen>
onWillPop: onBackPressed, onWillPop: onBackPressed,
child: SafeArea( child: SafeArea(
top: false, top: false,
bottom: Platform.isIOS?false:true, bottom: Platform.isIOS ? false : true,
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
...@@ -479,7 +480,10 @@ class _LoginScreenState extends State<LoginScreen> ...@@ -479,7 +480,10 @@ class _LoginScreenState extends State<LoginScreen>
], ],
Container( Container(
child: InkWell( child: InkWell(
onTap:loginProv.isLoading?null: () { onTap:
loginProv.isLoading
? null
: () {
// LoginApiFunction(); // LoginApiFunction();
loginProv.isLoading = true; loginProv.isLoading = true;
loginProv.LoginApiFunction( loginProv.LoginApiFunction(
...@@ -487,7 +491,9 @@ class _LoginScreenState extends State<LoginScreen> ...@@ -487,7 +491,9 @@ class _LoginScreenState extends State<LoginScreen>
email.text, email.text,
password.text, password.text,
); );
var f = FocusScope.of(context); var f = FocusScope.of(
context,
);
if (!f.hasPrimaryFocus) { if (!f.hasPrimaryFocus) {
f.unfocus(); f.unfocus();
...@@ -513,14 +519,25 @@ class _LoginScreenState extends State<LoginScreen> ...@@ -513,14 +519,25 @@ class _LoginScreenState extends State<LoginScreen>
), ),
), ),
child: Center( child: Center(
child:loginProv.isLoading?CircularProgressIndicator.adaptive( child:
padding: EdgeInsets.all(5), loginProv.isLoading
valueColor: AlwaysStoppedAnimation(Colors.white),): Text( ? CircularProgressIndicator.adaptive(
padding: EdgeInsets.all(
5,
),
valueColor:
AlwaysStoppedAnimation(
Colors.white,
),
)
: Text(
"Login", "Login",
textAlign: TextAlign.center, textAlign:
TextAlign.center,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontFamily: "JakartaRegular", fontFamily:
"JakartaRegular",
), ),
), ),
), ),
...@@ -589,7 +606,9 @@ class _LoginScreenState extends State<LoginScreen> ...@@ -589,7 +606,9 @@ class _LoginScreenState extends State<LoginScreen>
vertical: 10, vertical: 10,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(18), borderRadius: BorderRadius.circular(
18,
),
color: AppColors.text_field_color, color: AppColors.text_field_color,
), ),
child: Row( child: Row(
...@@ -598,7 +617,9 @@ class _LoginScreenState extends State<LoginScreen> ...@@ -598,7 +617,9 @@ class _LoginScreenState extends State<LoginScreen>
width: 180, width: 180,
height: 45, height: 45,
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.only(right: 5.0), margin: EdgeInsets.only(
right: 5.0,
),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius:
BorderRadius.circular(10.0), BorderRadius.circular(10.0),
...@@ -640,13 +661,16 @@ class _LoginScreenState extends State<LoginScreen> ...@@ -640,13 +661,16 @@ class _LoginScreenState extends State<LoginScreen>
height: 50, height: 50,
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.app_blue, color: AppColors.app_blue,
borderRadius: BorderRadius.circular(18), borderRadius: BorderRadius.circular(
18,
),
), ),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
// Share.share("${loginProv.deviceId}"); // Share.share("${loginProv.deviceId}");
Share.share("Your device ID is: ${loginProv.deviceId}"); Share.share(
"Your device ID is: ${loginProv.deviceId}",
);
}, },
child: SvgPicture.asset( child: SvgPicture.asset(
"assets/svg/share_ic.svg", "assets/svg/share_ic.svg",
...@@ -739,8 +763,17 @@ class LogoWidget extends StatelessWidget { ...@@ -739,8 +763,17 @@ class LogoWidget extends StatelessWidget {
return Container( return Container(
width: MediaQuery.of(context).size.width / 4.5, width: MediaQuery.of(context).size.width / 4.5,
height: MediaQuery.of(context).size.width / 4.5, height: MediaQuery.of(context).size.width / 4.5,
padding: imagePath == "assets/images/logo_7.png"?EdgeInsets.symmetric(horizontal: 5):null,
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage(image: AssetImage(imagePath), fit: BoxFit.cover), color: imagePath == "assets/images/logo_7.png"?Colors.white:Colors.transparent,
borderRadius: BorderRadius.circular(25),
image: DecorationImage(
image: AssetImage(imagePath),
fit:
imagePath == "assets/images/logo_7.png"
? BoxFit.scaleDown
: BoxFit.cover,
),
), ),
); );
} }
......
...@@ -608,6 +608,7 @@ class _AccountledgerState extends State<Accountledger> { ...@@ -608,6 +608,7 @@ class _AccountledgerState extends State<Accountledger> {
paymentID: paymentID:
item.refId, item.refId,
type: item.type, type: item.type,
description: item.description,
), ),
settings: RouteSettings( settings: RouteSettings(
name: name:
......
...@@ -94,7 +94,7 @@ class _AccountslistState extends State<Accountslist> { ...@@ -94,7 +94,7 @@ class _AccountslistState extends State<Accountslist> {
print(accountList.length); print(accountList.length);
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
appBar: appbar2( appBar: appbar2New(
context, context,
"Account List", "Account List",
provider.resetValues, provider.resetValues,
...@@ -103,12 +103,16 @@ class _AccountslistState extends State<Accountslist> { ...@@ -103,12 +103,16 @@ class _AccountslistState extends State<Accountslist> {
child: InkResponse( child: InkResponse(
onTap: () { onTap: () {
_showFilterSheet(context); _showFilterSheet1(context);
}, },
child: Padding(
padding: const EdgeInsets.all(8.0),
child: SvgPicture.asset("assets/svg/filter_ic.svg", height: 18), child: SvgPicture.asset("assets/svg/filter_ic.svg", height: 18),
), ),
), ),
), ),
0xFFFFFFFF
),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: body:
provider.isLoading provider.isLoading
...@@ -155,42 +159,68 @@ class _AccountslistState extends State<Accountslist> { ...@@ -155,42 +159,68 @@ class _AccountslistState extends State<Accountslist> {
); );
} }
return Container( return InkResponse(
onTap: () async {
print(
"length, ${accountList.length}",
);
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Accountslistdetails(
accountID:
accountList[index]
.id,
),
),
);
},
child: Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 10, horizontal: 5,
vertical: 10, vertical: 5,
), ),
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(
horizontal: 10, horizontal: 10,
vertical: 10, vertical: 5,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
), ),
child: Column( child: Row(
children: [
Row(
children: [ children: [
// Expanded(
// flex: 1,
// child: Container(
// height: 50,
// width: 35,
// padding: EdgeInsets.all(8.0),
// decoration: BoxDecoration(
// color: Color(0xFFEAF7FF),
// borderRadius:
// BorderRadius.circular(8),
// ),
// child: SvgPicture.asset(
// "assets/svg/common_ac_list_ic.svg",
// ),
// ),
// ),
Expanded( Expanded(
flex: 1, flex: 1,
child: Container( child: Container(
height: 50, height: 50,
width: 35, width: 35,
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Color(0xFFEAF7FF),
borderRadius:
BorderRadius.circular(8),
),
child: SvgPicture.asset( child: SvgPicture.asset(
"assets/svg/common_ac_list_ic.svg", "assets/svg/crm/lead_details_list_ic.svg",
), ),
), ),
), ),
SizedBox(width: 10), SizedBox(width: 10),
Expanded( Expanded(
flex: 4, flex: 7,
child: SizedBox( child: SizedBox(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
...@@ -198,9 +228,11 @@ class _AccountslistState extends State<Accountslist> { ...@@ -198,9 +228,11 @@ class _AccountslistState extends State<Accountslist> {
children: [ children: [
Text( Text(
accountList[index].name!, accountList[index].name!,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontFamily: fontFamily:
"JakartaMedium", "JakartaRegular",
fontSize: 14, fontSize: 14,
color: color:
AppColors.semi_black, AppColors.semi_black,
...@@ -208,118 +240,23 @@ class _AccountslistState extends State<Accountslist> { ...@@ -208,118 +240,23 @@ class _AccountslistState extends State<Accountslist> {
), ),
Text( Text(
accountList[index] accountList[index]
.contactName ?? .type ??
"-", "-",
maxLines: 1,
style: TextStyle( style: TextStyle(
fontFamily: fontFamily:
"JakartaMedium", "JakartaRegular",
fontSize: 14, fontSize: 12,
color: AppColors.app_blue, color: AppColors.grey_semi,
),
),
],
),
),
),
],
),
Divider(
thickness: 0.5,
color: Color(0xFFD7D7D7),
),
...List.generate(4, (j) {
final headings = [
"Mobile Number",
"Email Id",
"Address",
"Account Type",
];
final subHeadings = [
accountList[index].mob1 ?? "-",
accountList[index].email ?? "-",
accountList[index].address ?? "-",
accountList[index].type ?? "-",
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
headings[j],
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
SizedBox(width: 15),
Expanded(
child: Text(
subHeadings[j] ?? "-",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.grey_thick,
),
), ),
), ),
], ],
), ),
);
}),
InkResponse(
onTap: () async {
print(
"length, ${accountList.length}",
);
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Accountslistdetails(
accountID:
accountList[index]
.id,
),
),
);
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
), ),
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
), ),
], ],
), ),
), ),
),
],
),
); );
}, },
), ),
...@@ -449,9 +386,321 @@ class _AccountslistState extends State<Accountslist> { ...@@ -449,9 +386,321 @@ class _AccountslistState extends State<Accountslist> {
); );
} }
Future<void> _showFilterSheet1(BuildContext context) {
List<bool> isSelected = List.generate(
2,
(index) => index == 0 ? true : false,
);
return showModalBottomSheet(
useSafeArea: true,
isDismissible: true,
isScrollControlled: true,
showDragHandle: true,
backgroundColor: Colors.white,
enableDrag: true,
context: context,
builder: (context) {
return StatefulBuilder(
builder: (context, setState) {
return SafeArea(
child: Padding(
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).viewInsets.bottom,
),
child: Consumer<Accountslistprovider>(
builder: (context, provider, child) {
int selectedIndex = isSelected.indexWhere(
(element) => element == true,
);
List<String> headings = [
"Account Name",
"Mobile Number",
];
return Container(
height: MediaQuery.of(context).size.height*0.3,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 15),
child: Text(
"Filter",
style: TextStyle(
color: AppColors.app_blue,
fontSize: 18,
fontFamily: "JakartaSemiBold",
),
),
),
const SizedBox(height: 20),
Expanded(
flex:4,
child: Container(
decoration: BoxDecoration(
border: Border(
top: BorderSide(color: const Color(0xFFA5DAF9)),
bottom: BorderSide(
color: const Color(0xFFA5DAF9),
),
),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 3,
child: Column(
children: List.generate(headings.length, (jj) {
return Expanded(
child: InkResponse(
onTap: () {
setState(() {
// Reset all to false
isSelected = List.generate(
headings.length,
(index) => false,
);
// Set the clicked item to true
isSelected[jj] = true;
});
},
child: Container(
padding: const EdgeInsets.symmetric(
vertical: 7.5,
horizontal: 10,
),
decoration: BoxDecoration(
border: Border(
left:
isSelected[jj]
? BorderSide(
color:
AppColors
.app_blue,
width: 5.0,
)
: const BorderSide(
color:
Colors
.transparent,
),
bottom:
jj == headings.length - 1
? const BorderSide(
color:
Colors
.transparent,
)
: const BorderSide(
color: Color(
0xFFA5DAF9,
),
),
),
color: const Color(0xFFE6F6FF),
),
child: Center(
child: Text(
headings[jj],
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 14,
fontFamily: "JakartaRegular",
color: AppColors.semi_black,
),
),
),
),
),
);
}),
),
),
Expanded(
flex: 5,
child: SingleChildScrollView(
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
if (selectedIndex == 0) ...[
SizedBox(height: 10,),
textControllerWidget(
context,
provider.companyNameController,
"",
"Enter Account Name",
provider.onChangedCompanyName,
TextInputType.text,
false,
null,
),
]
else if (selectedIndex == 1) ...[
SizedBox(height: 10,),
textControllerWidget(
context,
provider.mobileNumberController,
"",
"Enter Mobile Number",
provider.onChangedMobileNum,
TextInputType.number,
false,
FilteringTextInputFormatter
.digitsOnly,
),
]
],
),
),
),
],
),
),
),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 15,
vertical: 20,
),
child: InkResponse(
onTap: () {
provider.pageNum = 1;
provider.commonAccountListAPIFunction(context);
Navigator.pop(context);
},
child: Container(
height: 45,
alignment: Alignment.center,
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15),
),
child: const Text(
"Search",
style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white,
),
),
),
),
),
],
),
);
},
),
),
);
},
);
},
);
}
Future<bool> _onBackPressed(BuildContext context) async { Future<bool> _onBackPressed(BuildContext context) async {
Provider.of<Accountslistprovider>(context, listen: false).pageNum = 1; Provider.of<Accountslistprovider>(context, listen: false).pageNum = 1;
Navigator.pop(context, true); Navigator.pop(context, true);
return true; return true;
} }
} }
// Divider(
// thickness: 0.5,
// color: Color(0xFFD7D7D7),
// ),
// ...List.generate(4, (j) {
// final headings = [
// "Mobile Number",
// "Email Id",
// "Address",
// "Account Type",
// ];
//
// final subHeadings = [
// accountList[index].mob1 ?? "-",
// accountList[index].email ?? "-",
// accountList[index].address ?? "-",
// accountList[index].type ?? "-",
// ];
// return Container(
// padding: EdgeInsets.symmetric(
// vertical: 5,
// ),
// child: Row(
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: [
// Expanded(
// child: Text(
// headings[j],
// style: TextStyle(
// fontFamily: "JakartaMedium",
// fontSize: 14,
// color: AppColors.semi_black,
// ),
// ),
// ),
// SizedBox(width: 15),
// Expanded(
// child: Text(
// subHeadings[j] ?? "-",
// style: TextStyle(
// fontFamily: "JakartaMedium",
// fontSize: 14,
// color: AppColors.grey_thick,
// ),
// ),
// ),
// ],
// ),
// );
// }),
// InkResponse(
//
// child: Container(
// padding: EdgeInsets.symmetric(
// vertical: 5,
// ),
// child: Row(
// crossAxisAlignment:
// CrossAxisAlignment.center,
// mainAxisAlignment:
// MainAxisAlignment.start,
// children: [
// Text(
// "View Details",
// style: TextStyle(
// fontFamily: "JakartaMedium",
// fontSize: 14,
// color: AppColors.app_blue,
// ),
// ),
// SizedBox(width: 5),
// SvgPicture.asset(
// "assets/svg/next_button.svg",
// ),
// ],
// ),
// ),
// ),
import 'dart:io'; import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:dotted_line/dotted_line.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:generp/Notifiers/commonProvider/accountDetailsProvider.dart'; import 'package:generp/Notifiers/commonProvider/accountDetailsProvider.dart';
...@@ -91,84 +92,370 @@ class _AccountslistdetailsState extends State<Accountslistdetails> { ...@@ -91,84 +92,370 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
} }
overallBalance = totalDebit - totalCredit; overallBalance = totalDebit - totalCredit;
final headings1 = [
"Bank Name",
"Bank Branch",
"Bank IFSC Code",
"Account Holder",
"Account Number",
"Bank UPI ID",
];
final headings2 = ["Address", "State", "District", "Sub Locality"];
final headings3 = ["Created Date"];
final subHeadings1 = [
provider.accountDetails.bankName ?? "-",
provider.accountDetails.bankBranchName ?? "-",
provider.accountDetails.bankIfscCode ?? "-",
provider.accountDetails.bankAccountHolderName ?? "-",
provider.accountDetails.bankAccountNumber ?? "-",
provider.accountDetails.bankUpiId ?? "-",
];
final subHeadings2 = [
provider.accountDetails.address ?? "-",
provider.accountDetails.state ?? "-",
provider.accountDetails.district ?? "-",
provider.accountDetails.subLocality ?? "-",
];
final subHeadings3 = [provider.accountDetails.createdDatetime ?? "-"];
return Scaffold( return Scaffold(
appBar: appbar2( appBar: appbar2New(
context, context,
"Account Details", "Account Details",
provider.resetValues, provider.resetValues,
SizedBox.shrink(),
0xFFFFFFFF,
),
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
body: SizedBox(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(30),
bottomRight: Radius.circular(30),
),
),
elevation: 2,
child: Column(
children: [
Container( Container(
padding: EdgeInsets.symmetric(horizontal: 5, vertical: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFE6F6FF), color: Colors.white,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.vertical(
bottom: Radius.circular(30),
), ),
child: Row( ),
// margin: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
padding: EdgeInsets.symmetric(
vertical: 10,
horizontal: 10,
),
child: Column(
children: [ children: [
SvgPicture.asset("assets/svg/fin_ic.svg", height: 12), Row(
SizedBox(width: 5), children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 35,
child: SvgPicture.asset(
"assets/svg/crm/lead_details_ic.svg",
),
),
),
SizedBox(width: 10),
Expanded(
flex: 5,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
provider.accountDetails.name ?? "-",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
Text( Text(
overallBalance.toString() ?? "-", provider.accountDetails.type ?? "-",
style: TextStyle(fontSize: 12), style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.grey_semi,
),
), ),
], ],
), ),
), ),
), ),
resizeToAvoidBottomInset: true, SizedBox(width: 10),
backgroundColor: AppColors.scaffold_bg_color, ],
body: SizedBox( ),
child: SingleChildScrollView( Visibility(
visible:
provider.showMoreDetails ? true : false,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
decoration: BoxDecoration( padding: EdgeInsets.symmetric(
color: Colors.white, vertical: 4,
borderRadius: BorderRadius.circular(16),
), ),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
child: Container( flex: 3,
child: Text(
"Bank Details",
style: TextStyle(
fontSize: 14,
fontFamily: "JakartaSemiBold",
),
),
),
Expanded(
flex: 6,
child: DottedLine(
dashGapLength: 4,
dashGapColor: Colors.white,
dashColor: AppColors.grey_semi,
dashLength: 2,
lineThickness: 0.5,
),
),
],
),
),
...List.generate(subHeadings1.length, (j) {
return Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 10, vertical: 7,
vertical: 15,
), ),
margin: EdgeInsets.symmetric( child: Row(
horizontal: 10, crossAxisAlignment:
vertical: 15, CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
headings1[j],
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.semi_black,
), ),
decoration: BoxDecoration(
color: Color(0xFFFFEFEF),
borderRadius: BorderRadius.circular(16),
), ),
child: Column( ),
crossAxisAlignment: CrossAxisAlignment.start, Expanded(
child: Text(
subHeadings1[j] == ""
? "-"
: subHeadings1[j],
style: TextStyle(
fontSize: 14,
color: Color(0xFF818181),
),
),
),
],
),
);
}),
Container(
padding: EdgeInsets.symmetric(
vertical: 4,
),
child: Row(
children: [ children: [
RichText( Expanded(
text: TextSpan( flex: 3,
child: Text(
"Address Details",
style: TextStyle(
fontSize: 14,
fontFamily: "JakartaSemiBold",
),
),
),
Expanded(
flex: 6,
child: DottedLine(
dashGapLength: 4,
dashGapColor: Colors.white,
dashColor: AppColors.grey_semi,
dashLength: 2,
lineThickness: 0.5,
),
),
],
),
),
...List.generate(subHeadings2.length, (j) {
return Container(
padding: EdgeInsets.symmetric(
vertical: 7,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
TextSpan( Expanded(
text: "${totalCredit}", child: Text(
headings2[j],
style: TextStyle( style: TextStyle(
color: Color(0xFFED3424),
fontFamily: "JakartaRegular", fontFamily: "JakartaRegular",
fontSize: 25, fontSize: 14,
color: AppColors.semi_black,
),
),
),
Expanded(
child: Text(
subHeadings2[j] == ""
? "-"
: subHeadings2[j],
style: TextStyle(
fontSize: 14,
color: Color(0xFF818181),
),
), ),
), ),
], ],
), ),
);
}),
Container(
padding: EdgeInsets.symmetric(
vertical: 4,
),
child: Row(
children: [
Expanded(
flex: 3,
child: Text(
"More Details",
style: TextStyle(
fontSize: 14,
fontFamily: "JakartaSemiBold",
),
),
),
Expanded(
flex: 6,
child: DottedLine(
dashGapLength: 4,
dashGapColor: Colors.white,
dashColor: AppColors.grey_semi,
dashLength: 2,
lineThickness: 0.5,
), ),
Text(
"credit",
style: TextStyle(color: Color(0xFF818181)),
), ),
], ],
), ),
), ),
...List.generate(subHeadings3.length, (j) {
return Container(
padding: EdgeInsets.symmetric(
vertical: 7,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
headings3[j],
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.semi_black,
),
),
), ),
Expanded( Expanded(
child: Text(
subHeadings3[j] == ""
? "-"
: subHeadings3[j],
style: TextStyle(
fontSize: 14,
color: Color(0xFF818181),
),
),
),
],
),
);
}),
],
),
),
InkResponse(
onTap: () async {
provider.showMoreDetails =
!provider.showMoreDetails;
},
child: Container( child: Container(
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
provider.showMoreDetails
? "Hide Details"
: "View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
Transform.flip(
flipY:
provider.showMoreDetails
? true
: false,
child: SvgPicture.asset(
"assets/svg/arrow_dropdown.svg",
height: 25,
width: 20,
color: AppColors.app_blue,
),
),
],
),
),
),
],
),
),
],
),
),
Container(
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 10, horizontal: 10,
vertical: 15, vertical: 15,
...@@ -178,149 +465,128 @@ class _AccountslistdetailsState extends State<Accountslistdetails> { ...@@ -178,149 +465,128 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
vertical: 15, vertical: 15,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFFFEFEF), color: Color(0xFFEDF7FF),
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
), ),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
RichText( Row(
text: TextSpan( mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
TextSpan( Text(
text: "${totalDebit}", provider.balanceDetails.balance ?? "-",
style: TextStyle( style: TextStyle(
color: Color(0xFFED3424), fontSize: 20,
fontFamily: "JakartaRegular", fontFamily: "JakartaMedium",
fontSize: 25, color: AppColors.app_blue,
), ),
), ),
], ],
), ),
Container(
padding: EdgeInsets.only(top: 5),
child: Text(
"Total Balance",
maxLines: 1,
style: TextStyle(
fontSize: 14,
fontFamily: "JakartaRegular",
color: AppColors.semi_black,
),
), ),
Text(
"debit",
style: TextStyle(color: Color(0xFF818181)),
), ),
], ],
), ),
), ),
Row(
children: [
...List.generate(2, (jj) {
final texts = ["Credited", "Debited"];
final heads = [
provider.balanceDetails.totalCredit ?? "-",
provider.balanceDetails.totalDebit ?? "-",
];
final svgs = [
"assets/svg/finance/cred_debit_ic.svg",
"assets/svg/finance/deb_credit_ic.svg",
];
return Expanded(
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
), ),
], margin: EdgeInsets.symmetric(
), horizontal: 10,
vertical: 15,
), ),
// Text(
// "Account Details",
// style: TextStyle(
// fontSize: 16,
// color: AppColors.grey_thick,
// fontFamily: "JakartaMedium",
// ),
// ),
Container(
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color:
texts[jj] == "Credited"
? Color(0xFFFFEFEF)
: Color(0xFFE7FFE5),
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
), ),
child: Column( child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
...List.generate(12, (j) { Text(
final headings = [ heads[jj] ?? "-",
"Name", maxLines: 2,
"Address", style: TextStyle(
"Date", fontSize: 20,
"Bank Name", color:
"Bank Branch", texts[jj] == "Credited"
"Bank IFSC Code", ? Color(0xFFEF3739)
"Account Holder", : Color(0xFF0D9C00),
"Account Number", fontFamily: "JakartaMedium",
"Bank UPI ID", ),
"State", ),
"District", Container(
"Sub Locality", padding: EdgeInsets.only(top: 5),
];
final subHeadings = [
provider.accountDetails.name ?? "-",
provider.accountDetails.address ?? "-",
provider.accountDetails.createdDatetime ?? "-",
provider.accountDetails.bankName ?? "-",
provider.accountDetails.bankBranchName ?? "-",
provider.accountDetails.bankIfscCode ?? "-",
provider.accountDetails.bankAccountHolderName ??
"-",
provider.accountDetails.bankAccountNumber ?? "-",
provider.accountDetails.bankUpiId ?? "-",
provider.accountDetails.state ?? "-",
provider.accountDetails.district ?? "-",
provider.accountDetails.subLocality ?? "-",
];
return Container(
padding: EdgeInsets.symmetric(vertical: 5),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
flex: 3,
child: Text( child: Text(
headings[j], texts[jj] ?? "-",
maxLines: 1,
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14, fontSize: 14,
fontFamily: "JakartaRegular",
color: AppColors.semi_black, color: AppColors.semi_black,
), ),
), ),
), ),
SizedBox(width: 15),
Expanded( Expanded(
child: Text( flex: 1,
subHeadings[j] == "" child: SvgPicture.asset(svgs[jj]),
? "-"
: subHeadings[j] ?? "-",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.grey_thick,
), ),
],
), ),
), ),
], ],
), ),
),
); );
}), }),
], ],
), ),
],
),
), ),
ListView.builder( ListView.builder(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
itemCount: groupedData.keys.length, itemCount: provider.ledgerList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
String date = groupedData.keys.elementAt(index);
List<LedgerList> items = groupedData[date]!;
return Container(
padding: EdgeInsets.symmetric(vertical: 5),
margin: EdgeInsets.symmetric(horizontal: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.only(bottom: 5),
child: Text(
date,
style: TextStyle(
fontSize: 14,
fontFamily: "JakartaMedium",
color: Color(0xFF818181),
),
),
),
...items.map((item) {
double running_balance = 0; double running_balance = 0;
int currentIndex = provider.ledgerList.indexOf( int currentIndex = provider.ledgerList.indexOf(
item, provider.ledgerList[index],
); );
for (var i = 0; i <= currentIndex; i++) { for (var i = 0; i <= currentIndex; i++) {
var ledgerItem = provider.ledgerList[i]; var ledgerItem = provider.ledgerList[i];
...@@ -336,8 +602,22 @@ class _AccountslistdetailsState extends State<Accountslistdetails> { ...@@ -336,8 +602,22 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
0; 0;
running_balance += (debit - credit); running_balance += (debit - credit);
} }
return InkResponse(
return Container( onTap: () async {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Transactiondetails(
paymentID: provider.ledgerList[index].refId,
type: provider.ledgerList[index].type,
description:
provider.ledgerList[index].description,
),
),
);
},
child: Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 10, horizontal: 10,
vertical: 10, vertical: 10,
...@@ -347,25 +627,24 @@ class _AccountslistdetailsState extends State<Accountslistdetails> { ...@@ -347,25 +627,24 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
), ),
child: Column( child: Row(
children: [ mainAxisAlignment: MainAxisAlignment.start,
Row( crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
flex: 1, flex: 1,
child: SizedBox( child: SizedBox(
child: child:
item.type == "Credit" provider.ledgerList[index].type ==
? Image.asset( "Credit"
"assets/images/trans_debit.png", ? SvgPicture.asset(
"assets/svg/finance/debited_filled_ic.svg",
height: 45, height: 45,
width: 45, width: 45,
fit: BoxFit.contain, fit: BoxFit.contain,
) )
: Image.asset( : SvgPicture.asset(
"assets/images/trans_credit.png", "assets/svg/finance/credited_filled_ic.svg",
height: 45, height: 45,
width: 45, width: 45,
fit: BoxFit.contain, fit: BoxFit.contain,
...@@ -374,23 +653,27 @@ class _AccountslistdetailsState extends State<Accountslistdetails> { ...@@ -374,23 +653,27 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
), ),
SizedBox(width: 10), SizedBox(width: 10),
Expanded( Expanded(
flex: 5, flex: 8,
child: SizedBox( child: SizedBox(
child: Column( child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Text( Row(
item.description ?? "-", crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 5,
child: SizedBox(
child: Text(
provider
.ledgerList[index]
.description ??
"-",
maxLines: 2, maxLines: 2,
overflow: overflow: TextOverflow.ellipsis,
TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium", fontFamily: "JakartaRegular",
fontSize: 12, fontSize: 14,
),
), ),
],
), ),
), ),
), ),
...@@ -406,24 +689,38 @@ class _AccountslistdetailsState extends State<Accountslistdetails> { ...@@ -406,24 +689,38 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
children: [ children: [
TextSpan( TextSpan(
text: text:
item.type == "Credit" provider
.ledgerList[index]
.type ==
"Credit"
? "-" ? "-"
: "+", : "+",
style: TextStyle( style: TextStyle(
color: Color(0xFF2D2D2D), color:
fontSize: 13, provider
.ledgerList[index]
.type ==
"Credit"
? Color(0xFFEF3739)
: Color(0xFF0D9C00),
fontSize: 14,
fontFamily: fontFamily:
"JakartaRegular", "JakartaRegular",
), ),
), ),
TextSpan( TextSpan(
text: text:
"₹${item.type == "Credit" ? "${item.creditAmount}" : "${item.debitAmount}"}", "₹${provider.ledgerList[index].type == "Credit" ? "${provider.ledgerList[index].creditAmount}" : "${provider.ledgerList[index].debitAmount}"}",
style: TextStyle( style: TextStyle(
color: Color(0xFF2D2D2D), color: provider
fontSize: 13, .ledgerList[index]
.type ==
"Credit"
? Color(0xFFEF3739)
: Color(0xFF0D9C00),
fontSize: 14,
fontFamily: fontFamily:
"JakartaMedium", "JakartaRegular",
), ),
), ),
], ],
...@@ -433,68 +730,64 @@ class _AccountslistdetailsState extends State<Accountslistdetails> { ...@@ -433,68 +730,64 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
), ),
], ],
), ),
Divider( SizedBox(height: 7,),
thickness: 0.5,
color: Color(0xFFd7d7d7),
),
Row( Row(
children: [ children: [
Expanded( Expanded(
flex: 5,
child: SizedBox(
child: Text( child: Text(
"Balance", provider
.ledgerList[index]
.date ??
"-",
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 13, fontFamily: "JakartaRegular",
color: Color(0xFF2d2d2d), color: AppColors.grey_semi,
fontSize: 12,
),
), ),
), ),
), ),
Spacer(),
Expanded( Expanded(
child: Text( flex: 3,
child: SizedBox(
child: RichText(
maxLines: 1,
textAlign: TextAlign.right, textAlign: TextAlign.right,
"${running_balance.toString()}" ?? overflow: TextOverflow.ellipsis,
"-", text: TextSpan(
children: [
TextSpan(
text: "Bal: ",
style: TextStyle( style: TextStyle(
color: Color(0xFF818181), color:
fontSize: 13, AppColors
), .semi_black,
fontSize: 12,
fontFamily:
"JakartaRegular",
), ),
), ),
], TextSpan(
text: "$running_balance",
style: TextStyle(
color:
AppColors.grey_semi,
fontSize: 12,
fontFamily:
"JakartaMedium",
), ),
InkResponse(
onTap: () async {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Transactiondetails(
paymentID: item.refId,
type: item.type,
), ),
],
), ),
);
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 5,
), ),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
), ),
), ),
SizedBox(width: 5), ],
SvgPicture.asset(
"assets/svg/next_button.svg",
), ),
], ],
), ),
...@@ -502,9 +795,6 @@ class _AccountslistdetailsState extends State<Accountslistdetails> { ...@@ -502,9 +795,6 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
), ),
], ],
), ),
);
}).toList(),
],
), ),
); );
}, },
...@@ -568,3 +858,590 @@ class _AccountslistdetailsState extends State<Accountslistdetails> { ...@@ -568,3 +858,590 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
return true; return true;
} }
} }
///import 'dart:io';
//
// import 'package:connectivity_plus/connectivity_plus.dart';
// import 'package:flutter/material.dart';
// import 'package:flutter_svg/svg.dart';
// import 'package:generp/Notifiers/commonProvider/accountDetailsProvider.dart';
// import 'package:generp/Utils/app_colors.dart';
// import 'package:generp/Utils/commonServices.dart';
// import 'package:generp/Utils/commonWidgets.dart';
// import 'package:generp/screens/commom/transactionDetails.dart';
// import 'package:generp/screens/finance/submitPaymentRequestionListsByMode.dart';
// import 'package:provider/provider.dart';
//
// import '../../Models/commonModels/commonAccountdetailsResponse.dart';
//
// class Accountslistdetails extends StatefulWidget {
// final accountID;
//
// const Accountslistdetails({super.key, required this.accountID});
//
// @override
// State<Accountslistdetails> createState() => _AccountslistdetailsState();
// }
//
// class _AccountslistdetailsState extends State<Accountslistdetails> {
// Map _source = {ConnectivityResult.mobile: true};
// final MyConnectivity _connectivity = MyConnectivity.instance;
//
// @override
// void initState() {
// // TODO: implement initState
// super.initState();
// _connectivity.initialise();
// _connectivity.myStream.listen((source) {
// setState(() => _source = source);
// });
// WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
// var prov = Provider.of<Accountdetailsprovider>(context, listen: false);
// prov.accountdetailsAPIFunction(context, widget.accountID);
// });
// }
//
// @override
// void dispose() {
// // TODO: implement dispose
// super.dispose();
// _connectivity.disposeStream();
// }
//
// @override
// Widget build(BuildContext context) {
// switch (_source.keys.toList()[0]) {
// case ConnectivityResult.mobile:
// connection = 'Online';
// break;
// case ConnectivityResult.wifi:
// connection = 'Online';
// break;
// case ConnectivityResult.none:
// default:
// connection = 'Offline';
// }
// return (connection == "Online")
// ? Platform.isAndroid
// ? WillPopScope(
// onWillPop: () => onBackPressed(context),
// child: SafeArea(
// top: false,
// bottom: true,
// child: _scaffold(context),
// ),
// )
// : _scaffold(context)
// : NoNetwork(context);
// }
//
// Widget _scaffold(BuildContext context) {
// return Consumer<Accountdetailsprovider>(
// builder: (context, provider, child) {
// final groupedData = provider.groupByDate(provider.ledgerList);
// // Calculate total credit, debit, and balance
// double totalCredit = 0;
// double totalDebit = 0;
// double overallBalance = 0;
//
// for (var item in provider.ledgerList) {
// double credit = double.tryParse(item.creditAmount.toString()) ?? 0;
// double debit = double.tryParse(item.debitAmount.toString()) ?? 0;
// totalCredit += credit;
// totalDebit += debit;
// }
// overallBalance = totalDebit - totalCredit;
//
// return Scaffold(
// appBar: appbar2New(
// context,
// "Account Details",
// provider.resetValues,
// SizedBox.shrink(),
// 0xFFFFFFFF
// ),
// resizeToAvoidBottomInset: true,
// backgroundColor: AppColors.scaffold_bg_color,
// body: SizedBox(
// child: SingleChildScrollView(
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
//
// Container(
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(16),
// ),
// child: Column(
// children: [
// Container(
// padding: EdgeInsets.symmetric(
// horizontal: 10,
// vertical: 15,
// ),
// margin: EdgeInsets.symmetric(
// horizontal: 10,
// vertical: 15,
// ),
// decoration: BoxDecoration(
// color: Color(0xFFEDF7FF),
// borderRadius: BorderRadius.circular(16),
// ),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Text(
// overallBalance.toString() ?? "-",
// style: TextStyle(fontSize: 20,
// fontFamily: "JakartaMedium",
// color: AppColors.app_blue
// ),
// ),
// ],
// ),
// ),
// Row(
// children: [
// Expanded(
// child: Container(
// padding: EdgeInsets.symmetric(
// horizontal: 10,
// vertical: 15,
// ),
// margin: EdgeInsets.symmetric(
// horizontal: 10,
// vertical: 15,
// ),
// decoration: BoxDecoration(
// color: Color(0xFFFFEFEF),
// borderRadius: BorderRadius.circular(16),
// ),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// RichText(
// text: TextSpan(
// children: [
// TextSpan(
// text: "${totalCredit}",
// style: TextStyle(
// color: Color(0xFFED3424),
// fontFamily: "JakartaRegular",
// fontSize: 25,
// ),
// ),
// ],
// ),
// ),
// Text(
// "credit",
// style: TextStyle(color: Color(0xFF818181)),
// ),
// ],
// ),
// ),
// ),
// Expanded(
// child: Container(
// padding: EdgeInsets.symmetric(
// horizontal: 10,
// vertical: 15,
// ),
// margin: EdgeInsets.symmetric(
// horizontal: 10,
// vertical: 15,
// ),
// decoration: BoxDecoration(
// color: Color(0xFFFFEFEF),
// borderRadius: BorderRadius.circular(16),
// ),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// RichText(
// text: TextSpan(
// children: [
// TextSpan(
// text: "${totalDebit}",
// style: TextStyle(
// color: Color(0xFFED3424),
// fontFamily: "JakartaRegular",
// fontSize: 25,
// ),
// ),
// ],
// ),
// ),
// Text(
// "debit",
// style: TextStyle(color: Color(0xFF818181)),
// ),
// ],
// ),
// ),
// ),
// ],
// ),
// ],
// ),
// ),
// // Text(
// // "Account Details",
// // style: TextStyle(
// // fontSize: 16,
// // color: AppColors.grey_thick,
// // fontFamily: "JakartaMedium",
// // ),
// // ),
// Container(
// padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
// margin: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(16),
// ),
// child: Column(
// children: [
// ...List.generate(12, (j) {
// final headings = [
// "Name",
// "Address",
// "Date",
// "Bank Name",
// "Bank Branch",
// "Bank IFSC Code",
// "Account Holder",
// "Account Number",
// "Bank UPI ID",
// "State",
// "District",
// "Sub Locality",
// ];
//
// final subHeadings = [
// provider.accountDetails.name ?? "-",
// provider.accountDetails.address ?? "-",
// provider.accountDetails.createdDatetime ?? "-",
// provider.accountDetails.bankName ?? "-",
// provider.accountDetails.bankBranchName ?? "-",
// provider.accountDetails.bankIfscCode ?? "-",
// provider.accountDetails.bankAccountHolderName ??
// "-",
// provider.accountDetails.bankAccountNumber ?? "-",
// provider.accountDetails.bankUpiId ?? "-",
// provider.accountDetails.state ?? "-",
// provider.accountDetails.district ?? "-",
// provider.accountDetails.subLocality ?? "-",
// ];
// return Container(
// padding: EdgeInsets.symmetric(vertical: 5),
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Expanded(
// child: Text(
// headings[j],
// style: TextStyle(
// fontFamily: "JakartaMedium",
// fontSize: 14,
// color: AppColors.semi_black,
// ),
// ),
// ),
// SizedBox(width: 15),
// Expanded(
// child: Text(
// subHeadings[j] == ""
// ? "-"
// : subHeadings[j] ?? "-",
// style: TextStyle(
// fontFamily: "JakartaMedium",
// fontSize: 14,
// color: AppColors.grey_thick,
// ),
// ),
// ),
// ],
// ),
// );
// }),
// ],
// ),
// ),
// ListView.builder(
// physics: NeverScrollableScrollPhysics(),
// shrinkWrap: true,
// itemCount: groupedData.keys.length,
// itemBuilder: (context, index) {
// String date = groupedData.keys.elementAt(index);
// List<LedgerList> items = groupedData[date]!;
//
// return Container(
// padding: EdgeInsets.symmetric(vertical: 5),
// margin: EdgeInsets.symmetric(horizontal: 10),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Container(
// padding: EdgeInsets.only(bottom: 5),
// child: Text(
// date,
// style: TextStyle(
// fontSize: 14,
// fontFamily: "JakartaMedium",
// color: Color(0xFF818181),
// ),
// ),
// ),
// ...items.map((item) {
// double running_balance = 0;
// int currentIndex = provider.ledgerList.indexOf(
// item,
// );
// for (var i = 0; i <= currentIndex; i++) {
// var ledgerItem = provider.ledgerList[i];
// double credit =
// double.tryParse(
// ledgerItem.creditAmount.toString(),
// ) ??
// 0;
// double debit =
// double.tryParse(
// ledgerItem.debitAmount.toString(),
// ) ??
// 0;
// running_balance += (debit - credit);
// }
//
// return Container(
// padding: EdgeInsets.symmetric(
// horizontal: 10,
// vertical: 10,
// ),
// margin: EdgeInsets.symmetric(vertical: 5),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(16),
// ),
// child: Column(
// children: [
// Row(
// mainAxisAlignment:
// MainAxisAlignment.start,
// children: [
// Expanded(
// flex: 1,
// child: SizedBox(
// child:
// item.type == "Credit"
// ? Image.asset(
// "assets/images/trans_debit.png",
// height: 45,
// width: 45,
// fit: BoxFit.contain,
// )
// : Image.asset(
// "assets/images/trans_credit.png",
// height: 45,
// width: 45,
// fit: BoxFit.contain,
// ),
// ),
// ),
// SizedBox(width: 10),
// Expanded(
// flex: 5,
// child: SizedBox(
// child: Column(
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: [
// Text(
// item.description ?? "-",
// maxLines: 2,
// overflow:
// TextOverflow.ellipsis,
// style: TextStyle(
// fontFamily: "JakartaMedium",
// fontSize: 12,
// ),
// ),
// ],
// ),
// ),
// ),
// Spacer(),
// Expanded(
// flex: 3,
// child: SizedBox(
// child: RichText(
// maxLines: 1,
// textAlign: TextAlign.right,
// overflow: TextOverflow.ellipsis,
// text: TextSpan(
// children: [
// TextSpan(
// text:
// item.type == "Credit"
// ? "-"
// : "+",
// style: TextStyle(
// color: Color(0xFF2D2D2D),
// fontSize: 13,
// fontFamily:
// "JakartaRegular",
// ),
// ),
// TextSpan(
// text:
// "₹${item.type == "Credit" ? "${item.creditAmount}" : "${item.debitAmount}"}",
// style: TextStyle(
// color: Color(0xFF2D2D2D),
// fontSize: 13,
// fontFamily:
// "JakartaMedium",
// ),
// ),
// ],
// ),
// ),
// ),
// ),
// ],
// ),
// Divider(
// thickness: 0.5,
// color: Color(0xFFd7d7d7),
// ),
// Row(
// children: [
// Expanded(
// child: Text(
// "Balance",
// style: TextStyle(
// fontSize: 13,
// color: Color(0xFF2d2d2d),
// ),
// ),
// ),
// Expanded(
// child: Text(
// textAlign: TextAlign.right,
// "${running_balance.toString()}" ??
// "-",
// style: TextStyle(
// color: Color(0xFF818181),
// fontSize: 13,
// ),
// ),
// ),
// ],
// ),
// InkResponse(
// onTap: () async {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) => Transactiondetails(
// paymentID: item.refId,
// type: item.type,
// ),
// ),
// );
// },
// child: Container(
// padding: EdgeInsets.symmetric(
// vertical: 5,
// ),
// child: Row(
// crossAxisAlignment:
// CrossAxisAlignment.center,
// mainAxisAlignment:
// MainAxisAlignment.start,
// children: [
// Text(
// "View Details",
// style: TextStyle(
// fontFamily: "JakartaMedium",
// fontSize: 14,
// color: AppColors.app_blue,
// ),
// ),
// SizedBox(width: 5),
// SvgPicture.asset(
// "assets/svg/next_button.svg",
// ),
// ],
// ),
// ),
// ),
// ],
// ),
// );
// }).toList(),
// ],
// ),
// );
// },
// ),
// if ([
// "Vendor",
// "Customer",
// ].contains(provider.accountDetails.type)) ...[
// InkWell(
// onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) => Submitpaymentrequestionlistsbymode(
// mode: "other",
// pageTitleName: "Add Payment Request (Other)",
// accountId: provider.accountDetails.id!,
// ),
// ),
// );
// },
// child: Container(
// alignment: Alignment.center,
// height: 45,
// margin: EdgeInsets.only(
// left: 5.0,
// right: 5.0,
// top: 5.0,
// bottom: 5.0,
// ),
// decoration: BoxDecoration(
// color: AppColors.app_blue, //1487C9
// borderRadius: BorderRadius.circular(15.0),
// ),
// child: Center(
// child: Text(
// "Add Payment Request (Other)",
// textAlign: TextAlign.center,
// style: TextStyle(
// color: Colors.white,
// fontFamily: "JakartaMedium",
// fontSize: 15,
// ),
// ),
// ),
// ),
// ),
// ],
// ],
// ),
// ),
// ),
// );
// },
// );
// }
//
// Future<bool> _onBackPressed(BuildContext context) async {
// Navigator.pop(context, true);
// return true;
// }
// }
import 'dart:io'; import 'dart:io';
import 'package:dotted_line/dotted_line.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:generp/Utils/app_colors.dart'; import 'package:generp/Utils/app_colors.dart';
import 'package:generp/Utils/commonWidgets.dart'; import 'package:generp/Utils/commonWidgets.dart';
import 'package:generp/screens/finance/FileViewer.dart'; import 'package:generp/screens/finance/FileViewer.dart';
...@@ -11,8 +13,14 @@ import '../../Notifiers/financeProvider/paymentRequisitionPaymentsListProvider.d ...@@ -11,8 +13,14 @@ import '../../Notifiers/financeProvider/paymentRequisitionPaymentsListProvider.d
class Transactiondetails extends StatefulWidget { class Transactiondetails extends StatefulWidget {
final paymentID; final paymentID;
final type; final type;
final description;
const Transactiondetails({super.key, this.paymentID, this.type}); const Transactiondetails({
super.key,
this.paymentID,
this.type,
this.description,
});
@override @override
State<Transactiondetails> createState() => _TransactiondetailsState(); State<Transactiondetails> createState() => _TransactiondetailsState();
...@@ -39,10 +47,10 @@ class _TransactiondetailsState extends State<Transactiondetails> { ...@@ -39,10 +47,10 @@ class _TransactiondetailsState extends State<Transactiondetails> {
var details = provider.paymentDetails; var details = provider.paymentDetails;
return SafeArea( return SafeArea(
top: false, top: false,
bottom: Platform.isIOS?false:true, bottom: Platform.isIOS ? false : true,
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
appBar: appbar(context, "Details"), appBar: appbarNew(context, "Details",0xFFFFFFFF),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: Container( body: Container(
margin: EdgeInsets.symmetric(vertical: 10, horizontal: 10), margin: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
...@@ -64,14 +72,14 @@ class _TransactiondetailsState extends State<Transactiondetails> { ...@@ -64,14 +72,14 @@ class _TransactiondetailsState extends State<Transactiondetails> {
child: SizedBox( child: SizedBox(
child: child:
widget.type == "Credit" widget.type == "Credit"
? Image.asset( ? SvgPicture.asset(
"assets/images/trans_debit.png", "assets/svg/finance/debited_filled_ic.svg",
height: 45, height: 45,
width: 45, width: 45,
fit: BoxFit.contain, fit: BoxFit.contain,
) )
: Image.asset( : SvgPicture.asset(
"assets/images/trans_credit.png", "assets/svg/finance/credited_filled_ic.svg",
height: 45, height: 45,
width: 45, width: 45,
fit: BoxFit.contain, fit: BoxFit.contain,
...@@ -82,129 +90,300 @@ class _TransactiondetailsState extends State<Transactiondetails> { ...@@ -82,129 +90,300 @@ class _TransactiondetailsState extends State<Transactiondetails> {
Expanded( Expanded(
flex: 5, flex: 5,
child: SizedBox( child: SizedBox(
child: Column( child: Text(
crossAxisAlignment: CrossAxisAlignment.start, details.description == ""
children: [ ? widget.description
Text( : details.description ?? "-",
widget.type == "Credit"
? "Debited Amount"
: "Credited Amount",
maxLines: 2, maxLines: 2,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium", fontFamily: "JakartaRegular",
fontSize: 12, fontSize: 14,
), ),
), ),
RichText( ),
textAlign: TextAlign.right, ),
maxLines: 1, SizedBox(width: 10),
Expanded(
flex: 3,
child: Container(
height: 45,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color:
widget.type == "Credit"
? Color(0xFFFFEFEF)
: Color(0xFFE7FFE5),
),
child: Center(
child: Text(
"₹ ${details.amount ?? "-"}",
maxLines: 2,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
text: TextSpan(
children: [
TextSpan(
text:
widget.type == "Credit" ? "-" : "+",
style: TextStyle( style: TextStyle(
color: Color(0xFF2D2D2D),
fontSize: 13,
fontFamily: "JakartaRegular", fontFamily: "JakartaRegular",
fontSize: 14,
color:
widget.type == "Credited"
? Color(0xFFEF3739)
: Color(0xFF0D9C00),
),
), ),
), ),
TextSpan(
text: "₹${details.amount}",
style: TextStyle(
color: Color(0xFF2D2D2D),
fontSize: 13,
fontFamily: "JakartaMedium",
), ),
), ),
], ],
), ),
Container(
padding: EdgeInsets.symmetric(vertical: 7.5),
child: Row(
children: [
Expanded(
flex: 3,
child: Text(
"Payment Summary",
style: TextStyle(
fontSize: 14,
fontFamily: "JakartaSemiBold",
),
), ),
],
), ),
Expanded(
flex: 5,
child: DottedLine(
dashGapLength: 4,
dashGapColor: Colors.white,
dashColor: AppColors.grey_semi,
dashLength: 2,
lineThickness: 0.5,
), ),
), ),
], ],
), ),
Divider(thickness: 0.5, color: Color(0xFFd7d7d7)), ),
...List.generate(6, (j) { ...List.generate(6, (j) {
final headings = [ final heads = [
"ID", "Payment Account",
"Date", "Payment Employee",
"Account", "Payment ID",
"Ref Type", "Payment Reference",
"Payment Remarks", "Payment Mode",
"Attachment" "Payment Date",
]; ];
final subHeads = [
final subHeadings = [ details.paymentAccountName ?? "-",
details.paymentEmployeeName ?? "-",
details.id ?? "-", details.id ?? "-",
details.createdDatetime ?? "-", details.paymentReferenceNumber ?? "-",
details.mode ?? "-",
details.paymentDate ?? "-",
];
return Container(
padding: EdgeInsets.symmetric(vertical: 3),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
textAlign: TextAlign.left,
heads[j],
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
Expanded(
child: Text(
textAlign: TextAlign.right,
subHeads[j] == "" ? "-" :
"${heads[j]=="Payment ID"?"#":""}${subHeads[j]}",
style: TextStyle(
fontSize: 14,
color: Color(0xFF818181),
),
),
),
],
),
);
}),
Container(
padding: EdgeInsets.symmetric(vertical: 7.5),
child: Row(
children: [
Expanded(
flex: 3,
child: Text(
"Receivers Details",
style: TextStyle(
fontSize: 14,
fontFamily: "JakartaSemiBold",
),
),
),
Expanded(
flex: 5,
child: DottedLine(
dashGapLength: 4,
dashGapColor: Colors.white,
dashColor: AppColors.grey_semi,
dashLength: 2,
lineThickness: 0.5,
),
),
],
),
),
...List.generate(7, (j) {
final heads = [
"Account Name",
"Account Holder",
"Account Number",
"Bank Name",
"Bank Branch Name",
"Bank IFSC",
"UPI ID",
];
final subHeads = [
details.accountName ?? "-", details.accountName ?? "-",
details.refType ?? "-", details.bankAccountHolderName ?? "-",
details.paymentRemarks ?? "-", details.bankAccountNumber ?? "-",
"View", details.bankName ?? "-",
details.bankBranchName ?? "-",
details.bankIfscCode ?? "-",
details.bankUpiId ?? "-",
]; ];
return Container( return Container(
padding: EdgeInsets.symmetric(vertical: 5), padding: EdgeInsets.symmetric(vertical: 3),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
headings[j], textAlign: TextAlign.left,
heads[j],
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium", fontFamily: "JakartaRegular",
fontSize: 14, fontSize: 14,
color: AppColors.semi_black, color: AppColors.semi_black,
), ),
), ),
), ),
SizedBox(width: 15),
if(subHeadings[j] == "View")...[
Expanded( Expanded(
child: InkResponse(
onTap: () async {
Navigator.push(context, MaterialPageRoute(
builder: (context) =>
Fileviewer(fileName: details
.attachmentViewFileName ?? "",
fileUrl: details
.attachmentDirFilePath ?? "")
,));
},
child: Text( child: Text(
"${subHeadings[j]}" == "" textAlign: TextAlign.right,
? "-" subHeads[j] == "" ? "-" : subHeads[j],
: subHeadings[j] ?? "-",
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14, fontSize: 14,
color: AppColors.app_blue, color: Color(0xFF818181),
decorationColor: AppColors.app_blue,
decoration: TextDecoration.underline
), ),
), ),
), ),
],
), ),
] else );
...[ }),
Container(
padding: EdgeInsets.symmetric(vertical: 7.5),
child: Row(
children: [
Expanded( Expanded(
flex: 3,
child: Text( child: Text(
"${subHeadings[j]}" == "" "Other Details",
? "-"
: subHeadings[j] ?? "-",
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14, fontSize: 14,
color: AppColors.grey_thick, fontFamily: "JakartaSemiBold",
),
),
),
Expanded(
flex: 5,
child: DottedLine(
dashGapLength: 4,
dashGapColor: Colors.white,
dashColor: AppColors.grey_semi,
dashLength: 2,
lineThickness: 0.5,
),
),
],
),
),
...List.generate(3, (j) {
final heads = [
"Payment Attachment",
"Description",
"Remarks",
];
final subHeads = [
"View",
details.description ?? "-",
details.paymentRemarks ?? "-",
];
return Container(
padding: EdgeInsets.symmetric(vertical: 3),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
textAlign: TextAlign.left,
heads[j],
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.semi_black,
), ),
), ),
), ),
]
Expanded(
child: InkResponse(
onTap: () async {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Fileviewer(
fileName:
details
.attachmentViewFileName ??
"",
fileUrl:
details
.attachmentDirFilePath ??
"",
),
),
);
},
child: Padding(
padding: const EdgeInsets.all(3.0),
child: Text(
textAlign: TextAlign.right,
subHeads[j] == "" ? "-" : subHeads[j],
style: TextStyle(
fontSize: 14,
color:
subHeads[j] == "View"
? AppColors.app_blue
: Color(0xFF818181),
decoration:
subHeads[j] == "View"
? TextDecoration.underline
: TextDecoration.none,
decorationColor: AppColors.app_blue,
),
),
),
),
),
], ],
), ),
); );
...@@ -220,3 +399,183 @@ class _TransactiondetailsState extends State<Transactiondetails> { ...@@ -220,3 +399,183 @@ class _TransactiondetailsState extends State<Transactiondetails> {
); );
} }
} }
///Container(
// margin: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
// child: SingleChildScrollView(
// child: Container(
// padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
// margin: EdgeInsets.symmetric(vertical: 5),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(16),
// ),
// child: Column(
// children: [
// Row(
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// Expanded(
// flex: 1,
// child: SizedBox(
// child:
// widget.type == "Credit"
// ? SvgPicture.asset(
// "assets/svg/finance/debited_filled_ic.svg",
// height: 45,
// width: 45,
// fit: BoxFit.contain,
// )
// : SvgPicture.asset(
// "assets/svg/finance/credited_filled_ic.svg",
// height: 45,
// width: 45,
// fit: BoxFit.contain,
// ),
// ),
// ),
// SizedBox(width: 10),
// Expanded(
// flex: 5,
// child: SizedBox(
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Text(
// widget.type == "Credit"
// ? "Debited Amount"
// : "Credited Amount",
// maxLines: 2,
// overflow: TextOverflow.ellipsis,
// style: TextStyle(
// fontFamily: "JakartaMedium",
// fontSize: 12,
// ),
// ),
// RichText(
// textAlign: TextAlign.right,
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// text: TextSpan(
// children: [
// TextSpan(
// text:
// widget.type == "Credit"
// ? "-"
// : "+",
// style: TextStyle(
// color: Color(0xFF2D2D2D),
// fontSize: 13,
// fontFamily: "JakartaRegular",
// ),
// ),
// TextSpan(
// text: "₹${details.description}",
// style: TextStyle(
// color: Color(0xFF2D2D2D),
// fontSize: 13,
// fontFamily: "JakartaMedium",
// ),
// ),
// ],
// ),
// ),
// ],
// ),
// ),
// ),
// ],
// ),
// Divider(thickness: 0.5, color: Color(0xFFd7d7d7)),
// ...List.generate(6, (j) {
// final headings = [
// "ID",
// "Date",
// "Account",
// "Ref Type",
// "Payment Remarks",
// "Attachment",
// ];
//
// final subHeadings = [
// details.id ?? "-",
// details.createdDatetime ?? "-",
// details.accountName ?? "-",
// details.refType ?? "-",
// details.paymentRemarks ?? "-",
// "View",
// ];
// return Container(
// padding: EdgeInsets.symmetric(vertical: 5),
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Expanded(
// child: Text(
// headings[j],
// style: TextStyle(
// fontFamily: "JakartaMedium",
// fontSize: 14,
// color: AppColors.semi_black,
// ),
// ),
// ),
// SizedBox(width: 15),
// if (subHeadings[j] == "View") ...[
// Expanded(
// child: InkResponse(
// onTap: () async {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) => Fileviewer(
// fileName:
// details
// .attachmentViewFileName ??
// "",
// fileUrl:
// details
// .attachmentDirFilePath ??
// "",
// ),
// ),
// );
// },
// child: Text(
// "${subHeadings[j]}" == ""
// ? "-"
// : subHeadings[j] ?? "-",
// style: TextStyle(
// fontFamily: "JakartaMedium",
// fontSize: 14,
// color: AppColors.app_blue,
// decorationColor: AppColors.app_blue,
// decoration: TextDecoration.underline,
// ),
// ),
// ),
// ),
// ] else ...[
// Expanded(
// child: Text(
// "${subHeadings[j]}" == ""
// ? "-"
// : subHeadings[j] ?? "-",
// style: TextStyle(
// fontFamily: "JakartaMedium",
// fontSize: 14,
// color: AppColors.grey_thick,
// ),
// ),
// ),
// ],
// ],
// ),
// );
// }),
// ],
// ),
// ),
// ),
// ),
...@@ -157,7 +157,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -157,7 +157,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Text( child: Text(
"Search", "Search By Name/Mobile",
style: TextStyle( style: TextStyle(
height: 1, height: 1,
color: AppColors.grey_thick, color: AppColors.grey_thick,
...@@ -1108,7 +1108,10 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -1108,7 +1108,10 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
), ),
floatingActionButtonLocation: floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat, FloatingActionButtonLocation.centerFloat,
floatingActionButton: InkResponse( floatingActionButton:(provider.accessPages
.where((page) => [8, 9].contains(page.id))
.toList()
.contains([8, 9]))? InkResponse(
onTap: () async { onTap: () async {
// if (provider.accessPages // if (provider.accessPages
// .where((page) => [8, 9].contains(page.id)) // .where((page) => [8, 9].contains(page.id))
...@@ -1141,7 +1144,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -1141,7 +1144,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
), ),
), ),
), ),
), ):SizedBox.shrink(),
); );
}, },
); );
......
...@@ -141,7 +141,7 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> { ...@@ -141,7 +141,7 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
), ),
), ),
counterText: "", counterText: "",
hintText: "Search", hintText: "Search By Name/Mobile",
hintStyle: TextStyle( hintStyle: TextStyle(
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
color: Color(0xFFB4BEC0), color: Color(0xFFB4BEC0),
......
...@@ -37,6 +37,7 @@ class _AllpaymentrequesitionlistsbymodesState ...@@ -37,6 +37,7 @@ class _AllpaymentrequesitionlistsbymodesState
final MyConnectivity _connectivity = MyConnectivity.instance; final MyConnectivity _connectivity = MyConnectivity.instance;
late Commondaterangefilter cf; late Commondaterangefilter cf;
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
...@@ -62,6 +63,80 @@ class _AllpaymentrequesitionlistsbymodesState ...@@ -62,6 +63,80 @@ class _AllpaymentrequesitionlistsbymodesState
}); });
} }
//'Requested',
// 'Level 1 Approved',
// 'Level 2 Approved',
// 'Level 1 Rejected',
// 'Level 2 Rejected',
// 'Processed',
// 'Payment Rejected'
Color getDecorationColor(value) {
var color = AppColors.approved_bg_color;
switch (value){
case 'Requested':
return AppColors.requested_bg_color;
case 'Level 1 Approved':
return AppColors.approved_bg_color;
case 'Level 1 Rejected':
return AppColors.rejected_bg_color;
case 'Level 2 Approved':
return AppColors.approved_bg_color;
case 'Level 2 Rejected':
return AppColors.rejected_bg_color;
case 'Processed':
return AppColors.processed_bg_color;
case 'Payment Rejected':
return AppColors.rejected_bg_color;
}
return color;
}
Color getTextColor(value) {
var color = AppColors.approved_text_color;
switch (value){
case 'Requested':
return AppColors.requested_text_color;
case 'Level 1 Approved':
return AppColors.approved_text_color;
case 'Level 1 Rejected':
return AppColors.rejected_text_color;
case 'Level 2 Approved':
return AppColors.approved_text_color;
case 'Level 2 Rejected':
return AppColors.rejected_text_color;
case 'Processed':
return AppColors.processed_text_color;
case 'Payment Rejected':
return AppColors.rejected_text_color;
}
return color;
}
getText(value){
var text = "A";
switch (value){
case 'Requested':
return "R";
case 'Level 1 Approved':
return "A";
case 'Level 1 Rejected':
return "R";
case 'Level 2 Approved':
return "A";
case 'Level 2 Rejected':
return "R";
case 'Processed':
return "P";
case 'Payment Rejected':
return "R";
}
return text;
}
@override @override
void dispose() { void dispose() {
// TODO: implement dispose // TODO: implement dispose
...@@ -104,7 +179,7 @@ class _AllpaymentrequesitionlistsbymodesState ...@@ -104,7 +179,7 @@ class _AllpaymentrequesitionlistsbymodesState
final requestLists = provider.requisitionList; final requestLists = provider.requisitionList;
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
appBar: appbar2( appBar: appbar2New(
context, context,
widget.pageTitleName, widget.pageTitleName,
provider.resetForm, provider.resetForm,
...@@ -154,6 +229,7 @@ class _AllpaymentrequesitionlistsbymodesState ...@@ -154,6 +229,7 @@ class _AllpaymentrequesitionlistsbymodesState
), ),
], ],
), ),
0xFFFFFFFF
), ),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: body:
...@@ -179,14 +255,42 @@ class _AllpaymentrequesitionlistsbymodesState ...@@ -179,14 +255,42 @@ class _AllpaymentrequesitionlistsbymodesState
child: Center(child: Text("No Data Available")), child: Center(child: Text("No Data Available")),
); );
} }
return Container( return InkResponse(
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Paymentrequestionlistdetails(
pageName: widget.pageTitleName,
mode: widget.mode,
paymentRequestId:
requestLists[index].id,
),
settings: RouteSettings(
name: "Paymentrequestionlistdetails",
),
),
);
if (routeSettingName ==
"Paymentrequestionlistdetails") {
print("croos refresh");
provider.paymentRequestionListsAPIFunction(
context,
widget.mode,
"",
"",
);
}
},
child: Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 10, horizontal: 10,
vertical: 10, vertical: 10,
), ),
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(
horizontal: 10, horizontal: 10,
vertical: 10, vertical: 5,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
...@@ -200,16 +304,21 @@ class _AllpaymentrequesitionlistsbymodesState ...@@ -200,16 +304,21 @@ class _AllpaymentrequesitionlistsbymodesState
flex: 1, flex: 1,
child: Container( child: Container(
height: 50, height: 50,
width: 35, width: 50,
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFFFF3CE), color: getDecorationColor(requestLists[index].status),
borderRadius: BorderRadius.circular( shape: BoxShape.circle
8, ),
child: Center(
child: Text(
getText(requestLists[index].status),
style: TextStyle(
color: getTextColor(requestLists[index].status),
fontSize: 18,
fontFamily: "JakartaBold"
), ),
), ),
child: SvgPicture.asset(
"assets/svg/fin_ic.svg",
), ),
), ),
), ),
...@@ -222,18 +331,20 @@ class _AllpaymentrequesitionlistsbymodesState ...@@ -222,18 +331,20 @@ class _AllpaymentrequesitionlistsbymodesState
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Text( Text(
requestLists[index].accountName!, requestLists[index]
.accountName!,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium", fontFamily: "JakartaRegular",
fontSize: 14, fontSize: 14,
color: AppColors.semi_black, color: AppColors.semi_black,
), ),
), ),
Text( Text(
"₹" "${requestLists[index].date}",
"${requestLists[index].amount}",
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium", fontFamily: "JakartaRegular",
fontSize: 14, fontSize: 14,
color: AppColors.app_blue, color: AppColors.app_blue,
), ),
...@@ -243,202 +354,23 @@ class _AllpaymentrequesitionlistsbymodesState ...@@ -243,202 +354,23 @@ class _AllpaymentrequesitionlistsbymodesState
), ),
), ),
Expanded( Expanded(
flex: 2, flex: 3,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5,
vertical: 10,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
8,
),
color: Color(0xFFE3FFE0),
),
child: Center(
child: Text(
requestLists[index].status!,
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: Color(0xFF0D9C00),
),
),
),
),
),
],
),
Divider(
thickness: 0.5,
color: Color(0xFFD7D7D7),
),
...List.generate(4, (j) {
final headings = [
"Requesting Propose",
"Attachment",
"Requested Date",
"Note",
];
final subHeadings = [
requestLists[index].requestingPurpose,
"View",
// requestLists[index].attachmentDirFilePath
requestLists[index].date,
requestLists[index].description,
];
if (j == 1 &&
requestLists[index]
.attachmentViewFileName ==
"") {
return SizedBox.shrink();
}
return Container(
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
headings[j],
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
Expanded(
child: InkResponse(
onTap:
j != 1
? null
: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(
context,
) => Fileviewer(
fileName:
requestLists[index]
.attachmentViewFileName!,
fileUrl:
requestLists[index]
.attachmentDirFilePath!,
),
),
);
},
child: Text( child: Text(
subHeadings[j]!, maxLines: 1,
style: TextStyle( "₹ ${requestLists[index].amount!}",
fontSize: 14, textAlign: TextAlign.right,
color:
j == 1
? AppColors.app_blue
: Color(0xFF818181),
decoration:
j == 1
? TextDecoration
.underline
: TextDecoration.none,
decorationColor:
j == 1
? AppColors.app_blue
: AppColors.white,
),
),
),
),
],
),
);
}),
InkResponse(
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Paymentrequestionlistdetails(
pageName:
widget.pageTitleName,
mode: widget.mode,
paymentRequestId:
requestLists[index].id,
),
settings: RouteSettings(
name: "Paymentrequestionlistdetails",
),
),
);
if (routeSettingName ==
"Paymentrequestionlistdetails") {
print("croos refresh");
provider
.paymentRequestionListsAPIFunction(
context,
widget.mode,
"",
"",
);
}
// if (res == true) {
// print("android refresh");
// provider
// .paymentRequestionListsAPIFunction(
// context,
// widget.mode,
// "",
// "",
// );
// }
// if (Platform.isIOS) {
// print("IOS Refresh");
// if (didPushed == "true" ||
// didPopped == "true") {
// provider
// .paymentRequestionListsAPIFunction(
// context,
// widget.mode,
// "",
// "",
// );
// }
// }
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"View Details",
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
fontSize: 14, fontSize: 14,
color: AppColors.app_blue, color: AppColors.app_blue,
), ),
), ),
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
), ),
], ],
), ),
),
),
], ],
), ),
),
); );
}, },
), ),
......
...@@ -94,31 +94,33 @@ class _FinancedashboardState extends State<Financedashboard> { ...@@ -94,31 +94,33 @@ class _FinancedashboardState extends State<Financedashboard> {
"assets/svg/finance/fin_accounts_ic.svg", //" "assets/svg/finance/fin_accounts_ic.svg", //"
]; ];
final paymentInitiationNames = ["Self", "Account List"]; final paymentInitiationNames = ["Self", "Account List"];
final paymentInitiationSubtitles = ["Payment Requisition", ""]; final paymentInitiationSubtitles = ["Payment Requests", "Transactions Details"];
final paymentInitiationRoles = [668, 293]; final paymentInitiationRoles = [668, 293];
final paymentAdministrationIcons = [ final paymentAdministrationIcons = [
"assets/svg/finance/fin_process_ic.svg", "assets/svg/finance/fin_process_ic.svg",
"assets/svg/finance/fin_admin_ic.svg", "assets/svg/finance/fin_admin_ic.svg",
"assets/svg/finance/fin_receipts_ic.svg", "assets/svg/finance/fin_receipts_ic.svg",
"assets/svg/finance/fin_ac_ledger_ic.svg", // "assets/svg/finance/fin_ac_ledger_ic.svg",
"assets/svg/finance/fin_payments_ic.svg", "assets/svg/finance/fin_payments_ic.svg",
]; ];
final paymentAdministrationNames = [ final paymentAdministrationNames = [
"Process", //process "Process", //process
"Admin", //admin "Admin", //admin
"Receipts List", "Receipts List",
"Account Ledger", // "Account Ledger",
"Payment List", "Payment List",
]; ];
final paymentAdministrationSubtitles = [ final paymentAdministrationSubtitles = [
"Payment Requisition", "Payment Requests",
"Payment Requisition", "Payment Requests",
"Payment Requisition", "Payment Requests",
"Ledgers, transactions, finance", // "Ledgers, transactions, finance",
"Payment Requisition", "Payment Requests",
]; ];
final paymentAdministrationRoles = [666, 678, 673, 675, 667]; final paymentAdministrationRoles = [666, 678, 673,
// 675,
667];
// Extract role IDs from accessible pages // Extract role IDs from accessible pages
final roles = provider.accessiblePagesList.map((e) => e.id).toList(); final roles = provider.accessiblePagesList.map((e) => e.id).toList();
...@@ -444,14 +446,16 @@ class _FinancedashboardState extends State<Financedashboard> { ...@@ -444,14 +446,16 @@ class _FinancedashboardState extends State<Financedashboard> {
), ),
), ),
); );
} else if (ad == 3) { }
navigate = await Navigator.push( // else if (ad == 3) {
context, // navigate = await Navigator.push(
MaterialPageRoute( // context,
builder: (context) => Accountledger(), // MaterialPageRoute(
), // builder: (context) => Accountledger(),
); // ),
} else { // );
// }
else {
navigate = await Navigator.push( navigate = await Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment