Commit 3ad2ea55 authored by Sai Srinivas's avatar Sai Srinivas
Browse files

ios Changes

parent 38d17dba
...@@ -227,7 +227,6 @@ class Paymentdetailsprovider extends ChangeNotifier { ...@@ -227,7 +227,6 @@ class Paymentdetailsprovider extends ChangeNotifier {
if (data.error == 0) { if (data.error == 0) {
print(data.paymentCollectionId); print(data.paymentCollectionId);
_CollectionId = data.paymentCollectionId ?? 0; _CollectionId = data.paymentCollectionId ?? 0;
notifyListeners(); notifyListeners();
} else {} } else {}
} else { } else {
...@@ -427,7 +426,7 @@ class Paymentdetailsprovider extends ChangeNotifier { ...@@ -427,7 +426,7 @@ class Paymentdetailsprovider extends ChangeNotifier {
email, email,
) async { ) async {
if (actName == "Generator") { if (actName == "Generator") {
_saveAgainst = "Generator"; _saveAgainst = "generator";
_genId = generatorID; _genId = generatorID;
} else { } else {
_saveAgainst = "account"; _saveAgainst = "account";
......
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'dart:async';
class Connectivityprovider extends ChangeNotifier {
static final Connectivityprovider _instance = Connectivityprovider._();
static Connectivityprovider get instance => _instance;
final Connectivity _connectivity = Connectivity();
bool _isOnline = false;
Map<ConnectivityResult, bool> _source = {ConnectivityResult.none: false};
Connectivityprovider._() {
initialise();
}
bool get isOnline => _isOnline;
Map<ConnectivityResult, bool> get source => _source;
void initialise() async {
List<ConnectivityResult> result = await _connectivity.checkConnectivity();
_checkStatus(result.first);
_connectivity.onConnectivityChanged.listen((result) {
_checkStatus(result.first);
});
}
void _checkStatus(ConnectivityResult result) async {
bool isOnline = false;
try {
final lookupResult = await InternetAddress.lookup('example.com');
isOnline =
lookupResult.isNotEmpty && lookupResult[0].rawAddress.isNotEmpty;
} on SocketException catch (_) {
isOnline = false;
}
_source = {result: isOnline};
_isOnline = isOnline;
notifyListeners(); // Notify all listeners of the change
}
void dispose() {
// No StreamController to close, as we're using ChangeNotifier
}
}
...@@ -483,12 +483,11 @@ class Requestionlistprovider extends ChangeNotifier { ...@@ -483,12 +483,11 @@ class Requestionlistprovider extends ChangeNotifier {
approvalEmployeeID, approvalEmployeeID,
) async { ) async {
try { try {
_submitClicked = true;
notifyListeners();
if (!validateForm(context, mode)) { if (!validateForm(context, mode)) {
_submitClicked = false;
return; return;
} }
_submitClicked = true;
notifyListeners();
var homeProvider = Provider.of<HomescreenNotifier>( var homeProvider = Provider.of<HomescreenNotifier>(
context, context,
...@@ -511,8 +510,8 @@ class Requestionlistprovider extends ChangeNotifier { ...@@ -511,8 +510,8 @@ class Requestionlistprovider extends ChangeNotifier {
bankIfscController.text, bankIfscController.text,
bankAcHolderController.text, bankAcHolderController.text,
bankUpiController.text, bankUpiController.text,
_image,
approvalEmployeeID, approvalEmployeeID,
_image,
); );
if (data != null) { if (data != null) {
if (data.error == "0") { if (data.error == "0") {
...@@ -550,11 +549,20 @@ class Requestionlistprovider extends ChangeNotifier { ...@@ -550,11 +549,20 @@ class Requestionlistprovider extends ChangeNotifier {
if (data != null) { if (data != null) {
if (data.error == "0") { if (data.error == "0") {
_directPaymentAccounts = data.paymentAccounts!; _directPaymentAccounts = data.paymentAccounts!;
_directPaymentAccounts = [DirectPaymentAccounts(id: "",name: "Select"),...data.paymentAccounts!]; _directPaymentAccounts = [
DirectPaymentAccounts(id: "", name: "Select"),
...data.paymentAccounts!,
];
_directPaymentModes = data.paymentModes!; _directPaymentModes = data.paymentModes!;
_directPaymentModes = [DirectPaymentModes(name: "Select",id: ""),...data.paymentModes!]; _directPaymentModes = [
DirectPaymentModes(name: "Select", id: ""),
...data.paymentModes!,
];
_directAccounts = data.accounts!; _directAccounts = data.accounts!;
_directAccounts = [DirectAccounts(id: "",name: "Select"),...data.accounts!]; _directAccounts = [
DirectAccounts(id: "", name: "Select"),
...data.accounts!,
];
checkdirectPaymentDropDownsSlected(); checkdirectPaymentDropDownsSlected();
notifyListeners(); notifyListeners();
...@@ -1058,6 +1066,14 @@ class Requestionlistprovider extends ChangeNotifier { ...@@ -1058,6 +1066,14 @@ class Requestionlistprovider extends ChangeNotifier {
!_requestingPurposes.contains(_selectReqPurpose)) { !_requestingPurposes.contains(_selectReqPurpose)) {
_selectReqPurpose = null; _selectReqPurpose = null;
} }
if (_selectedApprovalEmployee != null &&
!_approvalEmployee.contains(_selectedApprovalEmployee)) {
_selectedApprovalEmployee = null;
_selectedApprovalEmployeeID = null;
_selectedApprovalEmployeeValue = null;
}
notifyListeners();
} }
bool validateForm(BuildContext context, String mode) { bool validateForm(BuildContext context, String mode) {
...@@ -1156,6 +1172,7 @@ class Requestionlistprovider extends ChangeNotifier { ...@@ -1156,6 +1172,7 @@ class Requestionlistprovider extends ChangeNotifier {
// isValid = false;_submitClicked = false; // isValid = false;_submitClicked = false;
// } // }
buttonEnabled = isValid; buttonEnabled = isValid;
_submitClicked = true;
notifyListeners(); notifyListeners();
return isValid; return isValid;
} }
......
...@@ -42,7 +42,7 @@ class SplashVersionNotifier extends ChangeNotifier { ...@@ -42,7 +42,7 @@ class SplashVersionNotifier extends ChangeNotifier {
if (_packagedetails.isEmpty) { if (_packagedetails.isEmpty) {
await initPackageInfo(); await initPackageInfo();
} }
var loginProvider = Provider.of<Loginnotifier>(context,listen: false); var loginProvider = Provider.of<Loginnotifier>(context, listen: false);
var loginStatus = await SharedpreferencesService().getInt("loginStatus"); var loginStatus = await SharedpreferencesService().getInt("loginStatus");
print("login status: ${loginStatus}"); print("login status: ${loginStatus}");
...@@ -59,7 +59,6 @@ class SplashVersionNotifier extends ChangeNotifier { ...@@ -59,7 +59,6 @@ class SplashVersionNotifier extends ChangeNotifier {
} }
if (Platform.isAndroid && if (Platform.isAndroid &&
currentBuild < (data.latestVersionCode ?? 0)) { currentBuild < (data.latestVersionCode ?? 0)) {
print("Update"); print("Update");
AppUpdateDialouge(context, data.url!, data.releaseNotes!); AppUpdateDialouge(context, data.url!, data.releaseNotes!);
} else if (Platform.isIOS && } else if (Platform.isIOS &&
......
String didPushed = ""; String didPushed = "";
String didPopped = ""; String didPopped = "";
\ No newline at end of file var connection;
import 'dart:async';
import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart'; import 'package:fluttertoast/fluttertoast.dart';
toast(context,text) { toast(context, text) {
// OwnToast(context, text, "0"); // OwnToast(context, text, "0");
Fluttertoast.showToast( Fluttertoast.showToast(
msg: text, msg: text,
...@@ -13,4 +16,36 @@ toast(context,text) { ...@@ -13,4 +16,36 @@ toast(context,text) {
textColor: Colors.white, textColor: Colors.white,
fontSize: 15.0, fontSize: 15.0,
); );
} }
\ No newline at end of file
class MyConnectivity {
MyConnectivity._();
static final _instance = MyConnectivity._();
static MyConnectivity get instance => _instance;
final _connectivity = Connectivity();
final _controller = StreamController.broadcast();
Stream get myStream => _controller.stream;
void initialise() async {
ConnectivityResult result =
(await _connectivity.checkConnectivity()) as ConnectivityResult;
_checkStatus(result);
_connectivity.onConnectivityChanged.listen((result) {
_checkStatus(result as ConnectivityResult);
});
}
void _checkStatus(ConnectivityResult result) async {
bool isOnline = false;
try {
final result = await InternetAddress.lookup('example.com');
isOnline = result.isNotEmpty && result[0].rawAddress.isNotEmpty;
} on SocketException catch (_) {
isOnline = false;
}
_controller.sink.add({result: isOnline});
}
void disposeStream() => _controller.close();
}
...@@ -141,7 +141,7 @@ Widget textControllerWidget( ...@@ -141,7 +141,7 @@ Widget textControllerWidget(
height: hintText == "Enter Description" ? 150 : 50, height: hintText == "Enter Description" ? 150 : 50,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color:readonly?Color(0xFFD7D7D7): AppColors.text_field_color, color: readonly ? Color(0xFFD7D7D7) : AppColors.text_field_color,
borderRadius: BorderRadius.circular(14), borderRadius: BorderRadius.circular(14),
), ),
child: Padding( child: Padding(
...@@ -175,7 +175,7 @@ Widget textControllerWidget( ...@@ -175,7 +175,7 @@ Widget textControllerWidget(
? [FilteringTextInputFormatter.digitsOnly] ? [FilteringTextInputFormatter.digitsOnly]
: [], : [],
style: TextStyle( style: TextStyle(
color: readonly?Color(0xFF9e9e9e):AppColors.semi_black color: readonly ? Color(0xFF9e9e9e) : AppColors.semi_black,
), ),
decoration: InputDecoration( decoration: InputDecoration(
counterText: "", counterText: "",
...@@ -198,12 +198,13 @@ Widget textControllerWidget( ...@@ -198,12 +198,13 @@ Widget textControllerWidget(
NoNetwork(context) { NoNetwork(context) {
return Container( return Container(
decoration: BoxDecoration(color: AppColors.scaffold_bg_color),
height: MediaQuery.of(context).size.height, height: MediaQuery.of(context).size.height,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Image.asset('assets/images/no_wifi.png', width: 100, height: 100), // Image.asset('assets/images/no_wifi.png', width: 100, height: 100),
SizedBox(height: 10), SizedBox(height: 10),
Center( Center(
child: Text( child: Text(
......
...@@ -247,8 +247,7 @@ class MyApp extends StatelessWidget { ...@@ -247,8 +247,7 @@ class MyApp extends StatelessWidget {
tabBarTheme: const TabBarThemeData(), tabBarTheme: const TabBarThemeData(),
textSelectionTheme: TextSelectionThemeData( textSelectionTheme: TextSelectionThemeData(
cursorColor: AppColors.app_blue,
cursorColor: AppColors.app_blue
), ),
dialogTheme: const DialogThemeData( dialogTheme: const DialogThemeData(
shadowColor: Colors.white, shadowColor: Colors.white,
...@@ -296,7 +295,7 @@ class MyApp extends StatelessWidget { ...@@ -296,7 +295,7 @@ class MyApp extends StatelessWidget {
AppColors.grey_semi.withOpacity(0.6), AppColors.grey_semi.withOpacity(0.6),
), ),
), ),
useMaterial3: true useMaterial3: true,
// inputDecorationTheme: InputDecorationTheme( // inputDecorationTheme: InputDecorationTheme(
// hintStyle: TextStyle( // hintStyle: TextStyle(
// fontWeight: FontWeight.w400, // fontWeight: FontWeight.w400,
......
...@@ -31,8 +31,25 @@ class _AttendanceScreenState extends State<AttendanceScreen> { ...@@ -31,8 +31,25 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
}); });
} }
// return Container(
// // onWillPop: _onBackPressed,
// child: (Platform.isAndroid
// ? WillPopScope(
// onWillPop: onBackPressed,
// child: _scaffold(context),
// )
// : _scaffold(context)))
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Platform.isAndroid
? WillPopScope(
onWillPop: () => onBackPressed(context),
child: SafeArea(top: false, bottom: true, child: _scaffold(context)),
)
: _scaffold(context);
}
Widget _scaffold(BuildContext context) {
return Consumer<AttendanceNotifier>( return Consumer<AttendanceNotifier>(
builder: (context, attendance, index) { builder: (context, attendance, index) {
final timeString = final timeString =
...@@ -102,682 +119,599 @@ class _AttendanceScreenState extends State<AttendanceScreen> { ...@@ -102,682 +119,599 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
attendance.init(homeProvider, context); attendance.init(homeProvider, context);
attendance.loadAttendanceDetails(homeProvider, context); attendance.loadAttendanceDetails(homeProvider, context);
}, },
child: WillPopScope( child: Scaffold(
onWillPop: () => onBackPressed(context), resizeToAvoidBottomInset: true,
child: SafeArea( backgroundColor: AppColors.scaffold_bg_color,
top: false, appBar: appbar(context, "Attendance"),
bottom: Platform.isIOS ? false : true, body: Container(
child: Scaffold( child: SingleChildScrollView(
resizeToAvoidBottomInset: true, child: Column(
backgroundColor: AppColors.scaffold_bg_color, crossAxisAlignment: CrossAxisAlignment.start,
appBar: appbar(context, "Attendance"), children: [
body: Container( Container(
child: SingleChildScrollView( margin: EdgeInsets.only(top: 15, bottom: 15),
child: Column( decoration: BoxDecoration(
crossAxisAlignment: CrossAxisAlignment.start, color: Colors.white,
children: [ borderRadius: BorderRadius.circular(16),
Container( ),
margin: EdgeInsets.only(top: 15, bottom: 15), child: Column(
decoration: BoxDecoration( crossAxisAlignment: CrossAxisAlignment.start,
color: Colors.white, children: [
borderRadius: BorderRadius.circular(16), Container(
padding: EdgeInsets.only(
left: 15,
right: 10,
top: 15,
),
child: Row(
children: [
Expanded(child: Text("Check-in")),
Expanded(child: Text("Check-out")),
],
),
), ),
child: Column( SizedBox(
crossAxisAlignment: CrossAxisAlignment.start, child: Row(
children: [ children: [
Container( Expanded(
padding: EdgeInsets.only( child: Container(
left: 15, padding: EdgeInsets.symmetric(
right: 10, horizontal: 10,
top: 15, vertical: 15,
), ),
child: Row( margin: EdgeInsets.symmetric(
children: [ horizontal: 10,
Expanded(child: Text("Check-in")), vertical: 15,
Expanded(child: Text("Check-out")), ),
], decoration: BoxDecoration(
), color: Color(0xFFF3EDFF),
), borderRadius: BorderRadius.circular(16),
SizedBox( ),
child: Row( child: Column(
children: [ crossAxisAlignment:
Expanded( CrossAxisAlignment.start,
child: Container( children: [
padding: EdgeInsets.symmetric( RichText(
horizontal: 10, text: TextSpan(
vertical: 15, children: [
), TextSpan(
margin: EdgeInsets.symmetric( text: formattedTime,
horizontal: 10, style: TextStyle(
vertical: 15, color:
), formattedTime != "-"
decoration: BoxDecoration( ? Color(0xFF493272)
color: Color(0xFFF3EDFF), : Color(0xFFED3424),
borderRadius: BorderRadius.circular( fontFamily: "JakartaRegular",
16, fontSize: 30,
), ),
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
RichText(
text: TextSpan(
children: [
TextSpan(
text: formattedTime,
style: TextStyle(
color:
formattedTime != "-"
? Color(
0xFF493272,
)
: Color(
0xFFED3424,
),
fontFamily:
"JakartaRegular",
fontSize: 30,
),
),
TextSpan(
text: period,
style: TextStyle(
color:
period != "-"
? Color(
0xFF493272,
)
: Color(
0xFFED3424,
),
fontFamily:
"JakartaRegular",
),
),
],
), ),
), TextSpan(
Text( text: period,
"${attendance.attendanceHistory.firstOrNull?['check_in_location']}", style: TextStyle(
style: TextStyle( color:
color: Color(0xFF818181), period != "-"
? Color(0xFF493272)
: Color(0xFFED3424),
fontFamily: "JakartaRegular",
),
), ),
), ],
], ),
),
),
),
Expanded(
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
), ),
decoration: BoxDecoration( Text(
color: Color(0xFFF3EDFF), "${attendance.attendanceHistory.firstOrNull?['check_in_location']}",
borderRadius: BorderRadius.circular( style: TextStyle(
16, color: Color(0xFF818181),
), ),
), ),
child: Column( ],
crossAxisAlignment: ),
CrossAxisAlignment.start, ),
children: [ ),
RichText( Expanded(
text: TextSpan( child: Container(
children: [ padding: EdgeInsets.symmetric(
TextSpan( horizontal: 10,
text: formattedTime2, vertical: 15,
style: TextStyle( ),
color: margin: EdgeInsets.symmetric(
formattedTime2 != "-" horizontal: 10,
? Color( vertical: 15,
0xFF493272, ),
) decoration: BoxDecoration(
: Color( color: Color(0xFFF3EDFF),
0xFFED3424, borderRadius: BorderRadius.circular(16),
), ),
fontFamily: child: Column(
"JakartaRegular", crossAxisAlignment:
fontSize: 30, CrossAxisAlignment.start,
), children: [
), RichText(
TextSpan( text: TextSpan(
text: period2, children: [
style: TextStyle( TextSpan(
color: text: formattedTime2,
period2 != "-" style: TextStyle(
? Color( color:
0xFF493272, formattedTime2 != "-"
) ? Color(0xFF493272)
: Color( : Color(0xFFED3424),
0xFFED3424, fontFamily: "JakartaRegular",
), fontSize: 30,
fontFamily: ),
"JakartaRegular",
),
),
],
), ),
), TextSpan(
Text( text: period2,
"${attendance.attendanceHistory.firstOrNull?['check_out_location']}", style: TextStyle(
style: TextStyle( color:
color: Color(0xFF818181), period2 != "-"
? Color(0xFF493272)
: Color(0xFFED3424),
fontFamily: "JakartaRegular",
),
), ),
), ],
], ),
), ),
), Text(
"${attendance.attendanceHistory.firstOrNull?['check_out_location']}",
style: TextStyle(
color: Color(0xFF818181),
),
),
],
), ),
], ),
), ),
), ],
],
),
),
Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
child: Text(
"Attendance Details",
style: TextStyle(
fontFamily: "JakartaSemiBold",
fontSize: 14,
color: Color(0xFF818181),
), ),
), ),
],
),
),
Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
child: Text(
"Attendance Details",
style: TextStyle(
fontFamily: "JakartaSemiBold",
fontSize: 14,
color: Color(0xFF818181),
), ),
Container( ),
padding: EdgeInsets.symmetric( ),
horizontal: 10, Container(
vertical: 10, padding: EdgeInsets.symmetric(
), horizontal: 10,
decoration: BoxDecoration( vertical: 10,
color: Colors.white, ),
borderRadius: BorderRadius.circular(16), decoration: BoxDecoration(
), color: Colors.white,
child: GridView.builder( borderRadius: BorderRadius.circular(16),
itemCount: 4, ),
shrinkWrap: true, child: GridView.builder(
physics: NeverScrollableScrollPhysics(), itemCount: 4,
gridDelegate: shrinkWrap: true,
SliverGridDelegateWithFixedCrossAxisCount( physics: NeverScrollableScrollPhysics(),
crossAxisCount: 2, gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisSpacing: 10, crossAxisCount: 2,
mainAxisSpacing: 10, crossAxisSpacing: 10,
childAspectRatio: 20 / 10, mainAxisSpacing: 10,
), childAspectRatio: 20 / 10,
itemBuilder: (context, index) { ),
final numbers = [ itemBuilder: (context, index) {
attendance.presentDays, final numbers = [
attendance.absentDays, attendance.presentDays,
attendance.holidays, attendance.absentDays,
attendance.latePenalties, attendance.holidays,
]; attendance.latePenalties,
final names = [ ];
"Present Days", final names = [
"Absent Days", "Present Days",
"Holidays", "Absent Days",
"Late Points", "Holidays",
]; "Late Points",
final colors = [ ];
0xFFE7FFE5, final colors = [
0xFFFFEFEF, 0xFFE7FFE5,
0xFFF3EDFF, 0xFFFFEFEF,
0xFFFFF6F0, 0xFFF3EDFF,
]; 0xFFFFF6F0,
final textcolors = [ ];
0xFF0D9C00, final textcolors = [
0xFFFF0000, 0xFF0D9C00,
0xFF493272, 0xFFFF0000,
0xFF91481B, 0xFF493272,
]; 0xFF91481B,
return Container( ];
padding: EdgeInsets.symmetric(horizontal: 13), return Container(
decoration: BoxDecoration( padding: EdgeInsets.symmetric(horizontal: 13),
color: Color(colors[index]), decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), color: Color(colors[index]),
borderRadius: BorderRadius.circular(12),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
numbers[index].toString(),
style: TextStyle(
fontSize: 30,
fontFamily: "JakartaMedium",
color: Color(textcolors[index]),
),
), ),
child: Column( Text(
crossAxisAlignment: CrossAxisAlignment.start, names[index],
mainAxisAlignment: MainAxisAlignment.center, style: TextStyle(color: Color(0xFF818181)),
children: [
Text(
numbers[index].toString(),
style: TextStyle(
fontSize: 30,
fontFamily: "JakartaMedium",
color: Color(textcolors[index]),
),
),
Text(
names[index],
style: TextStyle(
color: Color(0xFF818181),
),
),
],
), ),
); ],
}, ),
), );
), },
),
),
///calendar ///calendar
Container( Container(
// padding: EdgeInsets.symmetric(horizontal: 10,vertical: 5), // padding: EdgeInsets.symmetric(horizontal: 10,vertical: 5),
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
horizontal: 10, decoration: BoxDecoration(
vertical: 5, borderRadius: BorderRadius.circular(16),
), color: Colors.white,
decoration: BoxDecoration( ),
borderRadius: BorderRadius.circular(16), child: Column(
color: Colors.white, children: [
), Padding(
child: Column( padding: const EdgeInsets.fromLTRB(30, 10, 30, 0),
children: [ child: Container(
Padding( child: Row(
padding: const EdgeInsets.fromLTRB( mainAxisAlignment:
30, MainAxisAlignment.spaceBetween,
10, children: [
30, SizedBox(
0, child: Row(
), children: [
child: Container( GestureDetector(
child: Row( onTap: () {
mainAxisAlignment: attendance.setPreviousMonth(
MainAxisAlignment.spaceBetween, homeProvider,
children: [ context,
SizedBox( );
child: Row( },
children: [ child: SvgPicture.asset(
GestureDetector( "assets/svg/arrow_left.svg",
onTap: () { ),
attendance.setPreviousMonth(
homeProvider,
context,
);
},
child: SvgPicture.asset(
"assets/svg/arrow_left.svg",
),
),
Text(
monthLabel,
style: TextStyle(
overflow: TextOverflow.ellipsis,
fontFamily: "JakartaMedium",
color: Color(0xFF2D2D2D),
),
),
GestureDetector(
onTap: () {
attendance.setNextMonth(
homeProvider,
context,
);
},
child: SvgPicture.asset(
"assets/svg/arrow_right_new.svg",
),
),
],
), ),
), Text(
monthLabel,
InkResponse( style: TextStyle(
onTap: () { overflow: TextOverflow.ellipsis,
_showInfoBottomSheet(context); fontFamily: "JakartaMedium",
}, color: Color(0xFF2D2D2D),
child: SizedBox( ),
width: 20, ),
height: 20, GestureDetector(
onTap: () {
attendance.setNextMonth(
homeProvider,
context,
);
},
child: SvgPicture.asset( child: SvgPicture.asset(
"assets/svg/ic_info_new.svg", "assets/svg/arrow_right_new.svg",
width: 20,
height: 20,
), ),
), ),
],
),
),
InkResponse(
onTap: () {
_showInfoBottomSheet(context);
},
child: SizedBox(
width: 20,
height: 20,
child: SvgPicture.asset(
"assets/svg/ic_info_new.svg",
width: 20,
height: 20,
), ),
], ),
), ),
), ],
), ),
SizedBox(height: 5), ),
Padding( ),
padding: const EdgeInsets.fromLTRB(8, 10, 8, 0), SizedBox(height: 5),
child: Container( Padding(
child: Row( padding: const EdgeInsets.fromLTRB(8, 10, 8, 0),
children: [ child: Container(
for ( child: Row(
var i = 0; children: [
i < for (
[ var i = 0;
'S', i <
'M', [
'T', 'S',
'W', 'M',
'T', 'T',
'F', 'W',
'S', 'T',
].length; 'F',
i++ 'S',
) ].length;
Expanded( i++
child: Text( )
[ Expanded(
'S', child: Text(
'M', ['S', 'M', 'T', 'W', 'T', 'F', 'S'][i],
'T', textAlign: TextAlign.center,
'W', style: TextStyle(
'T', overflow: TextOverflow.ellipsis,
'F', color:
'S', i == 0
][i], ? Color(0xFFFF0000)
textAlign: TextAlign.center, : AppColors.semi_black,
style: TextStyle(
overflow: TextOverflow.ellipsis,
color:
i == 0
? Color(0xFFFF0000)
: AppColors.semi_black,
),
),
), ),
], ),
), ),
), ],
), ),
),
),
Padding( Padding(
padding: const EdgeInsets.fromLTRB(0, 0, 0, 10), padding: const EdgeInsets.fromLTRB(0, 0, 0, 10),
child: Container( child: Container(
child: GridView.builder( child: GridView.builder(
itemCount: daysInPeriod + startingIndex, itemCount: daysInPeriod + startingIndex,
gridDelegate: gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount( SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 7, crossAxisCount: 7,
crossAxisSpacing: 2, crossAxisSpacing: 2,
mainAxisSpacing: 1, mainAxisSpacing: 1,
childAspectRatio: (255 / 245), childAspectRatio: (255 / 245),
),
padding: const EdgeInsets.fromLTRB(
0,
0,
0,
0,
), ),
shrinkWrap: true, padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
physics: NeverScrollableScrollPhysics(), shrinkWrap: true,
itemBuilder: (context, index) { physics: NeverScrollableScrollPhysics(),
if (index < startingIndex) { itemBuilder: (context, index) {
return SizedBox.shrink(); if (index < startingIndex) {
} return SizedBox.shrink();
}
final dayIndex = index - startingIndex;
final currentDateInPeriod = startDate.add( final dayIndex = index - startingIndex;
Duration(days: dayIndex), final currentDateInPeriod = startDate.add(
); Duration(days: dayIndex),
final currentDay = );
currentDateInPeriod.day; final currentDay = currentDateInPeriod.day;
final isFutureDate = currentDateInPeriod final isFutureDate = currentDateInPeriod
.isAfter(currentDate); .isAfter(currentDate);
// Find matching date in dateArrayList // Find matching date in dateArrayList
Map<String, dynamic>? dateMap; Map<String, dynamic>? dateMap;
try { try {
dateMap = dateArrayList[dayIndex]; dateMap = dateArrayList[dayIndex];
} catch (e) { } catch (e) {
dateMap = {}; dateMap = {};
} }
// Find matching penalty // Find matching penalty
Map<String, dynamic>? penaltyMap; Map<String, dynamic>? penaltyMap;
try { try {
penaltyMap = penaltyMap = penalityArrayList[dayIndex];
penalityArrayList[dayIndex]; } catch (e) {
} catch (e) { penaltyMap = {};
penaltyMap = {}; }
}
String? dateColor =
String? dateColor = dateMap.isNotEmpty
dateMap.isNotEmpty ? dateMap.values.first
? dateMap.values.first : null;
: null; String? penaltyKey =
String? penaltyKey = penaltyMap.isNotEmpty
penaltyMap.isNotEmpty ? penaltyMap.keys.first
? penaltyMap.keys.first : null;
: null; int? datePenalty =
int? datePenalty = penaltyMap.isNotEmpty
penaltyMap.isNotEmpty ? penaltyMap.values.first
? penaltyMap.values.first : 0;
: 0;
// Determine if this is the current day
// Determine if this is the current day final isCurrentDay =
final isCurrentDay = currentDateInPeriod.day ==
currentDateInPeriod.day == currentDate.day &&
currentDate.day && currentDateInPeriod.month ==
currentDateInPeriod.month == currentDate.month &&
currentDate.month && currentDateInPeriod.year ==
currentDateInPeriod.year == currentDate.year;
currentDate.year;
return InkWell(
return InkWell( onTap:
onTap: isFutureDate
isFutureDate ? null
? null : () {
: () { selectedIndex = index;
selectedIndex = index; if (penaltyKey != null) {
if (penaltyKey != null) { attendance.dateWiseAttendance(
attendance homeProvider,
.dateWiseAttendance( penaltyKey,
homeProvider, context,
penaltyKey, );
context, }
); attendance.selectedDate =
} currentDay.toString();
attendance.selectedDate = _showAttDetailsBottomSheet(
currentDay.toString(); context,
_showAttDetailsBottomSheet( );
context, },
); child: Card(
}, elevation: 0,
child: Card( child: Column(
elevation: 0, children: [
child: Column( // Row(
children: [ // mainAxisAlignment:
// Row( // MainAxisAlignment.center,
// mainAxisAlignment: // children: [
// MainAxisAlignment.center, // Text(
// children: [ // "($datePenalty)",
// Text( // style: TextStyle(
// "($datePenalty)", // fontWeight: FontWeight.w400,
// style: TextStyle( // color: Colors.black,
// fontWeight: FontWeight.w400, // fontSize: 5
// color: Colors.black, // ),
// fontSize: 5 // ),
// ), // ],
// ), // ),
// ], Center(
// ), child: Container(
Center( decoration: BoxDecoration(
child: Container( shape: BoxShape.circle,
decoration: BoxDecoration( border: Border.all(
shape: BoxShape.circle, color:
border: Border.all( (isCurrentDay ||
color: (selectedIndex ==
(isCurrentDay || index))
(selectedIndex == ? Color(0xFF1487C9)
index)) : Colors.transparent,
? Color( ),
0xFF1487C9, color:
) isFutureDate
: Colors ? Colors.transparent
.transparent, : (isCurrentDay ||
), (selectedIndex ==
index))
? Color(0xFFFFFFFF)
: dateColor == 'g'
? Color(
0xFF6B3A02,
).withAlpha(50)
: dateColor == 'r'
? Color(
0xFFFF0000,
).withAlpha(50)
: dateColor == 'b'
? Color(
0xFF493272,
).withAlpha(50)
: dateColor == 'br'
? Color(0xFFFFE8D0)
: dateColor == 'y'
? Color(0xFFFFF9B2)
: Colors.transparent,
),
child: Center(
child: Text(
currentDay.toString(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400,
color: color:
isFutureDate isFutureDate
? Colors.transparent ? AppColors
.semi_black
: (isCurrentDay || : (isCurrentDay ||
(selectedIndex == (selectedIndex ==
index)) index))
? Color(0xFFFFFFFF) ? Color(0xFF2D2D2D)
: dateColor == 'g' : dateColor == 'g'
? Color( ? Color(0xFF6B3A02)
0xFF6B3A02,
).withAlpha(50)
: dateColor == 'r' : dateColor == 'r'
? Color( ? Color(0xFFFF0000)
0xFFFF0000,
).withAlpha(50)
: dateColor == 'b' : dateColor == 'b'
? Color( ? Color(0xFF493272)
0xFF493272,
).withAlpha(50)
: dateColor == 'br' : dateColor == 'br'
? Color(0xFFFFE8D0) ? Color(0xFF6B3A02)
: dateColor == 'y' : dateColor == 'y'
? Color(0xFFFFF9B2) ? Color(0xFF605C00)
: Colors : Colors
.transparent, .transparent,
), ),
child: Center(
child: Text(
currentDay.toString(),
style: TextStyle(
fontSize: 14,
fontWeight:
FontWeight.w400,
color:
isFutureDate
? AppColors
.semi_black
: (isCurrentDay ||
(selectedIndex ==
index))
? Color(
0xFF2D2D2D,
)
: dateColor ==
'g'
? Color(
0xFF6B3A02,
)
: dateColor ==
'r'
? Color(
0xFFFF0000,
)
: dateColor ==
'b'
? Color(
0xFF493272,
)
: dateColor ==
'br'
? Color(
0xFF6B3A02,
)
: dateColor ==
'y'
? Color(
0xFF605C00,
)
: Colors
.transparent,
),
),
),
), ),
), ),
], ),
), ),
), ],
); ),
}, ),
), );
), },
), ),
], ),
), ),
), ],
SizedBox(height: 70), ),
],
), ),
), SizedBox(height: 70),
],
), ),
floatingActionButton: ),
attendance.attendanceStatus == 0 || ),
attendance.attendanceStatus == 1 floatingActionButton:
? Align( attendance.attendanceStatus == 0 ||
alignment: Alignment.bottomCenter, attendance.attendanceStatus == 1
child: InkWell( ? Align(
onTap: () async { alignment: Alignment.bottomCenter,
var res = await Navigator.push( child: InkWell(
context, onTap: () async {
MaterialPageRoute( var res = await Navigator.push(
builder: context,
(context) => CheckInOutScreen( MaterialPageRoute(
getAttendanceStatus: builder:
attendance.attendanceStatus, (context) => CheckInOutScreen(
), getAttendanceStatus:
), attendance.attendanceStatus,
);
if (res == true) {
attendance.getAttendanceList(
homeProvider,
context,
);
attendance.init(homeProvider, context);
attendance.loadAttendanceDetails(
homeProvider,
context,
);
}
var f = FocusScope.of(context);
if (!f.hasPrimaryFocus) {
f.unfocus();
}
},
child: Container(
alignment: Alignment.bottomCenter,
height: 45,
margin: EdgeInsets.symmetric(horizontal: 10),
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15.0),
),
child: Center(
child: Text(
attendance.attendanceStatus == 0
? "Check In"
: "Check Out",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16,
color: Colors.white,
fontFamily: "JakartaMedium",
), ),
), ),
);
if (res == true) {
attendance.getAttendanceList(homeProvider, context);
attendance.init(homeProvider, context);
attendance.loadAttendanceDetails(
homeProvider,
context,
);
}
var f = FocusScope.of(context);
if (!f.hasPrimaryFocus) {
f.unfocus();
}
},
child: Container(
alignment: Alignment.bottomCenter,
height: 45,
margin: EdgeInsets.symmetric(horizontal: 10),
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15.0),
),
child: Center(
child: Text(
attendance.attendanceStatus == 0
? "Check In"
: "Check Out",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16,
color: Colors.white,
fontFamily: "JakartaMedium",
), ),
), ),
), ),
) ),
: SizedBox(height: 0), ),
floatingActionButtonLocation: )
FloatingActionButtonLocation.centerFloat, : SizedBox(height: 0),
), floatingActionButtonLocation:
), FloatingActionButtonLocation.centerFloat,
), ),
); );
}, },
......
...@@ -77,205 +77,201 @@ class _WebERPIOSState extends State<WebERPIOS> { ...@@ -77,205 +77,201 @@ class _WebERPIOSState extends State<WebERPIOS> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return Platform.isAndroid
onWillPop: () async { ? WillPopScope(
if (await webViewController!.canGoBack()) { onWillPop: () => onBackPressed(context),
webViewController!.goBack(); child: SafeArea(top: false, bottom: true, child: _scaffold(context)),
return false; // Prevent default back button behavior )
} : _scaffold(context);
return true; // Allow default back button behavior }
},
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
appBar: appbar(context, "ERP"),
body: Container(
child: Column(
children: <Widget>[
Expanded(
child: Stack(
children: [
InAppWebView(
initialUrlRequest: URLRequest(
url: WebUri(widget.url.toString()),
),
androidOnGeolocationPermissionsShowPrompt: (
InAppWebViewController controller,
String origin,
) async {
return GeolocationPermissionShowPromptResponse(
origin: origin,
allow: true,
retain: true,
);
},
initialOptions: InAppWebViewGroupOptions(
android: AndroidInAppWebViewOptions(
useWideViewPort: true,
loadWithOverviewMode: true,
allowContentAccess: true,
geolocationEnabled: true,
allowFileAccess: true,
databaseEnabled: true, // Enables the WebView database
domStorageEnabled: true, // Enables DOM storage
builtInZoomControls:
true, // Enables the built-in zoom controls
displayZoomControls:
false, // Disables displaying zoom controls
safeBrowsingEnabled: true, // Enables Safe Browsing
),
ios: IOSInAppWebViewOptions(
allowsInlineMediaPlayback: true,
allowsLinkPreview: true,
allowsBackForwardNavigationGestures: true,
),
),
androidOnPermissionRequest: (
InAppWebViewController controller,
String origin,
List<String> resources,
) async {
return PermissionRequestResponse(
resources: resources,
action: PermissionRequestResponseAction.GRANT,
);
},
initialSettings: InAppWebViewSettings(
javaScriptEnabled: true,
allowFileAccess: true,
allowContentAccess: true,
clearCache: true,
blockNetworkLoads: false,
networkAvailable: true,
useOnLoadResource: true,
thirdPartyCookiesEnabled: true,
supportZoom: false,
geolocationEnabled: true,
safeBrowsingEnabled: false,
saveFormData: true,
allowFileAccessFromFileURLs: true,
useWideViewPort: true,
databaseEnabled: true,
domStorageEnabled: true,
allowsBackForwardNavigationGestures: true,
allowUniversalAccessFromFileURLs: true,
allowsLinkPreview: true,
),
onPermissionRequest: (controller, request) async {
return PermissionResponse(
resources: request.resources,
action: PermissionResponseAction.GRANT,
);
},
keepAlive: InAppWebViewKeepAlive(),
// initialData:
// InAppWebViewInitialData(baseUrl: WebUri(widget.url),data: ),
onWebViewCreated: (controller) {
webViewController = controller;
_controller.complete(controller);
},
pullToRefreshController: pullToRefreshController,
shouldOverrideUrlLoading: (
controller,
navigationAction,
) async {
var uri = navigationAction.request.url!;
print("urib scgefes");
print(uri);
print(uri.scheme);
if (uri.scheme == "tel") {
// Launch the phone dialer app with the specified phone number
if (await canLaunch(uri.toString())) {
await launch(uri.toString());
return NavigationActionPolicy.CANCEL;
}
} else if (uri.scheme == "mailto") {
if (await canLaunch(uri.toString())) {
await launch(uri.toString());
return NavigationActionPolicy.CANCEL;
}
} else if (uri.scheme == "whatsapp") {
// Launch WhatsApp with the specified chat or phone number
if (await canLaunch(uri.toString())) {
await launch(uri.toString());
return NavigationActionPolicy.CANCEL;
}
}
// // Check if the URL is trying to access the camera for image upload
// if (uri.scheme == 'camera' && uri.path.contains('/camera/')) {
// // Handle camera image upload here
// // You might want to display a custom UI for image selection or directly trigger the camera
// // You can use platform-specific plugins like image_picker for this purpose
// // Once the image is selected, you can pass it to the web view using JavaScript injection
// if (await canLaunch(uri.toString())) {
// await launch(uri.toString());
// return NavigationActionPolicy.CANCEL;
// }
// }
return NavigationActionPolicy.ALLOW;
},
onLoadStart: (controller, url) { Widget _scaffold(BuildContext context) {
return setState(() { return Scaffold(
isLoading = true; appBar: appbar(context, "ERP"),
}); body: Container(
}, child: Column(
onLoadStop: (controller, url) { children: <Widget>[
pullToRefreshController?.endRefreshing(); Expanded(
return setState(() { child: Stack(
isLoading = false; children: [
}); InAppWebView(
}, initialUrlRequest: URLRequest(
onReceivedError: (controller, request, error) { url: WebUri(widget.url.toString()),
pullToRefreshController?.endRefreshing(); ),
}, androidOnGeolocationPermissionsShowPrompt: (
onProgressChanged: (controller, progress) { InAppWebViewController controller,
if (progress == 100) { String origin,
pullToRefreshController?.endRefreshing(); ) async {
} return GeolocationPermissionShowPromptResponse(
}, origin: origin,
allow: true,
retain: true,
);
},
initialOptions: InAppWebViewGroupOptions(
android: AndroidInAppWebViewOptions(
useWideViewPort: true,
loadWithOverviewMode: true,
allowContentAccess: true,
geolocationEnabled: true,
allowFileAccess: true,
databaseEnabled: true, // Enables the WebView database
domStorageEnabled: true, // Enables DOM storage
builtInZoomControls:
true, // Enables the built-in zoom controls
displayZoomControls:
false, // Disables displaying zoom controls
safeBrowsingEnabled: true, // Enables Safe Browsing
), ),
if (isLoading) ...[ ios: IOSInAppWebViewOptions(
Container( allowsInlineMediaPlayback: true,
color: Colors.white.withOpacity(0.7), allowsLinkPreview: true,
child: Column( allowsBackForwardNavigationGestures: true,
crossAxisAlignment: CrossAxisAlignment.center, ),
mainAxisAlignment: MainAxisAlignment.center, ),
children: [
SpinKitRing( androidOnPermissionRequest: (
InAppWebViewController controller,
String origin,
List<String> resources,
) async {
return PermissionRequestResponse(
resources: resources,
action: PermissionRequestResponseAction.GRANT,
);
},
initialSettings: InAppWebViewSettings(
javaScriptEnabled: true,
allowFileAccess: true,
allowContentAccess: true,
clearCache: true,
blockNetworkLoads: false,
networkAvailable: true,
useOnLoadResource: true,
thirdPartyCookiesEnabled: true,
supportZoom: false,
geolocationEnabled: true,
safeBrowsingEnabled: false,
saveFormData: true,
allowFileAccessFromFileURLs: true,
useWideViewPort: true,
databaseEnabled: true,
domStorageEnabled: true,
allowsBackForwardNavigationGestures: true,
allowUniversalAccessFromFileURLs: true,
allowsLinkPreview: true,
),
onPermissionRequest: (controller, request) async {
return PermissionResponse(
resources: request.resources,
action: PermissionResponseAction.GRANT,
);
},
keepAlive: InAppWebViewKeepAlive(),
// initialData:
// InAppWebViewInitialData(baseUrl: WebUri(widget.url),data: ),
onWebViewCreated: (controller) {
webViewController = controller;
_controller.complete(controller);
},
pullToRefreshController: pullToRefreshController,
shouldOverrideUrlLoading: (
controller,
navigationAction,
) async {
var uri = navigationAction.request.url!;
print("urib scgefes");
print(uri);
print(uri.scheme);
if (uri.scheme == "tel") {
// Launch the phone dialer app with the specified phone number
if (await canLaunch(uri.toString())) {
await launch(uri.toString());
return NavigationActionPolicy.CANCEL;
}
} else if (uri.scheme == "mailto") {
if (await canLaunch(uri.toString())) {
await launch(uri.toString());
return NavigationActionPolicy.CANCEL;
}
} else if (uri.scheme == "whatsapp") {
// Launch WhatsApp with the specified chat or phone number
if (await canLaunch(uri.toString())) {
await launch(uri.toString());
return NavigationActionPolicy.CANCEL;
}
}
// // Check if the URL is trying to access the camera for image upload
// if (uri.scheme == 'camera' && uri.path.contains('/camera/')) {
// // Handle camera image upload here
// // You might want to display a custom UI for image selection or directly trigger the camera
// // You can use platform-specific plugins like image_picker for this purpose
// // Once the image is selected, you can pass it to the web view using JavaScript injection
// if (await canLaunch(uri.toString())) {
// await launch(uri.toString());
// return NavigationActionPolicy.CANCEL;
// }
// }
return NavigationActionPolicy.ALLOW;
},
onLoadStart: (controller, url) {
return setState(() {
isLoading = true;
});
},
onLoadStop: (controller, url) {
pullToRefreshController?.endRefreshing();
return setState(() {
isLoading = false;
});
},
onReceivedError: (controller, request, error) {
pullToRefreshController?.endRefreshing();
},
onProgressChanged: (controller, progress) {
if (progress == 100) {
pullToRefreshController?.endRefreshing();
}
},
),
if (isLoading) ...[
Container(
color: Colors.white.withOpacity(0.7),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
SpinKitRing(
color: AppColors.app_blue,
lineWidth: 4,
// duration: Duration(seconds: 2),
size: 50,
),
const SizedBox(height: 15),
SizedBox(
width: 200,
child: Text(
"Please wait.......",
textAlign: TextAlign.center,
style: TextStyle(
decorationThickness: 0,
fontSize: 15,
fontWeight: FontWeight.normal,
color: AppColors.app_blue, color: AppColors.app_blue,
lineWidth: 4,
// duration: Duration(seconds: 2),
size: 50,
), ),
const SizedBox(height: 15), ),
SizedBox(
width: 200,
child: Text(
"Please wait.......",
textAlign: TextAlign.center,
style: TextStyle(
decorationThickness: 0,
fontSize: 15,
fontWeight: FontWeight.normal,
color: AppColors.app_blue,
),
),
),
// SvgPicture.asset("/assets/images/NutsLoader.gif")
],
), ),
),
], // SvgPicture.asset("/assets/images/NutsLoader.gif")
], ],
), ),
), ),
], ],
],
),
), ),
), ],
), ),
), ),
); );
......
...@@ -16,13 +16,14 @@ import 'WebERPScreen.dart'; ...@@ -16,13 +16,14 @@ import 'WebERPScreen.dart';
Future runErpScreenApp2() async { Future runErpScreenApp2() async {
await FlutterDownloader.initialize( await FlutterDownloader.initialize(
debug: true // optional: set false to disable printing logs to console debug: true, // optional: set false to disable printing logs to console
); );
await Permission.storage.request(); await Permission.storage.request();
} }
class WebWhizzdomScreen extends StatefulWidget { class WebWhizzdomScreen extends StatefulWidget {
final String whizzdom_url; final String whizzdom_url;
const WebWhizzdomScreen({super.key,required this.whizzdom_url}); const WebWhizzdomScreen({super.key, required this.whizzdom_url});
@override @override
State<WebWhizzdomScreen> createState() => _WebWhizzdomScreenState(); State<WebWhizzdomScreen> createState() => _WebWhizzdomScreenState();
...@@ -30,7 +31,7 @@ class WebWhizzdomScreen extends StatefulWidget { ...@@ -30,7 +31,7 @@ class WebWhizzdomScreen extends StatefulWidget {
class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> { class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> {
final Completer<InAppWebViewController> _controller = final Completer<InAppWebViewController> _controller =
Completer<InAppWebViewController>(); Completer<InAppWebViewController>();
var empId = ""; var empId = "";
var sessionId = ""; var sessionId = "";
bool isLoading = true; bool isLoading = true;
...@@ -46,20 +47,23 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> { ...@@ -46,20 +47,23 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> {
@override @override
void initState() { void initState() {
// loadData(); // loadData();
pullToRefreshController = kIsWeb pullToRefreshController =
? null kIsWeb
: PullToRefreshController( ? null
settings: pullToRefreshSettings, : PullToRefreshController(
onRefresh: () async { settings: pullToRefreshSettings,
if (defaultTargetPlatform == TargetPlatform.android) { onRefresh: () async {
webViewController?.reload(); if (defaultTargetPlatform == TargetPlatform.android) {
} else if (defaultTargetPlatform == TargetPlatform.iOS) { webViewController?.reload();
webViewController?.loadUrl( } else if (defaultTargetPlatform == TargetPlatform.iOS) {
urlRequest: webViewController?.loadUrl(
URLRequest(url: await webViewController?.getUrl())); urlRequest: URLRequest(
} url: await webViewController?.getUrl(),
}, ),
); );
}
},
);
// print("URL:${widget.url}"); // print("URL:${widget.url}");
super.initState(); super.initState();
} }
...@@ -68,125 +72,134 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> { ...@@ -68,125 +72,134 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> {
void dispose() { void dispose() {
super.dispose(); super.dispose();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return Platform.isAndroid
onWillPop: () async { ? WillPopScope(
if (await webViewController!.canGoBack()) { onWillPop: () => onBackPressed(context),
webViewController!.goBack(); child: SafeArea(top: false, bottom: true, child: _scaffold(context)),
return false; // Prevent default back button behavior )
} : _scaffold(context);
return true; // Allow default back button behavior }
},
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Whizzdom"),
body: Container(
child: Column(children: <Widget>[
Expanded(
child: Stack(
children: [
InAppWebView(
initialUrlRequest: URLRequest(
url: WebUri(widget.whizzdom_url),
),
androidOnGeolocationPermissionsShowPrompt:
(InAppWebViewController controller, String origin) async {
return GeolocationPermissionShowPromptResponse(
origin: origin, allow: true, retain: true);
},
initialOptions: InAppWebViewGroupOptions(
android: AndroidInAppWebViewOptions(
useWideViewPort: true,
loadWithOverviewMode: true,
allowContentAccess: true,
geolocationEnabled: true,
allowFileAccess: true,
databaseEnabled: true, // Enables the WebView database
domStorageEnabled: true, // Enables DOM storage
builtInZoomControls:
true, // Enables the built-in zoom controls
displayZoomControls:
false, // Disables displaying zoom controls
safeBrowsingEnabled: true, // Enables Safe Browsing
clearSessionCache: true,
),
ios: IOSInAppWebViewOptions(
allowsInlineMediaPlayback: true,
),
),
androidOnPermissionRequest: (InAppWebViewController controller, Widget _scaffold(BuildContext context) {
String origin, List<String> resources) async { return Scaffold(
return PermissionRequestResponse( resizeToAvoidBottomInset: true,
resources: resources, appBar: appbar(context, "Whizzdom"),
action: PermissionRequestResponseAction.GRANT); body: Container(
}, child: Column(
onWebViewCreated: (controller) { children: <Widget>[
webViewController = controller; Expanded(
_controller.complete(controller); child: Stack(
}, children: [
pullToRefreshController: pullToRefreshController, InAppWebView(
onLoadStart: (controller, url) { initialUrlRequest: URLRequest(
return setState(() { url: WebUri(widget.whizzdom_url),
isLoading = true; ),
}); androidOnGeolocationPermissionsShowPrompt: (
}, InAppWebViewController controller,
onLoadStop: (controller, url) { String origin,
pullToRefreshController?.endRefreshing(); ) async {
return setState(() { return GeolocationPermissionShowPromptResponse(
isLoading = false; origin: origin,
}); allow: true,
}, retain: true,
onReceivedError: (controller, request, error) { );
pullToRefreshController?.endRefreshing(); },
}, initialOptions: InAppWebViewGroupOptions(
onProgressChanged: (controller, progress) { android: AndroidInAppWebViewOptions(
if (progress == 100) { useWideViewPort: true,
pullToRefreshController?.endRefreshing(); loadWithOverviewMode: true,
} allowContentAccess: true,
}, geolocationEnabled: true,
allowFileAccess: true,
databaseEnabled: true, // Enables the WebView database
domStorageEnabled: true, // Enables DOM storage
builtInZoomControls:
true, // Enables the built-in zoom controls
displayZoomControls:
false, // Disables displaying zoom controls
safeBrowsingEnabled: true, // Enables Safe Browsing
clearSessionCache: true,
),
ios: IOSInAppWebViewOptions(
allowsInlineMediaPlayback: true,
),
),
), androidOnPermissionRequest: (
if (isLoading) ...[Container( InAppWebViewController controller,
color: Colors.white.withOpacity(0.7), String origin,
child: Column( List<String> resources,
crossAxisAlignment: CrossAxisAlignment.center, ) async {
mainAxisAlignment: MainAxisAlignment.center, return PermissionRequestResponse(
children: [ resources: resources,
SpinKitRing( action: PermissionRequestResponseAction.GRANT,
);
},
onWebViewCreated: (controller) {
webViewController = controller;
_controller.complete(controller);
},
pullToRefreshController: pullToRefreshController,
onLoadStart: (controller, url) {
return setState(() {
isLoading = true;
});
},
onLoadStop: (controller, url) {
pullToRefreshController?.endRefreshing();
return setState(() {
isLoading = false;
});
},
onReceivedError: (controller, request, error) {
pullToRefreshController?.endRefreshing();
},
onProgressChanged: (controller, progress) {
if (progress == 100) {
pullToRefreshController?.endRefreshing();
}
},
),
if (isLoading) ...[
Container(
color: Colors.white.withOpacity(0.7),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
SpinKitRing(
color: AppColors.app_blue,
lineWidth: 4,
// duration: Duration(seconds: 2),
size: 50,
),
const SizedBox(height: 15),
SizedBox(
width: 200,
child: Text(
"Please wait.......",
textAlign: TextAlign.center,
style: TextStyle(
decorationThickness: 0,
fontSize: 15,
fontWeight: FontWeight.normal,
color: AppColors.app_blue, color: AppColors.app_blue,
lineWidth: 4,
// duration: Duration(seconds: 2),
size: 50,
),
const SizedBox(
height: 15,
),
SizedBox(
width: 200,
child: Text(
"Please wait.......",
textAlign: TextAlign.center,
style: TextStyle(
decorationThickness: 0,
fontSize: 15,
fontWeight: FontWeight.normal,
color: AppColors.app_blue),
),
), ),
),
// SvgPicture.asset("/assets/images/NutsLoader.gif")
],
), ),
)]
], // SvgPicture.asset("/assets/images/NutsLoader.gif")
)) ],
])), ),
),
],
],
),
),
],
), ),
), ),
); );
......
...@@ -34,6 +34,15 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -34,6 +34,15 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Platform.isAndroid
? WillPopScope(
onWillPop: () => onBackPressed(context),
child: SafeArea(top: false, bottom: true, child: _scaffold(context)),
)
: _scaffold(context);
}
Widget _scaffold(BuildContext context) {
return Consumer<Crmdashboardprovider>( return Consumer<Crmdashboardprovider>(
builder: (context, provider, child) { builder: (context, provider, child) {
final gridPages = final gridPages =
...@@ -41,354 +50,217 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -41,354 +50,217 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
.where((page) => ![8, 9, 23, 24, 51, 50].contains(page.id)) .where((page) => ![8, 9, 23, 24, 51, 50].contains(page.id))
.toList(); .toList();
return WillPopScope( return Scaffold(
onWillPop: () => onBackPressed(context), resizeToAvoidBottomInset: true,
child: SafeArea( backgroundColor: AppColors.scaffold_bg_color,
top: false, appBar: AppBar(
bottom: Platform.isIOS?false:true, automaticallyImplyLeading: false,
child: Scaffold( elevation: 2.0,
resizeToAvoidBottomInset: true, title: SizedBox(
backgroundColor: AppColors.scaffold_bg_color, child: Row(
appBar: AppBar( mainAxisAlignment: MainAxisAlignment.start,
automaticallyImplyLeading: false, crossAxisAlignment: CrossAxisAlignment.center,
elevation: 2.0, children: [
title: SizedBox( InkResponse(
child: Row( onTap: () => Navigator.pop(context, true),
mainAxisAlignment: MainAxisAlignment.start, child: SvgPicture.asset(
crossAxisAlignment: CrossAxisAlignment.center, "assets/svg/app_bar_back.svg",
children: [ height: 25,
InkResponse( ),
onTap: () => Navigator.pop(context, true), ),
child: SvgPicture.asset( InkResponse(
"assets/svg/app_bar_back.svg", onTap: () => Navigator.pop(context, true),
height: 25, child: Text(
), "CRM",
), style: TextStyle(
InkResponse( fontSize: 16,
onTap: () => Navigator.pop(context, true), height: 1.1,
child: Text( fontFamily: "JakartaSemiBold",
"CRM", color: AppColors.semi_black,
style: TextStyle(
fontSize: 16,
height: 1.1,
fontFamily: "JakartaSemiBold",
color: AppColors.semi_black,
),
),
), ),
], ),
), ),
],
),
),
bottom: PreferredSize(
preferredSize: Size.fromHeight(50),
child: Container(
padding: const EdgeInsets.fromLTRB(5.0, 0.0, 10, 0),
margin: const EdgeInsets.fromLTRB(10.0, 0.0, 10, 10),
height: 50,
alignment: Alignment.center,
decoration: BoxDecoration(
color: AppColors.text_field_color,
borderRadius: BorderRadius.circular(14),
border:
focusNode.hasFocus
? Border.all(color: AppColors.app_blue)
: null,
), ),
bottom: PreferredSize( child: Row(
preferredSize: Size.fromHeight(50), children: [
child: Container( Expanded(
padding: const EdgeInsets.fromLTRB(5.0, 0.0, 10, 0), child: Container(
margin: const EdgeInsets.fromLTRB(10.0, 0.0, 10, 10), padding: const EdgeInsets.fromLTRB(0.0, 0.0, 10, 0),
height: 50, margin: const EdgeInsets.fromLTRB(10.0, 0.0, 10, 10),
alignment: Alignment.center, child: TextFormField(
decoration: BoxDecoration( controller: provider.searchController,
color: AppColors.text_field_color, keyboardType: TextInputType.text,
borderRadius: BorderRadius.circular(14), maxLines: 1,
border:
focusNode.hasFocus
? Border.all(color: AppColors.app_blue)
: null,
),
child: Row(
children: [
Expanded(
child: Container(
padding: const EdgeInsets.fromLTRB(0.0, 0.0, 10, 0),
margin: const EdgeInsets.fromLTRB(10.0, 0.0, 10, 10),
child: TextFormField(
controller: provider.searchController,
keyboardType: TextInputType.text,
maxLines: 1,
onChanged: (value) {},
focusNode: focusNode,
onTapUpOutside: (event) {
focusNode.unfocus();
},
textInputAction: TextInputAction.done, onChanged: (value) {},
onEditingComplete: () { focusNode: focusNode,
Navigator.push( onTapUpOutside: (event) {
context, focusNode.unfocus();
MaterialPageRoute( },
builder:
(context) => Universalsearchscreen(
text: provider.searchController.text,
),
settings: RouteSettings(name: 'SearchScreen'),
),
);
},
decoration: InputDecoration(
counterText: "",
hintText: "Search",
hintStyle: TextStyle(
fontWeight: FontWeight.w400,
color: Color(0xFFB4BEC0),
fontSize: 14,
),
enabled: true,
enabledBorder: InputBorder.none, textInputAction: TextInputAction.done,
focusedBorder: InputBorder.none, onEditingComplete: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Universalsearchscreen(
text: provider.searchController.text,
),
settings: RouteSettings(name: 'SearchScreen'),
), ),
);
},
decoration: InputDecoration(
counterText: "",
hintText: "Search",
hintStyle: TextStyle(
fontWeight: FontWeight.w400,
color: Color(0xFFB4BEC0),
fontSize: 14,
), ),
enabled: true,
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
), ),
), ),
SvgPicture.asset("assets/svg/search_ic.svg"), ),
],
), ),
), SvgPicture.asset("assets/svg/search_ic.svg"),
), ],
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
bottom: Radius.circular(30), // Adjust the radius as needed
),
), ),
), ),
body: SingleChildScrollView( ),
physics: AlwaysScrollableScrollPhysics(), shape: RoundedRectangleBorder(
child: Column( borderRadius: BorderRadius.vertical(
children: [ bottom: Radius.circular(30), // Adjust the radius as needed
if(provider.allLeads.length>0)...[ ),
Container( ),
padding: EdgeInsets.symmetric( ),
horizontal: 10, body: SingleChildScrollView(
vertical: 5, physics: AlwaysScrollableScrollPhysics(),
), child: Column(
margin: EdgeInsets.symmetric( children: [
horizontal: 10, if (provider.allLeads.length > 0) ...[
vertical: 10, Container(
), padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
decoration: BoxDecoration( margin: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
color: Colors.white, decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16), color: Colors.white,
), borderRadius: BorderRadius.circular(16),
height: MediaQuery.of(context).size.height * 0.28,
child: GridView.builder(
padding: EdgeInsets.symmetric(
horizontal: 0,
vertical: 5,
),
itemCount: provider.allLeads.length,
shrinkWrap: true,
scrollDirection: Axis.horizontal,
physics: AlwaysScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: 10,
mainAxisSpacing: 10,
childAspectRatio: 0.65,
),
itemBuilder: (context, jndex) {
final icons = ["comm_ic_1", "comm_ic_2"];
final leadTitles = [
'Hot Leads',
'Cold Leads',
'Warm Leads',
'Total Leads',
'Order Lost',
'No Requirement',
'Open Enquiries',
];
final colors = [
0xFFE7FFE5,
0xFFF3EDFF,
0xFFFFFCD5,
0xFFFFF6F0,
0xFFE7FFE5,
0xFFF3EDFF,
0xFFFFFCD5,
0xFFFFF6F0,
];
final textcolors = [
0xFF0D9C00,
0xFF493272,
0xFF605C00,
0xFF91481B,
0xFF0D9C00,
0xFF493272,
0xFF605C00,
0xFF91481B,
];
return InkResponse(
onTap: () async {
if (provider.allLeads[jndex].filter!.pageName !=
"") {
if (provider.allLeads[jndex].filter!.pageName!
.contains("Lead List")) {
await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Leadlistbymode(
pageTitleName:
provider
.allLeads[jndex]
.filter!
.pageName!,
mode:
provider
.allLeads[jndex]
.filter!
.mode,
filter:
provider
.allLeads[jndex]
.filter!,
),
),
);
}
}
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 13),
decoration: BoxDecoration(
color: Color(colors[jndex]),
borderRadius: BorderRadius.circular(12),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
provider.allLeads[jndex].count!,
style: TextStyle(
fontSize: 30,
fontFamily: "JakartaMedium",
color: Color(textcolors[jndex]),
),
),
Text(
leadTitles[jndex],
style: TextStyle(color: Color(0xFF818181)),
),
],
),
),
);
},
),
), ),
], height: MediaQuery.of(context).size.height * 0.28,
ListView.builder( child: GridView.builder(
physics: NeverScrollableScrollPhysics(), padding: EdgeInsets.symmetric(horizontal: 0, vertical: 5),
itemCount: provider.allLeads.length,
shrinkWrap: true, shrinkWrap: true,
padding: EdgeInsets.symmetric( scrollDirection: Axis.horizontal,
vertical: 10, physics: AlwaysScrollableScrollPhysics(),
horizontal: 10, gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: 10,
mainAxisSpacing: 10,
childAspectRatio: 0.65,
), ),
itemCount: gridPages.length, itemBuilder: (context, jndex) {
itemBuilder: (context, index) { final icons = ["comm_ic_1", "comm_ic_2"];
// final icons = ["comm_ic_1", "comm_ic_2"]; final leadTitles = [
Widget? SvgIcon; 'Hot Leads',
'Cold Leads',
if (gridPages[index].pageName!.contains("Lead List")) { 'Warm Leads',
SvgIcon = SvgPicture.asset("assets/svg/fin_lv1.svg"); 'Total Leads',
} else if (gridPages[index].pageName == 'Order Lost',
"Nearby Leads") { 'No Requirement',
SvgIcon = SvgPicture.asset( 'Open Enquiries',
"assets/svg/home_icons_5.svg", ];
height: 18, final colors = [
width: 18, 0xFFE7FFE5,
); 0xFFF3EDFF,
} else { 0xFFFFFCD5,
SvgIcon = SvgPicture.asset("assets/svg/fin_ic.svg"); 0xFFFFF6F0,
} 0xFFE7FFE5,
0xFFF3EDFF,
0xFFFFFCD5,
0xFFFFF6F0,
];
final textcolors = [
0xFF0D9C00,
0xFF493272,
0xFF605C00,
0xFF91481B,
0xFF0D9C00,
0xFF493272,
0xFF605C00,
0xFF91481B,
];
return InkResponse( return InkResponse(
onTap: () { onTap: () async {
print(gridPages[index].pageName!); if (provider.allLeads[jndex].filter!.pageName !=
if (gridPages[index].pageName!.contains( "") {
"Lead List", if (provider.allLeads[jndex].filter!.pageName!
)) { .contains("Lead List")) {
Navigator.push( await Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => Leadlistbymode( (context) => Leadlistbymode(
mode: gridPages[index].mode, pageTitleName:
pageTitleName: provider
gridPages[index].pageName, .allLeads[jndex]
), .filter!
), .pageName!,
); mode:
} else if (gridPages[index].pageName!.contains( provider
"Account List", .allLeads[jndex]
)) { .filter!
Navigator.push( .mode,
context, filter:
MaterialPageRoute( provider.allLeads[jndex].filter!,
builder: ),
(context) => ProspectListByMode( ),
mode: gridPages[index].mode, );
pageTitleName: }
gridPages[index].pageName,
),
),
);
} else if (gridPages[index].pageName ==
"Nearby Leads") {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => NearbyOpenLeads(),
),
);
} }
// switch (gridPages[index].pageName!) {
// case "Lead List":
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => Leadlistbymode()),
// );
// break;
// case "Prospect List":
// // Navigator.push(
// // context,
// // MaterialPageRoute(builder: (context) => Accountledger()),
// // );
// break;
//
// default:
// print("111");
// break;
// }
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric(horizontal: 13),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Color(colors[jndex]),
borderRadius: BorderRadius.circular(14), borderRadius: BorderRadius.circular(12),
),
margin: EdgeInsets.symmetric(
horizontal: 5,
vertical: 5,
),
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
), ),
child: Row( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Expanded(flex: 1, child: SvgIcon), Text(
provider.allLeads[jndex].count!,
Expanded( style: TextStyle(
flex: 5, fontSize: 30,
child: Text( fontFamily: "JakartaMedium",
"${gridPages[index].pageName}", color: Color(textcolors[jndex]),
style: TextStyle(fontSize: 14),
), ),
), ),
Expanded( Text(
flex: 1, leadTitles[jndex],
child: SvgPicture.asset( style: TextStyle(color: Color(0xFF818181)),
"assets/svg/arrow_right_new.svg",
),
), ),
], ],
), ),
...@@ -396,132 +268,242 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -396,132 +268,242 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
); );
}, },
), ),
),
],
ListView.builder(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
itemCount: gridPages.length,
itemBuilder: (context, index) {
// final icons = ["comm_ic_1", "comm_ic_2"];
Widget? SvgIcon;
if (provider.pendingTasksLists.length > 0) ...[ if (gridPages[index].pageName!.contains("Lead List")) {
Align( SvgIcon = SvgPicture.asset("assets/svg/fin_lv1.svg");
alignment: Alignment.centerLeft, } else if (gridPages[index].pageName == "Nearby Leads") {
child: Padding( SvgIcon = SvgPicture.asset(
padding: EdgeInsets.symmetric(horizontal: 6), "assets/svg/home_icons_5.svg",
child: Text( height: 18,
"Pending Tasks", width: 18,
style: TextStyle( );
fontSize: 16, } else {
color: AppColors.grey_semi, SvgIcon = SvgPicture.asset("assets/svg/fin_ic.svg");
}
return InkResponse(
onTap: () {
print(gridPages[index].pageName!);
if (gridPages[index].pageName!.contains("Lead List")) {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Leadlistbymode(
mode: gridPages[index].mode,
pageTitleName: gridPages[index].pageName,
),
), ),
), );
} else if (gridPages[index].pageName!.contains(
"Account List",
)) {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => ProspectListByMode(
mode: gridPages[index].mode,
pageTitleName: gridPages[index].pageName,
),
),
);
} else if (gridPages[index].pageName ==
"Nearby Leads") {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => NearbyOpenLeads(),
),
);
}
// switch (gridPages[index].pageName!) {
// case "Lead List":
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => Leadlistbymode()),
// );
// break;
// case "Prospect List":
// // Navigator.push(
// // context,
// // MaterialPageRoute(builder: (context) => Accountledger()),
// // );
// break;
//
// default:
// print("111");
// break;
// }
},
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(14),
), ),
), margin: EdgeInsets.symmetric(
Container( horizontal: 5,
vertical: 5,
width: double.infinity, ),
height: MediaQuery.of(context).size.height*0.34, padding: EdgeInsets.symmetric(
child: ListView.builder( horizontal: 10,
vertical: 15,
),
child: Row(
children: [
Expanded(flex: 1, child: SvgIcon),
physics: AlwaysScrollableScrollPhysics(), Expanded(
shrinkWrap: true, flex: 5,
scrollDirection: Axis.horizontal, child: Text(
padding: EdgeInsets.symmetric( "${gridPages[index].pageName}",
vertical: 10, style: TextStyle(fontSize: 14),
horizontal: 10,
),
itemCount: provider.pendingTasksLists.length,
itemBuilder: (context, index) {
final headings = [
"Lead Name",
"Mobile Number",
"Appointment Date",
"Appointment Type",
"Note",
"Status",
];
final subHeadings = [
provider.pendingTasksLists[index].aname??"-",
provider.pendingTasksLists[index].conmob??"-",
provider.pendingTasksLists[index].appdate??"-",
provider.pendingTasksLists[index].atype??"-",
provider.pendingTasksLists[index].anote??"-",
provider.pendingTasksLists[index].lstatus??"-",
];
return Container(
height: MediaQuery.of(context).size.height*0.3,
width: MediaQuery.of(context).size.width*0.6,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(14),
),
margin: EdgeInsets.symmetric(
horizontal: 5,
vertical: 5,
), ),
padding: EdgeInsets.symmetric( ),
horizontal: 10, Expanded(
vertical: 15, flex: 1,
), child: SvgPicture.asset(
child: Column( "assets/svg/arrow_right_new.svg",
mainAxisAlignment: MainAxisAlignment.start,
children: [
...List.generate(headings.length, (j) {
return Container(
padding: EdgeInsets.symmetric(
vertical: 6,
horizontal: 0,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
"${headings[j]}",
style: TextStyle(fontSize: 14),
),
),
Expanded(
child: Text(
"${subHeadings[j]}",
style: TextStyle(
color: AppColors.grey_semi,
fontSize: 14,
),
),
),
],
),
);
},)
],
), ),
); ),
}, ],
), ),
), ),
], );
SizedBox(height: 150,), },
],
), ),
),
floatingActionButtonLocation: if (provider.pendingTasksLists.length > 0) ...[
FloatingActionButtonLocation.centerFloat, Align(
floatingActionButton: InkResponse( alignment: Alignment.centerLeft,
onTap: () { child: Padding(
_showPaymentOptionsSheet(context); padding: EdgeInsets.symmetric(horizontal: 6),
}, child: Text(
child: Container( "Pending Tasks",
height: 45, style: TextStyle(
alignment: Alignment.center, fontSize: 16,
margin: EdgeInsets.symmetric(horizontal: 10), color: AppColors.grey_semi,
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5), ),
decoration: BoxDecoration( ),
color: AppColors.app_blue, ),
borderRadius: BorderRadius.circular(15),
), ),
child: Text( Container(
"Add Leads and Prospect", width: double.infinity,
style: TextStyle( height: MediaQuery.of(context).size.height * 0.34,
fontSize: 15, child: ListView.builder(
fontFamily: "JakartaMedium", physics: AlwaysScrollableScrollPhysics(),
color: Colors.white, shrinkWrap: true,
scrollDirection: Axis.horizontal,
padding: EdgeInsets.symmetric(
vertical: 10,
horizontal: 10,
),
itemCount: provider.pendingTasksLists.length,
itemBuilder: (context, index) {
final headings = [
"Lead Name",
"Mobile Number",
"Appointment Date",
"Appointment Type",
"Note",
"Status",
];
final subHeadings = [
provider.pendingTasksLists[index].aname ?? "-",
provider.pendingTasksLists[index].conmob ?? "-",
provider.pendingTasksLists[index].appdate ?? "-",
provider.pendingTasksLists[index].atype ?? "-",
provider.pendingTasksLists[index].anote ?? "-",
provider.pendingTasksLists[index].lstatus ?? "-",
];
return Container(
height: MediaQuery.of(context).size.height * 0.3,
width: MediaQuery.of(context).size.width * 0.6,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(14),
),
margin: EdgeInsets.symmetric(
horizontal: 5,
vertical: 5,
),
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
...List.generate(headings.length, (j) {
return Container(
padding: EdgeInsets.symmetric(
vertical: 6,
horizontal: 0,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
"${headings[j]}",
style: TextStyle(fontSize: 14),
),
),
Expanded(
child: Text(
"${subHeadings[j]}",
style: TextStyle(
color: AppColors.grey_semi,
fontSize: 14,
),
),
),
],
),
);
}),
],
),
);
},
), ),
), ),
],
SizedBox(height: 150),
],
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
floatingActionButton: InkResponse(
onTap: () {
_showPaymentOptionsSheet(context);
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: EdgeInsets.symmetric(horizontal: 10),
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15),
),
child: Text(
"Add Leads and Prospect",
style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white,
), ),
), ),
), ),
......
...@@ -11,6 +11,7 @@ import 'package:provider/provider.dart'; ...@@ -11,6 +11,7 @@ import 'package:provider/provider.dart';
import '../../Notifiers/financeProvider/paymentReceiptsProvider.dart'; import '../../Notifiers/financeProvider/paymentReceiptsProvider.dart';
import '../../Utils/app_colors.dart'; import '../../Utils/app_colors.dart';
import '../../Utils/commonWidgets.dart'; import '../../Utils/commonWidgets.dart';
class Addpaymentreceiptlist extends StatefulWidget { class Addpaymentreceiptlist extends StatefulWidget {
final pageTitleName; final pageTitleName;
const Addpaymentreceiptlist({super.key, this.pageTitleName}); const Addpaymentreceiptlist({super.key, this.pageTitleName});
...@@ -21,7 +22,7 @@ class Addpaymentreceiptlist extends StatefulWidget { ...@@ -21,7 +22,7 @@ class Addpaymentreceiptlist extends StatefulWidget {
class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> { class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
Dropdowntheme ddtheme = Dropdowntheme(); Dropdowntheme ddtheme = Dropdowntheme();
List<FocusNode> focusNodes = List.generate(12, (index) => FocusNode(),); List<FocusNode> focusNodes = List.generate(12, (index) => FocusNode());
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
...@@ -37,7 +38,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> { ...@@ -37,7 +38,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
@override @override
void dispose() { void dispose() {
focusNodes.map((e)=>e.dispose()); focusNodes.map((e) => e.dispose());
super.dispose(); super.dispose();
} }
...@@ -53,12 +54,17 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> { ...@@ -53,12 +54,17 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
return WillPopScope( return WillPopScope(
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.white, backgroundColor: AppColors.white,
appBar: appbar2(context, "${widget.pageTitleName}",provider.resetForm,SizedBox(width: 0,)), appBar: appbar2(
body: Container( context,
"${widget.pageTitleName}",
provider.resetForm,
SizedBox(width: 0),
),
body: Container(
padding: EdgeInsets.symmetric(horizontal: 10), padding: EdgeInsets.symmetric(horizontal: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
...@@ -80,22 +86,21 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> { ...@@ -80,22 +86,21 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
items:[ items: [
...provider.receiptAccounts ...provider.receiptAccounts
.map( .map(
(accs) => (accs) => DropdownMenuItem<Accounts>(
DropdownMenuItem<Accounts>( value: accs,
value: accs, child: Text(
child: Text( accs.name ?? '',
accs.name ?? '', style: const TextStyle(
style: const TextStyle( fontSize: 14,
fontSize: 14, ),
overflow: TextOverflow.ellipsis,
), ),
overflow: TextOverflow.ellipsis,
), ),
), )
) .toList(),
.toList(),
], ],
value: provider.selectreceiptAccounts, value: provider.selectreceiptAccounts,
onChanged: (Accounts? value) { onChanged: (Accounts? value) {
...@@ -106,42 +111,51 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> { ...@@ -106,42 +111,51 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
"Selected Complaint Type: ${value.name}, ID: ${value.id}", "Selected Complaint Type: ${value.name}, ID: ${value.id}",
); );
provider.receiptAccountId = value.id!; provider.receiptAccountId = value.id!;
provider.receiptAccountValue = value.name!; provider.receiptAccountValue =
value.name!;
print( print(
"hfjkshfg" + "hfjkshfg" +
provider.receiptAccountId.toString(), provider.receiptAccountId
.toString(),
); );
} }
} }
}, },
dropdownSearchData: DropdownSearchData( dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50, searchInnerWidgetHeight: 50,
searchController: provider.accountSearchController, searchController:
provider.accountSearchController,
searchInnerWidget: Padding( searchInnerWidget: Padding(
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
child: TextFormField( child: TextFormField(
controller: provider.accountSearchController, controller:
provider.accountSearchController,
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
contentPadding: const EdgeInsets.symmetric( contentPadding:
horizontal: 10, const EdgeInsets.symmetric(
vertical: 8, horizontal: 10,
), vertical: 8,
),
hintText: 'Search account...', hintText: 'Search account...',
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(
8,
),
), ),
), ),
), ),
), ),
searchMatchFn: (item, searchValue) { searchMatchFn: (item, searchValue) {
return item.value?.name return item.value?.name
?.toLowerCase() ?.toLowerCase()
.contains(searchValue.toLowerCase()) ?? .contains(
searchValue.toLowerCase(),
) ??
false; false;
}, },
// Optional: clear search text when dropdown closes
// Optional: clear search text when dropdown closes
), ),
onMenuStateChange: (isOpen) { onMenuStateChange: (isOpen) {
if (!isOpen) { if (!isOpen) {
...@@ -171,22 +185,22 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> { ...@@ -171,22 +185,22 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
items: items:
provider.receiptPaymentAccounts provider.receiptPaymentAccounts
.map( .map(
(accs) => DropdownMenuItem< (accs) =>
ReceiptAccounts DropdownMenuItem<ReceiptAccounts>(
>( value: accs,
value: accs, child: Text(
child: Text( accs.name ?? '',
accs.name ?? '', style: const TextStyle(
style: const TextStyle( fontSize: 14,
fontSize: 14, ),
), overflow:
overflow: TextOverflow.ellipsis, TextOverflow.ellipsis,
), ),
), ),
) )
.toList(), .toList(),
value: provider.selectreceiptPaymentAccounts, value: provider.selectreceiptPaymentAccounts,
onChanged: (ReceiptAccounts? value) { onChanged: (ReceiptAccounts? value) {
if (value != null) { if (value != null) {
...@@ -199,9 +213,9 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> { ...@@ -199,9 +213,9 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
"Selected Complaint Type: ${value.name}, ID: ${value.id}", "Selected Complaint Type: ${value.name}, ID: ${value.id}",
); );
provider.receiptPaymentAccountsID = provider.receiptPaymentAccountsID =
value.id!; value.id!;
provider.receiptPaymentAccountsValue = provider.receiptPaymentAccountsValue =
value.name!; value.name!;
print( print(
"hfjkshfg" + "hfjkshfg" +
provider.receiptPaymentAccountsID provider.receiptPaymentAccountsID
...@@ -212,36 +226,45 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> { ...@@ -212,36 +226,45 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
}, },
dropdownSearchData: DropdownSearchData( dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50, searchInnerWidgetHeight: 50,
searchController: provider.paymentAccountSearchController, searchController:
provider.paymentAccountSearchController,
searchInnerWidget: Padding( searchInnerWidget: Padding(
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
child: TextFormField( child: TextFormField(
controller: provider.paymentAccountSearchController, controller:
provider
.paymentAccountSearchController,
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
contentPadding: const EdgeInsets.symmetric( contentPadding:
horizontal: 10, const EdgeInsets.symmetric(
vertical: 8, horizontal: 10,
), vertical: 8,
),
hintText: 'Search account...', hintText: 'Search account...',
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(
8,
),
), ),
), ),
), ),
), ),
searchMatchFn: (item, searchValue) { searchMatchFn: (item, searchValue) {
return item.value?.name return item.value?.name
?.toLowerCase() ?.toLowerCase()
.contains(searchValue.toLowerCase()) ?? .contains(
searchValue.toLowerCase(),
) ??
false; false;
}, },
// Optional: clear search text when dropdown closes
// Optional: clear search text when dropdown closes
), ),
onMenuStateChange: (isOpen) { onMenuStateChange: (isOpen) {
if (!isOpen) { if (!isOpen) {
provider.paymentAccountSearchController.clear(); provider.paymentAccountSearchController
.clear();
} }
}, },
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData: ddtheme.buttonStyleData,
...@@ -256,59 +279,60 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> { ...@@ -256,59 +279,60 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
errorWidget(context, provider.selectPaymentAccountError), errorWidget(context, provider.selectPaymentAccountError),
textControllerWidget( textControllerWidget(
context, context,
provider.amountController, provider.amountController,
"Amount", "Amount",
"Enter Amount", "Enter Amount",
provider.updateAmount,TextInputType.numberWithOptions(),false, provider.updateAmount,
null, TextInputType.numberWithOptions(),
false,
null,
focusNodes[0], focusNodes[0],
focusNodes[1], focusNodes[1],
TextInputAction.next TextInputAction.next,
), ),
errorWidget(context, provider.amountError), errorWidget(context, provider.amountError),
///payment date toBE ///payment date toBE
TextWidget(context, "Receipt Date"), TextWidget(context, "Receipt Date"),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
provider.showDatePickerDialog(context); provider.showDatePickerDialog(context);
}, },
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
child: Container( child: Container(
height: 50,
height: 50,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.text_field_color, color: AppColors.text_field_color,
borderRadius: BorderRadius.circular(14), borderRadius: BorderRadius.circular(14),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.fromLTRB(10.0, 0.0, 10, 0), padding: const EdgeInsets.fromLTRB(
10.0,
0.0,
10,
0,
),
child: TextFormField( child: TextFormField(
controller: provider.dateController, controller: provider.dateController,
keyboardType: TextInputType.text, keyboardType: TextInputType.text,
enabled: false, enabled: false,
maxLines: 1, maxLines: 1,
readOnly: true, readOnly: true,
onChanged: (value) { onChanged: (value) {},
},
focusNode: focusNodes[1], focusNode: focusNodes[1],
onTapUpOutside: (event) { onTapUpOutside: (event) {
if (focusNodes[1].hasFocus) {
if(focusNodes[1].hasFocus){ focusNodes[1].unfocus();
focusNodes[1].unfocus(); }
}
}, },
textInputAction: TextInputAction.done, textInputAction: TextInputAction.done,
onEditingComplete: () { onEditingComplete: () {
focusNodes[1].unfocus(); focusNodes[1].unfocus();
}, },
decoration: InputDecoration( decoration: InputDecoration(
hintText: "Enter Date", hintText: "Enter Date",
...@@ -344,33 +368,37 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> { ...@@ -344,33 +368,37 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
items: items:
provider.receiptPaymentModes provider.receiptPaymentModes
.map( .map(
(paymenents) => DropdownMenuItem< (paymenents) =>
PaymentModes DropdownMenuItem<PaymentModes>(
>( value: paymenents,
value: paymenents, child: Text(
child: Text( paymenents.name ?? '',
paymenents.name ?? '', style: const TextStyle(
style: const TextStyle( fontSize: 14,
fontSize: 14, ),
), overflow:
overflow: TextOverflow.ellipsis, TextOverflow.ellipsis,
), ),
), ),
) )
.toList(), .toList(),
value: provider.selectreceiptPaymentModes, value: provider.selectreceiptPaymentModes,
onChanged: (PaymentModes? value) { onChanged: (PaymentModes? value) {
if (value != null) { if (value != null) {
if (provider.receiptPaymentModes.isNotEmpty) { if (provider
provider.selectreceiptPaymentModes = value; .receiptPaymentModes
.isNotEmpty) {
provider.selectreceiptPaymentModes =
value;
print( print(
"Selected Complaint Type: ${value.name}, ID: ${value.id}", "Selected Complaint Type: ${value.name}, ID: ${value.id}",
); );
provider.receiptPaymentModesID = value.id!; provider.receiptPaymentModesID =
value.id!;
provider.receiptPaymentModesValues = provider.receiptPaymentModesValues =
value.name!; value.name!;
print( print(
"hfjkshfg" + "hfjkshfg" +
provider.receiptPaymentModesID provider.receiptPaymentModesID
...@@ -394,97 +422,119 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> { ...@@ -394,97 +422,119 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
"RTGS", "RTGS",
"IMPS", "IMPS",
"NEFT", "NEFT",
].contains(provider.paymentModeValue)) ... ].contains(provider.paymentModeValue)) ...[
[
textControllerWidget( textControllerWidget(
context, context,
provider.bankNameController, provider.bankNameController,
"Bank Name", "Bank Name",
"Enter Bank Name", "Enter Bank Name",
provider.updateBankName,TextInputType.text,false,null, provider.updateBankName,
TextInputType.text,
false,
null,
focusNodes[2], focusNodes[2],
focusNodes[3], focusNodes[3],
TextInputAction.next TextInputAction.next,
), ),
errorWidget(context, provider.bankNameError), errorWidget(context, provider.bankNameError),
textControllerWidget( textControllerWidget(
context, context,
provider.bankBranchController, provider.bankBranchController,
"Bank Branch", "Bank Branch",
"Enter Bank Branch", "Enter Bank Branch",
provider.updateBankBranch,TextInputType.text,false,null, provider.updateBankBranch,
focusNodes[3], TextInputType.text,
focusNodes[4], false,
TextInputAction.next null,
focusNodes[3],
focusNodes[4],
TextInputAction.next,
), ),
errorWidget(context, provider.bankBranchError), errorWidget(context, provider.bankBranchError),
textControllerWidget( textControllerWidget(
context, context,
provider.bankAccNumberController, provider.bankAccNumberController,
"Account Number", "Account Number",
"Enter Account Number", "Enter Account Number",
provider.updateNumber,TextInputType.number,false,FilteringTextInputFormatter.digitsOnly, provider.updateNumber,
focusNodes[4], TextInputType.number,
focusNodes[5], false,
TextInputAction.next FilteringTextInputFormatter.digitsOnly,
focusNodes[4],
focusNodes[5],
TextInputAction.next,
), ),
errorWidget(context, provider.bankNumberError), errorWidget(context, provider.bankNumberError),
textControllerWidget( textControllerWidget(
context, context,
provider.bankIfscController, provider.bankIfscController,
"Bank IFSC", "Bank IFSC",
"Enter Bank IFSC", "Enter Bank IFSC",
provider.updateIFSC,TextInputType.text,false,null, provider.updateIFSC,
focusNodes[5], TextInputType.text,
focusNodes[6], false,
TextInputAction.next null,
focusNodes[5],
focusNodes[6],
TextInputAction.next,
), ),
errorWidget(context, provider.bankIFSCError), errorWidget(context, provider.bankIFSCError),
textControllerWidget( textControllerWidget(
context, context,
provider.bankAcHolderController, provider.bankAcHolderController,
"Bank Account Holder Name", "Bank Account Holder Name",
"Enter Bank Account Holder Name", "Enter Bank Account Holder Name",
provider.updateHolder,TextInputType.text,false,null, provider.updateHolder,
focusNodes[6], TextInputType.text,
focusNodes[8], false,
TextInputAction.next null,
focusNodes[6],
focusNodes[8],
TextInputAction.next,
), ),
errorWidget(context, provider.bankHolderError), errorWidget(context, provider.bankHolderError),
] else if (provider.paymentModeValue == "UPI") ... ] else if (provider.paymentModeValue == "UPI") ...[
[
textControllerWidget( textControllerWidget(
context, context,
provider.bankUpiController, provider.bankUpiController,
"UPI ID", "UPI ID",
"Enter UPI ID", "Enter UPI ID",
provider.updateUPI,TextInputType.text,false,null, provider.updateUPI,
TextInputType.text,
false,
null,
focusNodes[7], focusNodes[7],
focusNodes[8], focusNodes[8],
TextInputAction.next TextInputAction.next,
), ),
errorWidget(context, provider.UPIError), errorWidget(context, provider.UPIError),
], ],
textControllerWidget( textControllerWidget(
context, context,
provider.paymentReferenceController, provider.paymentReferenceController,
"Payment Reference Number", "Payment Reference Number",
"Enter Payment Reference Number", "Enter Payment Reference Number",
provider.updatereference,TextInputType.text,false,null, provider.updatereference,
TextInputType.text,
false,
null,
focusNodes[8], focusNodes[8],
focusNodes[9], focusNodes[9],
TextInputAction.next TextInputAction.next,
), ),
errorWidget(context, provider.paymentreferenceError), errorWidget(context, provider.paymentreferenceError),
textControllerWidget( textControllerWidget(
context, context,
provider.descController, provider.descController,
"Description", "Description",
"Enter Description", "Enter Description",
provider.updateDescription,TextInputType.text,false,null, provider.updateDescription,
focusNodes[9], TextInputType.text,
focusNodes[10], false,
TextInputAction.done null,
focusNodes[9],
focusNodes[10],
TextInputAction.done,
), ),
errorWidget(context, provider.descriptionError), errorWidget(context, provider.descriptionError),
InkResponse( InkResponse(
...@@ -514,59 +564,83 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> { ...@@ -514,59 +564,83 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
), ),
), ),
), ),
if(provider.imagePicked==1 && provider.imagePath!=null)...[ if (provider.imagePicked == 1 &&
provider.imagePath != null) ...[
Padding( Padding(
padding: const EdgeInsets.symmetric(vertical: 4.0), padding: const EdgeInsets.symmetric(vertical: 4.0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text("${provider.imagePath}",style: TextStyle( Expanded(
color: AppColors.semi_black, flex: 5,
fontSize: 11, child: Text(
fontWeight: FontWeight.w600 "${provider.imagePath}",
),), style: TextStyle(
InkResponse( color: AppColors.semi_black,
fontSize: 11,
fontWeight: FontWeight.w600,
),
),
),
Expanded(
flex: 1,
child: InkResponse(
onTap: () { onTap: () {
provider.imagePicked = 0; provider.imagePicked = 0;
provider.imagePath = null; provider.imagePath = null;
provider.imageFilePath = null; provider.imageFilePath = null;
}, },
child: SvgPicture.asset("assets/svg/ic_close.svg",width: 15,height: 15,)) child: SvgPicture.asset(
"assets/svg/ic_close.svg",
width: 15,
height: 15,
),
),
),
], ],
), ),
) ),
], ],
SizedBox(height: 75,) SizedBox(height: 75),
], ],
), ),
), ),
), ),
floatingActionButtonLocation: floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat, FloatingActionButtonLocation.centerFloat,
bottomNavigationBar: InkResponse( bottomNavigationBar: InkResponse(
onTap: provider.submitClicked?null: () { onTap:
provider.submitClicked = true; provider.submitClicked
provider.addReceiptPaymentRequestionSubmitAPI(context, provider.formattedDate); ? null
}, : () {
provider.submitClicked = true;
provider.addReceiptPaymentRequestionSubmitAPI(
context,
provider.formattedDate,
);
},
child: Container( child: Container(
height: 45, height: 45,
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.symmetric(horizontal: 10,vertical: 0), margin: EdgeInsets.symmetric(horizontal: 10, vertical: 0),
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5), padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.app_blue, color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
), ),
child: provider.submitClicked?CircularProgressIndicator.adaptive( child:
valueColor: AlwaysStoppedAnimation(AppColors.white), provider.submitClicked
): Text( ? CircularProgressIndicator.adaptive(
"Submit", valueColor: AlwaysStoppedAnimation(AppColors.white),
style: TextStyle( )
fontSize: 15, : Text(
fontFamily: "JakartaMedium", "Submit",
color: Colors.white, style: TextStyle(
), fontSize: 15,
), fontFamily: "JakartaMedium",
color: Colors.white,
),
),
), ),
), ),
), ),
...@@ -638,8 +712,6 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> { ...@@ -638,8 +712,6 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
// ); // );
// } // }
Future<void> _showAttachmentSheet(BuildContext context) { Future<void> _showAttachmentSheet(BuildContext context) {
return showModalBottomSheet( return showModalBottomSheet(
useSafeArea: true, useSafeArea: true,
...@@ -658,9 +730,9 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> { ...@@ -658,9 +730,9 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
return Padding( return Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
bottom: bottom:
MediaQuery.of( MediaQuery.of(
context, context,
).viewInsets.bottom, // This handles keyboard ).viewInsets.bottom, // This handles keyboard
), ),
child: Container( child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
......
...@@ -27,7 +27,7 @@ class Directpaymentrequesitionlist extends StatefulWidget { ...@@ -27,7 +27,7 @@ class Directpaymentrequesitionlist extends StatefulWidget {
class _DirectpaymentrequesitionlistState class _DirectpaymentrequesitionlistState
extends State<Directpaymentrequesitionlist> { extends State<Directpaymentrequesitionlist> {
Dropdowntheme ddtheme = Dropdowntheme(); Dropdowntheme ddtheme = Dropdowntheme();
List<FocusNode> focusNodes = List.generate(12, (index) => FocusNode(),); List<FocusNode> focusNodes = List.generate(12, (index) => FocusNode());
@override @override
void initState() { void initState() {
...@@ -44,7 +44,7 @@ class _DirectpaymentrequesitionlistState ...@@ -44,7 +44,7 @@ class _DirectpaymentrequesitionlistState
@override @override
void dispose() { void dispose() {
focusNodes.map((e) => e.dispose(),); focusNodes.map((e) => e.dispose());
super.dispose(); super.dispose();
} }
...@@ -60,7 +60,7 @@ class _DirectpaymentrequesitionlistState ...@@ -60,7 +60,7 @@ class _DirectpaymentrequesitionlistState
return WillPopScope( return WillPopScope(
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.white, backgroundColor: AppColors.white,
...@@ -98,7 +98,8 @@ class _DirectpaymentrequesitionlistState ...@@ -98,7 +98,8 @@ class _DirectpaymentrequesitionlistState
style: const TextStyle( style: const TextStyle(
fontSize: 14, fontSize: 14,
), ),
overflow: TextOverflow.ellipsis, overflow:
TextOverflow.ellipsis,
), ),
), ),
) )
...@@ -122,32 +123,39 @@ class _DirectpaymentrequesitionlistState ...@@ -122,32 +123,39 @@ class _DirectpaymentrequesitionlistState
}, },
dropdownSearchData: DropdownSearchData( dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50, searchInnerWidgetHeight: 50,
searchController: provider.accountSearchController, searchController:
provider.accountSearchController,
searchInnerWidget: Padding( searchInnerWidget: Padding(
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
child: TextFormField( child: TextFormField(
controller: provider.accountSearchController, controller:
provider.accountSearchController,
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
contentPadding: const EdgeInsets.symmetric( contentPadding:
horizontal: 10, const EdgeInsets.symmetric(
vertical: 8, horizontal: 10,
), vertical: 8,
),
hintText: 'Search account...', hintText: 'Search account...',
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(
8,
),
), ),
), ),
), ),
), ),
searchMatchFn: (item, searchValue) { searchMatchFn: (item, searchValue) {
return item.value?.name return item.value?.name
?.toLowerCase() ?.toLowerCase()
.contains(searchValue.toLowerCase()) ?? .contains(
searchValue.toLowerCase(),
) ??
false; false;
}, },
// Optional: clear search text when dropdown closes
// Optional: clear search text when dropdown closes
), ),
onMenuStateChange: (isOpen) { onMenuStateChange: (isOpen) {
if (!isOpen) { if (!isOpen) {
...@@ -164,8 +172,6 @@ class _DirectpaymentrequesitionlistState ...@@ -164,8 +172,6 @@ class _DirectpaymentrequesitionlistState
), ),
), ),
errorWidget(context, provider.selectDirectAccountError), errorWidget(context, provider.selectDirectAccountError),
TextWidget(context, "Payment Account"), TextWidget(context, "Payment Account"),
DropdownButtonHideUnderline( DropdownButtonHideUnderline(
...@@ -221,36 +227,45 @@ class _DirectpaymentrequesitionlistState ...@@ -221,36 +227,45 @@ class _DirectpaymentrequesitionlistState
}, },
dropdownSearchData: DropdownSearchData( dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50, searchInnerWidgetHeight: 50,
searchController: provider.paymentAccountSearchController, searchController:
provider.paymentAccountSearchController,
searchInnerWidget: Padding( searchInnerWidget: Padding(
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
child: TextFormField( child: TextFormField(
controller: provider.paymentAccountSearchController, controller:
provider
.paymentAccountSearchController,
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
contentPadding: const EdgeInsets.symmetric( contentPadding:
horizontal: 10, const EdgeInsets.symmetric(
vertical: 8, horizontal: 10,
), vertical: 8,
),
hintText: 'Search account...', hintText: 'Search account...',
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(
8,
),
), ),
), ),
), ),
), ),
searchMatchFn: (item, searchValue) { searchMatchFn: (item, searchValue) {
return item.value?.name return item.value?.name
?.toLowerCase() ?.toLowerCase()
.contains(searchValue.toLowerCase()) ?? .contains(
searchValue.toLowerCase(),
) ??
false; false;
}, },
// Optional: clear search text when dropdown closes
// Optional: clear search text when dropdown closes
), ),
onMenuStateChange: (isOpen) { onMenuStateChange: (isOpen) {
if (!isOpen) { if (!isOpen) {
provider.paymentAccountSearchController.clear(); provider.paymentAccountSearchController
.clear();
} }
}, },
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData: ddtheme.buttonStyleData,
...@@ -271,11 +286,13 @@ class _DirectpaymentrequesitionlistState ...@@ -271,11 +286,13 @@ class _DirectpaymentrequesitionlistState
provider.amountController, provider.amountController,
"Amount", "Amount",
"Enter Amount", "Enter Amount",
provider.updateAmount,TextInputType.numberWithOptions(), provider.updateAmount,
false,null, TextInputType.numberWithOptions(),
false,
null,
focusNodes[0], focusNodes[0],
focusNodes[1], focusNodes[1],
TextInputAction.next TextInputAction.next,
), ),
errorWidget(context, provider.amountError), errorWidget(context, provider.amountError),
...@@ -312,16 +329,13 @@ class _DirectpaymentrequesitionlistState ...@@ -312,16 +329,13 @@ class _DirectpaymentrequesitionlistState
onChanged: (value) {}, onChanged: (value) {},
focusNode: focusNodes[1], focusNode: focusNodes[1],
onTapUpOutside: (event) { onTapUpOutside: (event) {
if (focusNodes[1].hasFocus) {
if(focusNodes[1].hasFocus){
focusNodes[1].unfocus(); focusNodes[1].unfocus();
} }
}, },
textInputAction: TextInputAction.done, textInputAction: TextInputAction.done,
onEditingComplete: () { onEditingComplete: () {
focusNodes[1].unfocus(); focusNodes[1].unfocus();
}, },
decoration: InputDecoration( decoration: InputDecoration(
hintText: "Enter Date", hintText: "Enter Date",
...@@ -375,7 +389,9 @@ class _DirectpaymentrequesitionlistState ...@@ -375,7 +389,9 @@ class _DirectpaymentrequesitionlistState
value: provider.selectDirectPaymentModes, value: provider.selectDirectPaymentModes,
onChanged: (DirectPaymentModes? value) { onChanged: (DirectPaymentModes? value) {
if (value != null) { if (value != null) {
if (provider.directPaymentModes.isNotEmpty) { if (provider
.directPaymentModes
.isNotEmpty) {
provider.selectDirectPaymentModes = value; provider.selectDirectPaymentModes = value;
print( print(
"Selected Complaint Type: ${value.name}, ID: ${value.id}", "Selected Complaint Type: ${value.name}, ID: ${value.id}",
...@@ -412,10 +428,13 @@ class _DirectpaymentrequesitionlistState ...@@ -412,10 +428,13 @@ class _DirectpaymentrequesitionlistState
provider.bankNameController, provider.bankNameController,
"Bank Name", "Bank Name",
"Enter Bank Name", "Enter Bank Name",
provider.updateBankName,TextInputType.text,false,null, provider.updateBankName,
focusNodes[2], TextInputType.text,
focusNodes[3], false,
TextInputAction.next null,
focusNodes[2],
focusNodes[3],
TextInputAction.next,
), ),
errorWidget(context, provider.bankNameError), errorWidget(context, provider.bankNameError),
textControllerWidget( textControllerWidget(
...@@ -423,10 +442,13 @@ class _DirectpaymentrequesitionlistState ...@@ -423,10 +442,13 @@ class _DirectpaymentrequesitionlistState
provider.bankBranchController, provider.bankBranchController,
"Bank Branch", "Bank Branch",
"Enter Bank Branch", "Enter Bank Branch",
provider.updateBankBranch,TextInputType.text,false,null, provider.updateBankBranch,
focusNodes[3], TextInputType.text,
focusNodes[4], false,
TextInputAction.next null,
focusNodes[3],
focusNodes[4],
TextInputAction.next,
), ),
errorWidget(context, provider.bankBranchError), errorWidget(context, provider.bankBranchError),
textControllerWidget( textControllerWidget(
...@@ -434,10 +456,13 @@ class _DirectpaymentrequesitionlistState ...@@ -434,10 +456,13 @@ class _DirectpaymentrequesitionlistState
provider.bankAccNumberController, provider.bankAccNumberController,
"Account Number", "Account Number",
"Enter Account Number", "Enter Account Number",
provider.updateNumber,TextInputType.number,false,FilteringTextInputFormatter.digitsOnly, provider.updateNumber,
focusNodes[4], TextInputType.number,
focusNodes[5], false,
TextInputAction.next FilteringTextInputFormatter.digitsOnly,
focusNodes[4],
focusNodes[5],
TextInputAction.next,
), ),
errorWidget(context, provider.bankNumberError), errorWidget(context, provider.bankNumberError),
textControllerWidget( textControllerWidget(
...@@ -445,10 +470,13 @@ class _DirectpaymentrequesitionlistState ...@@ -445,10 +470,13 @@ class _DirectpaymentrequesitionlistState
provider.bankIfscController, provider.bankIfscController,
"Bank IFSC", "Bank IFSC",
"Enter Bank IFSC", "Enter Bank IFSC",
provider.updateIFSC,TextInputType.text,false,null, provider.updateIFSC,
focusNodes[5], TextInputType.text,
focusNodes[6], false,
TextInputAction.next null,
focusNodes[5],
focusNodes[6],
TextInputAction.next,
), ),
errorWidget(context, provider.bankIFSCError), errorWidget(context, provider.bankIFSCError),
textControllerWidget( textControllerWidget(
...@@ -456,22 +484,29 @@ class _DirectpaymentrequesitionlistState ...@@ -456,22 +484,29 @@ class _DirectpaymentrequesitionlistState
provider.bankAcHolderController, provider.bankAcHolderController,
"Bank Account Holder Name", "Bank Account Holder Name",
"Enter Bank Account Holder Name", "Enter Bank Account Holder Name",
provider.updateHolder,TextInputType.text,false,null, provider.updateHolder,
focusNodes[6], TextInputType.text,
focusNodes[8], false,
TextInputAction.next null,
focusNodes[6],
focusNodes[8],
TextInputAction.next,
), ),
errorWidget(context, provider.bankHolderError), errorWidget(context, provider.bankHolderError),
] else if (provider.directPaymentModesValues == "UPI") ...[ ] else if (provider.directPaymentModesValues ==
"UPI") ...[
textControllerWidget( textControllerWidget(
context, context,
provider.bankUpiController, provider.bankUpiController,
"UPI ID", "UPI ID",
"Enter UPI ID", "Enter UPI ID",
provider.updateUPI,TextInputType.text,false,null, provider.updateUPI,
focusNodes[7], TextInputType.text,
focusNodes[8], false,
TextInputAction.next null,
focusNodes[7],
focusNodes[8],
TextInputAction.next,
), ),
errorWidget(context, provider.UPIError), errorWidget(context, provider.UPIError),
], ],
...@@ -480,10 +515,13 @@ class _DirectpaymentrequesitionlistState ...@@ -480,10 +515,13 @@ class _DirectpaymentrequesitionlistState
provider.paymentReferenceController, provider.paymentReferenceController,
"Payment Reference Number", "Payment Reference Number",
"Enter Payment Reference Number", "Enter Payment Reference Number",
provider.updateReference,TextInputType.text,false,null, provider.updateReference,
focusNodes[8], TextInputType.text,
focusNodes[9], false,
TextInputAction.next null,
focusNodes[8],
focusNodes[9],
TextInputAction.next,
), ),
errorWidget(context, provider.paymentreferenceerror), errorWidget(context, provider.paymentreferenceerror),
textControllerWidget( textControllerWidget(
...@@ -491,10 +529,13 @@ class _DirectpaymentrequesitionlistState ...@@ -491,10 +529,13 @@ class _DirectpaymentrequesitionlistState
provider.descController, provider.descController,
"Description", "Description",
"Enter Description", "Enter Description",
provider.updateDescription,TextInputType.text,false,null, provider.updateDescription,
focusNodes[9], TextInputType.text,
focusNodes[10], false,
TextInputAction.done null,
focusNodes[9],
focusNodes[10],
TextInputAction.done,
), ),
errorWidget(context, provider.descriptionError), errorWidget(context, provider.descriptionError),
InkResponse( InkResponse(
...@@ -524,27 +565,42 @@ class _DirectpaymentrequesitionlistState ...@@ -524,27 +565,42 @@ class _DirectpaymentrequesitionlistState
), ),
), ),
), ),
if(provider.imagePicked==1 && provider.imagePath!=null)...[ if (provider.imagePicked == 1 &&
provider.imagePath != null) ...[
Padding( Padding(
padding: const EdgeInsets.symmetric(vertical: 4.0), padding: const EdgeInsets.symmetric(vertical: 4.0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text("${provider.imagePath}",style: TextStyle( Flexible(
color: AppColors.semi_black, flex: 4,
fontSize: 11, child: Text(
fontWeight: FontWeight.w600 "${provider.imagePath}",
),), style: TextStyle(
InkResponse( color: AppColors.semi_black,
fontSize: 11,
fontWeight: FontWeight.w600,
),
),
),
Expanded(
flex: 1,
child: InkResponse(
onTap: () { onTap: () {
provider.imagePicked = 0; provider.imagePicked = 0;
provider.imagePath = null; provider.imagePath = null;
provider.imageFilePath = null; provider.imageFilePath = null;
}, },
child: SvgPicture.asset("assets/svg/ic_close.svg",width: 15,height: 15,)) child: SvgPicture.asset(
"assets/svg/ic_close.svg",
width: 15,
height: 15,
),
),
),
], ],
), ),
) ),
], ],
], ],
), ),
...@@ -553,13 +609,16 @@ class _DirectpaymentrequesitionlistState ...@@ -553,13 +609,16 @@ class _DirectpaymentrequesitionlistState
floatingActionButtonLocation: floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat, FloatingActionButtonLocation.centerFloat,
bottomNavigationBar: InkResponse( bottomNavigationBar: InkResponse(
onTap:provider.submitClicked?null: () { onTap:
provider.submitClicked = true; provider.submitClicked
provider.addDirectPaymentRequestionSubmitAPI( ? null
context, : () {
provider.formattedDate, provider.submitClicked = true;
); provider.addDirectPaymentRequestionSubmitAPI(
}, context,
provider.formattedDate,
);
},
child: Container( child: Container(
height: 45, height: 45,
alignment: Alignment.center, alignment: Alignment.center,
...@@ -569,16 +628,21 @@ class _DirectpaymentrequesitionlistState ...@@ -569,16 +628,21 @@ class _DirectpaymentrequesitionlistState
color: AppColors.app_blue, color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
), ),
child:provider.submitClicked?CircularProgressIndicator.adaptive( child:
valueColor: AlwaysStoppedAnimation(AppColors.app_blue), provider.submitClicked
): Text( ? CircularProgressIndicator.adaptive(
"Submit", valueColor: AlwaysStoppedAnimation(
style: TextStyle( AppColors.app_blue,
fontSize: 15, ),
fontFamily: "JakartaMedium", )
color: Colors.white, : Text(
), "Submit",
), style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white,
),
),
), ),
), ),
), ),
...@@ -650,8 +714,6 @@ class _DirectpaymentrequesitionlistState ...@@ -650,8 +714,6 @@ class _DirectpaymentrequesitionlistState
// ); // );
// } // }
Future<void> _showAttachmentSheet(BuildContext context) { Future<void> _showAttachmentSheet(BuildContext context) {
return showModalBottomSheet( return showModalBottomSheet(
useSafeArea: true, useSafeArea: true,
......
...@@ -29,175 +29,167 @@ class _FinancedashboardState extends State<Financedashboard> { ...@@ -29,175 +29,167 @@ class _FinancedashboardState extends State<Financedashboard> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Platform.isAndroid
? WillPopScope(
onWillPop: () => onBackPressed(context),
child: SafeArea(top: false, bottom: true, child: _scaffold(context)),
)
: _scaffold(context);
}
Widget _scaffold(BuildContext context) {
return Consumer<Dashboardprovider>( return Consumer<Dashboardprovider>(
builder: (context, provider, child) { builder: (context, provider, child) {
final pages = provider.accessiblePagesList; final pages = provider.accessiblePagesList;
return WillPopScope( return Scaffold(
onWillPop: () => onBackPressed(context), resizeToAvoidBottomInset: true,
child: SafeArea( backgroundColor: AppColors.scaffold_bg_color,
top: false, appBar: appbar(context, "Finance"),
bottom: Platform.isIOS?false:true, body: SizedBox(
child: Scaffold( child: SingleChildScrollView(
resizeToAvoidBottomInset: true, child: Column(
backgroundColor: AppColors.scaffold_bg_color, children: [
appBar: appbar(context, "Finance"), ListView.builder(
body: SizedBox( itemCount: pages.length,
child: SingleChildScrollView( shrinkWrap: true,
child: Column( physics: NeverScrollableScrollPhysics(),
children: [ itemBuilder: (context, index) {
ListView.builder( Widget? SvgIcon;
itemCount: pages.length, switch (pages[index].mode) {
shrinkWrap: true, case "apr_lvl1":
physics: NeverScrollableScrollPhysics(), SvgIcon = SvgPicture.asset("assets/svg/fin_lv1.svg");
itemBuilder: (context, index) { break;
Widget? SvgIcon; case "apr_lvl2":
switch (pages[index].mode) { SvgIcon = SvgPicture.asset("assets/svg/fin_lv2.svg");
case "apr_lvl1": break;
SvgIcon = SvgPicture.asset( final icons = ["comm_ic_1", "comm_ic_2"];
"assets/svg/fin_lv1.svg", default:
); SvgIcon = SvgPicture.asset("assets/svg/fin_ic.svg");
break; break;
case "apr_lvl2": }
SvgIcon = SvgPicture.asset( return InkResponse(
"assets/svg/fin_lv2.svg", onTap: () async {
); var navigate;
break; if (pages[index].pageName == "Payments List") {
final icons = ["comm_ic_1", "comm_ic_2"]; navigate = Paymentlistpaymentrequisition(
default: pageTitleName:
SvgIcon = SvgPicture.asset( provider.accessiblePagesList[index].pageName!,
"assets/svg/fin_ic.svg", );
); } else if (provider
break; .accessiblePagesList[index]
} .pageName ==
return InkResponse( "Payment Receipts List") {
onTap: () async { navigate = Paymentreceiptlist(
var navigate; pageTitleName:
if (pages[index].pageName == "Payments List") { provider.accessiblePagesList[index].pageName!,
navigate = Paymentlistpaymentrequisition( );
pageTitleName: } else if (provider
provider .accessiblePagesList[index]
.accessiblePagesList[index] .pageName ==
.pageName!, "Account List") {
); navigate = Accountslist();
} else if (provider
.accessiblePagesList[index]
.pageName ==
"Payment Receipts List") {
navigate = Paymentreceiptlist(
pageTitleName:
provider
.accessiblePagesList[index]
.pageName!,
);
} else if (provider
.accessiblePagesList[index]
.pageName ==
"Account List") {
navigate = Accountslist();
// break; // break;
} else if (provider } else if (provider
.accessiblePagesList[index]
.pageName ==
"Account Ledger") {
navigate = Accountledger();
} else {
navigate = Allpaymentrequesitionlistsbymodes(
mode: pages[index].mode!,
pageTitleName:
provider.accessiblePagesList[index].pageName!,
);
}
await Navigator.push(
context,
MaterialPageRoute(builder: (context) => navigate),
);
},
child: Container(
margin: EdgeInsets.symmetric(
horizontal: 5,
vertical: 5,
),
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(14),
),
child: Row(
children: [
if (provider
.accessiblePagesList[index] .accessiblePagesList[index]
.pageName == .pageName ==
"Account Ledger") { "Account List") ...[
navigate = Accountledger(); Expanded(
} else { flex: 1,
navigate = Allpaymentrequesitionlistsbymodes( child: SvgPicture.asset(
mode: pages[index].mode!, "assets/svg/comm_ic_1.svg",
pageTitleName: width: 25,
provider ),
.accessiblePagesList[index]
.pageName!,
);
}
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => navigate,
), ),
); ] else if (provider
},
child: Container(
margin: EdgeInsets.symmetric(
horizontal: 5,
vertical: 5,
),
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(14),
),
child: Row(
children: [
if(provider
.accessiblePagesList[index] .accessiblePagesList[index]
.pageName == .pageName ==
"Account List")...[ "Account Ledger") ...[
Expanded(flex: 1, Expanded(
child: SvgPicture.asset( flex: 1,
"assets/svg/comm_ic_1.svg",width: 25, child: SvgPicture.asset(
), "assets/svg/comm_ic_2.svg",
) width: 25,
]else if(provider
.accessiblePagesList[index]
.pageName ==
"Account Ledger")...[
Expanded(flex: 1,
child: SvgPicture.asset(
"assets/svg/comm_ic_2.svg",width: 25,
),
)
]else...[
Expanded(flex: 1, child: SvgIcon),
],
Expanded(
flex: 5,
child: Text("${pages[index].pageName}"),
),
Expanded(
flex: 1,
child: SvgPicture.asset(
"assets/svg/arrow_right_new.svg",
),
), ),
], ),
] else ...[
Expanded(flex: 1, child: SvgIcon),
],
Expanded(
flex: 5,
child: Text("${pages[index].pageName}"),
), ),
), Expanded(
); flex: 1,
}, child: SvgPicture.asset(
), "assets/svg/arrow_right_new.svg",
SizedBox(height: 150,) ),
], ),
],
),
),
);
},
), ),
), SizedBox(height: 150),
],
), ),
floatingActionButtonLocation: ),
FloatingActionButtonLocation.centerFloat, ),
floatingActionButton: InkResponse( floatingActionButtonLocation:
onTap: () { FloatingActionButtonLocation.centerFloat,
_showPaymentOptionsSheet(context); floatingActionButton: InkResponse(
}, onTap: () {
child: Container( _showPaymentOptionsSheet(context);
height: 45, },
alignment: Alignment.center, child: Container(
margin: EdgeInsets.symmetric(horizontal: 10), height: 45,
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5), alignment: Alignment.center,
decoration: BoxDecoration( margin: EdgeInsets.symmetric(horizontal: 10),
color: AppColors.app_blue, padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
borderRadius: BorderRadius.circular(15), decoration: BoxDecoration(
), color: AppColors.app_blue,
child: Text( borderRadius: BorderRadius.circular(15),
"Add", ),
style: TextStyle( child: Text(
fontSize: 15, "Add",
fontFamily: "JakartaMedium", style: TextStyle(
color: Colors.white, fontSize: 15,
), fontFamily: "JakartaMedium",
), color: Colors.white,
), ),
), ),
), ),
...@@ -295,14 +287,16 @@ class _FinancedashboardState extends State<Financedashboard> { ...@@ -295,14 +287,16 @@ class _FinancedashboardState extends State<Financedashboard> {
), ),
); );
} else if (provider } else if (provider
.accessiblePagesList2[index] .accessiblePagesList2[index]
.pageName!.contains("Add Account")) { .pageName!
.contains("Add Account")) {
res = await Navigator.push( res = await Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => Addcommonpayment( builder:
from: "Dashboard", (context) => Addcommonpayment(
), from: "Dashboard",
),
), ),
); );
} else { } else {
......
...@@ -22,7 +22,8 @@ class Submitpaymentrequestionlistsbymode extends StatefulWidget { ...@@ -22,7 +22,8 @@ class Submitpaymentrequestionlistsbymode extends StatefulWidget {
const Submitpaymentrequestionlistsbymode({ const Submitpaymentrequestionlistsbymode({
super.key, super.key,
required this.mode, required this.mode,
required this.pageTitleName, this.accountId, required this.pageTitleName,
this.accountId,
}); });
@override @override
...@@ -34,7 +35,8 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -34,7 +35,8 @@ class _SubmitpaymentrequestionlistsbymodeState
extends State<Submitpaymentrequestionlistsbymode> { extends State<Submitpaymentrequestionlistsbymode> {
Dropdowntheme ddtheme = Dropdowntheme(); Dropdowntheme ddtheme = Dropdowntheme();
List<FocusNode> focusNodes = List.generate(11, (index) => FocusNode()); List<FocusNode> focusNodes = List.generate(11, (index) => FocusNode());
GlobalKey _globalKey = GlobalKey();
ScrollController scrollcontroller = ScrollController();
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
...@@ -46,69 +48,49 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -46,69 +48,49 @@ class _SubmitpaymentrequestionlistsbymodeState
); );
print("widget.accountId ${widget.accountId}"); print("widget.accountId ${widget.accountId}");
provider.addPaymentRequestionViewAPI(context, widget.mode); provider.addPaymentRequestionViewAPI(context, widget.mode);
Future.delayed(Duration(milliseconds: 500),() { Future.delayed(Duration(milliseconds: 500), () {
if (widget.mode == "self" && provider.accounts.length == 1) { if (widget.mode == "self" && provider.accounts.length == 1) {
provider.selectedAccount = provider.accounts.first; provider.selectedAccount = provider.accounts.first;
provider.accountId = provider.accounts.first.id!; provider.accountId = provider.accounts.first.id!;
} } else if (widget.mode == "other" && provider.accounts != null) {
else if(widget.mode=="other" && provider.accounts != null) { if (widget.accountId != null) {
if (widget.accountId != null) { provider.selectedAccount = provider.accounts.firstWhereOrNull(
(element) => element.id == widget.accountId,
provider.selectedAccount = );
provider.accounts.firstWhereOrNull( print("sdsd,al;,al${provider.selectedAccount!.id}");
(element) => element.id == print("sdsd,al;,al${provider.selectedAccount!.name}");
widget.accountId, provider.accountId =
); provider.accounts
print("sdsd,al;,al${provider.selectedAccount!.id}"); .firstWhere((e) => e.id == widget.accountId)!
print("sdsd,al;,al${provider.selectedAccount!.name}"); .id!;
provider.accountId = provider.accountValue =
provider.accounts provider.accounts
.firstWhere( .firstWhere((e) => e.id == widget.accountId)!
(e) => e.id == widget.accountId, .name!;
)! }
.id!; }
provider.accountValue = });
provider.accounts
.firstWhere(
(e) => e.id == widget.accountId,
)!
.name!;
}
}
},);
}); });
} }
@override @override
void dispose() { void dispose() {
scrollcontroller.dispose();
focusNodes.map((e) => e.dispose()); focusNodes.map((e) => e.dispose());
super.dispose(); super.dispose();
} }
autofill(res){ autofill(res) {
print("auto"); print("auto");
var provider = Provider.of<Requestionlistprovider>( var provider = Provider.of<Requestionlistprovider>(context, listen: false);
context,
listen: false,
);
if (provider.accounts != null) { if (provider.accounts != null) {
provider.selectedAccount = provider.accounts.firstWhereOrNull(
provider.selectedAccount = provider.accounts.firstWhereOrNull((element) => element.id==res,); (element) => element.id == res,
);
print("sdsd,al;,al${provider.selectedAccount}"); print("sdsd,al;,al${provider.selectedAccount}");
provider.accountId = provider.accountId = provider.accounts.firstWhere((e) => e.id == res).id!;
provider.accounts
.firstWhere(
(e) => e.id == res,
)
.id!;
provider.accountValue = provider.accountValue =
provider.accounts provider.accounts.firstWhere((e) => e.id == res).name!;
.firstWhere(
(e) => e.id == res,
)
.name!;
} }
} }
...@@ -121,12 +103,10 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -121,12 +103,10 @@ class _SubmitpaymentrequestionlistsbymodeState
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Consumer<Requestionlistprovider>( return Consumer<Requestionlistprovider>(
builder: (context, provider, child) { builder: (context, provider, child) {
return WillPopScope( return WillPopScope(
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.white, backgroundColor: AppColors.white,
...@@ -143,6 +123,7 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -143,6 +123,7 @@ class _SubmitpaymentrequestionlistsbymodeState
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
), ),
child: SingleChildScrollView( child: SingleChildScrollView(
controller: scrollcontroller,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
...@@ -233,7 +214,7 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -233,7 +214,7 @@ class _SubmitpaymentrequestionlistsbymodeState
) ?? ) ??
false; false;
}, },
// Optional: clear search text when dropdown closes // Optional: clear search text when dropdown closes
), ),
onMenuStateChange: (isOpen) { onMenuStateChange: (isOpen) {
...@@ -257,7 +238,9 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -257,7 +238,9 @@ class _SubmitpaymentrequestionlistsbymodeState
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => Addcommonpayment(from: "Requesition",), (context) => Addcommonpayment(
from: "Requesition",
),
), ),
); );
print("return Response: ${res}"); print("return Response: ${res}");
...@@ -272,7 +255,7 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -272,7 +255,7 @@ class _SubmitpaymentrequestionlistsbymodeState
Durations.long4, Durations.long4,
() async { () async {
print("Long411"); print("Long411");
autofill(res); autofill(res);
}, },
); );
} }
...@@ -297,7 +280,7 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -297,7 +280,7 @@ class _SubmitpaymentrequestionlistsbymodeState
), ),
), ),
errorWidget(context, provider.selectAccountError), errorWidget(context, provider.selectAccountError),
if (["self", "admin"].contains(widget.mode)) ...[ if (["self", "admin"].contains(widget.mode)) ...[
TextWidget(context, "Select Requisition Type"), TextWidget(context, "Select Requisition Type"),
DropdownButtonHideUnderline( DropdownButtonHideUnderline(
...@@ -327,14 +310,14 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -327,14 +310,14 @@ class _SubmitpaymentrequestionlistsbymodeState
) )
.toList(), .toList(),
value: provider.selectReqPurpose, value: provider.selectReqPurpose,
onChanged: (String? value) { onChanged: (String? value) {
if (value != null) { if (value != null) {
provider.selectReqPurpose = value; provider.selectReqPurpose = value;
print( print(
"Selected Complaint Type: ${value},", "Selected Complaint Type: ${value},",
); );
print( print(
"hfjkshfg" + "hfjkshfg" +
provider.selectReqPurpose provider.selectReqPurpose
...@@ -367,7 +350,7 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -367,7 +350,7 @@ class _SubmitpaymentrequestionlistsbymodeState
), ),
], ],
errorWidget(context, provider.reqPurposeError), errorWidget(context, provider.reqPurposeError),
textControllerWidget( textControllerWidget(
context, context,
provider.descController, provider.descController,
...@@ -382,7 +365,7 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -382,7 +365,7 @@ class _SubmitpaymentrequestionlistsbymodeState
TextInputAction.next, TextInputAction.next,
), ),
errorWidget(context, provider.descriptionError), errorWidget(context, provider.descriptionError),
textControllerWidget( textControllerWidget(
context, context,
provider.amountController, provider.amountController,
...@@ -397,7 +380,7 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -397,7 +380,7 @@ class _SubmitpaymentrequestionlistsbymodeState
TextInputAction.done, TextInputAction.done,
), ),
errorWidget(context, provider.amountError), errorWidget(context, provider.amountError),
TextWidget(context, "Select Payment Mode"), TextWidget(context, "Select Payment Mode"),
DropdownButtonHideUnderline( DropdownButtonHideUnderline(
child: Row( child: Row(
...@@ -441,6 +424,27 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -441,6 +424,27 @@ class _SubmitpaymentrequestionlistsbymodeState
"hfjkshfg" + "hfjkshfg" +
provider.paymentModeId.toString(), provider.paymentModeId.toString(),
); );
if ([
"Cheque",
"RTGS",
"IMPS",
"NEFT",
].contains(provider.paymentModeValue)) {
WidgetsBinding.instance
.addPostFrameCallback((_) {
final context =
_globalKey.currentContext;
if (context != null) {
Scrollable.ensureVisible(
context,
duration: Duration(
milliseconds: 300,
),
curve: Curves.easeInOut,
);
}
});
}
} }
} }
}, },
...@@ -454,8 +458,8 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -454,8 +458,8 @@ class _SubmitpaymentrequestionlistsbymodeState
), ),
), ),
errorWidget(context, provider.selectPaymentError), errorWidget(context, provider.selectPaymentError),
if(widget.mode=="other")...[ if (widget.mode == "other") ...[
TextWidget(context, "Select Approval Employee"), TextWidget(context, "Select Approval Employee"),
DropdownButtonHideUnderline( DropdownButtonHideUnderline(
child: Row( child: Row(
...@@ -469,32 +473,37 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -469,32 +473,37 @@ class _SubmitpaymentrequestionlistsbymodeState
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
items: items:
provider.approvalEmployee provider.approvalEmployee
.map( .map(
(paymenents) => (paymenents) =>
DropdownMenuItem<Employees>( DropdownMenuItem<Employees>(
value: paymenents, value: paymenents,
child: Text( child: Text(
paymenents.name ?? '', paymenents.name ?? '',
style: const TextStyle( style: const TextStyle(
fontSize: 14, fontSize: 14,
), ),
overflow: overflow:
TextOverflow.ellipsis, TextOverflow.ellipsis,
), ),
), ),
) )
.toList(), .toList(),
value: provider.selectedApprovalEmployee, value: provider.selectedApprovalEmployee,
onChanged: (Employees? value) { onChanged: (Employees? value) {
if (value != null) { if (value != null) {
if (provider.approvalEmployee.isNotEmpty) { if (provider
provider.selectedApprovalEmployee = value; .approvalEmployee
.isNotEmpty) {
provider.selectedApprovalEmployee =
value;
print( print(
"Selected Complaint Type: ${value.name}, ID: ${value.id}", "Selected Complaint Type: ${value.name}, ID: ${value.id}",
); );
provider.selectedApprovalEmployeeID = value.id!; provider.selectedApprovalEmployeeID =
provider.selectedApprovalEmployeeValue = value.name!; value.id!;
provider.selectedApprovalEmployeeValue =
value.name!;
print( print(
"hfjkshfg" + "hfjkshfg" +
provider.paymentModeId.toString(), provider.paymentModeId.toString(),
...@@ -513,7 +522,7 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -513,7 +522,7 @@ class _SubmitpaymentrequestionlistsbymodeState
), ),
errorWidget(context, provider.selectPaymentError), errorWidget(context, provider.selectPaymentError),
], ],
InkResponse( InkResponse(
onTap: () { onTap: () {
_showAttachmentSheet(context); _showAttachmentSheet(context);
...@@ -548,24 +557,30 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -548,24 +557,30 @@ class _SubmitpaymentrequestionlistsbymodeState
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Expanded(
"${provider.imagePath}", flex: 4,
style: TextStyle( child: Text(
color: AppColors.semi_black, "${provider.imagePath}",
fontSize: 11, style: TextStyle(
fontWeight: FontWeight.w600, color: AppColors.semi_black,
fontSize: 11,
fontWeight: FontWeight.w600,
),
), ),
), ),
InkResponse( Expanded(
onTap: () { flex: 1,
provider.imagePicked = 0; child: InkResponse(
provider.imagePath = null; onTap: () {
provider.imageFilePath = null; provider.imagePicked = 0;
}, provider.imagePath = null;
child: SvgPicture.asset( provider.imageFilePath = null;
"assets/svg/ic_close.svg", },
width: 15, child: SvgPicture.asset(
height: 15, "assets/svg/ic_close.svg",
width: 15,
height: 15,
),
), ),
), ),
], ],
...@@ -573,13 +588,14 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -573,13 +588,14 @@ class _SubmitpaymentrequestionlistsbymodeState
), ),
], ],
errorWidget(context, provider.FileError), errorWidget(context, provider.FileError),
if ([ if ([
"Cheque", "Cheque",
"RTGS", "RTGS",
"IMPS", "IMPS",
"NEFT", "NEFT",
].contains(provider.paymentModeValue)) ...[ ].contains(provider.paymentModeValue)) ...[
SizedBox(height: 3, key: _globalKey),
textControllerWidget( textControllerWidget(
context, context,
provider.bankNameController, provider.bankNameController,
...@@ -594,7 +610,7 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -594,7 +610,7 @@ class _SubmitpaymentrequestionlistsbymodeState
TextInputAction.next, TextInputAction.next,
), ),
errorWidget(context, provider.bankNameError), errorWidget(context, provider.bankNameError),
textControllerWidget( textControllerWidget(
context, context,
provider.bankBranchController, provider.bankBranchController,
...@@ -609,7 +625,7 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -609,7 +625,7 @@ class _SubmitpaymentrequestionlistsbymodeState
TextInputAction.next, TextInputAction.next,
), ),
errorWidget(context, provider.bankBranchError), errorWidget(context, provider.bankBranchError),
textControllerWidget( textControllerWidget(
context, context,
provider.bankAccNumberController, provider.bankAccNumberController,
...@@ -624,7 +640,7 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -624,7 +640,7 @@ class _SubmitpaymentrequestionlistsbymodeState
TextInputAction.next, TextInputAction.next,
), ),
errorWidget(context, provider.bankNumberError), errorWidget(context, provider.bankNumberError),
textControllerWidget( textControllerWidget(
context, context,
provider.bankIfscController, provider.bankIfscController,
...@@ -639,13 +655,13 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -639,13 +655,13 @@ class _SubmitpaymentrequestionlistsbymodeState
TextInputAction.next, TextInputAction.next,
), ),
errorWidget(context, provider.bankIFSCError), errorWidget(context, provider.bankIFSCError),
], ],
if ([ if ([
"Cheque", "Cheque",
"RTGS", "RTGS",
"IMPS", "IMPS",
"NEFT", "NEFT",
"UPI" "UPI",
].contains(provider.paymentModeValue)) ...[ ].contains(provider.paymentModeValue)) ...[
textControllerWidget( textControllerWidget(
context, context,
...@@ -688,18 +704,18 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -688,18 +704,18 @@ class _SubmitpaymentrequestionlistsbymodeState
provider.submitClicked provider.submitClicked
? null ? null
: () { : () {
provider.submitClicked = false; provider.submitClicked = true;
provider.addPaymentRequestionSubmitAPI( provider.addPaymentRequestionSubmitAPI(
context, context,
widget.mode, widget.mode,
provider.selectedApprovalEmployeeID provider.selectedApprovalEmployeeID,
); );
}, },
child: Container( child: Container(
height: 45, height: 45,
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.symmetric(horizontal: 10,vertical: 10), margin: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5), padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.app_blue, color: AppColors.app_blue,
......
...@@ -17,6 +17,15 @@ class Gentrackerdashboard extends StatefulWidget { ...@@ -17,6 +17,15 @@ class Gentrackerdashboard extends StatefulWidget {
class _GentrackerdashboardState extends State<Gentrackerdashboard> { class _GentrackerdashboardState extends State<Gentrackerdashboard> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Platform.isAndroid
? WillPopScope(
onWillPop: () => onBackPressed(context),
child: SafeArea(top: false, bottom: true, child: _scaffold(context)),
)
: _scaffold(context);
}
Widget _scaffold(BuildContext context) {
final names = [ final names = [
"Generator Details", "Generator Details",
// "Register Complaint", // "Register Complaint",
...@@ -29,117 +38,109 @@ class _GentrackerdashboardState extends State<Gentrackerdashboard> { ...@@ -29,117 +38,109 @@ class _GentrackerdashboardState extends State<Gentrackerdashboard> {
// "gent_tag_loc", // "gent_tag_loc",
"gent_tag_den", "gent_tag_den",
]; ];
return WillPopScope( return Scaffold(
onWillPop: () => onBackPressed(context), resizeToAvoidBottomInset: true,
child: SafeArea( backgroundColor: AppColors.scaffold_bg_color,
top: false, appBar: appbar(context, "Gen Tracker"),
bottom: Platform.isIOS?false:true, body: Column(
child: Scaffold( children: [
resizeToAvoidBottomInset: true, Expanded(
backgroundColor: AppColors.scaffold_bg_color, flex: 1,
appBar: appbar(context, "Gen Tracker"), child: GridView.builder(
body: Column( padding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
children: [ itemCount: names.length,
Expanded( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
flex: 1, crossAxisCount: 2,
child: GridView.builder( crossAxisSpacing: 10,
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 10), mainAxisSpacing: 10,
itemCount: names.length, ),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( physics: NeverScrollableScrollPhysics(),
crossAxisCount: 2, itemBuilder: (context, index) {
crossAxisSpacing: 10, return InkResponse(
mainAxisSpacing: 10, onTap: () {
), switch (names[index]) {
physics: NeverScrollableScrollPhysics(), case "Generator Details":
itemBuilder: (context, index) { Navigator.push(
return InkResponse( context,
onTap: () { MaterialPageRoute(
switch (names[index]) { builder:
case "Generator Details": (context) => Scanentergeneratoridscreen(
Navigator.push( from: "Generator Details",
context, ),
MaterialPageRoute( ),
builder: );
(context) => Scanentergeneratoridscreen( break;
from: "Generator Details", case "Register Complaint":
), Navigator.push(
), context,
); MaterialPageRoute(
break; builder:
case "Register Complaint": (context) => Scanentergeneratoridscreen(
Navigator.push( from: "Register Complaint",
context, ),
MaterialPageRoute( ),
builder: );
(context) => Scanentergeneratoridscreen( break;
from: "Register Complaint", case "Tag Location":
), Navigator.push(
), context,
); MaterialPageRoute(
break; builder:
case "Tag Location": (context) => Scanentergeneratoridscreen(
Navigator.push( from: "Tag Location",
context, ),
MaterialPageRoute( ),
builder: );
(context) => Scanentergeneratoridscreen( break;
from: "Tag Location", case "Tag Generator":
), Navigator.push(
), context,
); MaterialPageRoute(
break; builder:
case "Tag Generator": (context) => Scanentergeneratoridscreen(
Navigator.push( from: "Tag Generator",
context, ),
MaterialPageRoute( ),
builder: );
(context) => Scanentergeneratoridscreen( break;
from: "Tag Generator",
),
),
);
break;
default: default:
print("111"); print("111");
break; break;
} }
},
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(30),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset("assets/svg/${icons[index]}.svg"),
SizedBox(height: 10),
Text(names[index]),
],
),
),
);
}, },
), child: Container(
), decoration: BoxDecoration(
SizedBox(height: 10), color: Colors.white,
Expanded( borderRadius: BorderRadius.circular(30),
flex: 3, ),
child: Padding( child: Column(
padding: const EdgeInsets.all(8.0), crossAxisAlignment: CrossAxisAlignment.center,
child: Text( mainAxisAlignment: MainAxisAlignment.center,
"Note: 'Tag Location' and 'Register Complaint' are moved to 'Generator Details'.", children: [
style: TextStyle(color: AppColors.grey_thick, SvgPicture.asset("assets/svg/${icons[index]}.svg"),
fontSize: 14), SizedBox(height: 10),
Text(names[index]),
],
),
), ),
), );
},
),
),
SizedBox(height: 10),
Expanded(
flex: 3,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
"Note: 'Tag Location' and 'Register Complaint' are moved to 'Generator Details'.",
style: TextStyle(color: AppColors.grey_thick, fontSize: 14),
), ),
SizedBox(height: 10), ),
],
), ),
), SizedBox(height: 10),
],
), ),
); );
} }
......
...@@ -35,78 +35,87 @@ class _InventoryScreenState extends State<InventoryScreen> { ...@@ -35,78 +35,87 @@ class _InventoryScreenState extends State<InventoryScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Consumer<InventoryProvider>( return Platform.isAndroid
builder: (context, provider, child) { ? WillPopScope(
return WillPopScope(
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: SafeArea( child: SafeArea(top: false, bottom: true, child: _scaffold(context)),
top: false, )
bottom: Platform.isIOS?false:true, : _scaffold(context);
child: Scaffold( }
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Gen Inventory"),
body: Container(
decoration: BoxDecoration(color: Colors.black),
child: Column(
children: [
Spacer(),
Container(
height: 250,
child: QRView(
key: provider.scannerKey, Widget _scaffold(BuildContext context) {
onQRViewCreated: (p0) { return Consumer<InventoryProvider>(
provider.onQRViewCreated(p0, "inventory", context); builder: (context, provider, child) {
}, return Scaffold(
formatsAllowed: [BarcodeFormat.qrcode], resizeToAvoidBottomInset: true,
cameraFacing: CameraFacing.back, backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Gen Inventory"),
body: Container(
decoration: BoxDecoration(color: Colors.black),
child: Column(
children: [
Spacer(),
Container(
height: 250,
overlay: QrScannerOverlayShape( child: QRView(
key: provider.scannerKey,
onQRViewCreated: (p0) {
provider.onQRViewCreated(p0, "inventory", context);
},
formatsAllowed: [BarcodeFormat.qrcode],
cameraFacing: CameraFacing.back,
borderColor: AppColors.app_blue, overlay: QrScannerOverlayShape(
borderRadius: 20, borderColor: AppColors.app_blue,
borderLength: 60, borderRadius: 20,
borderWidth: 10, borderLength: 60,
cutOutSize: 250.0, borderWidth: 10,
), cutOutSize: 250.0,
),
),
SizedBox(height: 25),
Text(
"Scan QR",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 18,fontFamily: "JakartaMedium", color: Colors.white),
),
Text(
"to open Inventory",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 14, color: Colors.white),
),
Spacer(),
Text(
"or",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 18,
fontFamily: "JakartaMedium",color: Colors.white),
), ),
InkResponse( ),
onTap: () async { ),
_showPartIdBottomSheet(context); SizedBox(height: 25),
}, Text(
child: Text( "Scan QR",
"Tap To Enter Part ID", textAlign: TextAlign.center,
textAlign: TextAlign.center, style: TextStyle(
style: TextStyle(fontSize: 17, fontSize: 18,
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
color: AppColors.app_blue), color: Colors.white,
), ),
),
Text(
"to open Inventory",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 14, color: Colors.white),
),
Spacer(),
Text(
"or",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18,
fontFamily: "JakartaMedium",
color: Colors.white,
),
),
InkResponse(
onTap: () async {
_showPartIdBottomSheet(context);
},
child: Text(
"Tap To Enter Part ID",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 17,
fontFamily: "JakartaMedium",
color: AppColors.app_blue,
), ),
SizedBox(height: 50), ),
],
), ),
), SizedBox(height: 50),
],
), ),
), ),
); );
...@@ -160,7 +169,7 @@ class _InventoryScreenState extends State<InventoryScreen> { ...@@ -160,7 +169,7 @@ class _InventoryScreenState extends State<InventoryScreen> {
), ),
), ),
), ),
SizedBox(height: 5,), SizedBox(height: 5),
Container( Container(
height: 48, height: 48,
alignment: Alignment.center, alignment: Alignment.center,
...@@ -188,7 +197,8 @@ class _InventoryScreenState extends State<InventoryScreen> { ...@@ -188,7 +197,8 @@ class _InventoryScreenState extends State<InventoryScreen> {
controller: partIDcontroller, controller: partIDcontroller,
keyboardType: TextInputType.text, keyboardType: TextInputType.text,
focusNode: partIDfocusNode, focusNode: partIDfocusNode,
textCapitalization: TextCapitalization.characters, textCapitalization:
TextCapitalization.characters,
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
onChanged: (value) {}, onChanged: (value) {},
...@@ -210,7 +220,7 @@ class _InventoryScreenState extends State<InventoryScreen> { ...@@ -210,7 +220,7 @@ class _InventoryScreenState extends State<InventoryScreen> {
), ),
), ),
), ),
SizedBox(height: 15,), SizedBox(height: 15),
InkWell( InkWell(
onTap: () { onTap: () {
provider.LoadPartDetailsApifunction( provider.LoadPartDetailsApifunction(
...@@ -238,9 +248,11 @@ class _InventoryScreenState extends State<InventoryScreen> { ...@@ -238,9 +248,11 @@ class _InventoryScreenState extends State<InventoryScreen> {
child: Text( child: Text(
"Submit", "Submit",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(color: Colors.white, style: TextStyle(
color: Colors.white,
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
fontSize: 15), fontSize: 15,
),
), ),
), ),
), ),
......
...@@ -23,243 +23,237 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> { ...@@ -23,243 +23,237 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
var provider = Provider.of<Pagesdashboardprovider>(context, listen: false); var provider = Provider.of<Pagesdashboardprovider>(
context,
listen: false,
);
provider.orderDashboardAPIFunction(context, "executive", "", "", ""); provider.orderDashboardAPIFunction(context, "executive", "", "", "");
provider.ordersAccessiblePagesAPIFunction(context); provider.ordersAccessiblePagesAPIFunction(context);
}); });
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Platform.isAndroid
? WillPopScope(
onWillPop: () => onBackPressed(context),
child: SafeArea(top: false, bottom: true, child: _scaffold(context)),
)
: _scaffold(context);
}
Widget _scaffold(BuildContext context) {
return Consumer<Pagesdashboardprovider>( return Consumer<Pagesdashboardprovider>(
builder: (context, provider, child) { builder: (context, provider, child) {
final pages = provider.ordersAccessiblePagesList; final pages = provider.ordersAccessiblePagesList;
return WillPopScope( return Scaffold(
onWillPop: () => onBackPressed(context), resizeToAvoidBottomInset: true,
child: SafeArea( backgroundColor: AppColors.scaffold_bg_color,
top: false, appBar: appbar(context, "Orders"),
bottom: Platform.isIOS?false:true, body: Container(
child: Scaffold( child: SingleChildScrollView(
resizeToAvoidBottomInset: true, child: Column(
backgroundColor: AppColors.scaffold_bg_color, children: [
appBar: appbar(context, "Orders"), Container(
body: Container( padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
child: SingleChildScrollView( margin: EdgeInsets.symmetric(horizontal: 0, vertical: 10),
child: Column( decoration: BoxDecoration(
children: [ color: Colors.white,
Container( borderRadius: BorderRadius.circular(16),
padding: EdgeInsets.symmetric(horizontal: 10,vertical: 5), ),
margin: EdgeInsets.symmetric(horizontal: 0,vertical: 10), height: MediaQuery.of(context).size.height * 0.28,
decoration: BoxDecoration( child: GridView.builder(
color: Colors.white, padding: EdgeInsets.symmetric(horizontal: 0, vertical: 5),
borderRadius: BorderRadius.circular(16) itemCount: provider.ordersgain.length,
), shrinkWrap: true,
height: MediaQuery.of(context).size.height * 0.28, scrollDirection: Axis.horizontal,
child: GridView.builder( physics: AlwaysScrollableScrollPhysics(),
padding: EdgeInsets.symmetric(horizontal: 0,vertical: 5), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
itemCount: provider.ordersgain.length, crossAxisCount: 2,
shrinkWrap: true, crossAxisSpacing: 10,
scrollDirection: Axis.horizontal, mainAxisSpacing: 10,
physics: AlwaysScrollableScrollPhysics(), childAspectRatio: 0.65,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( ),
crossAxisCount: 2, itemBuilder: (context, jndex) {
crossAxisSpacing: 10, final icons = ["comm_ic_1", "comm_ic_2"];
mainAxisSpacing: 10, final leadTitles = [
childAspectRatio: 0.65 'Order Gain',
), 'Dispatched',
itemBuilder: (context, jndex) { 'Pending Tasks',
final icons = ["comm_ic_1", "comm_ic_2"]; 'Quote',
final leadTitles = [ ];
'Order Gain', final colors = [
'Dispatched', 0xFFE7FFE5,
'Pending Tasks', 0xFFF3EDFF,
'Quote', 0xFFFFFCD5,
]; 0xFFFFF6F0,
final colors = [ ];
0xFFE7FFE5, final textcolors = [
0xFFF3EDFF, 0xFF0D9C00,
0xFFFFFCD5, 0xFF493272,
0xFFFFF6F0, 0xFF605C00,
]; 0xFF91481B,
final textcolors = [ ];
0xFF0D9C00, return InkResponse(
0xFF493272, onTap: () async {
0xFF605C00, if (provider.ordersgain[jndex].filter!.pageName !=
0xFF91481B, "") {
]; if (provider.ordersgain[jndex].filter!.pageName!
return InkResponse( .contains("Order List")) {
onTap: () async { // await Navigator.push(
if (provider.ordersgain[jndex].filter!.pageName != // context,
"") { // MaterialPageRoute(
if (provider.ordersgain[jndex].filter!.pageName! // builder:
.contains("Order List")) { // (context) => OrderslistbyModes(
// await Navigator.push( // pageTitleName:
// context, // provider
// MaterialPageRoute( // .ordersgain[jndex]
// builder: // .filter!
// (context) => OrderslistbyModes( // .pageName!,
// pageTitleName: // mode:
// provider // provider.ordersgain[jndex].filter!.mode,
// .ordersgain[jndex] // filter: provider.ordersgain[jndex].filter!,
// .filter! // ),
// .pageName!, // ),
// mode: // );
// provider.ordersgain[jndex].filter!.mode, }
// filter: provider.ordersgain[jndex].filter!, }
// ), },
// ), child: Container(
// ); padding: EdgeInsets.symmetric(horizontal: 13),
} decoration: BoxDecoration(
} color: Color(colors[jndex]),
}, borderRadius: BorderRadius.circular(12),
child: Container( ),
padding: EdgeInsets.symmetric(horizontal: 13), child: Column(
decoration: BoxDecoration( crossAxisAlignment: CrossAxisAlignment.start,
color: Color(colors[jndex]), mainAxisAlignment: MainAxisAlignment.center,
borderRadius: BorderRadius.circular(12), children: [
Text(
provider.ordersgain[jndex].count!,
style: TextStyle(
fontSize: 30,
fontFamily: "JakartaMedium",
color: Color(textcolors[jndex]),
),
), ),
child: Column( Text(
crossAxisAlignment: CrossAxisAlignment.start, leadTitles[jndex],
mainAxisAlignment: MainAxisAlignment.center, style: TextStyle(color: Color(0xFF818181)),
children: [
Text(
provider.ordersgain[jndex].count!,
style: TextStyle(
fontSize: 30,
fontFamily: "JakartaMedium",
color: Color(textcolors[jndex]),
),
),
Text(
leadTitles[jndex],
style: TextStyle(color: Color(0xFF818181)),
),
],
), ),
), ],
); ),
}, ),
), );
), },
),
),
ListView.builder( ListView.builder(
itemCount: pages.length, itemCount: pages.length,
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) { itemBuilder: (context, index) {
Widget? SvgIcon; Widget? SvgIcon;
switch (pages[index].mode) { switch (pages[index].mode) {
case "level_one_approval": case "level_one_approval":
SvgIcon = SvgPicture.asset( SvgIcon = SvgPicture.asset("assets/svg/fin_lv1.svg");
"assets/svg/fin_lv1.svg", break;
); case "level_two_approval":
break; case "level_two_rejected":
case "level_two_approval": SvgIcon = SvgPicture.asset("assets/svg/fin_lv2.svg");
case "level_two_rejected": break;
SvgIcon = SvgPicture.asset(
"assets/svg/fin_lv2.svg",
);
break;
default: default:
SvgIcon = SvgPicture.asset("assets/svg/fin_ic.svg"); SvgIcon = SvgPicture.asset("assets/svg/fin_ic.svg");
break; break;
}; }
;
return InkResponse( return InkResponse(
onTap: () async { onTap: () async {
var navigate; var navigate;
if (pages[index].pageName!.contains("Add Order") ) { if (pages[index].pageName!.contains("Add Order")) {
navigate = AddorderScreen( navigate = AddorderScreen(
mode: pages[index].mode!, mode: pages[index].mode!,
pageTitleName: pageTitleName: pages[index].pageName!,
pages[index] );
.pageName!, }
); if (pages[index].pageName!.contains("Add Payment")) {
}if (pages[index].pageName!.contains("Add Payment") ) { ("navigate to Add Payment");
("navigate to Add Payment"); navigate = AddpaymentScreen(
navigate = AddpaymentScreen( mode: pages[index].mode!,
mode: pages[index].mode!, pageTitleName: pages[index].pageName!,
pageTitleName: );
pages[index] } else if (pages[index].pageName!.contains(
.pageName!, "Payments List",
); )) {
} navigate = Paymentlistsbymode(
else if (pages[index].pageName!.contains("Payments List")) { mode: pages[index].mode!,
navigate = Paymentlistsbymode( pageTitleName: pages[index].pageName!,
mode: pages[index].mode!, );
pageTitleName: } else if (pages[index].pageName!.contains(
pages[index] "Order List",
.pageName!, )) {
); navigate = OrderslistbyModes(
} else if (pages[index].pageName!.contains("Order List")){ mode: pages[index].mode!,
navigate = OrderslistbyModes( pageTitleName: pages[index].pageName!,
mode: pages[index].mode!, );
pageTitleName: } else if (pages[index].pageName == "Add TPC Agent") {
pages[index] navigate = AddtpcagentScreen();
.pageName!, } else if (pages[index].pageName ==
); "TPC Agent List (Admin)") {
}else if(pages[index].pageName=="Add TPC Agent"){ navigate = Tpcagentlistbymode(
navigate = AddtpcagentScreen(); mode: pages[index].mode!,
}else if(pages[index].pageName=="TPC Agent List (Admin)"){ pageTitleName: pages[index].pageName!,
navigate = Tpcagentlistbymode( );
mode: pages[index].mode!, } else if (pages[index].pageName ==
pageTitleName: "Pending TPC Issue List") {
pages[index] navigate = Tpcagentissuelist(
.pageName!, mode: pages[index].mode!,
); pageTitleName: pages[index].pageName!,
}else if(pages[index].pageName=="Pending TPC Issue List"){ );
navigate = Tpcagentissuelist( }
mode: pages[index].mode!, if (navigate != null) {
pageTitleName: await Navigator.push(
pages[index] context,
.pageName!, MaterialPageRoute(builder: (context) => navigate),
); );
} }
if(navigate!=null){ },
await Navigator.push( child: Container(
context, margin: EdgeInsets.symmetric(
MaterialPageRoute(builder: (context) => navigate), horizontal: 5,
); vertical: 5,
} ),
padding: EdgeInsets.symmetric(
}, horizontal: 10,
child: Container( vertical: 15,
margin: EdgeInsets.symmetric( ),
horizontal: 5, decoration: BoxDecoration(
vertical: 5, color: Colors.white,
), borderRadius: BorderRadius.circular(14),
padding: EdgeInsets.symmetric( ),
horizontal: 10, child: Row(
vertical: 15, children: [
), Expanded(flex: 1, child: SvgIcon),
decoration: BoxDecoration( Expanded(
color: Colors.white, flex: 5,
borderRadius: BorderRadius.circular(14), child: Text("${pages[index].pageName}"),
), ),
child: Row( Expanded(
children: [ flex: 1,
Expanded(flex: 1, child: SvgIcon), child: SvgPicture.asset(
Expanded( "assets/svg/arrow_right_new.svg",
flex: 5, ),
child: Text(
"${pages[index].pageName}",
),
),
Expanded(
flex: 1,
child: SvgPicture.asset(
"assets/svg/arrow_right_new.svg",
),
),
],
), ),
), ],
); ),
}, ),
), );
], },
), ),
), ],
), ),
), ),
), ),
......
...@@ -27,7 +27,7 @@ class _AccountsuggestionsState extends State<Accountsuggestions> { ...@@ -27,7 +27,7 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
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,
appBar: appbar(context, "Accounts"), appBar: appbar(context, "Accounts"),
...@@ -54,7 +54,10 @@ class _AccountsuggestionsState extends State<Accountsuggestions> { ...@@ -54,7 +54,10 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
borderRadius: BorderRadius.circular(14), borderRadius: BorderRadius.circular(14),
border: border:
searchFocusNode.hasFocus searchFocusNode.hasFocus
? Border.all(color: AppColors.app_blue, width: 0.5) ? Border.all(
color: AppColors.app_blue,
width: 0.5,
)
: null, : null,
), ),
// alignment: Alignment.center, // alignment: Alignment.center,
...@@ -123,7 +126,9 @@ class _AccountsuggestionsState extends State<Accountsuggestions> { ...@@ -123,7 +126,9 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
builder: builder:
(context) => Paymentdetails( (context) => Paymentdetails(
accountName: "Account", accountName: "Account",
name: accountList![index].accountName, name:
accountList![index]
.accountName,
genId: "", genId: "",
referenceID: referenceID:
accountList![index].accountId, accountList![index].accountId,
...@@ -135,7 +140,8 @@ class _AccountsuggestionsState extends State<Accountsuggestions> { ...@@ -135,7 +140,8 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
child: SizedBox( child: SizedBox(
child: Container( child: Container(
width: width:
MediaQuery.of(context).size.width * 0.9, MediaQuery.of(context).size.width *
0.9,
padding: EdgeInsets.fromLTRB(0, 5, 0, 10), padding: EdgeInsets.fromLTRB(0, 5, 0, 10),
child: Row( child: Row(
children: [ children: [
...@@ -148,9 +154,8 @@ class _AccountsuggestionsState extends State<Accountsuggestions> { ...@@ -148,9 +154,8 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFE6F6FF), color: Color(0xFFE6F6FF),
borderRadius: BorderRadius.circular( borderRadius:
8, BorderRadius.circular(8),
),
), ),
child: SvgPicture.asset( child: SvgPicture.asset(
width: 30, width: 30,
...@@ -159,7 +164,7 @@ class _AccountsuggestionsState extends State<Accountsuggestions> { ...@@ -159,7 +164,7 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
), ),
), ),
), ),
SizedBox(width: 10,), SizedBox(width: 10),
Expanded( Expanded(
flex: 5, flex: 5,
child: Text( child: Text(
...@@ -168,7 +173,7 @@ class _AccountsuggestionsState extends State<Accountsuggestions> { ...@@ -168,7 +173,7 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
maxLines: 3, maxLines: 3,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: AppColors.semi_black color: AppColors.semi_black,
), ),
), ),
), ),
...@@ -189,7 +194,8 @@ class _AccountsuggestionsState extends State<Accountsuggestions> { ...@@ -189,7 +194,8 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
physics: AlwaysScrollableScrollPhysics(), physics: AlwaysScrollableScrollPhysics(),
child: Container( child: Container(
width: double.infinity, width: double.infinity,
height: MediaQuery.of(context).size.height, height:
MediaQuery.of(context).size.height,
// Set width to fill parent width // Set width to fill parent width
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
...@@ -197,7 +203,12 @@ class _AccountsuggestionsState extends State<Accountsuggestions> { ...@@ -197,7 +203,12 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
topRight: Radius.circular(30.0), topRight: Radius.circular(30.0),
), ),
), ),
padding: EdgeInsets.fromLTRB(10, 10, 10, 10), padding: EdgeInsets.fromLTRB(
10,
10,
10,
10,
),
child: Container( child: Container(
child: Align( child: Align(
alignment: Alignment.center, alignment: Alignment.center,
......
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