Commit ecd8fcd1 authored by Sai Srinivas's avatar Sai Srinivas
Browse files

07-07-2025 By Sai Srinivas

Pubspec and Safe Area.
parent 67ab0f3e
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:generp/Utils/app_colors.dart'; import 'package:generp/Utils/app_colors.dart';
import 'package:generp/Utils/commonWidgets.dart'; import 'package:generp/Utils/commonWidgets.dart';
...@@ -35,12 +37,14 @@ class _TransactiondetailsState extends State<Transactiondetails> { ...@@ -35,12 +37,14 @@ class _TransactiondetailsState extends State<Transactiondetails> {
return Consumer<Paymentrequisitionpaymentslistprovider>( return Consumer<Paymentrequisitionpaymentslistprovider>(
builder: (context, provider, child) { builder: (context, provider, child) {
var details = provider.paymentDetails; var details = provider.paymentDetails;
return Scaffold( return SafeArea(
resizeToAvoidBottomInset: true, top: false,
appBar: appbar(context, "Details"), bottom: Platform.isIOS?false:true,
backgroundColor: AppColors.scaffold_bg_color, child: Scaffold(
body: SafeArea( resizeToAvoidBottomInset: true,
child: Container( appBar: appbar(context, "Details"),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
margin: EdgeInsets.symmetric(vertical: 10, horizontal: 10), margin: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
child: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Container(
......
import 'dart:io';
import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
...@@ -26,12 +28,14 @@ Dropdowntheme ddtheme = Dropdowntheme(); ...@@ -26,12 +28,14 @@ Dropdowntheme ddtheme = Dropdowntheme();
var quotationDetails = provider.appointmentDetails; var quotationDetails = provider.appointmentDetails;
return WillPopScope( return WillPopScope(
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: Scaffold( child: SafeArea(
resizeToAvoidBottomInset: true, top: false,
appBar: appbar(context, "Appointment Details"), bottom: Platform.isIOS?false:true,
backgroundColor: AppColors.scaffold_bg_color, child: Scaffold(
body: SafeArea( resizeToAvoidBottomInset: true,
child: SizedBox( appBar: appbar(context, "Appointment Details"),
backgroundColor: AppColors.scaffold_bg_color,
body: SizedBox(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
...@@ -119,40 +123,40 @@ Dropdowntheme ddtheme = Dropdowntheme(); ...@@ -119,40 +123,40 @@ Dropdowntheme ddtheme = Dropdowntheme();
), ),
), ),
), ),
), floatingActionButton: Align(
floatingActionButton: Align( alignment: Alignment.bottomCenter,
alignment: Alignment.bottomCenter, child: InkWell(
child: InkWell( onTap: () {
onTap: () { _showAddAppointmentSheet(context);
_showAddAppointmentSheet(context); },
}, child: Container(
child: Container( alignment: Alignment.bottomCenter,
alignment: Alignment.bottomCenter, height: 45,
height: 45, width: MediaQuery
width: MediaQuery .of(context)
.of(context) .size
.size .width,
.width, margin: EdgeInsets.symmetric(horizontal: 10),
margin: EdgeInsets.symmetric(horizontal: 10), decoration: BoxDecoration(
decoration: BoxDecoration( color: AppColors.app_blue,
color: AppColors.app_blue, borderRadius: BorderRadius.circular(14.0),
borderRadius: BorderRadius.circular(14.0), ),
), child: Center(
child: Center( child: Text(
child: Text( "Add Appointment",
"Add Appointment", textAlign: TextAlign.center,
textAlign: TextAlign.center, style: TextStyle(
style: TextStyle( color: Colors.white,
color: Colors.white, fontFamily: "JakartaMedium",
fontFamily: "JakartaMedium", ),
), ),
), ),
), ),
), ),
), ),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
), ),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
), ),
); );
}, },
......
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
...@@ -21,12 +23,14 @@ class _FollowUpDetailsState extends State<FollowUpDetails> { ...@@ -21,12 +23,14 @@ class _FollowUpDetailsState extends State<FollowUpDetails> {
var followupDetails = provider.followupDetails; var followupDetails = provider.followupDetails;
return WillPopScope( return WillPopScope(
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: Scaffold( child: SafeArea(
resizeToAvoidBottomInset: true, top: false,
appBar: appbar(context, "Followup Details"), bottom: Platform.isIOS?false:true,
backgroundColor: AppColors.scaffold_bg_color, child: Scaffold(
body: SafeArea( resizeToAvoidBottomInset: true,
child: SizedBox( appBar: appbar(context, "Followup Details"),
backgroundColor: AppColors.scaffold_bg_color,
body: SizedBox(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
...@@ -52,7 +56,7 @@ class _FollowUpDetailsState extends State<FollowUpDetails> { ...@@ -52,7 +56,7 @@ class _FollowUpDetailsState extends State<FollowUpDetails> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
...List.generate(4, (j) { ...List.generate(4, (j) {
final textheads = [ final textheads = [
"Employee Name", "Employee Name",
...@@ -107,8 +111,8 @@ class _FollowUpDetailsState extends State<FollowUpDetails> { ...@@ -107,8 +111,8 @@ class _FollowUpDetailsState extends State<FollowUpDetails> {
), ),
), ),
), ),
),
),
), ),
); );
}, },
......
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:generp/Notifiers/crmProvider/crmLeadDetailsProvider.dart'; import 'package:generp/Notifiers/crmProvider/crmLeadDetailsProvider.dart';
...@@ -101,184 +103,188 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> { ...@@ -101,184 +103,188 @@ class _LeadDetailsByModeState extends State<LeadDetailsByMode> {
} }
return WillPopScope( return WillPopScope(
child: Scaffold( child: SafeArea(
resizeToAvoidBottomInset: true, top: false,
appBar: appbar2( bottom: Platform.isIOS?false:true,
context, child: Scaffold(
"Lead Details (${widget.mode})", resizeToAvoidBottomInset: true,
provider.resetAll, appBar: appbar2(
InkResponse( context,
onTap: () { "Lead Details (${widget.mode})",
_showOptionsSheet(context); provider.resetAll,
}, InkResponse(
child: SvgPicture.asset("assets/svg/ic_more.svg", height: 30), onTap: () {
_showOptionsSheet(context);
},
child: SvgPicture.asset("assets/svg/ic_more.svg", height: 30),
),
), ),
), backgroundColor: AppColors.scaffold_bg_color,
backgroundColor: AppColors.scaffold_bg_color, body: Container(
body: Container( child: SingleChildScrollView(
child: SingleChildScrollView( child: Container(
child: Container( decoration: BoxDecoration(
decoration: BoxDecoration( color: Colors.white,
color: Colors.white, borderRadius: BorderRadius.circular(16),
borderRadius: BorderRadius.circular(16), ),
), margin: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
margin: EdgeInsets.symmetric(vertical: 10, horizontal: 10), padding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 10), child: Column(
child: Column( children: [
children: [ Row(
Row( children: [
children: [ Expanded(
Expanded( flex: 1,
flex: 1, child: Container(
child: Container( height: 50,
height: 50, width: 35,
width: 35, padding: EdgeInsets.all(8.0),
padding: EdgeInsets.all(8.0), decoration: BoxDecoration(
decoration: BoxDecoration( color: Color(0xFFE6F6FF),
color: Color(0xFFE6F6FF), borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), ),
), child: SvgPicture.asset(
child: SvgPicture.asset( "assets/svg/se_block_head.svg",
"assets/svg/se_block_head.svg", ),
), ),
), ),
), SizedBox(width: 10),
SizedBox(width: 10), Expanded(
Expanded( flex: 4,
flex: 4, child: SizedBox(
child: SizedBox( child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ Text(
Text( leadDetails.name ?? "-",
leadDetails.name ?? "-", style: TextStyle(
style: TextStyle( fontFamily: "JakartaMedium",
fontFamily: "JakartaMedium", fontSize: 14,
fontSize: 14, color: AppColors.semi_black,
color: AppColors.semi_black, ),
), ),
), ],
], ),
), ),
), ),
), SizedBox(width: 10),
SizedBox(width: 10), if(provider.showEditButton=="1")
if(provider.showEditButton=="1") Expanded(
Expanded( flex: 1,
flex: 1, child: InkResponse(
child: InkResponse( onTap: () async {
onTap: () async { var res = await Navigator.push(
var res = await Navigator.push( context,
context, MaterialPageRoute(
MaterialPageRoute( builder:
builder: (context) => EditAccountDetails(
(context) => EditAccountDetails( leadID: leadDetails.id,
leadID: leadDetails.id, mode: widget.mode,
mode: widget.mode, accountID: leadDetails.accId,
accountID: leadDetails.accId, companyName:leadDetails.name,
companyName:leadDetails.name, ),
), ),
);
if(res==true){
provider.crmLeadDetailsAPIFunction(context, widget.leadId, widget.mode);
}
},
child: Container(
height: 32,
width: 30,
padding: EdgeInsets.all(8.0),
child: SvgPicture.asset(
"assets/svg/crm_contact_edit.svg",
), ),
);
if(res==true){
provider.crmLeadDetailsAPIFunction(context, widget.leadId, widget.mode);
}
},
child: Container(
height: 32,
width: 30,
padding: EdgeInsets.all(8.0),
child: SvgPicture.asset(
"assets/svg/crm_contact_edit.svg",
), ),
), ),
), ),
), ],
], ),
), Divider(thickness: 0.5, color: Color(0xFFD7D7D7)),
Divider(thickness: 0.5, color: Color(0xFFD7D7D7)), ...List.generate(totalSubHeadings.length, (j) {
...List.generate(totalSubHeadings.length, (j) { return Container(
return Container( padding: EdgeInsets.symmetric(vertical: 7),
padding: EdgeInsets.symmetric(vertical: 7), child: Row(
child: Row( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ Expanded(
Expanded( child: Text(
child: Text( totalHeadings[j],
totalHeadings[j], style: TextStyle(
style: TextStyle( fontFamily: "JakartaMedium",
fontFamily: "JakartaMedium", fontSize: 14,
fontSize: 14, color: AppColors.semi_black,
color: AppColors.semi_black, ),
), ),
), ),
), Expanded(
Expanded( child: InkResponse(
child: InkResponse( child:
child: totalHeadings[j] == "Lead Age"
totalHeadings[j] == "Lead Age" ? Tooltip(
? Tooltip( triggerMode: TooltipTriggerMode.tap,
triggerMode: TooltipTriggerMode.tap,
message: message:
"${provider.leadDetails.createdDatetime}", "${provider.leadDetails.createdDatetime}",
child: Text( child: Text(
totalSubHeadings[j] == "" totalSubHeadings[j] == ""
? "-"
: totalSubHeadings[j],
style: TextStyle(
fontSize: 14,
color: Color(0xFF818181),
decorationColor:
AppColors.grey_semi,
decoration:
TextDecoration.underline,
),
),
)
: Text(
totalSubHeadings[j] == ""
? "-" ? "-"
: totalSubHeadings[j], : totalSubHeadings[j],
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: Color(0xFF818181), color: Color(0xFF818181),
decorationColor:
AppColors.grey_semi,
decoration:
TextDecoration.underline,
), ),
), ),
) ),
: Text(
totalSubHeadings[j] == ""
? "-"
: totalSubHeadings[j],
style: TextStyle(
fontSize: 14,
color: Color(0xFF818181),
),
),
), ),
), ],
], ),
), );
); }),
}), InkResponse(
InkResponse( onTap: () async {
onTap: () async { provider.showMoreDetails = !provider.showMoreDetails;
provider.showMoreDetails = !provider.showMoreDetails; },
}, child: Container(
child: Container( padding: EdgeInsets.symmetric(
padding: EdgeInsets.symmetric( vertical: 5,
vertical: 5, ),
), child: Row(
child: Row( crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.center,
CrossAxisAlignment.center, mainAxisAlignment:
mainAxisAlignment: MainAxisAlignment.center,
MainAxisAlignment.center, children: [
children: [ Text(
Text( provider.showMoreDetails?"- Show Less": "+ More Details",
provider.showMoreDetails?"- Show Less": "+ More Details", style: TextStyle(
style: TextStyle( fontFamily: "JakartaMedium",
fontFamily: "JakartaMedium", fontSize: 14,
fontSize: 14, color: AppColors.app_blue,
color: AppColors.app_blue, ),
), ),
),
], ],
),
), ),
), ),
), ],
], ),
), ),
), ),
), ),
......
import 'dart:io';
import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
...@@ -85,234 +87,235 @@ class _LeadlistbymodeState extends State<Leadlistbymode> { ...@@ -85,234 +87,235 @@ class _LeadlistbymodeState extends State<Leadlistbymode> {
onWillPop: () { onWillPop: () {
return onBackPressed(context); return onBackPressed(context);
}, },
child: Scaffold( child: SafeArea(
resizeToAvoidBottomInset: true, top: false,
appBar: appbar2( bottom: Platform.isIOS?false:true,
context, child: Scaffold(
widget.pageTitleName, resizeToAvoidBottomInset: true,
provider.resetForm, appBar: appbar2(
Row( context,
children: [ widget.pageTitleName,
InkResponse( provider.resetForm,
onTap: () async { Row(
_showFilterSheet(context); children: [
}, InkResponse(
child: SvgPicture.asset( onTap: () async {
"assets/svg/filter_ic.svg", _showFilterSheet(context);
height: 25, },
child: SvgPicture.asset(
"assets/svg/filter_ic.svg",
height: 25,
),
), ),
), ],
], ),
), ),
), backgroundColor: AppColors.scaffold_bg_color,
backgroundColor: AppColors.scaffold_bg_color, body: provider.isLoading
body: SafeArea( ? Center(
child: child: CircularProgressIndicator.adaptive(
provider.isLoading valueColor: AlwaysStoppedAnimation<Color>(
? Center( AppColors.app_blue,
child: CircularProgressIndicator.adaptive( ),
valueColor: AlwaysStoppedAnimation<Color>( ),
AppColors.app_blue, )
), : crmLists.isNotEmpty
), ? SizedBox(
) child: Scrollbar(
: crmLists.isNotEmpty thumbVisibility: false,
? SizedBox( child: ListView.builder(
child: Scrollbar( itemCount: crmLists.length,
thumbVisibility: false, shrinkWrap: true,
child: ListView.builder( physics: AlwaysScrollableScrollPhysics(),
itemCount: crmLists.length, itemBuilder: (context, index) {
shrinkWrap: true, if (crmLists.isEmpty) {
physics: AlwaysScrollableScrollPhysics(), return SizedBox(
itemBuilder: (context, index) { child: Center(
if (crmLists.isEmpty) { child: Text("No Data Available"),
return SizedBox( ),
child: Center( );
child: Text("No Data Available"), }
), return Container(
); padding: EdgeInsets.symmetric(
} horizontal: 10,
return Container( vertical: 10,
padding: EdgeInsets.symmetric( ),
horizontal: 10, margin: EdgeInsets.symmetric(
vertical: 10, horizontal: 10,
), vertical: 10,
margin: EdgeInsets.symmetric( ),
horizontal: 10, decoration: BoxDecoration(
vertical: 10, color: Colors.white,
), borderRadius: BorderRadius.circular(16),
decoration: BoxDecoration( ),
color: Colors.white, child: Column(
borderRadius: BorderRadius.circular(16), children: [
), Row(
child: Column(
children: [ children: [
Row( Expanded(
children: [ flex: 1,
Expanded( child: Container(
flex: 1, height: 50,
child: Container( width: 35,
height: 50, padding: EdgeInsets.all(8.0),
width: 35, decoration: BoxDecoration(
padding: EdgeInsets.all(8.0), color: Color(0xFFE6F6FF),
decoration: BoxDecoration( borderRadius:
color: Color(0xFFE6F6FF), BorderRadius.circular(8),
borderRadius: ),
BorderRadius.circular(8), child: SvgPicture.asset(
"assets/svg/se_block_head.svg",
),
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
crmLists[index].company!,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
), ),
child: SvgPicture.asset( ],
"assets/svg/se_block_head.svg", ),
),
),
Expanded(
flex: 2,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5,
vertical: 10,
),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(8),
color: Color(0xFFE3FFE0),
),
child: Center(
child: Text(
crmLists[index].status!,
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: Color(0xFF0D9C00),
), ),
), ),
), ),
SizedBox(width: 10), ),
),
],
),
Divider(
thickness: 0.5,
color: Color(0xFFD7D7D7),
),
...List.generate(4, (j) {
final headings = [
"Account Manager",
"Contact Person",
"Product",
"Open Status",
];
final subHeadings = [
crmLists[index].accman,
crmLists[index].cname,
crmLists[index].product,
crmLists[index].openStatus,
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded( Expanded(
flex: 4, child: Text(
child: SizedBox( headings[j],
child: Column( style: TextStyle(
crossAxisAlignment: fontFamily: "JakartaMedium",
CrossAxisAlignment.start, fontSize: 14,
children: [ color: AppColors.semi_black,
Text(
crmLists[index].company!,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
],
), ),
), ),
), ),
Expanded( Expanded(
flex: 2, child: Text(
child: Container( subHeadings[j] ?? "-",
padding: EdgeInsets.symmetric( style: TextStyle(
horizontal: 5, fontSize: 14,
vertical: 10, color: Color(0xFF818181),
),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(8),
color: Color(0xFFE3FFE0),
),
child: Center(
child: Text(
crmLists[index].status!,
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: Color(0xFF0D9C00),
),
),
), ),
), ),
), ),
], ],
), ),
Divider( );
thickness: 0.5, }),
color: Color(0xFFD7D7D7), InkResponse(
), onTap: () async {
...List.generate(4, (j) { Navigator.push(
final headings = [ context,
"Account Manager", MaterialPageRoute(
"Contact Person", builder:
"Product", (context) => LeadDetailsByMode(
"Open Status", pageTitleName:
]; widget.pageTitleName,
mode: widget.mode,
final subHeadings = [ leadId:
crmLists[index].accman, provider
crmLists[index].cname, .crmLeadList[index]
crmLists[index].product, .leadid,
crmLists[index].openStatus,
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
headings[j],
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
Expanded(
child: Text(
subHeadings[j] ?? "-",
style: TextStyle(
fontSize: 14,
color: Color(0xFF818181),
),
),
), ),
], ),
), );
); },
}), child: Container(
InkResponse( padding: EdgeInsets.symmetric(
onTap: () async { vertical: 5,
Navigator.push( ),
context, child: Row(
MaterialPageRoute( crossAxisAlignment:
builder: CrossAxisAlignment.center,
(context) => LeadDetailsByMode( mainAxisAlignment:
pageTitleName: MainAxisAlignment.start,
widget.pageTitleName, children: [
mode: widget.mode, Text(
leadId: "View Details",
provider style: TextStyle(
.crmLeadList[index] fontFamily: "JakartaMedium",
.leadid, fontSize: 14,
), color: AppColors.app_blue,
), ),
);
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 5,
), ),
child: Row( SizedBox(width: 5),
crossAxisAlignment: SvgPicture.asset(
CrossAxisAlignment.center, "assets/svg/next_button.svg",
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
),
],
), ),
), ],
), ),
], ),
), ),
); ],
}, ),
), );
), },
) ),
: Emptywidget(context), ),
)
: Emptywidget(context),
), ),
), ),
); );
......
...@@ -46,7 +46,7 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> { ...@@ -46,7 +46,7 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
appBar: appbar2(context, "Nearby Leads (Open)",provider.resetAll,SizedBox(width: 0,)), appBar: appbar2(context, "Nearby Leads (Open)",provider.resetAll,sendWidget),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: SafeArea( body: SafeArea(
child: Container( child: Container(
...@@ -140,67 +140,7 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> { ...@@ -140,67 +140,7 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
), ),
), ),
SizedBox(height: 15), SizedBox(height: 15),
Align(
alignment: Alignment.centerLeft,
child: Text(
'Status',
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.w500,
),
),
),
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<String>(
isExpanded: true,
hint: const Row(
children: [
Expanded(
child: Text(
'Select Complaint Status',
style: TextStyle(
fontSize: 14,
),
overflow: TextOverflow.ellipsis,
),
),
],
),
items: <String>[
'Active',
'Inactive',
'Suspense',
].map(
(value) =>
DropdownMenuItem<String>(
value: value,
child: Text(
value ?? '',
style: const TextStyle(
fontSize: 14,
),
overflow: TextOverflow.ellipsis,
),
)).toList(),
value: provider.selectedItem,
onChanged: (String? newValue) {
setState(() {
provider.selectedItem = newValue!;
});
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
),
],
),
),
Row( Row(
children: [ children: [
Text( Text(
...@@ -222,7 +162,11 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> { ...@@ -222,7 +162,11 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
), ),
InteractiveSlider( InteractiveSlider(
min: 1.0, min: 1.0,
max: 100.0, max: 50.0,
padding: EdgeInsets.symmetric(horizontal: 0,
vertical: 0),
iconSize: 0.0,
enabled: true, enabled: true,
// backgroundColor: AppColors.app_blue, // backgroundColor: AppColors.app_blue,
...@@ -230,32 +174,32 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> { ...@@ -230,32 +174,32 @@ class _NearbyOpenLeadsState extends State<NearbyOpenLeads> {
segmentDividerColor:Color(0xFFF6F6F8), segmentDividerColor:Color(0xFFF6F6F8),
onChanged: (value) { onChanged: (value) {
provider.currentValue = value; provider.currentValue = value;
provider.debounce(() { // provider.debounce(() {
provider.LoadNearbyOpenLeadsAPI(context); // provider.LoadNearbyOpenLeadsAPI(context);
}, Duration(milliseconds: 200)); // }, Duration(milliseconds: 200));
},
),
Slider(
value: provider.currentValue,
max: 100,
divisions: 100,
label: provider.currentValue.toStringAsFixed(2),
inactiveColor: Color(0xFFD7D7D7),
activeColor: AppColors.cyan_blue,
onChanged: (value) {
provider.currentValue = value;
provider.debounce(() {
provider.LoadNearbyOpenLeadsAPI(context);
}, Duration(milliseconds: 200));
}, },
), ),
// Slider(
// value: provider.currentValue,
// max: 100,
// divisions: 100,
//
// label: provider.currentValue.toStringAsFixed(2),
// inactiveColor: Color(0xFFD7D7D7),
// activeColor: AppColors.cyan_blue,
// onChanged: (value) {
// provider.currentValue = value;
// provider.debounce(() {
// provider.LoadNearbyOpenLeadsAPI(context);
// }, Duration(milliseconds: 200));
// },
// ),
SizedBox(height: 30.0), SizedBox(height: 30.0),
Container( Container(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
provider.debounce(() { provider.debounce(() {
provider.LoadNearbyOpenLeadsAPI(context); provider.LoadNearbyOpenLeadsAPI(context,provider.currentValue);
Navigator.pop(context); Navigator.pop(context);
}, Duration(milliseconds: 500)); }, Duration(milliseconds: 500));
}, },
......
import 'dart:io';
import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
...@@ -166,170 +168,174 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> { ...@@ -166,170 +168,174 @@ class ProspectDetailsByModeState extends State<ProspectDetailsByMode> {
var leadDetails = provider.accountDetails; var leadDetails = provider.accountDetails;
return WillPopScope( return WillPopScope(
child: Scaffold( child: SafeArea(
resizeToAvoidBottomInset: true, top: false,
appBar: appbar2( bottom: Platform.isIOS?false:true,
context, child: Scaffold(
widget.pageTitleName, resizeToAvoidBottomInset: true,
provider.resetAll, appBar: appbar2(
InkResponse( context,
onTap: () { widget.pageTitleName,
_showOptionsSheet(context); provider.resetAll,
}, InkResponse(
child: SvgPicture.asset("assets/svg/ic_more.svg", height: 30), onTap: () {
_showOptionsSheet(context);
},
child: SvgPicture.asset("assets/svg/ic_more.svg", height: 30),
),
), ),
), backgroundColor: AppColors.scaffold_bg_color,
backgroundColor: AppColors.scaffold_bg_color, body: Container(
body: Container( child: SingleChildScrollView(
child: SingleChildScrollView( child: Container(
child: Container( decoration: BoxDecoration(
decoration: BoxDecoration( color: Colors.white,
color: Colors.white, borderRadius: BorderRadius.circular(16),
borderRadius: BorderRadius.circular(16), ),
), margin: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
margin: EdgeInsets.symmetric(vertical: 10, horizontal: 10), padding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 10), child: Column(
child: Column( children: [
children: [ Row(
Row( children: [
children: [ Expanded(
Expanded( flex: 1,
flex: 1, child: Container(
child: Container( height: 50,
height: 50, width: 35,
width: 35, padding: EdgeInsets.all(8.0),
padding: EdgeInsets.all(8.0), decoration: BoxDecoration(
decoration: BoxDecoration( color: Color(0xFFE6F6FF),
color: Color(0xFFE6F6FF), borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), ),
), child: SvgPicture.asset(
child: SvgPicture.asset( "assets/svg/se_block_head.svg",
"assets/svg/se_block_head.svg", ),
), ),
), ),
), SizedBox(width: 10),
SizedBox(width: 10), Expanded(
Expanded( flex: 4,
flex: 4, child: SizedBox(
child: SizedBox( child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ Text(
Text( "${leadDetails.salutationName ?? "-"} ${leadDetails.name ?? "-"}",
"${leadDetails.salutationName ?? "-"} ${leadDetails.name ?? "-"}", style: TextStyle(
style: TextStyle( fontFamily: "JakartaMedium",
fontFamily: "JakartaMedium", fontSize: 14,
fontSize: 14, color: AppColors.semi_black,
color: AppColors.semi_black, ),
), ),
), ],
], ),
), ),
), ),
),
if(provider.showTransferAccount=="1")...[ if(provider.showTransferAccount=="1")...[
SizedBox(width: 5), SizedBox(width: 5),
Expanded( Expanded(
flex: 1, flex: 1,
child: InkResponse( child: InkResponse(
onTap: () async { onTap: () async {
_showTransferAccountSheet( _showTransferAccountSheet(
context, context,
provider.accountDetails.id!, provider.accountDetails.id!,
); );
}, },
child: Container( child: Container(
height: 32, height: 32,
width: 30, width: 30,
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: SvgPicture.asset( child: SvgPicture.asset(
"assets/svg/transfer_ac.svg", "assets/svg/transfer_ac.svg",
),
), ),
), ),
), ),
), ],
], SizedBox(width: 5),
SizedBox(width: 5), Expanded(
Expanded( flex: 1,
flex: 1, child: InkResponse(
child: InkResponse( onTap: () async {
onTap: () async { editProvider.checkDropDownValues();
editProvider.checkDropDownValues(); prefill();
prefill(); await _showEditAccountSheet(
await _showEditAccountSheet( context,
context, provider.accountDetails.id!,
provider.accountDetails.id!, );
); },
}, child: Container(
child: Container( height: 32,
height: 32, width: 30,
width: 30, padding: EdgeInsets.all(8.0),
padding: EdgeInsets.all(8.0), child: SvgPicture.asset(
child: SvgPicture.asset( "assets/svg/crm_contact_edit.svg",
"assets/svg/crm_contact_edit.svg", ),
), ),
), ),
), ),
), ],
], ),
), Divider(thickness: 0.5, color: Color(0xFFD7D7D7)),
Divider(thickness: 0.5, color: Color(0xFFD7D7D7)), ...List.generate(provider.subHeadings.length, (j) {
...List.generate(provider.subHeadings.length, (j) { return Container(
return Container( padding: EdgeInsets.symmetric(vertical: 7),
padding: EdgeInsets.symmetric(vertical: 7), child: Row(
child: Row( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ Expanded(
Expanded( child: Text(
child: Text( provider.Headings[j],
provider.Headings[j], style: TextStyle(
style: TextStyle( fontFamily: "JakartaMedium",
fontFamily: "JakartaMedium", fontSize: 14,
fontSize: 14, color: AppColors.semi_black,
color: AppColors.semi_black, ),
), ),
), ),
), Expanded(
Expanded( child: InkResponse(
child: InkResponse( child:
child: provider.Headings[j] == "Lead Age"
provider.Headings[j] == "Lead Age" ? Tooltip(
? Tooltip( triggerMode: TooltipTriggerMode.tap,
triggerMode: TooltipTriggerMode.tap,
message: message:
"${provider.accountDetails.createdDatetime}", "${provider.accountDetails.createdDatetime}",
child: Text( child: Text(
provider.subHeadings[j] == ""
? "-"
: provider.subHeadings[j],
style: TextStyle(
fontSize: 14,
color: Color(0xFF818181),
decorationColor:
AppColors.grey_semi,
decoration:
TextDecoration.underline,
),
),
)
: Text(
provider.subHeadings[j] == "" provider.subHeadings[j] == ""
? "-" ? "-"
: provider.subHeadings[j], : provider.subHeadings[j],
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: Color(0xFF818181), color: Color(0xFF818181),
decorationColor:
AppColors.grey_semi,
decoration:
TextDecoration.underline,
), ),
), ),
) ),
: Text(
provider.subHeadings[j] == ""
? "-"
: provider.subHeadings[j],
style: TextStyle(
fontSize: 14,
color: Color(0xFF818181),
),
),
), ),
), ],
], ),
), );
); }),
}), ],
], ),
), ),
), ),
), ),
......
import 'dart:io';
import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
...@@ -48,30 +50,31 @@ class _ProspectListByModeState extends State<ProspectListByMode> { ...@@ -48,30 +50,31 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
onWillPop: () { onWillPop: () {
return onBackPressed(context); return onBackPressed(context);
}, },
child: Scaffold( child: SafeArea(
resizeToAvoidBottomInset: true, top: false,
appBar: appbar2( bottom: Platform.isIOS?false:true,
context, child: Scaffold(
widget.pageTitleName, resizeToAvoidBottomInset: true,
provider.resetForm, appBar: appbar2(
Row( context,
children: [ widget.pageTitleName,
InkResponse( provider.resetForm,
onTap: () async { Row(
_showFilterSheet(context); children: [
}, InkResponse(
child: SvgPicture.asset( onTap: () async {
"assets/svg/filter_ic.svg", _showFilterSheet(context);
height: 25, },
child: SvgPicture.asset(
"assets/svg/filter_ic.svg",
height: 25,
),
), ),
), ],
], ),
), ),
), backgroundColor: AppColors.scaffold_bg_color,
backgroundColor: AppColors.scaffold_bg_color, body: provider.isLoading
body: SafeArea(
child:
provider.isLoading
? Center( ? Center(
child: CircularProgressIndicator.adaptive( child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>( valueColor: AlwaysStoppedAnimation<Color>(
...@@ -259,7 +262,8 @@ class _ProspectListByModeState extends State<ProspectListByMode> { ...@@ -259,7 +262,8 @@ class _ProspectListByModeState extends State<ProspectListByMode> {
), ),
) )
: :
Emptywidget(context),) Emptywidget(context)
),
), ),
); );
}, },
......
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:generp/screens/crm/generateQuotationScreen.dart'; import 'package:generp/screens/crm/generateQuotationScreen.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
...@@ -22,12 +24,14 @@ class _QuotationDetailsState extends State<QuotationDetails> { ...@@ -22,12 +24,14 @@ class _QuotationDetailsState extends State<QuotationDetails> {
var quotationDetails = provider.quotationsDetails; var quotationDetails = provider.quotationsDetails;
return WillPopScope( return WillPopScope(
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: Scaffold( child: SafeArea(
resizeToAvoidBottomInset: true, top: false,
appBar: appbar(context, "Quotation Details"), bottom: Platform.isIOS?false:true,
backgroundColor: AppColors.scaffold_bg_color, child: Scaffold(
body: SafeArea( resizeToAvoidBottomInset: true,
child: SizedBox( appBar: appbar(context, "Quotation Details"),
backgroundColor: AppColors.scaffold_bg_color,
body: SizedBox(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
...@@ -118,47 +122,47 @@ class _QuotationDetailsState extends State<QuotationDetails> { ...@@ -118,47 +122,47 @@ class _QuotationDetailsState extends State<QuotationDetails> {
), ),
), ),
), ),
), floatingActionButton: Align(
floatingActionButton: Align( alignment: Alignment.bottomCenter,
alignment: Alignment.bottomCenter, child: InkWell(
child: InkWell( onTap: () async {
onTap: () async { var res = await Navigator.push(
var res = await Navigator.push( context,
context, MaterialPageRoute(
MaterialPageRoute( builder:
builder: (context) =>
(context) => Generatequotationscreen(leadId: widget.leadID),
Generatequotationscreen(leadId: widget.leadID), ),
);
if(res==true){
provider.crmLeadDetailsAPIFunction(context, widget.leadID, widget.mode);
}
},
child: Container(
alignment: Alignment.bottomCenter,
height: 45,
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(horizontal: 10),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(14.0),
), ),
); child: Center(
if(res==true){ child: Text(
provider.crmLeadDetailsAPIFunction(context, widget.leadID, widget.mode); "Generate Quotation",
} textAlign: TextAlign.center,
}, style: TextStyle(
child: Container( color: Colors.white,
alignment: Alignment.bottomCenter, fontFamily: "JakartaMedium",
height: 45, ),
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(horizontal: 10),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(14.0),
),
child: Center(
child: Text(
"Generate Quotation",
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontFamily: "JakartaMedium",
), ),
), ),
), ),
), ),
), ),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
), ),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
), ),
); );
}, },
......
import 'dart:io';
import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
...@@ -42,352 +44,356 @@ class _AddProspectLeadsState extends State<AddProspectLeads> { ...@@ -42,352 +44,356 @@ class _AddProspectLeadsState extends State<AddProspectLeads> {
editProvider.resetForm(); editProvider.resetForm();
return true; return true;
}, },
child: Scaffold( child: SafeArea(
resizeToAvoidBottomInset: true, top: false,
backgroundColor: AppColors.white, bottom: Platform.isIOS?false:true,
appBar: appbar2( child: Scaffold(
context, resizeToAvoidBottomInset: true,
"Add Lead", backgroundColor: AppColors.white,
editProvider.resetForm, appBar: appbar2(
const SizedBox(width: 0), context,
), "Add Lead",
body: Container( editProvider.resetForm,
padding: const EdgeInsets.symmetric(horizontal: 10), const SizedBox(width: 0),
child: SingleChildScrollView( ),
child: Column( body: Container(
crossAxisAlignment: CrossAxisAlignment.start, padding: const EdgeInsets.symmetric(horizontal: 10),
children: [ child: SingleChildScrollView(
TextWidget(context, "Employee"), child: Column(
DropdownButtonHideUnderline( crossAxisAlignment: CrossAxisAlignment.start,
child: Row( children: [
children: [ TextWidget(context, "Employee"),
Expanded( DropdownButtonHideUnderline(
child: DropdownButton2<Employees>( child: Row(
hint: Text( children: [
"Select Source", Expanded(
style: TextStyle(fontSize: 14), child: DropdownButton2<Employees>(
), hint: Text(
items: "Select Source",
editProvider.employeeList style: TextStyle(fontSize: 14),
.map( ),
(slist) => items:
DropdownMenuItem<Employees>( editProvider.employeeList
value: slist, .map(
child: Text( (slist) =>
slist.name!, DropdownMenuItem<Employees>(
style: TextStyle( value: slist,
fontSize: 14, child: Text(
slist.name!,
style: TextStyle(
fontSize: 14,
),
), ),
), ),
), )
) .toList(),
.toList(), value:
value: editProvider.employeeList.contains(
editProvider.employeeList.contains( editProvider
editProvider .selectedEmployee,
.selectedEmployee, )
) ? editProvider.selectedEmployee
? editProvider.selectedEmployee : null,
: null,
// value: provider.selectedEmployees, // value: provider.selectedEmployees,
onChanged: (Employees? value) { onChanged: (Employees? value) {
if (value != null) { if (value != null) {
if (editProvider if (editProvider
.employeeList .employeeList
.isNotEmpty) { .isNotEmpty) {
editProvider.selectedEmployee = editProvider.selectedEmployee =
value; value;
editProvider.selectedEmployeeId = editProvider.selectedEmployeeId =
value!.id!; value!.id!;
editProvider editProvider
.selectedEmployeeValue = .selectedEmployeeValue =
value!.name!; value!.name!;
}
} }
} },
}, isExpanded: true,
isExpanded: true, dropdownSearchData: DropdownSearchData(
dropdownSearchData: DropdownSearchData( searchInnerWidgetHeight: 50,
searchInnerWidgetHeight: 50, searchController:
searchController: editProvider.searchController,
editProvider.searchController, searchInnerWidget: Padding(
searchInnerWidget: Padding( padding: const EdgeInsets.all(8),
padding: const EdgeInsets.all(8), child: TextFormField(
child: TextFormField( controller:
controller: editProvider.searchController,
editProvider.searchController, decoration: InputDecoration(
decoration: InputDecoration( isDense: true,
isDense: true, contentPadding:
contentPadding: const EdgeInsets.symmetric(
const EdgeInsets.symmetric( horizontal: 10,
horizontal: 10, vertical: 8,
vertical: 8, ),
), hintText: 'Search account...',
hintText: 'Search account...', border: OutlineInputBorder(
border: OutlineInputBorder( borderRadius:
borderRadius: BorderRadius.circular(8),
BorderRadius.circular(8), ),
), ),
), ),
), ),
searchMatchFn: (item, searchValue) {
return item.value?.name
?.toLowerCase()
.contains(
searchValue.toLowerCase(),
) ??
false;
},
), ),
searchMatchFn: (item, searchValue) { onMenuStateChange: (isOpen) {
return item.value?.name if (!isOpen) {
?.toLowerCase() editProvider.searchController
.contains( .clear();
searchValue.toLowerCase(), }
) ??
false;
}, },
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData:
ddtheme.menuItemStyleData,
dropdownStyleData:
ddtheme.dropdownStyleData,
), ),
onMenuStateChange: (isOpen) {
if (!isOpen) {
editProvider.searchController
.clear();
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData:
ddtheme.menuItemStyleData,
dropdownStyleData:
ddtheme.dropdownStyleData,
), ),
), ],
], ),
), ),
),
InkResponse( InkResponse(
onTap: () { onTap: () {
editProvider.editAddNewRow(); editProvider.editAddNewRow();
}, },
child: Container( child: Container(
margin: const EdgeInsets.symmetric(vertical: 10), margin: const EdgeInsets.symmetric(vertical: 10),
height: 45, height: 45,
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
decoration: BoxDecoration( decoration: BoxDecoration(
color: const Color(0xFFE6F6FF), color: const Color(0xFFE6F6FF),
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
border: Border.all( border: Border.all(
color: AppColors.app_blue,
width: 0.5,
),
),
child: Center(
child: Text(
"+ Add Product",
style: TextStyle(
fontFamily: "JakartaMedium",
color: AppColors.app_blue, color: AppColors.app_blue,
width: 0.5,
),
),
child: Center(
child: Text(
"+ Add Product",
style: TextStyle(
fontFamily: "JakartaMedium",
color: AppColors.app_blue,
),
), ),
), ),
), ),
), ),
), if (editProvider.leadProductsList.isNotEmpty ||
if (editProvider.leadProductsList.isNotEmpty || editProvider.editProductPriceControllers.isNotEmpty)...[
editProvider.editProductPriceControllers.isNotEmpty)...[ ListView.builder(
ListView.builder( itemCount: editProvider.editProductPriceControllers.length,
itemCount: editProvider.editProductPriceControllers.length, physics: const NeverScrollableScrollPhysics(),
physics: const NeverScrollableScrollPhysics(), shrinkWrap: true,
shrinkWrap: true, itemBuilder: (context, j) {
itemBuilder: (context, j) { return Container(
return Container( padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10), margin: const EdgeInsets.symmetric(vertical: 10),
margin: const EdgeInsets.symmetric(vertical: 10), decoration: BoxDecoration(
decoration: BoxDecoration( color: Colors.white,
color: Colors.white, borderRadius: BorderRadius.circular(20),
borderRadius: BorderRadius.circular(20), ),
), child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ TextWidget(context, "Product"),
TextWidget(context, "Product"), DropdownButtonHideUnderline(
DropdownButtonHideUnderline( child: Row(
child: Row( children: [
children: [ Expanded(
Expanded( child: DropdownButton2<Products>(
child: DropdownButton2<Products>( isExpanded: true,
isExpanded: true, hint: const Text(
hint: const Text( 'Select Product',
'Select Product', style: TextStyle(fontSize: 14),
style: TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis,
),
items: editProvider.leadProductsList
.map((ord) => DropdownMenuItem<Products>(
value: ord,
child: Text(
"(Product Name: ${ord.name})",
style: const TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
)) items: editProvider.leadProductsList
.toList(), .map((ord) => DropdownMenuItem<Products>(
value: editProvider.selectedProductIds[j] != null value: ord,
? editProvider.leadProductsList.firstWhere( child: Text(
(ord) => ord.id == editProvider.selectedProductIds[j], "(Product Name: ${ord.name})",
orElse: () => editProvider.leadProductsList[0], style: const TextStyle(fontSize: 14),
) overflow: TextOverflow.ellipsis,
: null, ),
onChanged: (Products? value) { ))
if (value != null) { .toList(),
editProvider.updateSelectedProductIds(j, value); value: editProvider.selectedProductIds[j] != null
editProvider.selectedProductIds[j] = ? editProvider.leadProductsList.firstWhere(
value.id?.toString() ?? ''; (ord) => ord.id == editProvider.selectedProductIds[j],
editProvider.updateTotalAmount(j); orElse: () => editProvider.leadProductsList[0],
} )
}, : null,
buttonStyleData: ddtheme.buttonStyleData, onChanged: (Products? value) {
iconStyleData: ddtheme.iconStyleData, if (value != null) {
menuItemStyleData: ddtheme.menuItemStyleData, editProvider.updateSelectedProductIds(j, value);
dropdownStyleData: ddtheme.dropdownStyleData, editProvider.selectedProductIds[j] =
value.id?.toString() ?? '';
editProvider.updateTotalAmount(j);
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
),
],
),
),
const SizedBox(height: 10),
Row(
children: [
Expanded(
flex: 2,
child: textControllerWidget(
context,
editProvider.editProductPriceControllers[j],
"Product Price",
"Enter Product Price",
(value) => editProvider.updateTotalAmount(j),
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
), ),
), ),
], ],
), ),
), const SizedBox(height: 10),
const SizedBox(height: 10), Row(
Row( children: [
children: [ Expanded(
Expanded( flex: 2,
flex: 2, child: textControllerWidget(
child: textControllerWidget( context,
context, editProvider.editQuantityControllers[j],
editProvider.editProductPriceControllers[j], "Quantity",
"Product Price", "Enter Quantity",
"Enter Product Price", (value) => editProvider.updateTotalAmount(j),
(value) => editProvider.updateTotalAmount(j), TextInputType.number,
TextInputType.number, false,
false, FilteringTextInputFormatter.digitsOnly,
FilteringTextInputFormatter.digitsOnly, ),
),
),
],
),
const SizedBox(height: 10),
Row(
children: [
Expanded(
flex: 2,
child: textControllerWidget(
context,
editProvider.editQuantityControllers[j],
"Quantity",
"Enter Quantity",
(value) => editProvider.updateTotalAmount(j),
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
), ),
), ],
], ),
), const SizedBox(height: 10),
const SizedBox(height: 10), Row(
Row( children: [
children: [ Expanded(
Expanded( flex: 2,
flex: 2, child: textControllerWidget(
child: textControllerWidget( context,
context, editProvider.editTotalAmountControllers[j],
editProvider.editTotalAmountControllers[j], "Total Amount",
"Total Amount", "Enter Total Amount",
"Enter Total Amount", (_) {},
(_) {}, TextInputType.number,
TextInputType.number, true,
true, FilteringTextInputFormatter.digitsOnly,
FilteringTextInputFormatter.digitsOnly, ),
), ),
), ],
], ),
),
], ],
),
);
},
),
],
TextWidget(context, "Status"),
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<String>(
hint: Text(
"Select Salutation",
style: TextStyle(fontSize: 14),
), ),
items: );
editProvider.statusList },
.map( ),
(slist) => ],
DropdownMenuItem<String>( TextWidget(context, "Status"),
value: slist, DropdownButtonHideUnderline(
child: Text( child: Row(
slist, children: [
style: TextStyle( Expanded(
fontSize: 14, child: DropdownButton2<String>(
hint: Text(
"Select Salutation",
style: TextStyle(fontSize: 14),
),
items:
editProvider.statusList
.map(
(slist) =>
DropdownMenuItem<String>(
value: slist,
child: Text(
slist,
style: TextStyle(
fontSize: 14,
),
), ),
), ),
), )
) .toList(),
.toList(), value: editProvider.selectedStatus,
value: editProvider.selectedStatus, onChanged: (String? value) {
onChanged: (String? value) { if (value != null) {
if (value != null) { if (editProvider
if (editProvider .statusList
.statusList .isNotEmpty) {
.isNotEmpty) { editProvider.selectedStatus = value;
editProvider.selectedStatus = value; }
} }
} },
}, isExpanded: true,
isExpanded: true, buttonStyleData: ddtheme.buttonStyleData,
buttonStyleData: ddtheme.buttonStyleData, iconStyleData: ddtheme.iconStyleData,
iconStyleData: ddtheme.iconStyleData, menuItemStyleData:
menuItemStyleData: ddtheme.menuItemStyleData,
ddtheme.menuItemStyleData, dropdownStyleData:
dropdownStyleData: ddtheme.dropdownStyleData,
ddtheme.dropdownStyleData, ),
), ),
), ],
], ),
), ),
), ],
], ),
), ),
), ),
), floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, bottomNavigationBar: InkResponse(
bottomNavigationBar: InkResponse( onTap: editProvider.submitLoading
onTap: editProvider.submitLoading ? null
? null : () {
: () { editProvider.submitForm(context,widget.mode,widget.leadID,editProvider.selectedEmployeeId,editProvider.selectedStatus);
editProvider.submitForm(context,widget.mode,widget.leadID,editProvider.selectedEmployeeId,editProvider.selectedStatus); // editProvider.crmProspectDetailsAddLeadsSubmitAPIFunction(context, mode, account_id, acc_manager_id, products, lead_status)
// editProvider.crmProspectDetailsAddLeadsSubmitAPIFunction(context, mode, account_id, acc_manager_id, products, lead_status)
}, },
child: Container( child: Container(
height: 45, height: 45,
alignment: Alignment.center, alignment: Alignment.center,
margin: const EdgeInsets.symmetric(horizontal: 10, vertical: 15), margin: const EdgeInsets.symmetric(horizontal: 10, vertical: 15),
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5), padding: const 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: editProvider.submitLoading child: editProvider.submitLoading
? CircularProgressIndicator.adaptive( ? CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(AppColors.app_blue), valueColor: AlwaysStoppedAnimation<Color>(AppColors.app_blue),
) )
: const Text( : const Text(
"Submit", "Submit",
style: TextStyle( style: TextStyle(
fontSize: 15, fontSize: 15,
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
color: Colors.white, color: Colors.white,
),
), ),
), ),
), ),
......
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
...@@ -23,12 +25,14 @@ class _ContactdetailsState extends State<Contactdetails> { ...@@ -23,12 +25,14 @@ class _ContactdetailsState extends State<Contactdetails> {
var customerDetails = provider.contactDetails; var customerDetails = provider.contactDetails;
return WillPopScope( return WillPopScope(
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: Scaffold( child: SafeArea(
resizeToAvoidBottomInset: true, top: false,
appBar: appbar(context, "Contact Details"), bottom: Platform.isIOS?false:true,
backgroundColor: AppColors.scaffold_bg_color, child: Scaffold(
body: SafeArea( resizeToAvoidBottomInset: true,
child: SizedBox( appBar: appbar(context, "Contact Details"),
backgroundColor: AppColors.scaffold_bg_color,
body: SizedBox(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
...@@ -181,37 +185,37 @@ class _ContactdetailsState extends State<Contactdetails> { ...@@ -181,37 +185,37 @@ class _ContactdetailsState extends State<Contactdetails> {
), ),
), ),
), ),
), floatingActionButton: Align(
floatingActionButton: Align( alignment: Alignment.bottomCenter,
alignment: Alignment.bottomCenter, child: InkWell(
child: InkWell( onTap: () {
onTap: () { _showAddContactSheet(context);
_showAddContactSheet(context); },
}, child: Container(
child: Container( alignment: Alignment.bottomCenter,
alignment: Alignment.bottomCenter, height: 45,
height: 45, width: MediaQuery.of(context).size.width,
width: MediaQuery.of(context).size.width, margin: EdgeInsets.symmetric(horizontal: 10),
margin: EdgeInsets.symmetric(horizontal: 10), decoration: BoxDecoration(
decoration: BoxDecoration( color: AppColors.app_blue,
color: AppColors.app_blue, borderRadius: BorderRadius.circular(14.0),
borderRadius: BorderRadius.circular(14.0), ),
), child: Center(
child: Center( child: Text(
child: Text( "Add Contact",
"Add Contact", textAlign: TextAlign.center,
textAlign: TextAlign.center, style: TextStyle(
style: TextStyle( color: Colors.white,
color: Colors.white, fontFamily: "JakartaMedium",
fontFamily: "JakartaMedium", ),
), ),
), ),
), ),
), ),
), ),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
), ),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
), ),
); );
}, },
......
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
...@@ -41,113 +43,115 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -41,113 +43,115 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
return WillPopScope( return WillPopScope(
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: Scaffold( child: SafeArea(
resizeToAvoidBottomInset: true, top: false,
backgroundColor: AppColors.scaffold_bg_color, bottom: Platform.isIOS?false:true,
appBar: AppBar( child: Scaffold(
automaticallyImplyLeading: false, resizeToAvoidBottomInset: true,
elevation: 2.0, backgroundColor: AppColors.scaffold_bg_color,
title: SizedBox( appBar: AppBar(
child: Row( automaticallyImplyLeading: false,
mainAxisAlignment: MainAxisAlignment.start, elevation: 2.0,
crossAxisAlignment: CrossAxisAlignment.center, title: SizedBox(
children: [ child: Row(
InkResponse( mainAxisAlignment: MainAxisAlignment.start,
onTap: () => Navigator.pop(context, true), crossAxisAlignment: CrossAxisAlignment.center,
child: SvgPicture.asset( children: [
"assets/svg/app_bar_back.svg", InkResponse(
height: 25, onTap: () => Navigator.pop(context, true),
child: SvgPicture.asset(
"assets/svg/app_bar_back.svg",
height: 25,
),
), ),
), InkResponse(
InkResponse( onTap: () => Navigator.pop(context, true),
onTap: () => Navigator.pop(context, true), child: Text(
child: Text( "CRM",
"CRM", style: TextStyle(
style: TextStyle( fontSize: 16,
fontSize: 16, height: 1.1,
height: 1.1, fontFamily: "JakartaSemiBold",
fontFamily: "JakartaSemiBold", color: AppColors.semi_black,
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,
), ),
child: Row( ),
children: [ bottom: PreferredSize(
Expanded( preferredSize: Size.fromHeight(50),
child: Container( child: Container(
padding: const EdgeInsets.fromLTRB(0.0, 0.0, 10, 0), padding: const EdgeInsets.fromLTRB(5.0, 0.0, 10, 0),
margin: const EdgeInsets.fromLTRB(10.0, 0.0, 10, 10), margin: const EdgeInsets.fromLTRB(10.0, 0.0, 10, 10),
child: TextFormField( height: 50,
controller: provider.searchController, alignment: Alignment.center,
keyboardType: TextInputType.text, decoration: BoxDecoration(
maxLines: 1, color: AppColors.text_field_color,
borderRadius: BorderRadius.circular(14),
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) {}, onChanged: (value) {},
focusNode: focusNode, focusNode: focusNode,
onTapUpOutside: (event) { onTapUpOutside: (event) {
focusNode.unfocus(); focusNode.unfocus();
}, },
textInputAction: TextInputAction.done, textInputAction: TextInputAction.done,
onEditingComplete: () { onEditingComplete: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => Universalsearchscreen( (context) => Universalsearchscreen(
text: provider.searchController.text, text: provider.searchController.text,
), ),
settings: RouteSettings(name: 'SearchScreen'), settings: RouteSettings(name: 'SearchScreen'),
),
);
},
decoration: InputDecoration(
counterText: "",
hintText: "Search",
hintStyle: TextStyle(
fontWeight: FontWeight.w400,
color: Color(0xFFB4BEC0),
fontSize: 14,
), ),
); enabled: true,
},
decoration: InputDecoration(
counterText: "",
hintText: "Search",
hintStyle: TextStyle(
fontWeight: FontWeight.w400,
color: Color(0xFFB4BEC0),
fontSize: 14,
),
enabled: true,
enabledBorder: InputBorder.none, enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none, focusedBorder: InputBorder.none,
),
), ),
), ),
), ),
), SvgPicture.asset("assets/svg/search_ic.svg"),
SvgPicture.asset("assets/svg/search_ic.svg"), ],
], ),
), ),
), ),
), shape: RoundedRectangleBorder(
shape: RoundedRectangleBorder( borderRadius: BorderRadius.vertical(
borderRadius: BorderRadius.vertical( bottom: Radius.circular(30), // Adjust the radius as needed
bottom: Radius.circular(30), // Adjust the radius as needed ),
), ),
), ),
), body: SingleChildScrollView(
body: SafeArea(
child: SingleChildScrollView(
physics: AlwaysScrollableScrollPhysics(), physics: AlwaysScrollableScrollPhysics(),
child: Column( child: Column(
children: [ children: [
...@@ -495,28 +499,28 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -495,28 +499,28 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
], ],
), ),
), ),
), floatingActionButtonLocation:
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
FloatingActionButtonLocation.centerFloat, floatingActionButton: InkResponse(
floatingActionButton: InkResponse( onTap: () {
onTap: () { _showPaymentOptionsSheet(context);
_showPaymentOptionsSheet(context); },
}, child: Container(
child: Container( height: 45,
height: 45, alignment: Alignment.center,
alignment: Alignment.center, margin: EdgeInsets.symmetric(horizontal: 10),
margin: EdgeInsets.symmetric(horizontal: 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, borderRadius: BorderRadius.circular(15),
borderRadius: BorderRadius.circular(15), ),
), child: Text(
child: Text( "Add Leads and Prospect",
"Add Leads and Prospect", style: TextStyle(
style: TextStyle( fontSize: 15,
fontSize: 15, fontFamily: "JakartaMedium",
fontFamily: "JakartaMedium", color: Colors.white,
color: Colors.white, ),
), ),
), ),
), ),
......
import 'dart:io';
import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
...@@ -44,12 +46,14 @@ class _EditAccountDetailsState extends State<EditAccountDetails> { ...@@ -44,12 +46,14 @@ class _EditAccountDetailsState extends State<EditAccountDetails> {
builder: (context, provider, child) { builder: (context, provider, child) {
return WillPopScope( return WillPopScope(
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: Scaffold( child: SafeArea(
resizeToAvoidBottomInset: true, top: false,
appBar: appbar(context, "Edit Account"), bottom: Platform.isIOS?false:true,
backgroundColor: AppColors.scaffold_bg_color, child: Scaffold(
body: SafeArea( resizeToAvoidBottomInset: true,
child: Container( appBar: appbar(context, "Edit Account"),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
padding: EdgeInsets.symmetric(horizontal: 10,vertical: 10), padding: EdgeInsets.symmetric(horizontal: 10,vertical: 10),
margin: EdgeInsets.symmetric(horizontal: 10,vertical: 5), margin: EdgeInsets.symmetric(horizontal: 10,vertical: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
...@@ -201,8 +205,8 @@ class _EditAccountDetailsState extends State<EditAccountDetails> { ...@@ -201,8 +205,8 @@ class _EditAccountDetailsState extends State<EditAccountDetails> {
), ),
), ),
), ),
),
),
), ),
); );
}, },
......
...@@ -395,6 +395,8 @@ ...@@ -395,6 +395,8 @@
// ); // );
// } // }
// } // }
import 'dart:io';
import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
...@@ -438,208 +440,212 @@ class _EditProductsListState extends State<EditProductsList> { ...@@ -438,208 +440,212 @@ class _EditProductsListState extends State<EditProductsList> {
editProvider.resetForm(); editProvider.resetForm();
return true; return true;
}, },
child: Scaffold( child: SafeArea(
resizeToAvoidBottomInset: true, top: false,
backgroundColor: AppColors.scaffold_bg_color, bottom: Platform.isIOS?false:true,
appBar: appbar2( child: Scaffold(
context, resizeToAvoidBottomInset: true,
"Edit Products", backgroundColor: AppColors.scaffold_bg_color,
editProvider.resetForm, appBar: appbar2(
const SizedBox(width: 0), context,
), "Edit Products",
body: Container( editProvider.resetForm,
padding: const EdgeInsets.symmetric(horizontal: 10), const SizedBox(width: 0),
child: SingleChildScrollView( ),
child: Column( body: Container(
crossAxisAlignment: CrossAxisAlignment.start, padding: const EdgeInsets.symmetric(horizontal: 10),
children: [ child: SingleChildScrollView(
InkResponse( child: Column(
onTap: () { crossAxisAlignment: CrossAxisAlignment.start,
editProvider.editAddNewRow(); children: [
}, InkResponse(
child: Container( onTap: () {
margin: const EdgeInsets.symmetric(vertical: 10), editProvider.editAddNewRow();
height: 45, },
width: MediaQuery.of(context).size.width, child: Container(
decoration: BoxDecoration( margin: const EdgeInsets.symmetric(vertical: 10),
color: const Color(0xFFE6F6FF), height: 45,
borderRadius: BorderRadius.circular(12), width: MediaQuery.of(context).size.width,
border: Border.all( decoration: BoxDecoration(
color: AppColors.app_blue, color: const Color(0xFFE6F6FF),
width: 0.5, borderRadius: BorderRadius.circular(12),
), border: Border.all(
),
child: Center(
child: Text(
"+ Add Product",
style: TextStyle(
fontFamily: "JakartaMedium",
color: AppColors.app_blue, color: AppColors.app_blue,
width: 0.5,
),
),
child: Center(
child: Text(
"+ Add Product",
style: TextStyle(
fontFamily: "JakartaMedium",
color: AppColors.app_blue,
),
), ),
), ),
), ),
), ),
), if (editProvider.leadProductsList.isNotEmpty ||
if (editProvider.leadProductsList.isNotEmpty || editProvider.editProductPriceControllers.isNotEmpty)
editProvider.editProductPriceControllers.isNotEmpty) ListView.builder(
ListView.builder( itemCount: editProvider.editProductPriceControllers.length,
itemCount: editProvider.editProductPriceControllers.length, physics: const NeverScrollableScrollPhysics(),
physics: const NeverScrollableScrollPhysics(), shrinkWrap: true,
shrinkWrap: true, itemBuilder: (context, j) {
itemBuilder: (context, j) { return Container(
return Container( padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10), margin: const EdgeInsets.symmetric(vertical: 10),
margin: const EdgeInsets.symmetric(vertical: 10), decoration: BoxDecoration(
decoration: BoxDecoration( color: Colors.white,
color: Colors.white, borderRadius: BorderRadius.circular(20),
borderRadius: BorderRadius.circular(20), ),
), child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ TextWidget(context, "Product"),
TextWidget(context, "Product"), DropdownButtonHideUnderline(
DropdownButtonHideUnderline( child: Row(
child: Row( children: [
children: [ Expanded(
Expanded( child: DropdownButton2<Products>(
child: DropdownButton2<Products>( isExpanded: true,
isExpanded: true, hint: const Text(
hint: const Text( 'Select Product',
'Select Product', style: TextStyle(fontSize: 14),
style: TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis,
),
items: editProvider.productsList
.map((ord) => DropdownMenuItem<Products>(
value: ord,
child: Text(
"(Product Name: ${ord.name})",
style: const TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
)) items: editProvider.productsList
.toList(), .map((ord) => DropdownMenuItem<Products>(
value: editProvider.selectedProductIds[j] != null value: ord,
? editProvider.productsList.firstWhere( child: Text(
(ord) => ord.id == editProvider.selectedProductIds[j], "(Product Name: ${ord.name})",
orElse: () => editProvider.productsList[0], style: const TextStyle(fontSize: 14),
) overflow: TextOverflow.ellipsis,
: null, ),
onChanged: (Products? value) { ))
if (value != null) { .toList(),
editProvider.updateSelectedProductIds(j, value); value: editProvider.selectedProductIds[j] != null
editProvider.selectedProductIds[j] = ? editProvider.productsList.firstWhere(
value.id?.toString() ?? ''; (ord) => ord.id == editProvider.selectedProductIds[j],
editProvider.updateTotalAmount(j); orElse: () => editProvider.productsList[0],
} )
}, : null,
buttonStyleData: ddtheme.buttonStyleData, onChanged: (Products? value) {
iconStyleData: ddtheme.iconStyleData, if (value != null) {
menuItemStyleData: ddtheme.menuItemStyleData, editProvider.updateSelectedProductIds(j, value);
dropdownStyleData: ddtheme.dropdownStyleData, editProvider.selectedProductIds[j] =
value.id?.toString() ?? '';
editProvider.updateTotalAmount(j);
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
),
],
),
),
const SizedBox(height: 10),
Row(
children: [
Expanded(
flex: 2,
child: textControllerWidget(
context,
editProvider.editProductPriceControllers[j],
"Product Price",
"Enter Product Price",
(value) => editProvider.updateTotalAmount(j),
TextInputType.number,
false,
null
), ),
), ),
], ],
), ),
), const SizedBox(height: 10),
const SizedBox(height: 10), Row(
Row( children: [
children: [ Expanded(
Expanded( flex: 2,
flex: 2, child: textControllerWidget(
child: textControllerWidget( context,
context, editProvider.editQuantityControllers[j],
editProvider.editProductPriceControllers[j], "Quantity",
"Product Price", "Enter Quantity",
"Enter Product Price", (value) => editProvider.updateTotalAmount(j),
(value) => editProvider.updateTotalAmount(j), TextInputType.number,
TextInputType.number, false,
false, FilteringTextInputFormatter.digitsOnly,
null ),
),
),
],
),
const SizedBox(height: 10),
Row(
children: [
Expanded(
flex: 2,
child: textControllerWidget(
context,
editProvider.editQuantityControllers[j],
"Quantity",
"Enter Quantity",
(value) => editProvider.updateTotalAmount(j),
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
), ),
), ],
], ),
), errorWidget(context, "Note: Submit Quantity as Zero (0) to delete Product"),
errorWidget(context, "Note: Submit Quantity as Zero (0) to delete Product"), const SizedBox(height: 10),
const SizedBox(height: 10), Row(
Row( children: [
children: [ Expanded(
Expanded( flex: 2,
flex: 2, child: textControllerWidget(
child: textControllerWidget( context,
context, editProvider.editTotalAmountControllers[j],
editProvider.editTotalAmountControllers[j], "Amount",
"Amount", "Total Amount",
"Total Amount", (_) {},
(_) {}, TextInputType.number,
TextInputType.number, true,
true, FilteringTextInputFormatter.digitsOnly,
FilteringTextInputFormatter.digitsOnly, ),
), ),
), ],
], ),
), // IconButton(
// IconButton( // icon: const Icon(Icons.delete),
// icon: const Icon(Icons.delete), // onPressed: editProvider.editProductPriceControllers.length > 1
// onPressed: editProvider.editProductPriceControllers.length > 1 // ? () => editProvider.editRemoveRow(j)
// ? () => editProvider.editRemoveRow(j) // : null,
// : null, // ),
// ), ],
], ),
), );
); },
}, ),
), ],
], ),
), ),
), ),
), floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, bottomNavigationBar: InkResponse(
bottomNavigationBar: InkResponse( onTap: editProvider.submitLoading
onTap: editProvider.submitLoading ? null
? null : () {
: () { editProvider.submitForm(context,widget.leadID);
editProvider.submitForm(context,widget.leadID);
}, },
child: Container( child: Container(
height: 45, height: 45,
alignment: Alignment.center, alignment: Alignment.center,
margin: const EdgeInsets.symmetric(horizontal: 10, vertical: 15), margin: const EdgeInsets.symmetric(horizontal: 10, vertical: 15),
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5), padding: const 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: editProvider.submitLoading child: editProvider.submitLoading
? CircularProgressIndicator.adaptive( ? CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(AppColors.app_blue), valueColor: AlwaysStoppedAnimation<Color>(AppColors.app_blue),
) )
: const Text( : const Text(
"Submit", "Submit",
style: TextStyle( style: TextStyle(
fontSize: 15, fontSize: 15,
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
color: Colors.white, color: Colors.white,
),
), ),
), ),
), ),
......
import 'dart:io';
import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
...@@ -50,485 +52,489 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> { ...@@ -50,485 +52,489 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
// provider.resetForm(); // provider.resetForm();
return true; return true;
}, },
child: Scaffold( child: SafeArea(
resizeToAvoidBottomInset: true, top: false,
backgroundColor: AppColors.scaffold_bg_color, bottom: Platform.isIOS?false:true,
appBar: appbar2( child: Scaffold(
context, resizeToAvoidBottomInset: true,
"Generate Quotation", backgroundColor: AppColors.scaffold_bg_color,
provider.resetForm, appBar: appbar2(
const SizedBox(width: 0), context,
), "Generate Quotation",
body: Container( provider.resetForm,
decoration: BoxDecoration(color: AppColors.white), const SizedBox(width: 0),
padding: const EdgeInsets.symmetric(horizontal: 10), ),
child: SingleChildScrollView( body: Container(
child: Column( decoration: BoxDecoration(color: AppColors.white),
crossAxisAlignment: CrossAxisAlignment.start, padding: const EdgeInsets.symmetric(horizontal: 10),
children: [ child: SingleChildScrollView(
textControllerWidget( child: Column(
context, crossAxisAlignment: CrossAxisAlignment.start,
provider.mailIdController, children: [
"Email Id", textControllerWidget(
"Enter Email Id", context,
provider.onChangemailId, provider.mailIdController,
TextInputType.emailAddress, "Email Id",
false, "Enter Email Id",
null, provider.onChangemailId,
), TextInputType.emailAddress,
errorWidget(context, provider.mailIdError), false,
null,
),
errorWidget(context, provider.mailIdError),
textControllerWidget( textControllerWidget(
context, context,
provider.mobileController, provider.mobileController,
"Mobile Number", "Mobile Number",
"Enter Mobile Number", "Enter Mobile Number",
provider.onChangemobile, provider.onChangemobile,
TextInputType.phone, TextInputType.phone,
false, false,
FilteringTextInputFormatter.digitsOnly, FilteringTextInputFormatter.digitsOnly,
), ),
errorWidget(context, provider.mobileError), errorWidget(context, provider.mobileError),
textControllerWidget( textControllerWidget(
context, context,
provider.subjectsController, provider.subjectsController,
"Subject", "Subject",
"Enter Subject", "Enter Subject",
provider.onChangesubjects, provider.onChangesubjects,
TextInputType.text, TextInputType.text,
false, false,
null, null,
), ),
errorWidget(context, provider.subjectsError), errorWidget(context, provider.subjectsError),
InkResponse( InkResponse(
onTap: () { onTap: () {
provider.editAddNewRow(); provider.editAddNewRow();
}, },
child: Container( child: Container(
margin: const EdgeInsets.symmetric(vertical: 10), margin: const EdgeInsets.symmetric(vertical: 10),
height: 45, height: 45,
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
decoration: BoxDecoration( decoration: BoxDecoration(
color: const Color(0xFFE6F6FF), color: const Color(0xFFE6F6FF),
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
border: Border.all( border: Border.all(
color: AppColors.app_blue,
width: 0.5,
),
),
child: Center(
child: Text(
"+ Add Product",
style: TextStyle(
fontFamily: "JakartaMedium",
color: AppColors.app_blue, color: AppColors.app_blue,
width: 0.5,
),
),
child: Center(
child: Text(
"+ Add Product",
style: TextStyle(
fontFamily: "JakartaMedium",
color: AppColors.app_blue,
),
), ),
), ),
), ),
), ),
), if (provider.leadProductsList.isNotEmpty ||
if (provider.leadProductsList.isNotEmpty || provider.editProductPriceControllers.isNotEmpty) ...[
provider.editProductPriceControllers.isNotEmpty) ...[ ListView.builder(
ListView.builder( itemCount: provider.editProductPriceControllers.length,
itemCount: provider.editProductPriceControllers.length, physics: const NeverScrollableScrollPhysics(),
physics: const NeverScrollableScrollPhysics(), shrinkWrap: true,
shrinkWrap: true, itemBuilder: (context, j) {
itemBuilder: (context, j) { return Container(
return Container( padding: const EdgeInsets.symmetric(
padding: const EdgeInsets.symmetric( horizontal: 10,
horizontal: 10, vertical: 10,
vertical: 10, ),
), margin: const EdgeInsets.symmetric(vertical: 10),
margin: const EdgeInsets.symmetric(vertical: 10), decoration: BoxDecoration(
decoration: BoxDecoration( color: Colors.white,
color: Colors.white, borderRadius: BorderRadius.circular(20),
borderRadius: BorderRadius.circular(20), ),
), child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ TextWidget(context, "Product"),
TextWidget(context, "Product"), DropdownButtonHideUnderline(
DropdownButtonHideUnderline( child: Row(
child: Row( children: [
children: [ Expanded(
Expanded( child: DropdownButton2<LeadProducts>(
child: DropdownButton2<LeadProducts>( isExpanded: true,
isExpanded: true, hint: const Text(
hint: const Text( 'Select Product',
'Select Product', style: TextStyle(fontSize: 14),
style: TextStyle(fontSize: 14), overflow: TextOverflow.ellipsis,
overflow: TextOverflow.ellipsis, ),
), items:
items: provider.leadProductsList
provider.leadProductsList .map(
.map( (ord) => DropdownMenuItem<
(ord) => DropdownMenuItem< LeadProducts
LeadProducts >(
>( value: ord,
value: ord, child: Text(
child: Text( "(Product Name: ${ord.productName})",
"(Product Name: ${ord.productName})", style: const TextStyle(
style: const TextStyle( fontSize: 14,
fontSize: 14, ),
overflow:
TextOverflow
.ellipsis,
), ),
overflow:
TextOverflow
.ellipsis,
), ),
), )
) .toList(),
.toList(), value:
value: provider.selectedProductIds[j] !=
provider.selectedProductIds[j] != null
null ? provider.leadProductsList
? provider.leadProductsList .firstWhere(
.firstWhere( (ord) =>
(ord) => ord.id ==
ord.id == provider
provider .selectedProductIds[j],
.selectedProductIds[j], orElse:
orElse: () =>
() => provider
provider .leadProductsList[0],
.leadProductsList[0], )
) : null,
: null, onChanged: (LeadProducts? value) {
onChanged: (LeadProducts? value) { if (value != null) {
if (value != null) { provider.updateSelectedProductIds(
provider.updateSelectedProductIds( j,
j, value,
value, );
); provider.selectedProductIds[j] =
provider.selectedProductIds[j] = value.id?.toString() ?? '';
value.id?.toString() ?? ''; provider.updateTotalAmount(j);
provider.updateTotalAmount(j); }
} },
}, buttonStyleData:
buttonStyleData: ddtheme.buttonStyleData,
ddtheme.buttonStyleData, iconStyleData: ddtheme.iconStyleData,
iconStyleData: ddtheme.iconStyleData, menuItemStyleData:
menuItemStyleData: ddtheme.menuItemStyleData,
ddtheme.menuItemStyleData, dropdownStyleData:
dropdownStyleData: ddtheme.dropdownStyleData,
ddtheme.dropdownStyleData, ),
),
],
),
),
const SizedBox(height: 10),
Row(
children: [
Expanded(
flex: 2,
child: textControllerWidget(
context,
provider.editProductPriceControllers[j],
"Product Price",
"Enter Product Price",
(value) =>
provider.updateTotalAmount(j),
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
), ),
), ),
], ],
), ),
), const SizedBox(height: 10),
const SizedBox(height: 10), Row(
Row( children: [
children: [ Expanded(
Expanded( flex: 2,
flex: 2, child: textControllerWidget(
child: textControllerWidget( context,
context, provider.editQuantityControllers[j],
provider.editProductPriceControllers[j], "Quantity",
"Product Price", "Enter Quantity",
"Enter Product Price", (value) =>
(value) => provider.updateTotalAmount(j),
provider.updateTotalAmount(j), TextInputType.number,
TextInputType.number, false,
false, FilteringTextInputFormatter.digitsOnly,
FilteringTextInputFormatter.digitsOnly, ),
),
),
],
),
const SizedBox(height: 10),
Row(
children: [
Expanded(
flex: 2,
child: textControllerWidget(
context,
provider.editQuantityControllers[j],
"Quantity",
"Enter Quantity",
(value) =>
provider.updateTotalAmount(j),
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
), ),
), ],
], ),
), const SizedBox(height: 10),
const SizedBox(height: 10), Row(
Row( children: [
children: [ Expanded(
Expanded( flex: 2,
flex: 2, child: textControllerWidget(
child: textControllerWidget( context,
context, provider.editTotalAmountControllers[j],
provider.editTotalAmountControllers[j], "Amount",
"Amount", "Total Amount",
"Total Amount", (_) {},
(_) {}, TextInputType.number,
TextInputType.number, true,
true, FilteringTextInputFormatter.digitsOnly,
FilteringTextInputFormatter.digitsOnly, ),
), ),
), ],
], ),
), // IconButton(
// IconButton( // icon: const Icon(Icons.delete),
// icon: const Icon(Icons.delete), // onPressed: provider.editProductPriceControllers.length > 1
// onPressed: provider.editProductPriceControllers.length > 1 // ? () => provider.editRemoveRow(j)
// ? () => provider.editRemoveRow(j) // : null,
// : null, // ),
// ), ],
], ),
), );
); },
}, ),
],
textControllerWidget(
context,
provider.taxesController,
"Taxes",
"Enter Taxes",
provider.onChangetaxes,
TextInputType.text,
false,
null,
), ),
], errorWidget(context, provider.taxesError),
textControllerWidget(
context,
provider.taxesController,
"Taxes",
"Enter Taxes",
provider.onChangetaxes,
TextInputType.text,
false,
null,
),
errorWidget(context, provider.taxesError),
textControllerWidget( textControllerWidget(
context, context,
provider.SpecialNoteController, provider.SpecialNoteController,
"Special Note", "Special Note",
"Enter Special Note", "Enter Special Note",
provider.onChangeSpecialNote, provider.onChangeSpecialNote,
TextInputType.text, TextInputType.text,
false, false,
null, null,
), ),
errorWidget(context, provider.SpecialNoteError), errorWidget(context, provider.SpecialNoteError),
textControllerWidget( textControllerWidget(
context, context,
provider.forController, provider.forController,
"FOR", "FOR",
"Enter FOR", "Enter FOR",
provider.onChangefor, provider.onChangefor,
TextInputType.text, TextInputType.text,
false, false,
null, null,
), ),
errorWidget(context, provider.forError), errorWidget(context, provider.forError),
textControllerWidget( textControllerWidget(
context, context,
provider.paymentTermsController, provider.paymentTermsController,
"Payment Terms", "Payment Terms",
"Enter Payment Terms", "Enter Payment Terms",
provider.onChangepaymentTerms, provider.onChangepaymentTerms,
TextInputType.text, TextInputType.text,
false, false,
null, null,
), ),
errorWidget(context, provider.paymentTermsError), errorWidget(context, provider.paymentTermsError),
], ],
),
), ),
), ),
),
floatingActionButtonLocation: floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat, FloatingActionButtonLocation.centerFloat,
bottomNavigationBar: Material( bottomNavigationBar: Material(
elevation: 10, elevation: 10,
shadowColor: Colors.black54, shadowColor: Colors.black54,
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.black26, color: Colors.black26,
blurRadius: 10, blurRadius: 10,
offset: Offset(0, -2), offset: Offset(0, -2),
), ),
], ],
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
child: InkResponse( child: InkResponse(
onTap: onTap:
provider.submitLoading
? null
: () {
//genquotedown
final insertedData = provider.getFormData();
provider
.crmLeadDetailsGenerateQuoteSubmitAPIFunction(
context,
widget.leadId,
insertedData,
"genquotedown",
);
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
// color: AppColors.app_blue,
borderRadius: BorderRadius.circular(10),
),
child:
provider.submitLoading provider.submitLoading
? CircularProgressIndicator.adaptive( ? null
valueColor: AlwaysStoppedAnimation<Color>( : () {
AppColors.app_blue, //genquotedown
), final insertedData = provider.getFormData();
) provider
: SvgPicture.asset("assets/svg/download_quote.svg"), .crmLeadDetailsGenerateQuoteSubmitAPIFunction(
context,
widget.leadId,
insertedData,
"genquotedown",
);
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
// color: AppColors.app_blue,
borderRadius: BorderRadius.circular(10),
),
child:
provider.submitLoading
? CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue,
),
)
: SvgPicture.asset("assets/svg/download_quote.svg"),
),
), ),
), ),
), SizedBox(width: 10),
SizedBox(width: 10), Expanded(
Expanded( child: InkResponse(
child: InkResponse( onTap:
onTap:
provider.submitLoading
? null
: () {
//genquotemail,
final insertedData = provider.getFormData();
provider
.crmLeadDetailsGenerateQuoteSubmitAPIFunction(
context,
widget.leadId,
insertedData,
"genquotemail",
);
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
// color: AppColors.app_blue,
borderRadius: BorderRadius.circular(10),
),
child:
provider.submitLoading provider.submitLoading
? CircularProgressIndicator.adaptive( ? null
valueColor: AlwaysStoppedAnimation<Color>( : () {
AppColors.app_blue, //genquotemail,
), final insertedData = provider.getFormData();
) provider
: SvgPicture.asset("assets/svg/mail_quote.svg") .crmLeadDetailsGenerateQuoteSubmitAPIFunction(
context,
widget.leadId,
insertedData,
"genquotemail",
);
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
// color: AppColors.app_blue,
borderRadius: BorderRadius.circular(10),
),
child:
provider.submitLoading
? CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue,
),
)
: SvgPicture.asset("assets/svg/mail_quote.svg")
),
), ),
), ),
), SizedBox(width: 10),
SizedBox(width: 10), Expanded(
Expanded( child: InkResponse(
child: InkResponse( onTap:
onTap:
provider.submitLoading
? null
: () {
//genquotewhatsapp,
final insertedData = provider.getFormData();
provider
.crmLeadDetailsGenerateQuoteSubmitAPIFunction(
context,
widget.leadId,
insertedData,
"genquotewhatsapp",
);
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
// color: AppColors.app_blue,
borderRadius: BorderRadius.circular(10),
),
child:
provider.submitLoading provider.submitLoading
? CircularProgressIndicator.adaptive( ? null
valueColor: AlwaysStoppedAnimation<Color>( : () {
AppColors.app_blue, //genquotewhatsapp,
), final insertedData = provider.getFormData();
) provider
: SvgPicture.asset("assets/svg/whatsapp_quote.svg") .crmLeadDetailsGenerateQuoteSubmitAPIFunction(
context,
widget.leadId,
insertedData,
"genquotewhatsapp",
);
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
// color: AppColors.app_blue,
borderRadius: BorderRadius.circular(10),
),
child:
provider.submitLoading
? CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue,
),
)
: SvgPicture.asset("assets/svg/whatsapp_quote.svg")
),
), ),
), ),
), SizedBox(width: 10),
SizedBox(width: 10), Expanded(
Expanded( child: InkResponse(
child: InkResponse( onTap:
onTap:
provider.submitLoading
? null
: () {
//genquotewhatsappbymynum,
final insertedData = provider.getFormData();
provider
.crmLeadDetailsGenerateQuoteSubmitAPIFunction(
context,
widget.leadId,
insertedData,
"genquotewhatsappbymynum",
);
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
// color: AppColors.app_blue,
borderRadius: BorderRadius.circular(10),
),
child:
provider.submitLoading provider.submitLoading
? CircularProgressIndicator.adaptive( ? null
valueColor: AlwaysStoppedAnimation<Color>( : () {
AppColors.app_blue, //genquotewhatsappbymynum,
), final insertedData = provider.getFormData();
) provider
:SvgPicture.asset("assets/svg/whatsapp_quote_self.svg") .crmLeadDetailsGenerateQuoteSubmitAPIFunction(
context,
widget.leadId,
insertedData,
"genquotewhatsappbymynum",
);
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
// color: AppColors.app_blue,
borderRadius: BorderRadius.circular(10),
),
child:
provider.submitLoading
? CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue,
),
)
:SvgPicture.asset("assets/svg/whatsapp_quote_self.svg")
),
), ),
), ),
), ],
], ),
), ),
), ),
), ),
......
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:generp/screens/crm/editProductsList.dart'; import 'package:generp/screens/crm/editProductsList.dart';
...@@ -35,12 +37,14 @@ class _ProductdetailsState extends State<Productdetails> { ...@@ -35,12 +37,14 @@ class _ProductdetailsState extends State<Productdetails> {
var customerDetails = provider.leadProducts; var customerDetails = provider.leadProducts;
return WillPopScope( return WillPopScope(
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: Scaffold( child: SafeArea(
resizeToAvoidBottomInset: true, top: false,
appBar: appbar(context, "Product Details"), bottom: Platform.isIOS?false:true,
backgroundColor: AppColors.scaffold_bg_color, child: Scaffold(
body: SafeArea( resizeToAvoidBottomInset: true,
child: SizedBox( appBar: appbar(context, "Product Details"),
backgroundColor: AppColors.scaffold_bg_color,
body: SizedBox(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
...@@ -114,40 +118,40 @@ class _ProductdetailsState extends State<Productdetails> { ...@@ -114,40 +118,40 @@ class _ProductdetailsState extends State<Productdetails> {
), ),
), ),
), ),
), floatingActionButton: Align(
floatingActionButton: Align( alignment: Alignment.bottomCenter,
alignment: Alignment.bottomCenter, child: InkWell(
child: InkWell( onTap: () async {
onTap: () async { var res = await Navigator.push(context, MaterialPageRoute(builder: (context) => EditProductsList(
var res = await Navigator.push(context, MaterialPageRoute(builder: (context) => EditProductsList( leadID: widget.leadID,
leadID: widget.leadID, ),));
),)); if(res==true){
if(res==true){ provider.crmLeadDetailsAPIFunction(context, widget.leadID, widget.mode);
provider.crmLeadDetailsAPIFunction(context, widget.leadID, widget.mode); }
} },
}, child: Container(
child: Container( alignment: Alignment.bottomCenter,
alignment: Alignment.bottomCenter, height: 45,
height: 45, width: MediaQuery.of(context).size.width,
width: MediaQuery.of(context).size.width, margin: EdgeInsets.symmetric(horizontal: 10),
margin: EdgeInsets.symmetric(horizontal: 10), decoration: BoxDecoration(
decoration: BoxDecoration( color: AppColors.app_blue,
color: AppColors.app_blue, borderRadius: BorderRadius.circular(14.0),
borderRadius: BorderRadius.circular(14.0), ),
), child: Center(
child: Center( child: Text(
child: Text( "Edit Products",
"Edit Products", textAlign: TextAlign.center,
textAlign: TextAlign.center, style: TextStyle(color: Colors.white,
style: TextStyle(color: Colors.white, fontFamily: "JakartaMedium"),
fontFamily: "JakartaMedium"), ),
), ),
), ),
), ),
), ),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
), ),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
), ),
); );
}, },
......
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
...@@ -23,12 +25,14 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> { ...@@ -23,12 +25,14 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
var customerDetails = provider.contactList; var customerDetails = provider.contactList;
return WillPopScope( return WillPopScope(
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: Scaffold( child: SafeArea(
resizeToAvoidBottomInset: true, top: false,
appBar: appbar(context, "Contact Details"), bottom: Platform.isIOS?false:true,
backgroundColor: AppColors.scaffold_bg_color, child: Scaffold(
body: SafeArea( resizeToAvoidBottomInset: true,
child: SizedBox( appBar: appbar(context, "Contact Details"),
backgroundColor: AppColors.scaffold_bg_color,
body: SizedBox(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
...@@ -181,37 +185,37 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> { ...@@ -181,37 +185,37 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
), ),
), ),
), ),
), floatingActionButton: Align(
floatingActionButton: Align( alignment: Alignment.bottomCenter,
alignment: Alignment.bottomCenter, child: InkWell(
child: InkWell( onTap: () {
onTap: () { _showAddContactSheet(context,provider.accountDetails.id!);
_showAddContactSheet(context,provider.accountDetails.id!); },
}, child: Container(
child: Container( alignment: Alignment.bottomCenter,
alignment: Alignment.bottomCenter, height: 45,
height: 45, width: MediaQuery.of(context).size.width,
width: MediaQuery.of(context).size.width, margin: EdgeInsets.symmetric(horizontal: 10),
margin: EdgeInsets.symmetric(horizontal: 10), decoration: BoxDecoration(
decoration: BoxDecoration( color: AppColors.app_blue,
color: AppColors.app_blue, borderRadius: BorderRadius.circular(14.0),
borderRadius: BorderRadius.circular(14.0), ),
), child: Center(
child: Center( child: Text(
child: Text( "Add Contact",
"Add Contact", textAlign: TextAlign.center,
textAlign: TextAlign.center, style: TextStyle(
style: TextStyle( color: Colors.white,
color: Colors.white, fontFamily: "JakartaMedium",
fontFamily: "JakartaMedium", ),
), ),
), ),
), ),
), ),
), ),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
), ),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
), ),
); );
}, },
......
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:generp/Notifiers/crmProvider/crmProspectDetailsProvider.dart'; import 'package:generp/Notifiers/crmProvider/crmProspectDetailsProvider.dart';
import 'package:generp/screens/crm/LeadDetailsByMode.dart'; import 'package:generp/screens/crm/LeadDetailsByMode.dart';
...@@ -37,12 +39,14 @@ class _ProspectLeadDetailsState extends State<ProspectLeadDetails> { ...@@ -37,12 +39,14 @@ class _ProspectLeadDetailsState extends State<ProspectLeadDetails> {
var customerDetails = provider.leadList; var customerDetails = provider.leadList;
return WillPopScope( return WillPopScope(
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: Scaffold( child: SafeArea(
resizeToAvoidBottomInset: true, top: false,
appBar: appbar(context, "Lead Details"), bottom: Platform.isIOS?false:true,
backgroundColor: AppColors.scaffold_bg_color, child: Scaffold(
body: SafeArea( resizeToAvoidBottomInset: true,
child: SizedBox( appBar: appbar(context, "Lead Details"),
backgroundColor: AppColors.scaffold_bg_color,
body: SizedBox(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
...@@ -144,49 +148,49 @@ class _ProspectLeadDetailsState extends State<ProspectLeadDetails> { ...@@ -144,49 +148,49 @@ class _ProspectLeadDetailsState extends State<ProspectLeadDetails> {
), ),
), ),
), ),
), floatingActionButton: Align(
floatingActionButton: Align( alignment: Alignment.bottomCenter,
alignment: Alignment.bottomCenter, child: InkWell(
child: InkWell( onTap: () async {
onTap: () async { var res = await Navigator.push(
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => AddProspectLeads(leadID: widget.leadID,mode: widget.mode,),
),
);
if (res == true) {
provider.crmProspectDetailsAPIFunction(
context, context,
widget.leadID, MaterialPageRoute(
builder:
(context) => AddProspectLeads(leadID: widget.leadID,mode: widget.mode,),
),
); );
} if (res == true) {
}, provider.crmProspectDetailsAPIFunction(
child: Container( context,
alignment: Alignment.bottomCenter, widget.leadID,
height: 45, );
width: MediaQuery.of(context).size.width, }
margin: EdgeInsets.symmetric(horizontal: 10), },
decoration: BoxDecoration( child: Container(
color: AppColors.app_blue, alignment: Alignment.bottomCenter,
borderRadius: BorderRadius.circular(14.0), height: 45,
), width: MediaQuery.of(context).size.width,
child: Center( margin: EdgeInsets.symmetric(horizontal: 10),
child: Text( decoration: BoxDecoration(
"Add Lead", color: AppColors.app_blue,
textAlign: TextAlign.center, borderRadius: BorderRadius.circular(14.0),
style: TextStyle( ),
color: Colors.white, child: Center(
fontFamily: "JakartaMedium", child: Text(
"Add Lead",
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontFamily: "JakartaMedium",
),
), ),
), ),
), ),
), ),
), ),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
), ),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
), ),
); );
}, },
......
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:generp/screens/order/ordersDetailsByModes.dart'; import 'package:generp/screens/order/ordersDetailsByModes.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
...@@ -34,12 +36,14 @@ class _ProspectOrderDetailsState extends State<ProspectOrderDetails> { ...@@ -34,12 +36,14 @@ class _ProspectOrderDetailsState extends State<ProspectOrderDetails> {
var customerDetails = provider.ordersList; var customerDetails = provider.ordersList;
return WillPopScope( return WillPopScope(
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: Scaffold( child: SafeArea(
resizeToAvoidBottomInset: true, top: false,
appBar: appbar(context, "Order Details"), bottom: Platform.isIOS?false:true,
backgroundColor: AppColors.scaffold_bg_color, child: Scaffold(
body: SafeArea( resizeToAvoidBottomInset: true,
child: SizedBox( appBar: appbar(context, "Order Details"),
backgroundColor: AppColors.scaffold_bg_color,
body: SizedBox(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
...@@ -166,8 +170,8 @@ class _ProspectOrderDetailsState extends State<ProspectOrderDetails> { ...@@ -166,8 +170,8 @@ class _ProspectOrderDetailsState extends State<ProspectOrderDetails> {
), ),
), ),
), ),
),
),
), ),
); );
}, },
......
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:generp/screens/order/paymentDetailsByMode.dart'; import 'package:generp/screens/order/paymentDetailsByMode.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
...@@ -35,12 +37,15 @@ class _ProspectPaymentDetailsState extends State<ProspectPaymentDetails> { ...@@ -35,12 +37,15 @@ class _ProspectPaymentDetailsState extends State<ProspectPaymentDetails> {
var customerDetails = provider.paymentsList; var customerDetails = provider.paymentsList;
return WillPopScope( return WillPopScope(
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: Scaffold( child: SafeArea(
resizeToAvoidBottomInset: true, top: false,
appBar: appbar(context, "Payment Details"), bottom: Platform.isIOS?false:true,
backgroundColor: AppColors.scaffold_bg_color,
body: SafeArea( child: Scaffold(
child: SizedBox( resizeToAvoidBottomInset: true,
appBar: appbar(context, "Payment Details"),
backgroundColor: AppColors.scaffold_bg_color,
body: SizedBox(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
......
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