Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sai Srinivas
GEN_ERP_2025
Commits
c0252747
Commit
c0252747
authored
Jul 22, 2025
by
Sai Srinivas
Browse files
22-07-2025 By Sai Srinivas
CRM Leads List, Pending tasks and Lead Details Updated
parent
dddda326
Changes
32
Hide whitespace changes
Inline
Side-by-side
lib/screens/crm/crmDashboard.dart
View file @
c0252747
import
'dart:io'
;
import
'dart:io'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:dotted_line/dotted_line.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Models/crmModels/crmPendingTasksResponse.dart'
;
import
'package:generp/screens/crm/pendingTasksDetails.dart'
;
import
'package:generp/screens/crm/pendingTasksList.dart'
;
import
'package:generp/screens/crm/universalSearchScreen.dart'
;
import
'package:generp/screens/crm/universalSearchScreen.dart'
;
import
'package:provider/provider.dart'
;
import
'package:provider/provider.dart'
;
...
@@ -87,7 +91,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
...
@@ -87,7 +91,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
backgroundColor:
AppColors
.
scaffold_bg_color
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
AppBar
(
appBar:
AppBar
(
automaticallyImplyLeading:
false
,
automaticallyImplyLeading:
false
,
elevation:
2.0
,
//
elevation: 2.0,
title:
SizedBox
(
title:
SizedBox
(
child:
Row
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
...
@@ -96,10 +100,11 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
...
@@ -96,10 +100,11 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
InkResponse
(
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
child:
SvgPicture
.
asset
(
"assets/svg/app
_
bar_back.svg"
,
"assets/svg/appbar_back
_button
.svg"
,
height:
25
,
height:
25
,
),
),
),
),
SizedBox
(
width:
10
),
InkResponse
(
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
Text
(
child:
Text
(
...
@@ -117,75 +122,56 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
...
@@ -117,75 +122,56 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
),
),
bottom:
PreferredSize
(
bottom:
PreferredSize
(
preferredSize:
Size
.
fromHeight
(
50
),
preferredSize:
Size
.
fromHeight
(
50
),
child:
Container
(
child:
InkResponse
(
padding:
const
EdgeInsets
.
fromLTRB
(
5.0
,
0.0
,
10
,
0
),
onTap:
()
{
margin:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
10
),
print
(
"Tap"
);
height:
50
,
Navigator
.
push
(
alignment:
Alignment
.
center
,
context
,
decoration:
BoxDecoration
(
MaterialPageRoute
(
color:
AppColors
.
text_field_color
,
builder:
borderRadius:
BorderRadius
.
circular
(
14
),
(
context
)
=>
Universalsearchscreen
(
border:
text:
provider
.
searchController
.
text
,
focusNode
.
hasFocus
),
?
Border
.
all
(
color:
AppColors
.
app_blue
)
settings:
RouteSettings
(
name:
'SearchScreen'
),
:
null
,
),
),
);
child:
Row
(
},
children:
[
child:
Container
(
Expanded
(
padding:
const
EdgeInsets
.
fromLTRB
(
5.0
,
0.0
,
10
,
0
),
child:
Container
(
margin:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
10
),
padding:
const
EdgeInsets
.
fromLTRB
(
0.0
,
0.0
,
10
,
0
),
height:
50
,
margin:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
10
),
alignment:
Alignment
.
center
,
child:
TextFormField
(
decoration:
BoxDecoration
(
controller:
provider
.
searchController
,
color:
AppColors
.
text_field_color
,
keyboardType:
TextInputType
.
text
,
borderRadius:
BorderRadius
.
circular
(
14
),
maxLines:
1
,
),
child:
Row
(
onChanged:
(
value
)
{},
children:
[
focusNode:
focusNode
,
Expanded
(
onTapUpOutside:
(
event
)
{
child:
Container
(
focusNode
.
unfocus
();
alignment:
Alignment
.
centerLeft
,
},
padding:
const
EdgeInsets
.
fromLTRB
(
0.0
,
0.0
,
10
,
0
),
margin:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
10
),
textInputAction:
TextInputAction
.
done
,
child:
Text
(
onEditingComplete:
()
{
"Search"
,
Navigator
.
push
(
style:
TextStyle
(
context
,
color:
AppColors
.
grey_thick
,
MaterialPageRoute
(
builder:
(
context
)
=>
Universalsearchscreen
(
text:
provider
.
searchController
.
text
,
),
settings:
RouteSettings
(
name:
'SearchScreen'
),
),
);
},
decoration:
InputDecoration
(
counterText:
""
,
hintText:
"Search"
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFFB4BEC0
),
fontSize:
14
,
fontSize:
14
,
),
),
enabled:
true
,
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
),
),
),
),
),
),
),
SvgPicture
.
asset
(
"assets/svg/search_ic.svg"
),
SvgPicture
.
asset
(
"assets/svg/search_ic.svg"
)
,
]
,
]
,
)
,
),
),
),
),
),
),
shape:
RoundedRectangleBorder
(
//
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:
SingleChildScrollView
(
physics:
AlwaysScrollableScrollPhysics
(),
physics:
AlwaysScrollableScrollPhysics
(),
...
@@ -194,12 +180,14 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
...
@@ -194,12 +180,14 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
if
(
provider
.
allLeads
.
length
>
0
)
...[
if
(
provider
.
allLeads
.
length
>
0
)
...[
Container
(
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical
:
10
),
margin:
EdgeInsets
.
only
(
bottom
:
10
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
borderRadius:
BorderRadius
.
vertical
(
bottom:
Radius
.
circular
(
16
),
),
),
),
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.2
8
,
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.2
5
,
child:
GridView
.
builder
(
child:
GridView
.
builder
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
0
,
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
0
,
vertical:
5
),
itemCount:
provider
.
allLeads
.
length
,
itemCount:
provider
.
allLeads
.
length
,
...
@@ -210,18 +198,33 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
...
@@ -210,18 +198,33 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
crossAxisCount:
2
,
crossAxisCount:
2
,
crossAxisSpacing:
10
,
crossAxisSpacing:
10
,
mainAxisSpacing:
10
,
mainAxisSpacing:
10
,
childAspectRatio:
0.65
,
childAspectRatio:
55
/
100
,
),
),
itemBuilder:
(
context
,
jndex
)
{
itemBuilder:
(
context
,
jndex
)
{
final
icons
=
[
"comm_ic_1"
,
"comm_ic_2"
];
final
icons
=
[
"comm_ic_1"
,
"comm_ic_2"
];
final
leadTitles
=
[
final
leadTitles
=
[
'Hot Leads'
,
'Open Leads'
,
'Cold Leads'
,
'Quotation Generated'
,
'Pending Tasks'
,
'Today Visits'
,
'Today Calls'
,
'Hot Leads'
'Cold Leads'
,
'Warm Leads'
,
'Warm Leads'
,
'Total Leads'
,
// 'Total Leads',
'Order Lost'
,
// 'Order Lost',
'No Requirement'
,
// 'No Requirement',
'Open Enquiries'
,
// 'Open Enquiries',
];
final
assetNames
=
[
"assets/svg/crm/open_leads_ic.svg"
,
"assets/svg/crm/quotes_generated_ic.svg"
,
"assets/svg/crm/pending_tasks_ic.svg"
,
"assets/svg/crm/today_visits_ic.svg"
,
"assets/svg/crm/today_calls_ic.svg"
,
"assets/svg/crm/hot_leads_ic.svg"
,
"assets/svg/crm/cold_leads_ic.svg"
,
"assets/svg/crm/warm_leads_ic.svg"
,
];
];
final
colors
=
[
final
colors
=
[
0xFFE7FFE5
,
0xFFE7FFE5
,
...
@@ -243,6 +246,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
...
@@ -243,6 +246,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
0xFF605C00
,
0xFF605C00
,
0xFF91481B
,
0xFF91481B
,
];
];
return
InkResponse
(
return
InkResponse
(
onTap:
()
async
{
onTap:
()
async
{
if
(
provider
.
allLeads
[
jndex
].
filter
!.
pageName
!=
if
(
provider
.
allLeads
[
jndex
].
filter
!.
pageName
!=
...
@@ -276,23 +280,40 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
...
@@ -276,23 +280,40 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
padding:
EdgeInsets
.
symmetric
(
horizontal:
13
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
13
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
Color
(
colors
[
jndex
]),
color:
Color
(
colors
[
jndex
]),
borderRadius:
BorderRadius
.
circular
(
1
2
),
borderRadius:
BorderRadius
.
circular
(
2
0
),
),
),
child:
Column
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
children:
[
Text
(
Text
(
provider
.
allLeads
[
jndex
].
count
!
,
provider
.
allLeads
[
jndex
].
count
.
toString
()
,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
3
0
,
fontSize:
2
0
,
fontFamily:
"JakartaMedium"
,
fontFamily:
"JakartaMedium"
,
color:
Color
(
textcolors
[
jndex
]),
color:
Color
(
textcolors
[
jndex
]),
),
),
),
),
Text
(
Row
(
leadTitles
[
jndex
],
children:
[
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
Expanded
(
flex:
3
,
child:
Text
(
leadTitles
[
jndex
],
style:
TextStyle
(
fontSize:
14
,
fontFamily:
"JakartaRegular"
,
color:
AppColors
.
semi_black
,
),
),
),
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
assetNames
[
jndex
],
),
),
],
),
),
],
],
),
),
...
@@ -302,209 +323,468 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
...
@@ -302,209 +323,468 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
),
),
),
),
],
],
ListView
.
builder
(
physics:
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
),
itemCount:
gridPages
.
length
,
itemBuilder:
(
context
,
index
)
{
// final icons = ["comm_ic_1", "comm_ic_2"];
Widget
?
SvgIcon
;
if
(
gridPages
[
index
].
pageName
!.
contains
(
"Lead List"
))
{
// ListView.builder(
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_lv1.svg"
);
// physics: NeverScrollableScrollPhysics(),
}
else
if
(
gridPages
[
index
].
pageName
==
"Nearby Leads"
)
{
// shrinkWrap: true,
SvgIcon
=
SvgPicture
.
asset
(
// padding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
"assets/svg/home_icons_5.svg"
,
// itemCount: gridPages.length,
height:
18
,
// itemBuilder: (context, index) {
width:
18
,
// // final icons = ["comm_ic_1", "comm_ic_2"];
);
// Widget? SvgIcon;
}
else
{
//
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_ic.svg"
);
// if (gridPages[index].pageName!.contains("Lead List")) {
}
// SvgIcon = SvgPicture.asset("assets/svg/fin_lv1.svg");
return
InkResponse
(
// } else if (gridPages[index].pageName == "Nearby Leads") {
onTap:
()
{
// SvgIcon = SvgPicture.asset(
print
(
gridPages
[
index
].
pageName
!);
// "assets/svg/home_icons_5.svg",
if
(
gridPages
[
index
].
pageName
!.
contains
(
"Lead List"
))
{
// height: 18,
Navigator
.
push
(
// width: 18,
context
,
// );
MaterialPageRoute
(
// } else {
builder:
// SvgIcon = SvgPicture.asset("assets/svg/fin_ic.svg");
(
context
)
=>
Leadlistbymode
(
// }
mode:
gridPages
[
index
].
mode
,
// return InkResponse(
pageTitleName:
gridPages
[
index
].
pageName
,
// onTap: () {
),
// print(gridPages[index].pageName!);
),
// if (gridPages[index].pageName!.contains("Lead List")) {
);
// Navigator.push(
}
else
if
(
gridPages
[
index
].
pageName
!.
contains
(
// context,
"Account List"
,
// MaterialPageRoute(
))
{
// builder:
Navigator
.
push
(
// (context) => Leadlistbymode(
context
,
// mode: gridPages[index].mode,
MaterialPageRoute
(
// pageTitleName: gridPages[index].pageName,
builder:
// ),
(
context
)
=>
ProspectListByMode
(
// ),
mode:
gridPages
[
index
].
mode
,
// );
pageTitleName:
gridPages
[
index
].
pageName
,
// } else if (gridPages[index].pageName!.contains(
),
// "Account List",
),
// )) {
);
// Navigator.push(
}
else
if
(
gridPages
[
index
].
pageName
==
// context,
"Nearby Leads"
)
{
// MaterialPageRoute(
Navigator
.
push
(
// builder:
context
,
// (context) => ProspectListByMode(
MaterialPageRoute
(
// mode: gridPages[index].mode,
builder:
(
context
)
=>
NearbyOpenLeads
(),
// pageTitleName: gridPages[index].pageName,
),
// ),
);
// ),
}
// );
// switch (gridPages[index].pageName!) {
// } else if (gridPages[index].pageName ==
// case "Lead List":
// "Nearby Leads") {
// Navigator.push(
// Navigator.push(
// context,
// context,
// MaterialPageRoute(builder: (context) => Leadlistbymode()),
// MaterialPageRoute(
// );
// builder: (context) => NearbyOpenLeads(),
// break;
// ),
// case "Prospect List":
// );
// // Navigator.push(
// }
// // context,
// // switch (gridPages[index].pageName!) {
// // MaterialPageRoute(builder: (context) => Accountledger()),
// // case "Lead List":
// // );
// // Navigator.push(
// break;
// // context,
//
// // MaterialPageRoute(builder: (context) => Leadlistbymode()),
// default:
// // );
// print("111");
// // break;
// break;
// // case "Prospect List":
// }
// // // Navigator.push(
},
// // // context,
child:
Container
(
// // // MaterialPageRoute(builder: (context) => Accountledger()),
decoration:
BoxDecoration
(
// // // );
color:
Colors
.
white
,
// // break;
borderRadius:
BorderRadius
.
circular
(
14
),
// //
),
// // default:
margin:
EdgeInsets
.
symmetric
(
// // print("111");
horizontal:
5
,
// // break;
vertical:
5
,
// // }
),
// },
padding:
EdgeInsets
.
symmetric
(
// child: Container(
horizontal:
10
,
// decoration: BoxDecoration(
vertical:
15
,
// color: Colors.white,
),
// borderRadius: BorderRadius.circular(14),
child:
Row
(
// ),
// margin: EdgeInsets.symmetric(
// horizontal: 5,
// vertical: 5,
// ),
// padding: EdgeInsets.symmetric(
// horizontal: 10,
// vertical: 15,
// ),
// child: Row(
// children: [
// Expanded(flex: 1, child: SvgIcon),
//
// Expanded(
// flex: 5,
// child: Text(
// "${gridPages[index].pageName}",
// style: TextStyle(fontSize: 14),
// ),
// ),
// Expanded(
// flex: 1,
// child: SvgPicture.asset(
// "assets/svg/arrow_right_new.svg",
// ),
// ),
// ],
// ),
// ),
// );
// },
// ),
Container
(
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.2
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
Row
(
children:
[
Expanded
(
child:
Column
(
children:
[
children:
[
Expanded
(
flex:
1
,
child:
SvgIcon
),
Expanded
(
Expanded
(
flex:
5
,
child:
InkResponse
(
child:
Text
(
onTap:
()
{},
"
${gridPages[index].pageName}
"
,
child:
Container
(
style:
TextStyle
(
fontSize:
14
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
5
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Row
(
children:
[
Expanded
(
flex:
2
,
child:
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Leadlistbymode
(
mode:
"executive"
,
pageTitleName:
"Lead List"
,
),
),
);
},
child:
Container
(
padding:
EdgeInsets
.
only
(
top:
15
,
left:
10
,
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"Lead List"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
14
,
),
),
Text
(
"Product and
\n
service orders"
,
style:
TextStyle
(
color:
AppColors
.
grey_semi
,
fontSize:
12
,
),
),
],
),
),
),
),
Expanded
(
child:
SvgPicture
.
asset
(
"assets/svg/crm/lead_list_ic.svg"
,
),
),
],
),
),
),
),
),
),
SizedBox
(
height:
10
),
Expanded
(
Expanded
(
flex:
1
,
child:
InkResponse
(
child:
SvgPicture
.
asset
(
child:
Container
(
"assets/svg/arrow_right_new.svg"
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
5
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Row
(
children:
[
Expanded
(
flex:
2
,
child:
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
ProspectListByMode
(
mode:
"executive"
,
pageTitleName:
"Account List"
,
),
),
);
},
child:
Container
(
padding:
EdgeInsets
.
only
(
top:
15
,
left:
10
,
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"Account List"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
14
,
),
),
Text
(
"Assigned agents,
\n
performance"
,
style:
TextStyle
(
color:
AppColors
.
grey_semi
,
fontSize:
12
,
),
),
],
),
),
),
),
Expanded
(
child:
SvgPicture
.
asset
(
"assets/svg/crm/account_list_ic.svg"
,
),
),
],
),
),
),
),
),
),
],
],
),
),
),
),
);
SizedBox
(
width:
10
),
},
Expanded
(
child:
InkResponse
(
onTap:
()
{},
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
15
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Expanded
(
child:
Row
(
children:
[
Expanded
(
child:
Text
(
"Appointment"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
14
,
),
),
),
],
),
),
Text
(
"Records,
\n
Ledger"
,
style:
TextStyle
(
color:
AppColors
.
grey_semi
,
fontSize:
12
,
),
),
Spacer
(),
Expanded
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
end
,
crossAxisAlignment:
CrossAxisAlignment
.
end
,
children:
[
SvgPicture
.
asset
(
"assets/svg/crm/appointment_calendar_ic.svg"
,
),
],
),
),
],
),
),
),
),
],
),
),
),
if
(
provider
.
pendingTasksLists
.
length
>
0
)
...[
if
(
provider
.
pendingTasksLists
.
length
>
0
)
...[
Align
(
Align
(
alignment:
Alignment
.
centerLeft
,
alignment:
Alignment
.
centerLeft
,
child:
Padding
(
child:
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
6
),
padding:
EdgeInsets
.
only
(
left:
15
,
top:
10
,
right:
15
),
child:
Text
(
child:
Row
(
"Pending Tasks"
,
children:
[
style:
TextStyle
(
Text
(
fontSize:
16
,
"Pending Tasks"
,
color:
AppColors
.
grey_semi
,
style:
TextStyle
(
),
fontSize:
16
,
color:
AppColors
.
grey_semi
,
),
),
if
(
provider
.
pendingTasksLists
.
length
>
5
)
...[
Spacer
(),
InkResponse
(
onTap:
()
async
{
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
PendingTasksList
(),
settings:
RouteSettings
(
name:
"PendingTasksList"
,
),
),
);
},
child:
SizedBox
(
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Text
(
"View All"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
app_blue
,
),
),
SizedBox
(
width:
5
),
SvgPicture
.
asset
(
"assets/svg/next_button.svg"
,
),
],
),
),
),
],
],
),
),
),
),
),
),
Container
(
Container
(
width:
double
.
infinity
,
width:
double
.
infinity
,
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.34
,
child:
ListView
.
builder
(
child:
ListView
.
builder
(
physics:
AlwaysScrollableScrollPhysics
(),
physics:
AlwaysScrollableScrollPhysics
(),
shrinkWrap:
true
,
shrinkWrap:
true
,
scrollDirection:
Axis
.
horizontal
,
padding:
EdgeInsets
.
symmetric
(
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
vertical:
5
,
horizontal:
10
,
horizontal:
10
,
),
),
itemCount:
provider
.
pendingTasksLists
.
length
,
// itemCount: provider.pendingTasksLists.length,
itemCount:
provider
.
pendingTasksLists
.
length
>
5
?
5
:
provider
.
pendingTasksLists
.
length
,
itemBuilder:
(
context
,
index
)
{
itemBuilder:
(
context
,
index
)
{
final
headings
=
[
"Lead Name"
,
"Mobile Number"
,
"Appointment Date"
,
"Appointment Type"
,
"Note"
,
"Status"
,
];
final
subHeadings
=
[
final
subHeadings
=
[
provider
.
pendingTasksLists
[
index
].
aname
??
"-"
,
provider
.
pendingTasksLists
[
index
].
aname
??
"-"
,
provider
.
pendingTasksLists
[
index
].
conmob
??
"-"
,
provider
.
pendingTasksLists
[
index
].
appdate
??
"-"
,
provider
.
pendingTasksLists
[
index
].
appdate
??
"-"
,
provider
.
pendingTasksLists
[
index
].
atype
??
"-"
,
provider
.
pendingTasksLists
[
index
].
anote
??
"-"
,
provider
.
pendingTasksLists
[
index
].
anote
??
"-"
,
provider
.
pendingTasksLists
[
index
].
lstatus
??
"-"
,
];
];
return
Container
(
return
InkResponse
(
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.3
,
onTap:
()
async
{
width:
MediaQuery
.
of
(
context
).
size
.
width
*
0.6
,
await
Navigator
.
push
(
decoration:
BoxDecoration
(
context
,
color:
Colors
.
white
,
MaterialPageRoute
(
borderRadius:
BorderRadius
.
circular
(
14
),
builder:
),
(
context
)
=>
margin:
EdgeInsets
.
symmetric
(
Pendingtasksdetails
(
detailIndex:
index
),
horizontal:
5
,
settings:
RouteSettings
(
name:
'Pendingtasksdetails'
)
vertical:
5
,
),
),
);
padding:
EdgeInsets
.
symmetric
(
},
horizontal:
10
,
child:
Container
(
vertical:
15
,
decoration:
BoxDecoration
(
),
color:
Colors
.
white
,
child:
Column
(
borderRadius:
BorderRadius
.
circular
(
15
),
mainAxisAlignment:
MainAxisAlignment
.
start
,
),
children:
[
margin:
EdgeInsets
.
symmetric
(
vertical:
3
),
...
List
.
generate
(
headings
.
length
,
(
j
)
{
padding:
EdgeInsets
.
symmetric
(
return
Container
(
horizontal:
10
,
padding:
EdgeInsets
.
symmetric
(
vertical:
5
,
vertical:
6
,
),
horizontal:
0
,
child:
Column
(
),
mainAxisAlignment:
MainAxisAlignment
.
start
,
child:
Row
(
children:
[
crossAxisAlignment:
...
List
.
generate
(
3
,
(
j
)
{
CrossAxisAlignment
.
start
,
return
Container
(
children:
[
padding:
EdgeInsets
.
symmetric
(
Expanded
(
vertical:
3
,
child:
Text
(
horizontal:
0
,
"
${headings[j]}
"
,
),
style:
TextStyle
(
fontSize:
14
),
),
child:
Column
(
),
children:
[
Expanded
(
if
(
j
==
2
)
...[
child:
Text
(
Padding
(
"
${subHeadings[j]}
"
,
padding:
const
EdgeInsets
.
only
(
style:
TextStyle
(
top:
3.0
,
color:
AppColors
.
grey_semi
,
bottom:
3.0
,
fontSize:
14
,
),
child:
DottedLine
(
dashGapLength:
4
,
dashGapColor:
Colors
.
white
,
dashColor:
AppColors
.
grey_semi
,
dashLength:
4
,
lineThickness:
0.5
,
),
),
),
],
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
child:
Text
(
"
${subHeadings[j]}
"
,
style:
TextStyle
(
color:
j
==
0
?
AppColors
.
semi_black
:
AppColors
.
grey_semi
,
fontSize:
14
,
),
),
),
],
),
),
)
,
]
,
]
,
)
,
)
,
)
;
);
}),
})
,
]
,
]
,
)
,
),
),
);
);
},
},
...
...
lib/screens/crm/followUpUpdateScreen.dart
0 → 100644
View file @
c0252747
import
'dart:io'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:dropdown_button2/dropdown_button2.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/flutter_svg.dart'
;
import
'package:generp/Notifiers/crmProvider/crmDashboardProvider.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/Utils/dropdownTheme.dart'
;
import
'package:provider/provider.dart'
;
class
Followupupdatescreen
extends
StatefulWidget
{
const
Followupupdatescreen
({
super
.
key
});
@override
State
<
Followupupdatescreen
>
createState
()
=>
_FollowupupdatescreenState
();
}
class
_FollowupupdatescreenState
extends
State
<
Followupupdatescreen
>
{
Dropdowntheme
ddtheme
=
Dropdowntheme
();
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
TextEditingController
followUpFeedbackController
=
TextEditingController
();
TextEditingController
noteController
=
TextEditingController
();
onFollowUpChanged
(
value
)
{}
onNoteChanged
(
value
)
{}
@override
void
initState
()
{
super
.
initState
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
event
)
{
setState
(()
=>
_source
=
event
);
});
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{});
}
@override
void
dispose
()
{
// TODO: implement dispose
super
.
dispose
();
_connectivity
.
disposeStream
();
}
@override
Widget
build
(
BuildContext
context
)
{
switch
(
_source
.
keys
.
toList
()[
0
])
{
case
ConnectivityResult
.
mobile
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
wifi
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
none
:
default
:
connection
=
'Offline'
;
}
return
(
connection
==
"Online"
)
?
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Crmdashboardprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
AppBar
(
automaticallyImplyLeading:
false
,
// elevation: 2.0,
title:
SizedBox
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
"assets/svg/appbar_back_button.svg"
,
height:
25
,
),
),
SizedBox
(
width:
10
),
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
Text
(
"Followup Update"
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
fontFamily:
"JakartaSemiBold"
,
color:
AppColors
.
semi_black
,
),
),
),
],
),
),
),
body:
SingleChildScrollView
(
child:
Column
(
children:
[
Container
(
padding:
EdgeInsets
.
only
(
left:
10
),
alignment:
Alignment
.
topLeft
,
child:
Text
(
"Follow up Details"
,
style:
TextStyle
(
color:
AppColors
.
grey_thick
,
fontSize:
16
),
),
),
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
15
),
),
margin:
EdgeInsets
.
symmetric
(
vertical:
5
,
horizontal:
10
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
TextWidget
(
context
,
"In Time"
),
Container
(
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
child:
InkWell
(
onTap:
()
{
provider
.
selectTime
(
context
);
},
child:
Container
(
alignment:
Alignment
.
center
,
height:
45
,
margin:
EdgeInsets
.
only
(
left:
15.0
,
right:
15.0
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
15.0
),
),
child:
Row
(
children:
[
Text
(
provider
.
selectedTime
.
hour
.
toString
()
+
":"
+
provider
.
selectedTime
.
minute
.
toString
()
??
"Enter in Time"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w400
),
),
],
),
),
),
),
TextWidget
(
context
,
"Follow up Type"
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
String
>(
isExpanded:
true
,
hint:
const
Row
(
children:
[
Expanded
(
child:
Text
(
'Select Followup Type'
,
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
.
selectedFollowupType
,
onChanged:
(
String
?
newValue
)
{
setState
(()
{
provider
.
selectedFollowupType
=
newValue
!;
});
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
),
),
textControllerWidget
(
context
,
followUpFeedbackController
,
"Feedback"
,
"Write Feedback"
,
onFollowUpChanged
,
TextInputType
.
text
,
false
,
null
,
),
TextWidget
(
context
,
"Lead Status"
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
String
>(
isExpanded:
true
,
hint:
const
Row
(
children:
[
Expanded
(
child:
Text
(
'Select Lead Status'
,
style:
TextStyle
(
fontSize:
14
),
overflow:
TextOverflow
.
ellipsis
,
),
),
],
),
items:
<
String
>[
'Cold'
,
'Hot'
,
'Warm'
,
'Open'
,
'Closed'
,
]
.
map
(
(
value
)
=>
DropdownMenuItem
<
String
>(
value:
value
,
child:
Text
(
value
??
''
,
style:
const
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
)
.
toList
(),
value:
provider
.
selectedLeadStatus
,
onChanged:
(
String
?
newValue
)
{
setState
(()
{
provider
.
selectedLeadStatus
=
newValue
!;
});
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
),
),
TextWidget
(
context
,
"Next Appointment/Update Order Status"
,
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
String
>(
isExpanded:
true
,
hint:
const
Row
(
children:
[
Expanded
(
child:
Text
(
'Select Status'
,
style:
TextStyle
(
fontSize:
14
),
overflow:
TextOverflow
.
ellipsis
,
),
),
],
),
items:
<
String
>[
'Cold'
,
'Hot'
,
'Warm'
,
'Open'
,
'Closed'
,
]
.
map
(
(
value
)
=>
DropdownMenuItem
<
String
>(
value:
value
,
child:
Text
(
value
??
''
,
style:
const
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
)
.
toList
(),
value:
provider
.
nextAppointmentStatus
,
onChanged:
(
String
?
newValue
)
{
setState
(()
{
provider
.
nextAppointmentStatus
=
newValue
!;
});
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
),
),
],
),
),
SizedBox
(
height:
15
),
Container
(
padding:
EdgeInsets
.
only
(
left:
10
),
alignment:
Alignment
.
topLeft
,
child:
Text
(
"Next Appointment"
,
style:
TextStyle
(
color:
AppColors
.
grey_thick
,
fontSize:
16
),
),
),
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
15
),
),
margin:
EdgeInsets
.
symmetric
(
vertical:
5
,
horizontal:
10
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
TextWidget
(
context
,
"Next Appointment Date"
),
Container
(
height:
50
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
0
),
child:
TextFormField
(
controller:
provider
.
nextAppointmentDateController
,
keyboardType:
TextInputType
.
text
,
enabled:
false
,
maxLines:
1
,
readOnly:
true
,
onChanged:
(
value
)
{},
decoration:
InputDecoration
(
hintText:
"Enter Date"
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFFB4BEC0
),
fontSize:
14
,
),
enabledBorder:
InputBorder
.
none
,
disabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
),
),
),
),
TextWidget
(
context
,
"Appointment Type"
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
String
>(
isExpanded:
true
,
hint:
const
Row
(
children:
[
Expanded
(
child:
Text
(
'Select Appointment Type'
,
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
.
selectNextAppointmentType
,
onChanged:
(
String
?
newValue
)
{
setState
(()
{
provider
.
selectNextAppointmentType
=
newValue
!;
});
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
),
),
textControllerWidget
(
context
,
noteController
,
"Note"
,
"Write Note"
,
onNoteChanged
,
TextInputType
.
text
,
false
,
null
,
),
],
),
),
SizedBox
(
height:
150
),
],
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
floatingActionButton:
InkResponse
(
onTap:
()
{},
child:
Container
(
height:
45
,
alignment:
Alignment
.
center
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
15
),
),
child:
Text
(
"Submit"
,
style:
TextStyle
(
fontSize:
15
,
fontFamily:
"JakartaMedium"
,
color:
Colors
.
white
,
),
),
),
),
);
},
);
}
}
lib/screens/crm/pendingTasksDetails.dart
0 → 100644
View file @
c0252747
import
'dart:io'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:dotted_line/dotted_line.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Notifiers/crmProvider/crmDashboardProvider.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:generp/screens/crm/LeadDetailsByMode.dart'
;
import
'package:generp/screens/crm/followUpUpdateScreen.dart'
;
import
'package:provider/provider.dart'
;
import
'../../Utils/commonWidgets.dart'
;
class
Pendingtasksdetails
extends
StatefulWidget
{
final
detailIndex
;
const
Pendingtasksdetails
({
super
.
key
,
required
this
.
detailIndex
});
@override
State
<
Pendingtasksdetails
>
createState
()
=>
_PendingtasksdetailsState
();
}
class
_PendingtasksdetailsState
extends
State
<
Pendingtasksdetails
>
{
FocusNode
focusNode
=
FocusNode
();
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
@override
void
initState
()
{
super
.
initState
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
event
)
{
setState
(()
=>
_source
=
event
);
});
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
var
prov
=
Provider
.
of
<
Crmdashboardprovider
>(
context
,
listen:
false
);
prov
.
accessPagesAPIFunction
(
context
);
prov
.
crmDashboardAPIFunction
(
context
,
"executive"
,
""
,
""
,
""
);
prov
.
crmPendingTasksAPIFunction
(
context
);
});
}
@override
void
dispose
()
{
// TODO: implement dispose
super
.
dispose
();
_connectivity
.
disposeStream
();
}
@override
Widget
build
(
BuildContext
context
)
{
switch
(
_source
.
keys
.
toList
()[
0
])
{
case
ConnectivityResult
.
mobile
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
wifi
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
none
:
default
:
connection
=
'Offline'
;
}
return
(
connection
==
"Online"
)
?
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Crmdashboardprovider
>(
builder:
(
context
,
provider
,
child
)
{
var
task
=
provider
.
pendingTasksLists
[
widget
.
detailIndex
];
final
subHeadings
=
[
task
.
aname
.
toString
(),
task
.
appdate
??
"-"
];
final
belowSubHeads
=
[
task
.
conmob
.
toString
(),
task
.
anote
??
"-"
];
final
belowHeads
=
[
"Mobile Number"
,
"Note"
];
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
AppBar
(
automaticallyImplyLeading:
false
,
// elevation: 2.0,
title:
SizedBox
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
"assets/svg/appbar_back_button.svg"
,
height:
25
,
),
),
SizedBox
(
width:
10
),
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
Text
(
"Pending Tasks"
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
fontFamily:
"JakartaSemiBold"
,
color:
AppColors
.
semi_black
,
),
),
),
],
),
),
),
body:
(
provider
.
pendingTasksLists
[
widget
.
detailIndex
]
!=
null
)
?
SizedBox
(
child:
Column
(
children:
[
InkResponse
(
onTap:
()
async
{
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
LeadDetailsByMode
(
mode:
"Executive"
,
pageTitleName:
"Lead Details"
,
leadId:
task
.
leadid
,
),
),
);
},
child:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
15
),
),
margin:
EdgeInsets
.
symmetric
(
vertical:
5
,
horizontal:
10
,
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
...
List
.
generate
(
subHeadings
.
length
,
(
j
)
{
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
,
horizontal:
0
,
),
child:
Column
(
children:
[
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
child:
Text
(
"
${subHeadings[j]}
"
,
style:
TextStyle
(
color:
j
==
0
?
AppColors
.
semi_black
:
AppColors
.
grey_semi
,
fontSize:
14
,
),
),
),
],
),
],
),
);
}),
SizedBox
(
height:
10
),
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Expanded
(
flex:
1
,
child:
Text
(
"Details"
)),
Expanded
(
flex:
5
,
child:
DottedLine
(
dashGapLength:
4
,
dashGapColor:
Colors
.
white
,
dashColor:
AppColors
.
grey_semi
,
dashLength:
2
,
lineThickness:
0.5
,
),
),
],
),
SizedBox
(
height:
10
),
...
List
.
generate
(
belowHeads
.
length
,
(
i
)
{
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
,
horizontal:
0
,
),
child:
Column
(
children:
[
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
child:
Text
(
"
${belowHeads[i]}
"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
14
,
),
),
),
Expanded
(
child:
Text
(
"
${belowSubHeads[i]}
"
,
style:
TextStyle
(
color:
AppColors
.
grey_semi
,
fontSize:
14
,
),
),
),
],
),
],
),
);
}),
],
),
),
),
SizedBox
(
height:
150
),
],
),
)
:
Emptywidget
(
context
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
floatingActionButton:
InkResponse
(
onTap:
()
async
{
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Followupupdatescreen
()),
);
},
child:
Container
(
height:
45
,
alignment:
Alignment
.
center
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
15
),
),
child:
Text
(
"Follow up Update"
,
style:
TextStyle
(
fontSize:
15
,
fontFamily:
"JakartaMedium"
,
color:
Colors
.
white
,
),
),
),
),
);
},
);
}
}
lib/screens/crm/pendingTasksList.dart
0 → 100644
View file @
c0252747
import
'dart:io'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:dotted_line/dotted_line.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/flutter_svg.dart'
;
import
'package:generp/Notifiers/crmProvider/crmDashboardProvider.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/screens/crm/pendingTasksDetails.dart'
;
import
'package:provider/provider.dart'
;
class
PendingTasksList
extends
StatefulWidget
{
const
PendingTasksList
({
super
.
key
});
@override
State
<
PendingTasksList
>
createState
()
=>
_PendingTasksListState
();
}
class
_PendingTasksListState
extends
State
<
PendingTasksList
>
{
FocusNode
focusNode
=
FocusNode
();
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
@override
void
initState
()
{
super
.
initState
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
event
)
{
setState
(()
=>
_source
=
event
);
});
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
var
prov
=
Provider
.
of
<
Crmdashboardprovider
>(
context
,
listen:
false
);
prov
.
accessPagesAPIFunction
(
context
);
prov
.
crmDashboardAPIFunction
(
context
,
"executive"
,
""
,
""
,
""
);
prov
.
crmPendingTasksAPIFunction
(
context
);
});
}
@override
void
dispose
()
{
// TODO: implement dispose
super
.
dispose
();
_connectivity
.
disposeStream
();
}
@override
Widget
build
(
BuildContext
context
)
{
switch
(
_source
.
keys
.
toList
()[
0
])
{
case
ConnectivityResult
.
mobile
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
wifi
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
none
:
default
:
connection
=
'Offline'
;
}
return
(
connection
==
"Online"
)
?
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Crmdashboardprovider
>(
builder:
(
context
,
provider
,
child
)
{
final
gridPages
=
provider
.
accessPages
.
where
((
page
)
=>
![
8
,
9
,
23
,
24
,
51
,
50
].
contains
(
page
.
id
))
.
toList
();
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
AppBar
(
automaticallyImplyLeading:
false
,
// elevation: 2.0,
title:
SizedBox
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
"assets/svg/appbar_back_button.svg"
,
height:
25
,
),
),
SizedBox
(
width:
10
),
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
Text
(
"Pending Tasks"
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
fontFamily:
"JakartaSemiBold"
,
color:
AppColors
.
semi_black
,
),
),
),
],
),
),
),
body:
(
provider
.
pendingTasksLists
.
isNotEmpty
)
?
SingleChildScrollView
(
physics:
AlwaysScrollableScrollPhysics
(),
child:
Column
(
children:
[
Container
(
width:
double
.
infinity
,
child:
ListView
.
builder
(
physics:
AlwaysScrollableScrollPhysics
(),
shrinkWrap:
true
,
padding:
EdgeInsets
.
symmetric
(
vertical:
5
,
horizontal:
10
,
),
itemCount:
provider
.
pendingTasksLists
.
length
,
itemBuilder:
(
context
,
index
)
{
final
subHeadings
=
[
provider
.
pendingTasksLists
[
index
].
aname
??
"-"
,
provider
.
pendingTasksLists
[
index
].
appdate
??
"-"
,
provider
.
pendingTasksLists
[
index
].
anote
??
"-"
,
];
return
InkResponse
(
onTap:
()
async
{
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Pendingtasksdetails
(
detailIndex:
index
,
),
settings:
RouteSettings
(
name:
'Pendingtasksdetails'
)
),
);
},
child:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
15
),
),
margin:
EdgeInsets
.
symmetric
(
vertical:
3
,
horizontal:
10
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
...
List
.
generate
(
3
,
(
j
)
{
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
,
horizontal:
0
,
),
child:
Column
(
children:
[
if
(
j
==
2
)
...[
Padding
(
padding:
const
EdgeInsets
.
only
(
top:
3.0
,
bottom:
3.0
,
),
child:
DottedLine
(
dashGapLength:
4
,
dashGapColor:
Colors
.
white
,
dashColor:
AppColors
.
grey_semi
,
dashLength:
4
,
lineThickness:
0.5
,
),
),
],
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
child:
Text
(
"
${subHeadings[j]}
"
,
style:
TextStyle
(
color:
j
==
0
?
AppColors
.
semi_black
:
AppColors
.
grey_semi
,
fontSize:
14
,
),
),
),
],
),
],
),
);
}),
],
),
),
);
},
),
),
SizedBox
(
height:
150
),
],
),
)
:
Emptywidget
(
context
),
);
},
);
}
}
lib/screens/finance/financeDashboard.dart
View file @
c0252747
...
@@ -161,495 +161,494 @@ class _FinancedashboardState extends State<Financedashboard> {
...
@@ -161,495 +161,494 @@ class _FinancedashboardState extends State<Financedashboard> {
return
Scaffold
(
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
// appBar: appbarNew(context, "Finance",0xFFCEEDFF),
appBar:
appbarNew
(
context
,
"Finance"
,
0xFFCEEDFF
),
appBar:
appbar
(
context
,
"Finance"
),
body:
SizedBox
(
body:
SizedBox
(
child:
SingleChildScrollView
(
child:
SingleChildScrollView
(
child:
Column
(
child:
Column
(
children:
[
children:
[
//
Container(
Container
(
//
height: 200,
height:
200
,
//
decoration: BoxDecoration(
decoration:
BoxDecoration
(
//
image: DecorationImage(image: AssetImage(
image:
DecorationImage
(
image:
AssetImage
(
//
"assets/svg/finance/main_dashboard.png",
"assets/svg/finance/main_dashboard.png"
,
//
), fit: BoxFit.contain,),
),
fit:
BoxFit
.
contain
,),
//
gradient: LinearGradient(colors: [
gradient:
LinearGradient
(
colors:
[
//
Color(0xFFCEEDFF),
Color
(
0xFFCEEDFF
),
//
AppColors.scaffold_bg_color
AppColors
.
scaffold_bg_color
//
],begin: Alignment.topCenter,end: Alignment.bottomCenter)
],
begin:
Alignment
.
topCenter
,
end:
Alignment
.
bottomCenter
)
//
),
),
//
//
),
),
Container
(
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
Column
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
children:
[
// if (filteredApprovalLevels.isNotEmpty) ...[
if
(
filteredApprovalLevels
.
isNotEmpty
)
...[
// Padding(
Padding
(
// padding: const EdgeInsets.only(top: 10, bottom: 5),
padding:
const
EdgeInsets
.
only
(
top:
10
,
bottom:
5
),
// child: Text(
child:
Text
(
// "Approval Levels",
"Approval Levels"
,
// style: TextStyle(
style:
TextStyle
(
// color: AppColors.grey_thick,
color:
AppColors
.
grey_thick
,
// fontSize: 14,
fontSize:
14
,
// fontFamily: "JakartaMedium",
fontFamily:
"JakartaMedium"
,
// ),
),
// ),
),
// ),
),
// Container(
Container
(
// padding: EdgeInsets.symmetric(
padding:
EdgeInsets
.
symmetric
(
// vertical: 10,
vertical:
10
,
// horizontal: 15,
horizontal:
15
,
// ),
),
// decoration: BoxDecoration(
decoration:
BoxDecoration
(
// color: Colors.white,
color:
Colors
.
white
,
// borderRadius: BorderRadius.circular(14),
borderRadius:
BorderRadius
.
circular
(
14
),
// ),
),
// child: Row(
child:
Row
(
// mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment
.
center
,
// children: List.generate(filteredApprovalLevels.length, (
children:
List
.
generate
(
filteredApprovalLevels
.
length
,
(
// co,
co
,
// ) {
)
{
// return Expanded(
return
Expanded
(
// child: InkResponse(
child:
InkResponse
(
// onTap: () async {
onTap:
()
async
{
// var navigate;
var
navigate
;
// navigate = Allpaymentrequesitionlistsbymodes(
navigate
=
Allpaymentrequesitionlistsbymodes
(
// mode: approvalModes[co],
mode:
approvalModes
[
co
],
// pageTitleName:
pageTitleName:
// "Payment Requisition List ${approvalModes[co] == "apr_lvl1"
"Payment Requisition List
${approvalModes[co] == "apr_lvl1"
// ? "(Level 1)"
? "(Level 1)"
// : approvalModes[co] == "apr_lvl2"
: approvalModes[co] == "apr_lvl2"
// ? "(Level 2)"
? "(Level 2)"
// : "(Self Level 2)"}",
: "(Self Level 2)"}
"
,
// );
);
//
// await Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => navigate,
// ),
// );
// },
// child: SizedBox(
// child: Column(
// crossAxisAlignment:
// CrossAxisAlignment.center,
// mainAxisAlignment:
// MainAxisAlignment.center,
// children: [
// SvgPicture.asset(
// filteredApprovalLevels[co]['icon'] ??
// "",
// ),
// SizedBox(height: 10),
// Text(
// filteredApprovalLevels[co]['name'] ??
// "-",
// maxLines: 2,
// textAlign: TextAlign.center,
// style: TextStyle(
// fontSize: 12,
// fontFamily: "JakartaMedium",
// ),
// ),
// ],
// ),
// ),
// ),
// );
// }),
// ),
// ),
// ],
//
// if (filteredPaymentInitiations.isNotEmpty) ...[
// Padding(
// padding: const EdgeInsets.only(top: 10, bottom: 5),
// child: Text(
// "Payment Initiation",
// style: TextStyle(
// color: AppColors.grey_thick,
// fontSize: 14,
// fontFamily: "JakartaMedium",
// ),
// ),
// ),
// GridView.builder(
// shrinkWrap: true,
// padding: EdgeInsets.only(bottom: 0),
//
// itemCount: filteredPaymentInitiations.length,
// physics: NeverScrollableScrollPhysics(),
// gridDelegate:
// SliverGridDelegateWithMaxCrossAxisExtent(
// childAspectRatio: 1,
// mainAxisExtent: 100,
// maxCrossAxisExtent:
// MediaQuery.of(context).size.width * 0.5,
// ),
// itemBuilder: (context, ini) {
// return InkResponse(
// onTap: () async {
// var navigate;
// if (ini == 0) {
// navigate = await Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (
// context,
// ) => Allpaymentrequesitionlistsbymodes(
// mode: "self",
// pageTitleName:
// "Payment Requisition List (Self)",
// ),
// ),
// );
// } else {
// navigate = await Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => Accountslist(),
// ),
// );
// }
// },
// child: Container(
// padding: EdgeInsets.symmetric(
// vertical: 5,
// horizontal: 15,
// ),
// margin: EdgeInsets.symmetric(
// vertical: 7,
// horizontal: 5,
// ),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(14),
// ),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment:
// CrossAxisAlignment.center,
// children: [
// Expanded(
// flex: 2,
// child: SizedBox(
// child: Column(
// crossAxisAlignment:
// CrossAxisAlignment.start,
// mainAxisAlignment:
// MainAxisAlignment.center,
// children: [
// Text(
// filteredPaymentInitiations[ini]['name'] ??
// "-",
// style: TextStyle(
// fontSize: 14,
// color: AppColors.app_blue,
// fontFamily: "JakartaMedium",
// ),
// ),
// Text(
// filteredPaymentInitiations[ini]['subtitle'] ??
// "-",
// style: TextStyle(
// fontSize: 12,
// color: AppColors.grey_semi,
// fontFamily: "JakartaMedium",
// ),
// ),
// ],
// ),
// ),
// ),
// SizedBox(width: 10),
// Expanded(
// flex: 1,
// child: SvgPicture.asset(
// filteredPaymentInitiations[ini]['icon'] ??
// "",
// ),
// ),
// ],
// ),
// ),
// );
// },
// ),
// ],
//
// if (filteredPaymentAdministrations.isNotEmpty) ...[
// Padding(
// padding: const EdgeInsets.only(top: 10, bottom: 5),
// child: Text(
// "Payment Administration",
// style: TextStyle(
// color: AppColors.grey_thick,
// fontSize: 14,
// fontFamily: "JakartaMedium",
// ),
// ),
// ),
// GridView.builder(
// itemCount: filteredPaymentAdministrations.length,
// physics: NeverScrollableScrollPhysics(),
// shrinkWrap: true,
// gridDelegate:
// SliverGridDelegateWithFixedCrossAxisCount(
// crossAxisCount: 2,
// childAspectRatio: 2 / 1.1,
// ),
// itemBuilder: (context, ad) {
// return InkResponse(
// onTap: () async {
// var navigate;
// if (ad == 0) {
// navigate = await Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (
// context,
// ) => Allpaymentrequesitionlistsbymodes(
// mode: "process",
// pageTitleName:
// "Payment Requisition List (Self)",
// ),
// ),
// );
// } else if (ad == 1) {
// navigate = await Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (
// context,
// ) => Allpaymentrequesitionlistsbymodes(
// mode: "admin",
// pageTitleName:
// "Payment Requisition List (Admin)",
// ),
// ),
// );
// } else if (ad == 2) {
// navigate = await Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) => Paymentreceiptlist(
// pageTitleName:
// "Payment Receipt List",
// ),
// ),
// );
// } else if (ad == 3) {
// navigate = await Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => Accountledger(),
// ),
// );
// } else {
// navigate = await Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) =>
// Paymentlistpaymentrequisition(
// pageTitleName:
// "Payments List",
// ),
// ),
// );
// }
// },
// child: Container(
// padding: EdgeInsets.symmetric(
// vertical: 5,
// horizontal: 15,
// ),
// margin: EdgeInsets.symmetric(
// vertical: 7,
// horizontal: 5,
// ),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(14),
// ),
// child: Row(
// mainAxisAlignment:
// MainAxisAlignment.center,
// crossAxisAlignment:
// CrossAxisAlignment.center,
// children: [
// Expanded(
// flex: 2,
// child: SizedBox(
// child: Column(
// crossAxisAlignment:
// CrossAxisAlignment.start,
// mainAxisAlignment:
// MainAxisAlignment.center,
// children: [
// Text(
// filteredPaymentAdministrations[ad]['name'] ??
// "-",
// style: TextStyle(
// fontSize: 14,
// color: AppColors.app_blue,
// fontFamily: "JakartaMedium",
// ),
// ),
// Text(
// filteredPaymentAdministrations[ad]['subtitle'] ??
// "-",
// maxLines: 2,
// style: TextStyle(
// fontSize: 12,
// color: AppColors.grey_semi,
// fontFamily: "JakartaMedium",
// ),
// ),
// ],
// ),
// ),
// ),
// SizedBox(width: 10),
// Expanded(
// flex: 1,
// child: SvgPicture.asset(
// filteredPaymentAdministrations[ad]['icon'] ??
// "",
// ),
// ),
// ],
// ),
// ),
// );
// },
// ),
// ],
// SizedBox(height: 100,),
ListView
.
builder
(
itemCount:
pages
.
length
,
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
itemBuilder:
(
context
,
index
)
{
Widget
?
SvgIcon
;
switch
(
pages
[
index
].
mode
)
{
case
"apr_lvl1"
:
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_lv1.svg"
);
break
;
case
"apr_lvl2"
:
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_lv2.svg"
);
break
;
// final icons = ["comm_ic_1", "comm_ic_2"];
case
"self_apr_lvl2"
:
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_lv2.svg"
);
break
;
default
:
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_ic.svg"
);
break
;
}
return
InkResponse
(
onTap:
()
async
{
var
navigate
;
if
(
pages
[
index
].
pageName
==
"Payments List"
)
{
navigate
=
Paymentlistpaymentrequisition
(
pageTitleName:
provider
.
accessiblePagesList
[
index
].
pageName
!,
);
}
else
if
(
provider
.
accessiblePagesList
[
index
]
.
pageName
==
"Payment Receipts List"
)
{
navigate
=
Paymentreceiptlist
(
pageTitleName:
provider
.
accessiblePagesList
[
index
].
pageName
!,
);
}
else
if
(
provider
.
accessiblePagesList
[
index
]
.
pageName
==
"Account List"
)
{
navigate
=
Accountslist
();
// break;
await
Navigator
.
push
(
}
else
if
(
provider
context
,
.
accessiblePagesList
[
index
]
MaterialPageRoute
(
.
pageName
==
builder:
(
context
)
=>
navigate
,
"Account Ledger"
)
{
),
navigate
=
Accountledger
();
);
}
else
{
},
navigate
=
Allpaymentrequesitionlistsbymodes
(
child:
SizedBox
(
mode:
pages
[
index
].
mode
!,
child:
Column
(
pageTitleName:
crossAxisAlignment:
provider
.
accessiblePagesList
[
index
].
pageName
!,
CrossAxisAlignment
.
center
,
);
mainAxisAlignment:
}
MainAxisAlignment
.
center
,
await
Navigator
.
push
(
children:
[
context
,
SvgPicture
.
asset
(
MaterialPageRoute
(
builder:
(
context
)
=>
navigate
),
filteredApprovalLevels
[
co
][
'icon'
]
??
""
,
),
SizedBox
(
height:
10
),
Text
(
filteredApprovalLevels
[
co
][
'name'
]
??
"-"
,
maxLines:
2
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
12
,
fontFamily:
"JakartaMedium"
,
),
),
],
),
),
),
);
);
},
}),
child:
Container
(
),
margin:
EdgeInsets
.
symmetric
(
),
horizontal:
5
,
],
vertical:
5
,
),
if
(
filteredPaymentInitiations
.
isNotEmpty
)
...[
padding:
EdgeInsets
.
symmetric
(
Padding
(
horizontal:
10
,
padding:
const
EdgeInsets
.
only
(
top:
10
,
bottom:
5
),
vertical:
15
,
child:
Text
(
),
"Payment Initiation"
,
decoration:
BoxDecoration
(
style:
TextStyle
(
color:
Colors
.
white
,
color:
AppColors
.
grey_thick
,
borderRadius:
BorderRadius
.
circular
(
14
),
fontSize:
14
,
fontFamily:
"JakartaMedium"
,
),
),
),
GridView
.
builder
(
shrinkWrap:
true
,
padding:
EdgeInsets
.
only
(
bottom:
0
),
itemCount:
filteredPaymentInitiations
.
length
,
physics:
NeverScrollableScrollPhysics
(),
gridDelegate:
SliverGridDelegateWithMaxCrossAxisExtent
(
childAspectRatio:
1
,
mainAxisExtent:
100
,
maxCrossAxisExtent:
MediaQuery
.
of
(
context
).
size
.
width
*
0.5
,
),
),
child:
Row
(
itemBuilder:
(
context
,
ini
)
{
children:
[
return
InkResponse
(
if
(
provider
onTap:
()
async
{
.
accessiblePagesList
[
index
]
var
navigate
;
.
pageName
==
if
(
ini
==
0
)
{
"Account List"
)
...[
navigate
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
,
)
=>
Allpaymentrequesitionlistsbymodes
(
mode:
"self"
,
pageTitleName:
"Payment Requisition List (Self)"
,
),
),
);
}
else
{
navigate
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Accountslist
(),
),
);
}
},
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
,
horizontal:
15
,
),
margin:
EdgeInsets
.
symmetric
(
vertical:
7
,
horizontal:
5
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Expanded
(
flex:
2
,
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
filteredPaymentInitiations
[
ini
][
'name'
]
??
"-"
,
style:
TextStyle
(
fontSize:
14
,
color:
AppColors
.
app_blue
,
fontFamily:
"JakartaMedium"
,
),
),
Text
(
filteredPaymentInitiations
[
ini
][
'subtitle'
]
??
"-"
,
style:
TextStyle
(
fontSize:
12
,
color:
AppColors
.
grey_semi
,
fontFamily:
"JakartaMedium"
,
),
),
],
),
),
),
SizedBox
(
width:
10
),
Expanded
(
Expanded
(
flex:
1
,
flex:
1
,
child:
SvgPicture
.
asset
(
child:
SvgPicture
.
asset
(
"assets/svg/comm_ic_1.svg"
,
filteredPaymentInitiations
[
ini
][
'icon'
]
??
width:
25
,
""
,
),
),
],
),
),
);
},
),
],
if
(
filteredPaymentAdministrations
.
isNotEmpty
)
...[
Padding
(
padding:
const
EdgeInsets
.
only
(
top:
10
,
bottom:
5
),
child:
Text
(
"Payment Administration"
,
style:
TextStyle
(
color:
AppColors
.
grey_thick
,
fontSize:
14
,
fontFamily:
"JakartaMedium"
,
),
),
),
GridView
.
builder
(
itemCount:
filteredPaymentAdministrations
.
length
,
physics:
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
2
,
childAspectRatio:
2
/
1.1
,
),
itemBuilder:
(
context
,
ad
)
{
return
InkResponse
(
onTap:
()
async
{
var
navigate
;
if
(
ad
==
0
)
{
navigate
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
,
)
=>
Allpaymentrequesitionlistsbymodes
(
mode:
"process"
,
pageTitleName:
"Payment Requisition List (Self)"
,
),
),
);
}
else
if
(
ad
==
1
)
{
navigate
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
,
)
=>
Allpaymentrequesitionlistsbymodes
(
mode:
"admin"
,
pageTitleName:
"Payment Requisition List (Admin)"
,
),
),
);
}
else
if
(
ad
==
2
)
{
navigate
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Paymentreceiptlist
(
pageTitleName:
"Payment Receipt List"
,
),
),
);
}
else
if
(
ad
==
3
)
{
navigate
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Accountledger
(),
),
);
}
else
{
navigate
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Paymentlistpaymentrequisition
(
pageTitleName:
"Payments List"
,
),
),
);
}
},
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
,
horizontal:
15
,
),
margin:
EdgeInsets
.
symmetric
(
vertical:
7
,
horizontal:
5
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Expanded
(
flex:
2
,
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
filteredPaymentAdministrations
[
ad
][
'name'
]
??
"-"
,
style:
TextStyle
(
fontSize:
14
,
color:
AppColors
.
app_blue
,
fontFamily:
"JakartaMedium"
,
),
),
Text
(
filteredPaymentAdministrations
[
ad
][
'subtitle'
]
??
"-"
,
maxLines:
2
,
style:
TextStyle
(
fontSize:
12
,
color:
AppColors
.
grey_semi
,
fontFamily:
"JakartaMedium"
,
),
),
],
),
),
),
),
),
]
else
if
(
provider
SizedBox
(
width:
10
),
.
accessiblePagesList
[
index
]
.
pageName
==
"Account Ledger"
)
...[
Expanded
(
Expanded
(
flex:
1
,
flex:
1
,
child:
SvgPicture
.
asset
(
child:
SvgPicture
.
asset
(
"assets/svg/comm_ic_2.svg"
,
filteredPaymentAdministrations
[
ad
][
'icon'
]
??
width:
25
,
""
,
),
),
),
),
]
else
...[
Expanded
(
flex:
1
,
child:
SvgIcon
),
],
],
Expanded
(
),
flex:
5
,
child:
Text
(
"
${pages[index].pageName}
"
),
),
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/arrow_right_new.svg"
,
),
),
],
),
),
),
);
);
},
},
),
),
],
SizedBox
(
height:
100
,),
// ListView.builder(
// itemCount: pages.length,
// shrinkWrap: true,
// physics: NeverScrollableScrollPhysics(),
// itemBuilder: (context, index) {
// Widget? SvgIcon;
// switch (pages[index].mode) {
// case "apr_lvl1":
// SvgIcon = SvgPicture.asset("assets/svg/fin_lv1.svg");
// break;
// case "apr_lvl2":
// SvgIcon = SvgPicture.asset("assets/svg/fin_lv2.svg");
// break;
// // final icons = ["comm_ic_1", "comm_ic_2"];
// case "self_apr_lvl2":
// SvgIcon = SvgPicture.asset("assets/svg/fin_lv2.svg");
// break;
// default:
// SvgIcon = SvgPicture.asset("assets/svg/fin_ic.svg");
// break;
// }
// return InkResponse(
// onTap: () async {
// var navigate;
// if (pages[index].pageName == "Payments List") {
// navigate = Paymentlistpaymentrequisition(
// pageTitleName:
// provider.accessiblePagesList[index].pageName!,
// );
// } else if (provider
// .accessiblePagesList[index]
// .pageName ==
// "Payment Receipts List") {
// navigate = Paymentreceiptlist(
// pageTitleName:
// provider.accessiblePagesList[index].pageName!,
// );
// } else if (provider
// .accessiblePagesList[index]
// .pageName ==
// "Account List") {
// navigate = Accountslist();
//
// // break;
// } else if (provider
// .accessiblePagesList[index]
// .pageName ==
// "Account Ledger") {
// navigate = Accountledger();
// } else {
// navigate = Allpaymentrequesitionlistsbymodes(
// mode: pages[index].mode!,
// pageTitleName:
// provider.accessiblePagesList[index].pageName!,
// );
// }
// await Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => navigate),
// );
// },
// child: Container(
// margin: EdgeInsets.symmetric(
// horizontal: 5,
// vertical: 5,
// ),
// padding: EdgeInsets.symmetric(
// horizontal: 10,
// vertical: 15,
// ),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(14),
// ),
// child: Row(
// children: [
// if (provider
// .accessiblePagesList[index]
// .pageName ==
// "Account List") ...[
// Expanded(
// flex: 1,
// child: SvgPicture.asset(
// "assets/svg/comm_ic_1.svg",
// width: 25,
// ),
// ),
// ] else if (provider
// .accessiblePagesList[index]
// .pageName ==
// "Account Ledger") ...[
// Expanded(
// flex: 1,
// child: SvgPicture.asset(
// "assets/svg/comm_ic_2.svg",
// width: 25,
// ),
// ),
// ] else ...[
// Expanded(flex: 1, child: SvgIcon),
// ],
// Expanded(
// flex: 5,
// child: Text("${pages[index].pageName}"),
// ),
// Expanded(
// flex: 1,
// child: SvgPicture.asset(
// "assets/svg/arrow_right_new.svg",
// ),
// ),
// ],
// ),
// ),
// );
// },
// ),
],
],
),
),
...
...
lib/screens/
update
d/Homescreen
New
.dart
→
lib/screens/
ol
d/Homescreen
Old
.dart
View file @
c0252747
...
@@ -6,38 +6,25 @@ import 'package:flutter/cupertino.dart';
...
@@ -6,38 +6,25 @@ import 'package:flutter/cupertino.dart';
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_svg/flutter_svg.dart'
;
import
'package:flutter_svg/flutter_svg.dart'
;
import
'package:generp/Notifiers/HomeScreenNotifier.dart'
;
import
'package:generp/Utils/app_colors.dart'
show
AppColors
;
import
'package:generp/Notifiers/LogoutNotifier.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:generp/Notifiers/ProfileNotifier.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/screens/AttendanceScreen.dart'
;
import
'package:generp/screens/screensExports.dart'
;
import
'package:generp/screens/ScannerLogin.dart'
;
import
'package:generp/screens/notifierExports.dart'
;
import
'package:generp/screens/WebERPIOS.dart'
;
import
'package:generp/screens/WebERPScreen.dart'
;
import
'package:generp/screens/WebWhizzdomScreen.dart'
;
import
'package:generp/screens/crm/crmDashboard.dart'
;
import
'package:generp/screens/finance/financeDashboard.dart'
;
import
'package:generp/screens/genTracker/GenTrackerDashboard.dart'
;
import
'package:generp/screens/inventory/InventoryScreen.dart'
;
import
'package:generp/screens/order/orderModuleDashboard.dart'
;
import
'package:generp/screens/serviceEngineer/serviceEngineerDashboard.dart'
;
import
'../../Utils/app_colors.dart'
;
import
'package:geolocator/geolocator.dart'
;
import
'package:geolocator/geolocator.dart'
;
import
'package:provider/provider.dart'
;
import
'package:provider/provider.dart'
;
import
'package:cached_network_image/cached_network_image.dart'
;
import
'package:cached_network_image/cached_network_image.dart'
;
import
'package:location/location.dart'
as
loc
;
import
'package:location/location.dart'
as
loc
;
import
'package:auto_size_text/auto_size_text.dart'
;
import
'package:auto_size_text/auto_size_text.dart'
;
import
'../../Utils/commonServices.dart'
;
class
MyHomePageOld
extends
StatefulWidget
{
const
MyHomePageOld
({
super
.
key
});
class
MyHomePageNew
extends
StatefulWidget
{
const
MyHomePageNew
({
super
.
key
});
@override
@override
State
<
MyHomePage
New
>
createState
()
=>
_MyHomePage
New
State
();
State
<
MyHomePage
Old
>
createState
()
=>
_MyHomePage
Old
State
();
}
}
class
_MyHomePage
New
State
extends
State
<
MyHomePage
New
>
{
class
_MyHomePage
Old
State
extends
State
<
MyHomePage
Old
>
{
Timer
?
timer
;
Timer
?
timer
;
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
...
@@ -47,6 +34,7 @@ class _MyHomePageNewState extends State<MyHomePageNew> {
...
@@ -47,6 +34,7 @@ class _MyHomePageNewState extends State<MyHomePageNew> {
// TODO: implement initState
// TODO: implement initState
_connectivity
.
initialise
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
source
)
{
_connectivity
.
myStream
.
listen
((
source
)
{
setState
(()
=>
_source
=
source
);
setState
(()
=>
_source
=
source
);
});
});
var
prov
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
);
var
prov
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
);
...
@@ -148,50 +136,53 @@ class _MyHomePageNewState extends State<MyHomePageNew> {
...
@@ -148,50 +136,53 @@ class _MyHomePageNewState extends State<MyHomePageNew> {
return
(
connection
==
'Online'
)
return
(
connection
==
'Online'
)
?
Consumer2
<
HomescreenNotifier
,
ProfileNotifer
>(
?
Consumer2
<
HomescreenNotifier
,
ProfileNotifer
>(
builder:
(
context
,
homescreen
,
profile
,
child
)
{
builder:
(
context
,
homescreen
,
profile
,
child
)
{
final
coreRequiredRoles
=
[
"433"
,
"434"
,
"430"
,
"430"
];
// Define the original data
final
requiredRoles
=
[
"430"
,
"430"
,
"431"
,
"431"
];
final
names
=
[
final
coreNames
=
[
"Service"
,
"Gen Tracker"
,
"CRM"
,
"Orders"
];
"Attendance"
,
final
names
=
[
"Attendance"
,
"Finance"
,
"ERP"
,
"Whizzdom"
];
"Finance"
,
final
subtitles
=
[
"CRM"
,
"Check-in,Check-out"
,
"Orders"
,
"Payments, expense tracking"
,
"ERP"
,
"Centralized data and reports"
,
"Service Engineer"
,
"Training, Assessments"
,
"Gen Tracker"
,
];
// "Nearby",
final
coreIcons
=
[
"Inventory"
,
"assets/svg/home/home_service_ic.svg"
,
"Whizzdom"
,
"assets/svg/home/home_gentracker_ic.svg"
,
// "Common",
"assets/svg/home/home_crm_ic.svg"
,
"assets/svg/home/home_order_ic.svg"
,
];
];
final
icons
=
[
final
icons
=
[
"assets/svg/home/home_attendance_ic.svg"
,
"assets/svg/home_icons_1.svg"
,
"assets/svg/home/home_finance_ic.svg"
,
"assets/svg/home_icons_10.svg"
,
"assets/svg/home/home_erp_ic.svg"
,
"assets/svg/home_icons_12.svg"
,
"assets/svg/home/home_whizzdom_ic.svg"
,
"assets/svg/home_icons_11.svg"
,
"assets/svg/home_icons_2.svg"
,
"assets/svg/home_icons_4.svg"
,
"assets/svg/home_icons_31.svg"
,
// "assets/svg/home_icons_5.svg",
"assets/svg/home_icons_6.svg"
,
"assets/svg/home_icons_81.svg"
,
// "assets/svg/home_icons_9.svg",
];
final
requiredRoles
=
[
"430"
,
"430"
,
"430"
,
"430"
,
"431"
,
"433"
,
"434"
,
// "433",
"432"
,
"431"
,
// "430",
];
];
final
coreFilteredItems
=
<
Map
<
String
,
String
>>[];
final
filteredItems
=
<
Map
<
String
,
String
>>[];
for
(
int
j
=
0
;
j
<
names
.
length
;
j
++)
{
if
(
homescreen
.
roleStatus
.
contains
(
requiredRoles
[
j
]))
{
filteredItems
.
add
({
'name'
:
names
[
j
],
'icon'
:
icons
[
j
],
'subtitle'
:
subtitles
[
j
],
});
}
}
for
(
int
i
=
0
;
i
<
coreNames
.
length
;
i
++)
{
final
filteredItems
=
<
Map
<
String
,
String
>>[];
if
(
homescreen
.
roleStatus
.
contains
(
coreRequiredRoles
[
i
]))
{
for
(
int
i
=
0
;
i
<
names
.
length
;
i
++)
{
coreFilteredItems
.
add
({
if
(
homescreen
.
roleStatus
.
contains
(
requiredRoles
[
i
]))
{
'name'
:
coreNames
[
i
],
filteredItems
.
add
({
'name'
:
names
[
i
],
'icon'
:
icons
[
i
]});
'icon'
:
coreIcons
[
i
],
});
}
}
}
}
return
WillPopScope
(
return
WillPopScope
(
onWillPop:
onBackPressed
,
onWillPop:
onBackPressed
,
child:
RefreshIndicator
.
adaptive
(
child:
RefreshIndicator
.
adaptive
(
...
@@ -207,18 +198,14 @@ class _MyHomePageNewState extends State<MyHomePageNew> {
...
@@ -207,18 +198,14 @@ class _MyHomePageNewState extends State<MyHomePageNew> {
child:
Scaffold
(
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
AppBar
(
automaticallyImplyLeading:
false
,
body:
Container
(
toolbarHeight:
0
,
backgroundColor:
Colors
.
white
,
),
body:
SizedBox
(
child:
Column
(
child:
Column
(
children:
[
children:
[
Expanded
(
Expanded
(
flex:
3
,
flex:
4
,
child:
Container
(
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
vertical:
10
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
vertical
(
borderRadius:
BorderRadius
.
vertical
(
...
@@ -237,8 +224,8 @@ class _MyHomePageNewState extends State<MyHomePageNew> {
...
@@ -237,8 +224,8 @@ class _MyHomePageNewState extends State<MyHomePageNew> {
borderRadius:
BorderRadius
.
circular
(
30
),
borderRadius:
BorderRadius
.
circular
(
30
),
gradient:
LinearGradient
(
gradient:
LinearGradient
(
colors:
[
colors:
[
AppColors
.
profile_card
,
AppColors
.
profile_card
_gradient1
,
AppColors
.
profile_card
,
AppColors
.
profile_card
_gradient2
,
],
],
),
),
),
),
...
@@ -247,18 +234,15 @@ class _MyHomePageNewState extends State<MyHomePageNew> {
...
@@ -247,18 +234,15 @@ class _MyHomePageNewState extends State<MyHomePageNew> {
children:
[
children:
[
Expanded
(
Expanded
(
flex:
2
,
flex:
2
,
child:
Padding
(
child:
SizedBox
(
padding:
EdgeInsets
.
symmetric
(
vertical:
15
,
),
child:
Column
(
child:
Column
(
mainAxisAlignment:
mainAxisAlignment:
MainAxisAlignment
.
center
,
MainAxisAlignment
.
center
,
children:
[
children:
[
SizedBox
(
SizedBox
(
width:
6
0
,
width:
6
6
,
height:
6
0
,
height:
6
6
,
child:
ClipRRect
(
child:
ClipRRect
(
borderRadius:
borderRadius:
BorderRadius
.
circular
(
50
),
BorderRadius
.
circular
(
50
),
...
@@ -278,7 +262,7 @@ class _MyHomePageNewState extends State<MyHomePageNew> {
...
@@ -278,7 +262,7 @@ class _MyHomePageNewState extends State<MyHomePageNew> {
),
),
),
),
),
),
Spacer
(),
Row
(
Row
(
mainAxisAlignment:
mainAxisAlignment:
MainAxisAlignment
.
center
,
MainAxisAlignment
.
center
,
...
@@ -313,9 +297,7 @@ class _MyHomePageNewState extends State<MyHomePageNew> {
...
@@ -313,9 +297,7 @@ class _MyHomePageNewState extends State<MyHomePageNew> {
Expanded
(
Expanded
(
flex:
3
,
flex:
3
,
child:
Container
(
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
padding:
EdgeInsets
.
only
(
right:
10
),
vertical:
15
,
),
child:
Column
(
child:
Column
(
crossAxisAlignment:
crossAxisAlignment:
CrossAxisAlignment
.
start
,
CrossAxisAlignment
.
start
,
...
@@ -333,12 +315,12 @@ class _MyHomePageNewState extends State<MyHomePageNew> {
...
@@ -333,12 +315,12 @@ class _MyHomePageNewState extends State<MyHomePageNew> {
// ),
// ),
AutoSizeText
(
AutoSizeText
(
'
${profile.employeeName}
'
,
'
${profile.employeeName}
'
,
maxFontSize:
1
6
,
maxFontSize:
1
8
,
minFontSize:
12
,
minFontSize:
12
,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
1
6
,
fontSize:
1
8
,
color:
AppColors
.
app_blue
,
color:
AppColors
.
app_blue
,
fontFamily:
"Jakarta
SemiBold
"
,
fontFamily:
"Jakarta
Regular
"
,
),
),
maxLines:
2
,
maxLines:
2
,
),
),
...
@@ -370,46 +352,38 @@ class _MyHomePageNewState extends State<MyHomePageNew> {
...
@@ -370,46 +352,38 @@ class _MyHomePageNewState extends State<MyHomePageNew> {
fontSize:
14
,
fontSize:
14
,
),
),
),
),
Spacer
(),
InkResponse
(
InkResponse
(
onTap:
()
{
onTap:
()
{
_showProfileBottomSheet
(
_showProfileBottomSheet
(
context
,
context
,
);
);
},
},
child:
Padding
(
child:
Row
(
padding:
mainAxisAlignment:
const
EdgeInsets
.
symmetric
(
MainAxisAlignment
.
start
,
vertical:
3.0
,
crossAxisAlignment:
),
CrossAxisAlignment
.
center
,
child:
Row
(
children:
[
mainAxisAlignment:
Text
(
MainAxisAlignment
.
start
,
"View Profile"
,
crossAxisAlignment:
style:
TextStyle
(
CrossAxisAlignment
.
center
,
color:
AppColors
.
app_blue
,
children:
[
fontFamily:
Text
(
"JakartaRegular"
,
"View Profile"
,
fontSize:
14
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontFamily:
"JakartaRegular"
,
fontSize:
14
,
),
),
),
SizedBox
(
width:
5
),
),
SizedBox
(
SizedBox
(
width:
5
),
width:
13
,
SizedBox
(
height
:
1
3
,
width
:
1
5
,
child:
Center
(
height:
15
,
child:
SvgPicture
.
asset
(
child:
Center
(
"assets/svg/next_button.svg"
,
child:
SvgPicture
.
asset
(
)
,
"assets/svg/next_button.svg"
,
),
),
),
),
]
,
)
,
)
,
]
,
),
),
),
),
],
],
...
@@ -424,644 +398,219 @@ class _MyHomePageNewState extends State<MyHomePageNew> {
...
@@ -424,644 +398,219 @@ class _MyHomePageNewState extends State<MyHomePageNew> {
Expanded
(
Expanded
(
flex:
10
,
flex:
10
,
child:
Container
(
child:
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
padding:
EdgeInsets
.
only
(
child:
Column
(
left:
20
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
right:
20
,
children:
[
top:
0
,
if
(
coreFilteredItems
.
isNotEmpty
)
...[
bottom:
10
,
Padding
(
),
padding:
const
EdgeInsets
.
only
(
margin:
EdgeInsets
.
only
(
top:
10
),
top:
10
,
child:
GridView
.
builder
(
bottom:
5
,
itemCount:
filteredItems
.
length
,
),
gridDelegate:
child:
Text
(
SliverGridDelegateWithFixedCrossAxisCount
(
"Core Functionalities"
,
crossAxisCount:
2
,
style:
TextStyle
(
crossAxisSpacing:
10
,
color:
AppColors
.
grey_thick
,
mainAxisSpacing:
10
,
fontSize:
14
,
),
fontFamily:
"JakartaMedium"
,
itemBuilder:
(
context
,
index
)
{
),
final
item
=
filteredItems
[
index
];
),
return
InkResponse
(
),
onTap:
()
async
{
Container
(
var
res
;
padding:
EdgeInsets
.
symmetric
(
switch
(
item
[
'name'
])
{
vertical:
10
,
case
"Attendance"
:
horizontal:
15
,
res
=
await
Navigator
.
push
(
),
context
,
decoration:
BoxDecoration
(
MaterialPageRoute
(
color:
Colors
.
white
,
builder:
borderRadius:
BorderRadius
.
circular
(
14
),
(
context
)
=>
),
AttendanceScreen
(),
child:
Row
(
settings:
RouteSettings
(
mainAxisAlignment:
arguments:
'AttendanceScreen'
,
MainAxisAlignment
.
center
,
children:
List
.
generate
(
4
,
(
ic
)
{
return
Expanded
(
child:
InkResponse
(
onTap:
()
async
{
var
res
;
switch
(
coreFilteredItems
[
ic
][
'name'
])
{
case
"Gen Tracker"
:
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Gentrackerdashboard
(),
settings:
RouteSettings
(
arguments:
'Gentrackerdashboard'
,
),
),
);
break
;
case
"Service"
:
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Serviceengineerdashboard
(),
),
);
break
;
case
"Orders"
:
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Ordermoduledashboard
(),
),
);
case
"CRM"
:
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
CrmdashboardScreen
(),
settings:
RouteSettings
(
name:
'CrmdashboardScreen'
,
),
),
);
default
:
print
(
"111"
);
break
;
}
if
(
res
==
true
)
{
homescreen
.
DashboardApiFunction
(
context
,
);
}
},
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SvgPicture
.
asset
(
coreFilteredItems
[
ic
][
'icon'
]
??
"-"
,
),
SizedBox
(
height:
10
),
Text
(
coreFilteredItems
[
ic
][
'name'
]
??
"-"
,
maxLines:
2
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
12
,
fontFamily:
"JakartaMedium"
,
),
),
],
),
),
),
),
),
);
);
}),
break
;
),
case
"ERP"
:
),
bool
isGpsEnabled
=
],
await
Geolocator
.
isLocationServiceEnabled
();
if
(
isGpsEnabled
)
{
if
(
homescreen
.
roleStatus
.
contains
(
if
(
Platform
.
isAndroid
)
{
"432"
,
res
=
await
Navigator
.
push
(
))
...[
context
,
Padding
(
MaterialPageRoute
(
padding:
const
EdgeInsets
.
only
(
builder:
top:
10
,
(
context
)
=>
WebErpScreen
(
bottom:
5
,
erp_url:
),
homescreen
child:
Text
(
.
webPageUrl
,
"Inventory Management"
,
),
style:
TextStyle
(
),
color:
AppColors
.
grey_thick
,
);
fontSize:
14
,
}
else
{
fontFamily:
"JakartaMedium"
,
res
=
await
Navigator
.
push
(
),
context
,
),
MaterialPageRoute
(
),
builder:
InkResponse
(
(
context
)
=>
WebERPIOS
(
onTap:
()
async
{
url:
var
res
=
await
Navigator
.
push
(
homescreen
context
,
.
webPageUrl
,
MaterialPageRoute
(
),
builder:
),
(
context
)
=>
InventoryScreen
(),
);
),
}
);
}
else
{
if
(
res
==
true
)
{
requestGpsPermission
();
homescreen
.
DashboardApiFunction
(
}
break
;
case
"Gen Tracker"
:
res
=
await
Navigator
.
push
(
context
,
context
,
);
MaterialPageRoute
(
}
builder:
},
(
context
)
=>
child:
Container
(
Gentrackerdashboard
(),
padding:
EdgeInsets
.
symmetric
(
settings:
RouteSettings
(
vertical:
15
,
arguments:
horizontal:
15
,
'Gentrackerdashboard'
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
,
),
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/home/home_inventory_ic.svg"
,
),
),
),
),
SizedBox
(
width:
10
),
);
Expanded
(
break
;
flex:
5
,
case
"Service Engineer"
:
child:
SizedBox
(
res
=
await
Navigator
.
push
(
child:
Column
(
context
,
crossAxisAlignment:
MaterialPageRoute
(
CrossAxisAlignment
.
start
,
builder:
children:
[
(
context
)
=>
Text
(
Serviceengineerdashboard
(),
"Inventory"
,
style:
TextStyle
(
fontSize:
14
,
color:
AppColors
.
app_blue
,
fontFamily:
"JakartaMedium"
,
),
),
Text
(
"Stock Management, Evaluations"
,
style:
TextStyle
(
fontSize:
14
,
color:
AppColors
.
grey_semi
,
fontFamily:
"JakartaMedium"
,
),
),
],
),
),
),
),
],
);
),
break
;
),
case
"Nearby"
:
),
res
=
await
Navigator
.
push
(
],
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Nearbygenerators
(),
),
);
if
(
filteredItems
.
isNotEmpty
)
...[
break
;
Padding
(
case
"Inventory"
:
padding:
const
EdgeInsets
.
only
(
res
=
await
Navigator
.
push
(
top:
10
,
context
,
bottom:
5
,
MaterialPageRoute
(
),
builder:
child:
Text
(
(
context
)
=>
"Workforce & Operations"
,
InventoryScreen
(),
style:
TextStyle
(
),
color:
AppColors
.
grey_thick
,
);
fontSize:
14
,
break
;
fontFamily:
"JakartaMedium"
,
case
"Whizzdom"
:
),
bool
isGpsEnabled
=
),
await
Geolocator
.
isLocationServiceEnabled
();
),
if
(
isGpsEnabled
)
{
Expanded
(
res
=
await
Navigator
.
push
(
child:
GridView
.
builder
(
context
,
itemCount:
filteredItems
.
length
,
MaterialPageRoute
(
gridDelegate:
builder:
SliverGridDelegateWithFixedCrossAxisCount
(
(
crossAxisCount:
2
,
childAspectRatio:
2
/
1.1
,
),
itemBuilder:
(
context
,
ci
)
{
return
InkResponse
(
onTap:
()
async
{
var
res
;
switch
(
filteredItems
[
ci
][
'name'
])
{
case
"Attendance"
:
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
AttendanceScreen
(),
settings:
RouteSettings
(
arguments:
'AttendanceScreen'
,
),
),
);
break
;
case
"ERP"
:
bool
isGpsEnabled
=
await
Geolocator
.
isLocationServiceEnabled
();
if
(
isGpsEnabled
)
{
if
(
Platform
.
isAndroid
)
{
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
,
)
=>
WebErpScreen
(
erp_url:
homescreen
.
webPageUrl
,
),
),
);
}
else
{
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
,
)
=>
WebERPIOS
(
url:
homescreen
.
webPageUrl
,
),
),
);
}
}
else
{
requestGpsPermission
();
}
break
;
case
"Whizzdom"
:
bool
isGpsEnabled
=
await
Geolocator
.
isLocationServiceEnabled
();
if
(
isGpsEnabled
)
{
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
,
)
=>
WebWhizzdomScreen
(
whizzdom_url:
homescreen
.
whizzdomPageUrl
,
),
),
);
}
else
{
requestGpsPermission
();
}
break
;
case
"Finance"
:
res
=
await
Navigator
.
push
(
context
,
context
,
MaterialPageRoute
(
)
=>
WebWhizzdomScreen
(
builder:
whizzdom_url:
(
context
)
=>
homescreen
Financedashboard
(),
.
whizzdomPageUrl
,
settings:
RouteSettings
(
),
arguments:
'Financedashboard'
,
),
),
);
break
;
default
:
print
(
"111"
);
break
;
}
if
(
res
==
true
)
{
homescreen
.
DashboardApiFunction
(
context
,
);
}
},
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
,
horizontal:
15
,
),
margin:
EdgeInsets
.
symmetric
(
vertical:
7
,
horizontal:
5
,
),
),
decoration:
BoxDecoration
(
);
color:
Colors
.
white
,
}
else
{
borderRadius:
requestGpsPermission
();
BorderRadius
.
circular
(
14
),
}
break
;
case
"Common"
:
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Commondashboard
(),
),
);
break
;
case
"Finance"
:
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Financedashboard
(),
settings:
RouteSettings
(
arguments:
'Financedashboard'
,
),
),
child:
Row
(
),
mainAxisAlignment:
);
MainAxisAlignment
.
center
,
break
;
crossAxisAlignment:
case
"Orders"
:
CrossAxisAlignment
.
center
,
res
=
await
Navigator
.
push
(
children:
[
context
,
Expanded
(
MaterialPageRoute
(
flex:
2
,
builder:
child:
SizedBox
(
(
context
)
=>
child:
Column
(
Ordermoduledashboard
(),
crossAxisAlignment:
),
CrossAxisAlignment
);
.
start
,
case
"CRM"
:
mainAxisAlignment:
res
=
await
Navigator
.
push
(
MainAxisAlignment
context
,
.
center
,
MaterialPageRoute
(
children:
[
builder:
Text
(
(
context
)
=>
filteredItems
[
ci
][
'name'
]
??
CrmdashboardScreen
(),
"-"
,
settings:
RouteSettings
(
style:
TextStyle
(
name:
'CrmdashboardScreen'
,
fontSize:
14
,
color:
AppColors
.
app_blue
,
fontFamily:
"JakartaMedium"
,
),
),
Text
(
filteredItems
[
ci
][
'subtitle'
]
??
"-"
,
style:
TextStyle
(
fontSize:
12
,
color:
AppColors
.
grey_semi
,
fontFamily:
"JakartaMedium"
,
),
),
],
),
),
),
SizedBox
(
width:
10
),
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
filteredItems
[
ci
][
'icon'
]
??
"-"
,
),
),
],
),
),
),
),
);
);
},
default
:
print
(
"111"
);
break
;
}
if
(
res
==
true
)
{
homescreen
.
DashboardApiFunction
(
context
,
);
}
},
child:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
30
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SvgPicture
.
asset
(
item
[
'icon'
]!,
height:
45
,
),
SizedBox
(
height:
10
),
Text
(
item
[
'name'
]!),
],
),
),
),
),
],
);
]
,
}
,
),
),
),
),
),
),
// Expanded(
// flex: 10,
// child: Container(
// padding: EdgeInsets.only(
// left: 20,
// right: 20,
// top: 0,
// bottom: 10,
// ),
// margin: EdgeInsets.only(top: 10),
// child: GridView.builder(
// itemCount: filteredItems.length,
// gridDelegate:
// SliverGridDelegateWithFixedCrossAxisCount(
// crossAxisCount: 2,
// crossAxisSpacing: 10,
// mainAxisSpacing: 10,
// ),
// itemBuilder: (context, index) {
// final item = filteredItems[index];
// return InkResponse(
// onTap: () async {
// var res;
// switch (item['name']) {
// case "Attendance":
// res = await Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) =>
// AttendanceScreen(),
// settings: RouteSettings(
// arguments: 'AttendanceScreen',
// ),
// ),
// );
// break;
// case "ERP":
// bool isGpsEnabled =
// await Geolocator.isLocationServiceEnabled();
// if (isGpsEnabled) {
// if (Platform.isAndroid) {
// res = await Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) => WebErpScreen(
// erp_url:
// homescreen
// .webPageUrl,
// ),
// ),
// );
// } else {
// res = await Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) => WebERPIOS(
// url:
// homescreen
// .webPageUrl,
// ),
// ),
// );
// }
// } else {
// requestGpsPermission();
// }
//
// break;
// case "Gen Tracker":
// res = await Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) =>
// Gentrackerdashboard(),
// settings: RouteSettings(
// arguments:
// 'Gentrackerdashboard',
// ),
// ),
// );
// break;
// case "Service Engineer":
// res = await Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) =>
// Serviceengineerdashboard(),
// ),
// );
// break;
// case "Nearby":
// res = await Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) =>
// Nearbygenerators(),
// ),
// );
//
// break;
// case "Inventory":
// res = await Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) =>
// InventoryScreen(),
// ),
// );
// break;
// case "Whizzdom":
// bool isGpsEnabled =
// await Geolocator.isLocationServiceEnabled();
// if (isGpsEnabled) {
// res = await Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (
// context,
// ) => WebWhizzdomScreen(
// whizzdom_url:
// homescreen
// .whizzdomPageUrl,
// ),
// ),
// );
// } else {
// requestGpsPermission();
// }
// break;
// case "Common":
// res = await Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) =>
// Commondashboard(),
// ),
// );
// break;
// case "Finance":
// res = await Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) =>
// Financedashboard(),
// settings: RouteSettings(
// arguments: 'Financedashboard',
// ),
// ),
// );
// break;
// case "Orders":
// res = await Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) =>
// Ordermoduledashboard(),
// ),
// );
// case "CRM":
// res = await Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) =>
// CrmdashboardScreen(),
// settings: RouteSettings(
// name: 'CrmdashboardScreen',
// ),
// ),
// );
// default:
// print("111");
// break;
// }
// if (res == true) {
// homescreen.DashboardApiFunction(
// context,
// );
// }
// },
// child: Container(
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(30),
// ),
// child: Column(
// crossAxisAlignment:
// CrossAxisAlignment.center,
// mainAxisAlignment:
// MainAxisAlignment.center,
// children: [
// SvgPicture.asset(
// item['icon']!,
// height: 45,
// ),
// SizedBox(height: 10),
// Text(item['name']!),
// ],
// ),
// ),
// );
// },
// ),
// ),
// ),
],
],
),
),
),
),
...
...
lib/screens/
update
d/crmDashboard
Update
d.dart
→
lib/screens/
ol
d/crmDashboard
ol
d.dart
View file @
c0252747
import
'dart:io'
;
import
'dart:io'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:dotted_line/dotted_line.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:flutter_svg/svg.dart'
;
...
@@ -14,14 +13,14 @@ import '../../Utils/app_colors.dart';
...
@@ -14,14 +13,14 @@ import '../../Utils/app_colors.dart';
import
'../../Utils/commonServices.dart'
;
import
'../../Utils/commonServices.dart'
;
import
'../../Utils/commonWidgets.dart'
;
import
'../../Utils/commonWidgets.dart'
;
class
CrmdashboardScreen
Updated
extends
StatefulWidget
{
class
CrmdashboardScreen
extends
StatefulWidget
{
const
CrmdashboardScreen
Updated
({
super
.
key
});
const
CrmdashboardScreen
({
super
.
key
});
@override
@override
State
<
CrmdashboardScreen
Updated
>
createState
()
=>
_CrmdashboardScreen
Updated
State
();
State
<
CrmdashboardScreen
>
createState
()
=>
_CrmdashboardScreenState
();
}
}
class
_CrmdashboardScreen
Updated
State
extends
State
<
CrmdashboardScreen
Updated
>
{
class
_CrmdashboardScreenState
extends
State
<
CrmdashboardScreen
>
{
FocusNode
focusNode
=
FocusNode
();
FocusNode
focusNode
=
FocusNode
();
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
...
@@ -88,7 +87,7 @@ class _CrmdashboardScreenUpdatedState extends State<CrmdashboardScreenUpdated> {
...
@@ -88,7 +87,7 @@ class _CrmdashboardScreenUpdatedState extends State<CrmdashboardScreenUpdated> {
backgroundColor:
AppColors
.
scaffold_bg_color
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
AppBar
(
appBar:
AppBar
(
automaticallyImplyLeading:
false
,
automaticallyImplyLeading:
false
,
//
elevation: 2.0,
elevation:
2.0
,
title:
SizedBox
(
title:
SizedBox
(
child:
Row
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
...
@@ -97,11 +96,10 @@ class _CrmdashboardScreenUpdatedState extends State<CrmdashboardScreenUpdated> {
...
@@ -97,11 +96,10 @@ class _CrmdashboardScreenUpdatedState extends State<CrmdashboardScreenUpdated> {
InkResponse
(
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
child:
SvgPicture
.
asset
(
"assets/svg/appbar_back
_button
.svg"
,
"assets/svg/app
_
bar_back.svg"
,
height:
25
,
height:
25
,
),
),
),
),
SizedBox
(
width:
10
),
InkResponse
(
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
Text
(
child:
Text
(
...
@@ -119,53 +117,75 @@ class _CrmdashboardScreenUpdatedState extends State<CrmdashboardScreenUpdated> {
...
@@ -119,53 +117,75 @@ class _CrmdashboardScreenUpdatedState extends State<CrmdashboardScreenUpdated> {
),
),
bottom:
PreferredSize
(
bottom:
PreferredSize
(
preferredSize:
Size
.
fromHeight
(
50
),
preferredSize:
Size
.
fromHeight
(
50
),
child:
InkResponse
(
child:
Container
(
onTap:
()
{
padding:
const
EdgeInsets
.
fromLTRB
(
5.0
,
0.0
,
10
,
0
),
print
(
"Tap"
);
margin:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
10
),
Navigator
.
push
(
height:
50
,
context
,
alignment:
Alignment
.
center
,
MaterialPageRoute
(
decoration:
BoxDecoration
(
builder:
color:
AppColors
.
text_field_color
,
(
context
)
=>
Universalsearchscreen
(
borderRadius:
BorderRadius
.
circular
(
14
),
text:
provider
.
searchController
.
text
,
border:
),
focusNode
.
hasFocus
settings:
RouteSettings
(
name:
'SearchScreen'
),
?
Border
.
all
(
color:
AppColors
.
app_blue
)
),
:
null
,
);
),
},
child:
Row
(
child:
Container
(
children:
[
padding:
const
EdgeInsets
.
fromLTRB
(
5.0
,
0.0
,
10
,
0
),
Expanded
(
margin:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
10
),
child:
Container
(
height:
50
,
padding:
const
EdgeInsets
.
fromLTRB
(
0.0
,
0.0
,
10
,
0
),
alignment:
Alignment
.
center
,
margin:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
10
),
decoration:
BoxDecoration
(
child:
TextFormField
(
color:
AppColors
.
text_field_color
,
controller:
provider
.
searchController
,
borderRadius:
BorderRadius
.
circular
(
14
),
keyboardType:
TextInputType
.
text
,
),
maxLines:
1
,
child:
Row
(
children:
[
onChanged:
(
value
)
{},
Expanded
(
focusNode:
focusNode
,
child:
Container
(
onTapUpOutside:
(
event
)
{
alignment:
Alignment
.
centerLeft
,
focusNode
.
unfocus
();
padding:
const
EdgeInsets
.
fromLTRB
(
0.0
,
0.0
,
10
,
0
),
},
margin:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
10
),
child:
Text
(
"Search"
,
style:
TextStyle
(
textInputAction:
TextInputAction
.
done
,
color:
AppColors
.
grey_thick
,
onEditingComplete:
()
{
fontSize:
14
Navigator
.
push
(
),),
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Universalsearchscreen
(
text:
provider
.
searchController
.
text
,
),
settings:
RouteSettings
(
name:
'SearchScreen'
),
),
);
},
decoration:
InputDecoration
(
counterText:
""
,
hintText:
"Search"
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFFB4BEC0
),
fontSize:
14
,
),
enabled:
true
,
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
),
),
),
),
),
SvgPicture
.
asset
(
"assets/svg/search_ic.svg"
),
),
]
,
SvgPicture
.
asset
(
"assets/svg/search_ic.svg"
)
,
)
,
]
,
),
),
),
),
),
),
//
shape: RoundedRectangleBorder(
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:
SingleChildScrollView
(
physics:
AlwaysScrollableScrollPhysics
(),
physics:
AlwaysScrollableScrollPhysics
(),
...
@@ -174,14 +194,12 @@ class _CrmdashboardScreenUpdatedState extends State<CrmdashboardScreenUpdated> {
...
@@ -174,14 +194,12 @@ class _CrmdashboardScreenUpdatedState extends State<CrmdashboardScreenUpdated> {
if
(
provider
.
allLeads
.
length
>
0
)
...[
if
(
provider
.
allLeads
.
length
>
0
)
...[
Container
(
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
margin:
EdgeInsets
.
only
(
bottom
:
10
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical
:
10
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
vertical
(
borderRadius:
BorderRadius
.
circular
(
16
),
bottom:
Radius
.
circular
(
16
),
),
),
),
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.2
5
,
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.2
8
,
child:
GridView
.
builder
(
child:
GridView
.
builder
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
0
,
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
0
,
vertical:
5
),
itemCount:
provider
.
allLeads
.
length
,
itemCount:
provider
.
allLeads
.
length
,
...
@@ -192,33 +210,18 @@ class _CrmdashboardScreenUpdatedState extends State<CrmdashboardScreenUpdated> {
...
@@ -192,33 +210,18 @@ class _CrmdashboardScreenUpdatedState extends State<CrmdashboardScreenUpdated> {
crossAxisCount:
2
,
crossAxisCount:
2
,
crossAxisSpacing:
10
,
crossAxisSpacing:
10
,
mainAxisSpacing:
10
,
mainAxisSpacing:
10
,
childAspectRatio:
55
/
100
,
childAspectRatio:
0.65
,
),
),
itemBuilder:
(
context
,
jndex
)
{
itemBuilder:
(
context
,
jndex
)
{
final
icons
=
[
"comm_ic_1"
,
"comm_ic_2"
];
final
icons
=
[
"comm_ic_1"
,
"comm_ic_2"
];
final
leadTitles
=
[
final
leadTitles
=
[
'Open Leads'
,
'Hot Leads'
,
'Quotation Generated'
,
'Cold Leads'
,
'Pending Tasks'
,
'Today Visits'
,
'Today Calls'
,
'Hot Leads'
'Cold Leads'
,
'Warm Leads'
,
'Warm Leads'
,
// 'Total Leads',
'Total Leads'
,
// 'Order Lost',
'Order Lost'
,
// 'No Requirement',
'No Requirement'
,
// 'Open Enquiries',
'Open Enquiries'
,
];
final
assetNames
=
[
"assets/svg/crm/open_leads_ic.svg"
,
"assets/svg/crm/quotes_generated_ic.svg"
,
"assets/svg/crm/pending_tasks_ic.svg"
,
"assets/svg/crm/today_visits_ic.svg"
,
"assets/svg/crm/today_calls_ic.svg"
,
"assets/svg/crm/hot_leads_ic.svg"
,
"assets/svg/crm/cold_leads_ic.svg"
,
"assets/svg/crm/warm_leads_ic.svg"
,
];
];
final
colors
=
[
final
colors
=
[
0xFFE7FFE5
,
0xFFE7FFE5
,
...
@@ -240,7 +243,6 @@ class _CrmdashboardScreenUpdatedState extends State<CrmdashboardScreenUpdated> {
...
@@ -240,7 +243,6 @@ class _CrmdashboardScreenUpdatedState extends State<CrmdashboardScreenUpdated> {
0xFF605C00
,
0xFF605C00
,
0xFF91481B
,
0xFF91481B
,
];
];
return
InkResponse
(
return
InkResponse
(
onTap:
()
async
{
onTap:
()
async
{
if
(
provider
.
allLeads
[
jndex
].
filter
!.
pageName
!=
if
(
provider
.
allLeads
[
jndex
].
filter
!.
pageName
!=
...
@@ -274,40 +276,23 @@ class _CrmdashboardScreenUpdatedState extends State<CrmdashboardScreenUpdated> {
...
@@ -274,40 +276,23 @@ class _CrmdashboardScreenUpdatedState extends State<CrmdashboardScreenUpdated> {
padding:
EdgeInsets
.
symmetric
(
horizontal:
13
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
13
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
Color
(
colors
[
jndex
]),
color:
Color
(
colors
[
jndex
]),
borderRadius:
BorderRadius
.
circular
(
2
0
),
borderRadius:
BorderRadius
.
circular
(
1
2
),
),
),
child:
Column
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
children:
[
Text
(
Text
(
provider
.
allLeads
[
jndex
].
count
.
toString
()
,
provider
.
allLeads
[
jndex
].
count
!
,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
2
0
,
fontSize:
3
0
,
fontFamily:
"JakartaMedium"
,
fontFamily:
"JakartaMedium"
,
color:
Color
(
textcolors
[
jndex
]),
color:
Color
(
textcolors
[
jndex
]),
),
),
),
),
Row
(
Text
(
children:
[
leadTitles
[
jndex
],
Expanded
(
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
flex:
3
,
child:
Text
(
leadTitles
[
jndex
],
style:
TextStyle
(
fontSize:
14
,
fontFamily:
"JakartaRegular"
,
color:
AppColors
.
semi_black
,
),
),
),
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
assetNames
[
jndex
],
),
),
],
),
),
],
],
),
),
...
@@ -317,432 +302,203 @@ class _CrmdashboardScreenUpdatedState extends State<CrmdashboardScreenUpdated> {
...
@@ -317,432 +302,203 @@ class _CrmdashboardScreenUpdatedState extends State<CrmdashboardScreenUpdated> {
),
),
),
),
],
],
ListView
.
builder
(
physics:
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
),
itemCount:
gridPages
.
length
,
itemBuilder:
(
context
,
index
)
{
// final icons = ["comm_ic_1", "comm_ic_2"];
Widget
?
SvgIcon
;
// ListView.builder(
if
(
gridPages
[
index
].
pageName
!.
contains
(
"Lead List"
))
{
// physics: NeverScrollableScrollPhysics(),
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_lv1.svg"
);
// shrinkWrap: true,
}
else
if
(
gridPages
[
index
].
pageName
==
"Nearby Leads"
)
{
// padding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
SvgIcon
=
SvgPicture
.
asset
(
// itemCount: gridPages.length,
"assets/svg/home_icons_5.svg"
,
// itemBuilder: (context, index) {
height:
18
,
// // final icons = ["comm_ic_1", "comm_ic_2"];
width:
18
,
// Widget? SvgIcon;
);
//
}
else
{
// if (gridPages[index].pageName!.contains("Lead List")) {
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_ic.svg"
);
// SvgIcon = SvgPicture.asset("assets/svg/fin_lv1.svg");
}
// } else if (gridPages[index].pageName == "Nearby Leads") {
return
InkResponse
(
// SvgIcon = SvgPicture.asset(
onTap:
()
{
// "assets/svg/home_icons_5.svg",
print
(
gridPages
[
index
].
pageName
!);
// height: 18,
if
(
gridPages
[
index
].
pageName
!.
contains
(
"Lead List"
))
{
// width: 18,
Navigator
.
push
(
// );
context
,
// } else {
MaterialPageRoute
(
// SvgIcon = SvgPicture.asset("assets/svg/fin_ic.svg");
builder:
// }
(
context
)
=>
Leadlistbymode
(
// return InkResponse(
mode:
gridPages
[
index
].
mode
,
// onTap: () {
pageTitleName:
gridPages
[
index
].
pageName
,
// print(gridPages[index].pageName!);
// if (gridPages[index].pageName!.contains("Lead List")) {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) => Leadlistbymode(
// mode: gridPages[index].mode,
// pageTitleName: gridPages[index].pageName,
// ),
// ),
// );
// } else if (gridPages[index].pageName!.contains(
// "Account List",
// )) {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) => ProspectListByMode(
// mode: gridPages[index].mode,
// pageTitleName: gridPages[index].pageName,
// ),
// ),
// );
// } else if (gridPages[index].pageName ==
// "Nearby Leads") {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => NearbyOpenLeads(),
// ),
// );
// }
// // switch (gridPages[index].pageName!) {
// // case "Lead List":
// // Navigator.push(
// // context,
// // MaterialPageRoute(builder: (context) => Leadlistbymode()),
// // );
// // break;
// // case "Prospect List":
// // // Navigator.push(
// // // context,
// // // MaterialPageRoute(builder: (context) => Accountledger()),
// // // );
// // break;
// //
// // default:
// // print("111");
// // break;
// // }
// },
// child: Container(
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(14),
// ),
// margin: EdgeInsets.symmetric(
// horizontal: 5,
// vertical: 5,
// ),
// padding: EdgeInsets.symmetric(
// horizontal: 10,
// vertical: 15,
// ),
// child: Row(
// children: [
// Expanded(flex: 1, child: SvgIcon),
//
// Expanded(
// flex: 5,
// child: Text(
// "${gridPages[index].pageName}",
// style: TextStyle(fontSize: 14),
// ),
// ),
// Expanded(
// flex: 1,
// child: SvgPicture.asset(
// "assets/svg/arrow_right_new.svg",
// ),
// ),
// ],
// ),
// ),
// );
// },
// ),
Container
(
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.2
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
Row
(
children:
[
Expanded
(
child:
Column
(
children:
[
Expanded
(
child:
InkResponse
(
onTap:
()
{},
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
5
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Row
(
children:
[
Expanded
(
flex:
2
,
child:
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Leadlistbymode
(
mode:
"executive"
,
pageTitleName:
"Lead List"
,
),
),
);
},
child:
Container
(
padding:
EdgeInsets
.
only
(
top:
15
,
left:
10
,
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"Lead List"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
14
,
),
),
Text
(
"Product and
\n
service orders"
,
style:
TextStyle
(
color:
AppColors
.
grey_semi
,
fontSize:
12
,
),
),
],
),
),
),
),
Expanded
(
child:
SvgPicture
.
asset
(
"assets/svg/crm/lead_list_ic.svg"
,
),
),
],
),
),
),
),
),
),
SizedBox
(
height:
10
),
);
Expanded
(
}
else
if
(
gridPages
[
index
].
pageName
!.
contains
(
child:
InkResponse
(
"Account List"
,
child:
Container
(
))
{
padding:
EdgeInsets
.
symmetric
(
horizontal:
5
),
Navigator
.
push
(
decoration:
BoxDecoration
(
context
,
color:
Colors
.
white
,
MaterialPageRoute
(
borderRadius:
BorderRadius
.
circular
(
20
),
builder:
),
(
context
)
=>
ProspectListByMode
(
child:
Row
(
mode:
gridPages
[
index
].
mode
,
children:
[
pageTitleName:
gridPages
[
index
].
pageName
,
Expanded
(
flex:
2
,
child:
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
ProspectListByMode
(
mode:
"executive"
,
pageTitleName:
"Account List"
,
),
),
);
},
child:
Container
(
padding:
EdgeInsets
.
only
(
top:
15
,
left:
10
,
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"Account List"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
14
,
),
),
Text
(
"Assigned agents,
\n
performance"
,
style:
TextStyle
(
color:
AppColors
.
grey_semi
,
fontSize:
12
,
),
),
],
),
),
),
),
Expanded
(
child:
SvgPicture
.
asset
(
"assets/svg/crm/account_list_ic.svg"
,
),
),
],
),
),
),
),
),
),
],
);
}
else
if
(
gridPages
[
index
].
pageName
==
"Nearby Leads"
)
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
NearbyOpenLeads
(),
),
);
}
// switch (gridPages[index].pageName!) {
// case "Lead List":
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => Leadlistbymode()),
// );
// break;
// case "Prospect List":
// // Navigator.push(
// // context,
// // MaterialPageRoute(builder: (context) => Accountledger()),
// // );
// break;
//
// default:
// print("111");
// break;
// }
},
child:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
),
),
margin:
EdgeInsets
.
symmetric
(
SizedBox
(
width:
10
),
horizontal:
5
,
Expanded
(
vertical:
5
,
child:
InkResponse
(
),
onTap:
()
{},
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
child:
Row
(
children:
[
Expanded
(
flex:
1
,
child:
SvgIcon
),
child:
Container
(
Expanded
(
padding:
EdgeInsets
.
symmetric
(
flex:
5
,
horizontal:
15
,
child:
Text
(
vertical:
15
,
"
${gridPages[index].pageName}
"
,
),
style:
TextStyle
(
fontSize:
14
),
decoration:
BoxDecoration
(
),
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
),
child:
Column
(
Expanded
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
flex:
1
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
child:
SvgPicture
.
asset
(
children:
[
"assets/svg/arrow_right_new.svg"
,
Expanded
(
),
child:
Row
(
children:
[
Expanded
(
child:
Text
(
"Appointment"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
14
,
),
),
),
],
),
),
Text
(
"Records,
\n
Ledger"
,
style:
TextStyle
(
color:
AppColors
.
grey_semi
,
fontSize:
12
,
),
),
Spacer
(),
Expanded
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
end
,
crossAxisAlignment:
CrossAxisAlignment
.
end
,
children:
[
SvgPicture
.
asset
(
"assets/svg/crm/appointment_calendar_ic.svg"
,
),
],
),
),
],
),
),
)
,
]
,
),
),
),
),
],
);
)
,
}
,
),
),
if
(
provider
.
pendingTasksLists
.
length
>
0
)
...[
if
(
provider
.
pendingTasksLists
.
length
>
0
)
...[
Align
(
Align
(
alignment:
Alignment
.
centerLeft
,
alignment:
Alignment
.
centerLeft
,
child:
Padding
(
child:
Padding
(
padding:
EdgeInsets
.
only
(
left:
15
,
top:
10
,
right:
15
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
6
),
child:
Row
(
child:
Text
(
children:
[
"Pending Tasks"
,
Text
(
style:
TextStyle
(
"Pending Tasks"
,
fontSize:
16
,
style:
TextStyle
(
color:
AppColors
.
grey_semi
,
fontSize:
16
,
),
color:
AppColors
.
grey_semi
,
),
),
if
(
provider
.
pendingTasksLists
.
length
>
5
)
...[
Spacer
(),
SizedBox
(
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Text
(
"View All"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
app_blue
,
),
),
SizedBox
(
width:
5
),
SvgPicture
.
asset
(
"assets/svg/next_button.svg"
,
),
],
),
),
],
],
),
),
),
),
),
),
Container
(
Container
(
width:
double
.
infinity
,
width:
double
.
infinity
,
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.34
,
child:
ListView
.
builder
(
child:
ListView
.
builder
(
physics:
AlwaysScrollableScrollPhysics
(),
physics:
AlwaysScrollableScrollPhysics
(),
shrinkWrap:
true
,
shrinkWrap:
true
,
scrollDirection:
Axis
.
horizontal
,
padding:
EdgeInsets
.
symmetric
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
,
vertical:
10
,
horizontal:
10
,
horizontal:
10
,
),
),
itemCount:
provider
.
pendingTasksLists
.
length
,
itemCount:
provider
.
pendingTasksLists
.
length
,
itemBuilder:
(
context
,
index
)
{
itemBuilder:
(
context
,
index
)
{
final
headings
=
[
"Lead Name"
,
"Mobile Number"
,
"Appointment Date"
,
"Appointment Type"
,
"Note"
,
"Status"
,
];
final
subHeadings
=
[
final
subHeadings
=
[
provider
.
pendingTasksLists
[
index
].
aname
??
"-"
,
provider
.
pendingTasksLists
[
index
].
aname
??
"-"
,
provider
.
pendingTasksLists
[
index
].
conmob
??
"-"
,
provider
.
pendingTasksLists
[
index
].
appdate
??
"-"
,
provider
.
pendingTasksLists
[
index
].
appdate
??
"-"
,
provider
.
pendingTasksLists
[
index
].
atype
??
"-"
,
provider
.
pendingTasksLists
[
index
].
anote
??
"-"
,
provider
.
pendingTasksLists
[
index
].
anote
??
"-"
,
provider
.
pendingTasksLists
[
index
].
lstatus
??
"-"
,
];
];
return
Container
(
return
Container
(
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.3
,
width:
MediaQuery
.
of
(
context
).
size
.
width
*
0.6
,
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
15
),
borderRadius:
BorderRadius
.
circular
(
14
),
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
5
,
vertical:
5
,
),
),
margin:
EdgeInsets
.
symmetric
(
vertical:
3
),
padding:
EdgeInsets
.
symmetric
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
horizontal:
10
,
vertical:
5
,
vertical:
1
5
,
),
),
child:
Column
(
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
children:
[
...
List
.
generate
(
3
,
(
j
)
{
...
List
.
generate
(
headings
.
length
,
(
j
)
{
return
Container
(
return
Container
(
padding:
EdgeInsets
.
symmetric
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
,
vertical:
6
,
horizontal:
0
,
horizontal:
0
,
),
),
child:
Row
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
children:
[
if
(
j
==
2
)
...[
Expanded
(
Padding
(
child:
Text
(
padding:
const
EdgeInsets
.
only
(
"
${headings[j]}
"
,
top:
3.0
,
style:
TextStyle
(
fontSize:
14
),
bottom:
3.0
,
),
child:
DottedLine
(
dashGapLength:
4
,
dashGapColor:
Colors
.
white
,
dashColor:
AppColors
.
grey_semi
,
dashLength:
4
,
lineThickness:
0.5
,
),
),
),
],
),
Row
(
Expanded
(
crossAxisAlignment:
child:
Text
(
CrossAxisAlignment
.
start
,
"
${subHeadings[j]}
"
,
children:
[
style:
TextStyle
(
Expanded
(
color:
AppColors
.
grey_semi
,
child:
Text
(
fontSize:
14
,
"
${subHeadings[j]}
"
,
style:
TextStyle
(
color:
j
==
0
?
AppColors
.
semi_black
:
AppColors
.
grey_semi
,
fontSize:
14
,
),
),
),
),
]
,
)
,
),
),
],
],
),
),
...
...
lib/screens/old/leadDetailsOld.dart
0 → 100644
View file @
c0252747
import
'dart:io'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Notifiers/crmProvider/crmLeadDetailsProvider.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:generp/screens/crm/AppointmentDetails.dart'
;
import
'package:generp/screens/crm/FollowUpDetails.dart'
;
import
'package:generp/screens/crm/QuotationDetails.dart'
;
import
'package:generp/screens/crm/contactDetails.dart'
;
import
'package:generp/screens/crm/editAccountDetails.dart'
;
import
'package:generp/screens/crm/productDetails.dart'
;
import
'package:provider/provider.dart'
;
import
'../../Utils/app_colors.dart'
;
import
'../../Utils/commonWidgets.dart'
;
import
'../finance/FileViewer.dart'
;
class
LeadDetailsByModeOld
extends
StatefulWidget
{
final
mode
;
final
pageTitleName
;
final
leadId
;
const
LeadDetailsByModeOld
({
super
.
key
,
required
this
.
mode
,
required
this
.
pageTitleName
,
required
this
.
leadId
,
});
@override
State
<
LeadDetailsByModeOld
>
createState
()
=>
_LeadDetailsByModeOldState
();
}
class
_LeadDetailsByModeOldState
extends
State
<
LeadDetailsByModeOld
>
{
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
source
)
{
setState
(()
=>
_source
=
source
);
});
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
final
provider
=
Provider
.
of
<
crmLeadDetailsProvider
>(
context
,
listen:
false
,
);
provider
.
crmLeadDetailsAPIFunction
(
context
,
widget
.
leadId
,
widget
.
mode
);
});
}
@override
void
dispose
()
{
// TODO: implement dispose
super
.
dispose
();
_connectivity
.
disposeStream
();
}
@override
Widget
build
(
BuildContext
context
)
{
switch
(
_source
.
keys
.
toList
()[
0
])
{
case
ConnectivityResult
.
mobile
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
wifi
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
none
:
default
:
connection
=
'Offline'
;
}
return
(
connection
==
"Online"
)
?
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
crmLeadDetailsProvider
>(
builder:
(
context
,
provider
,
child
)
{
var
leadDetails
=
provider
.
leadDetails
;
var
headings1
=
[
"Account Manager Name"
,
"Account Created By"
,
"Address"
,
"Lead Status"
,
"Last Followup Date"
,
];
var
subHeadings1
=
[
provider
.
accountDetails
!.
accManager
??
"-"
,
provider
.
accountDetails
!.
owner
??
"-"
,
provider
.
leadDetails
!.
address
??
"-"
,
provider
.
leadDetails
!.
status
??
"-"
,
provider
.
followupDetails
.
first
!.
fdate
??
"-"
,
];
var
headings2
=
[
"State"
,
"District"
,
"Sub Locality"
,
"Source"
,
"Reference"
,
"Team"
,
"Segment"
,
"Lead Age"
,
];
var
subHeadings2
=
[
provider
.
accountDetails
!.
state
??
"-"
,
provider
.
accountDetails
!.
district
??
"-"
,
provider
.
accountDetails
!.
subLocality
??
"-"
,
provider
.
accountDetails
!.
source
??
"-"
,
provider
.
accountDetails
!.
reference
??
"-"
,
provider
.
accountDetails
!.
team
??
"-"
,
provider
.
accountDetails
!.
segment
??
"-"
,
"
${provider.leadDetails!.lage ?? "-"}
days"
,
];
var
totalHeadings
=
[...
headings1
];
var
totalSubHeadings
=
[...
subHeadings1
];
if
(
provider
.
showMoreDetails
)
{
totalHeadings
=
[...
headings1
,
...
headings2
];
totalSubHeadings
=
[...
subHeadings1
,
...
subHeadings2
];
}
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar2
(
context
,
"Lead Details (
${widget.mode}
)"
,
provider
.
resetAll
,
InkResponse
(
onTap:
()
{
_showOptionsSheet
(
context
);
},
child:
SvgPicture
.
asset
(
"assets/svg/ic_more.svg"
,
height:
30
),
),
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
child:
SingleChildScrollView
(
child:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
margin:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
),
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
),
child:
Column
(
children:
[
Row
(
children:
[
Expanded
(
flex:
1
,
child:
Container
(
height:
50
,
width:
35
,
padding:
EdgeInsets
.
all
(
8.0
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFE6F6FF
),
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
(
leadDetails
.
name
??
"-"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
semi_black
,
),
),
],
),
),
),
SizedBox
(
width:
10
),
if
(
provider
.
showEditButton
==
"1"
)
Expanded
(
flex:
1
,
child:
InkResponse
(
onTap:
()
async
{
var
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
EditAccountDetails
(
leadID:
leadDetails
.
id
,
mode:
widget
.
mode
,
accountID:
leadDetails
.
accId
,
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"
,
),
),
),
),
],
),
Divider
(
thickness:
0.5
,
color:
Color
(
0xFFD7D7D7
)),
...
List
.
generate
(
totalSubHeadings
.
length
,
(
j
)
{
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
7
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
child:
Text
(
totalHeadings
[
j
],
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
semi_black
,
),
),
),
Expanded
(
child:
InkResponse
(
child:
totalHeadings
[
j
]
==
"Lead Age"
?
Tooltip
(
triggerMode:
TooltipTriggerMode
.
tap
,
message:
"
${provider.leadDetails.createdDatetime}
"
,
child:
Text
(
totalSubHeadings
[
j
]
==
""
?
"-"
:
totalSubHeadings
[
j
],
style:
TextStyle
(
fontSize:
14
,
color:
Color
(
0xFF818181
),
decorationColor:
AppColors
.
grey_semi
,
decoration:
TextDecoration
.
underline
,
),
),
)
:
Text
(
totalSubHeadings
[
j
]
==
""
?
"-"
:
totalSubHeadings
[
j
],
style:
TextStyle
(
fontSize:
14
,
color:
Color
(
0xFF818181
),
),
),
),
),
],
),
);
}),
InkResponse
(
onTap:
()
async
{
provider
.
showMoreDetails
=
!
provider
.
showMoreDetails
;
},
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
provider
.
showMoreDetails
?
"- Show Less"
:
"+ More Details"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
app_blue
,
),
),
],
),
),
),
],
),
),
),
),
);
},
);
}
Future
<
void
>
_showOptionsSheet
(
BuildContext
context
)
{
return
showModalBottomSheet
(
useSafeArea:
true
,
isDismissible:
true
,
isScrollControlled:
true
,
showDragHandle:
true
,
backgroundColor:
Colors
.
white
,
enableDrag:
true
,
context:
context
,
builder:
(
context
)
{
return
StatefulBuilder
(
builder:
(
context
,
setState
)
{
return
SafeArea
(
child:
Consumer
<
crmLeadDetailsProvider
>(
builder:
(
context
,
provider
,
child
)
{
final
assetnames
=
[
"crm_appoint_details"
,
"crm_cont_details"
,
"crm_follow_up_details"
,
"crm_prod_details"
,
"crm_quotation_details"
,
];
final
Headingnames
=
[
"Product Details"
,
"Contact Details"
,
"Followup Details"
,
"Appointment Details"
,
"Quotation Details"
,
];
return
Container
(
margin:
EdgeInsets
.
only
(
bottom:
15
,
left:
15
,
right:
15
,
top:
10
,
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
child:
SingleChildScrollView
(
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
SizedBox
(
height:
15
),
...
List
.
generate
(
assetnames
.
length
,
(
index
)
{
return
ListTile
(
onTap:
()
{
Navigator
.
pop
(
context
,
true
);
switch
(
index
)
{
case
0
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Productdetails
(
leadID:
provider
.
leadDetails
.
id
,
mode:
widget
.
mode
,
),
),
);
break
;
case
1
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Contactdetails
(
accID:
provider
.
leadDetails
.
accId
,
),
),
);
break
;
case
2
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
FollowUpDetails
(),
),
);
break
;
case
3
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
AppointmentDetails
(
leadID:
provider
.
leadDetails
.
id
,
),
),
);
break
;
case
4
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
QuotationDetails
(
leadID:
provider
.
leadDetails
.
id
,
mode:
widget
.
mode
,
),
),
);
default
:
print
(
"object"
);
}
},
leading:
SvgPicture
.
asset
(
"assets/svg/
${assetnames[index]}
.svg"
,
),
title:
Text
(
Headingnames
[
index
],
style:
TextStyle
(
fontFamily:
"JakartaMedium"
),
),
trailing:
SvgPicture
.
asset
(
"assets/svg/arrow_right_new.svg"
,
),
);
}),
],
),
),
);
},
),
);
},
);
},
);
}
}
lib/screens/old/leadListOld.dart
0 → 100644
View file @
c0252747
import
'dart:io'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:dropdown_button2/dropdown_button2.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Models/crmModels/GetDistrictOnStateResponse.dart'
;
import
'package:generp/Models/crmModels/GetSegmentOnTeamResponse.dart'
;
import
'package:generp/Models/crmModels/GetSourceOnReferenceResponse.dart'
;
import
'package:generp/Models/crmModels/GetSubLocOnDistrictResponse.dart'
;
import
'package:generp/Models/crmModels/LeadListViewResponse.dart'
;
import
'package:generp/Notifiers/crmProvider/LeadListProvider.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:provider/provider.dart'
;
import
'package:generp/screens/screensExports.dart'
;
import
'../../Utils/app_colors.dart'
;
import
'../../Utils/commonWidgets.dart'
;
import
'../../Utils/dropdownTheme.dart'
;
import
'../commonDateRangeFilter.dart'
;
class
LeadlistbymodeOld
extends
StatefulWidget
{
final
pageTitleName
;
final
mode
;
final
filter
;
const
LeadlistbymodeOld
({
super
.
key
,
required
this
.
pageTitleName
,
required
this
.
mode
,
this
.
filter
,
});
@override
State
<
LeadlistbymodeOld
>
createState
()
=>
_LeadlistbymodeOldState
();
}
class
_LeadlistbymodeOldState
extends
State
<
LeadlistbymodeOld
>
{
Dropdowntheme
ddtheme
=
Dropdowntheme
();
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
source
)
{
setState
(()
=>
_source
=
source
);
});
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
final
provider
=
Provider
.
of
<
Leadlistprovider
>(
context
,
listen:
false
);
provider
.
crmLeadListViewAPIFunction
(
context
,
widget
.
mode
);
if
(
widget
.
filter
!=
null
)
{
provider
.
crmLeadListAPIFunction
(
context
,
widget
.
mode
,
""
,
widget
.
filter
!.
status
,
widget
.
filter
!.
openStatus
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
);
}
else
{
provider
.
crmLeadListAPIFunction
(
context
,
widget
.
mode
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
);
}
});
}
@override
void
dispose
()
{
// TODO: implement dispose
super
.
dispose
();
_connectivity
.
disposeStream
();
}
@override
Widget
build
(
BuildContext
context
)
{
switch
(
_source
.
keys
.
toList
()[
0
])
{
case
ConnectivityResult
.
mobile
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
wifi
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
none
:
default
:
connection
=
'Offline'
;
}
return
(
connection
==
"Online"
)
?
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Leadlistprovider
>(
builder:
(
context
,
provider
,
child
)
{
final
crmLists
=
provider
.
crmLeadList
;
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar2
(
context
,
widget
.
pageTitleName
,
provider
.
resetForm
,
Row
(
children:
[
InkResponse
(
onTap:
()
async
{
_showFilterSheet
(
context
);
},
child:
SvgPicture
.
asset
(
"assets/svg/filter_ic.svg"
,
height:
25
,
),
),
],
),
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
provider
.
isLoading
?
Center
(
child:
CircularProgressIndicator
.
adaptive
(
valueColor:
AlwaysStoppedAnimation
<
Color
>(
AppColors
.
app_blue
,
),
),
)
:
crmLists
.
isNotEmpty
?
SizedBox
(
child:
Scrollbar
(
thumbVisibility:
false
,
child:
ListView
.
builder
(
itemCount:
crmLists
.
length
,
shrinkWrap:
true
,
physics:
AlwaysScrollableScrollPhysics
(),
itemBuilder:
(
context
,
index
)
{
if
(
crmLists
.
isEmpty
)
{
return
SizedBox
(
child:
Center
(
child:
Text
(
"No Data Available"
)),
);
}
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Column
(
children:
[
Row
(
children:
[
Expanded
(
flex:
1
,
child:
Container
(
height:
50
,
width:
35
,
padding:
EdgeInsets
.
all
(
8.0
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFE6F6FF
),
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
,
),
),
],
),
),
),
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
),
),
),
),
),
),
],
),
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
(
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
),
),
),
),
],
),
);
}),
InkResponse
(
onTap:
()
async
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
LeadDetailsByMode
(
pageTitleName:
widget
.
pageTitleName
,
mode:
widget
.
mode
,
leadId:
provider
.
crmLeadList
[
index
]
.
leadid
,
),
),
);
},
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Text
(
"View Details"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
app_blue
,
),
),
SizedBox
(
width:
5
),
SvgPicture
.
asset
(
"assets/svg/next_button.svg"
,
),
],
),
),
),
],
),
);
},
),
),
)
:
Emptywidget
(
context
),
);
},
);
}
Future
<
void
>
_showFilterSheet
(
BuildContext
context
)
{
return
showModalBottomSheet
(
useSafeArea:
true
,
isDismissible:
true
,
isScrollControlled:
true
,
showDragHandle:
true
,
backgroundColor:
Colors
.
white
,
enableDrag:
true
,
context:
context
,
builder:
(
context
)
{
return
StatefulBuilder
(
builder:
(
context
,
setState
)
{
return
SafeArea
(
child:
Consumer
<
Leadlistprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Container
(
margin:
EdgeInsets
.
only
(
bottom:
15
,
left:
15
,
right:
15
,
top:
10
,
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
SizedBox
(
height:
15
),
Row
(
children:
[
Expanded
(
child:
Text
(
"Filter"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
14
,
),
),
),
],
),
textControllerWidget
(
context
,
provider
.
sLeadIDController
,
"Lead ID"
,
"Enter Lead ID"
,
provider
.
onChangedLeadId
,
TextInputType
.
text
,
false
,
null
,
),
if
(
widget
.
mode
!=
"executive"
)
...[
TextWidget
(
context
,
"Employee"
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
Employees
>(
hint:
Text
(
"Select Source"
,
style:
TextStyle
(
fontSize:
14
),
),
items:
provider
.
employeesList
.
map
(
(
slist
)
=>
DropdownMenuItem
<
Employees
>(
value:
slist
,
child:
Text
(
slist
.
name
!,
style:
TextStyle
(
fontSize:
14
,
),
),
),
)
.
toList
(),
value:
provider
.
employeesList
.
contains
(
provider
.
selectedEmployees
,
)
?
provider
.
selectedEmployees
:
null
,
// value: provider.selectedEmployees,
onChanged:
(
Employees
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
employeesList
.
isNotEmpty
)
{
provider
.
selectedEmployees
=
value
;
provider
.
selectedEmployeeId
=
value
!.
id
!;
provider
.
selectedEmployeeValue
=
value
!.
name
!;
provider
.
crmLeadListSourceOnReferenceAPIFunction
(
context
,
widget
.
mode
,
provider
.
selectedSourceId
,
);
}
}
},
isExpanded:
true
,
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
),
),
],
TextWidget
(
context
,
"Lead Status"
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
String
>(
hint:
Text
(
"Select Lead Status"
,
style:
TextStyle
(
fontSize:
14
),
),
items:
provider
.
leadStatusList
.
map
(
(
leadStatus
)
=>
DropdownMenuItem
<
String
>(
value:
leadStatus
,
child:
Text
(
leadStatus
!,
style:
TextStyle
(
fontSize:
14
,
),
),
),
)
.
toList
(),
value:
provider
.
selectedLeadStatus
,
onChanged:
(
String
?
value
)
{
if
(
value
!=
null
)
{
provider
.
selectedLeadStatus
=
value
;
}
},
isExpanded:
true
,
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
),
),
TextWidget
(
context
,
"Open/Close Status"
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
String
>(
hint:
Text
(
"Select Open/Close Status"
,
style:
TextStyle
(
fontSize:
14
),
),
items:
provider
.
openStatusList
.
map
(
(
leadStatus
)
=>
DropdownMenuItem
<
String
>(
value:
leadStatus
,
child:
Text
(
leadStatus
!,
style:
TextStyle
(
fontSize:
14
,
),
),
),
)
.
toList
(),
value:
provider
.
selectedOpenStatus
,
onChanged:
(
String
?
value
)
{
if
(
value
!=
null
)
{
provider
.
selectedOpenStatus
=
value
;
}
},
isExpanded:
true
,
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
),
),
textControllerWidget
(
context
,
provider
.
mobileNumberController
,
"Mobile Number"
,
"Enter Mobile Number"
,
provider
.
onChangedMobileNum
,
TextInputType
.
number
,
false
,
FilteringTextInputFormatter
.
digitsOnly
,
),
textControllerWidget
(
context
,
provider
.
companyNameController
,
"Company Name"
,
"Enter Company Name"
,
provider
.
onChangedCompanyName
,
TextInputType
.
text
,
false
,
null
,
),
TextWidget
(
context
,
"Source"
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
Sources
>(
hint:
Text
(
"Select Source"
,
style:
TextStyle
(
fontSize:
14
),
),
items:
provider
.
sourcesList
.
map
(
(
slist
)
=>
DropdownMenuItem
<
Sources
>(
value:
slist
,
child:
Text
(
slist
.
name
!,
style:
TextStyle
(
fontSize:
14
,
),
),
),
)
.
toList
(),
value:
provider
.
selectedSources
,
onChanged:
(
Sources
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
sourcesList
.
isNotEmpty
)
{
provider
.
selectedSources
=
value
;
provider
.
selectedSourceId
=
value
!.
id
!;
provider
.
selectedSourceValue
=
value
!.
name
!;
provider
.
crmLeadListSourceOnReferenceAPIFunction
(
context
,
widget
.
mode
,
provider
.
selectedSourceId
,
);
}
}
},
isExpanded:
true
,
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
),
),
TextWidget
(
context
,
"Reference"
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
References
>(
hint:
Text
(
"Select Reference"
,
style:
TextStyle
(
fontSize:
14
),
),
items:
provider
.
referencesList
.
map
(
(
slist
)
=>
DropdownMenuItem
<
References
>(
value:
slist
,
child:
Text
(
slist
.
name
!,
style:
TextStyle
(
fontSize:
14
,
),
),
),
)
.
toList
(),
value:
provider
.
selectedReferences
,
onChanged:
(
References
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
referencesList
.
isNotEmpty
)
{
provider
.
selectedReferences
=
value
;
provider
.
selectedReferenceId
=
value
!.
id
!;
provider
.
selectedReferenceValue
=
value
!.
name
!;
}
}
},
isExpanded:
true
,
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
),
),
TextWidget
(
context
,
"Team"
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
Teams
>(
hint:
Text
(
"Select Team"
,
style:
TextStyle
(
fontSize:
14
),
),
items:
provider
.
teamsList
.
map
(
(
slist
)
=>
DropdownMenuItem
<
Teams
>(
value:
slist
,
child:
Text
(
slist
.
name
!,
style:
TextStyle
(
fontSize:
14
,
),
),
),
)
.
toList
(),
value:
provider
.
selectedTeams
,
onChanged:
(
Teams
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
teamsList
.
isNotEmpty
)
{
provider
.
selectedTeams
=
value
;
provider
.
selectedTeamId
=
value
!.
id
!;
provider
.
selectedTeamValue
=
value
!.
name
!;
provider
.
crmLeadListSegmentOnTeamAPIFunction
(
context
,
widget
.
mode
,
provider
.
selectedTeamId
,
);
}
}
},
isExpanded:
true
,
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
),
),
TextWidget
(
context
,
"Segment"
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
Segments
>(
hint:
Text
(
"Select Segment"
,
style:
TextStyle
(
fontSize:
14
),
),
items:
provider
.
segmentsList
.
map
(
(
slist
)
=>
DropdownMenuItem
<
Segments
>(
value:
slist
,
child:
Text
(
slist
.
name
!,
style:
TextStyle
(
fontSize:
14
,
),
),
),
)
.
toList
(),
value:
provider
.
selectedSegments
,
onChanged:
(
Segments
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
segmentsList
.
isNotEmpty
)
{
provider
.
selectedSegments
=
value
;
provider
.
selectedSegmentId
=
value
!.
id
!;
provider
.
selectedSegmentValue
=
value
!.
name
!;
}
}
},
isExpanded:
true
,
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
),
),
TextWidget
(
context
,
"State"
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
States
>(
hint:
Text
(
"Select State"
,
style:
TextStyle
(
fontSize:
14
),
),
items:
provider
.
statesList
.
map
(
(
slist
)
=>
DropdownMenuItem
<
States
>(
value:
slist
,
child:
Text
(
slist
.
name
!,
style:
TextStyle
(
fontSize:
14
,
),
),
),
)
.
toList
(),
value:
provider
.
selectedStates
,
onChanged:
(
States
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
statesList
.
isNotEmpty
)
{
provider
.
selectedStates
=
value
;
provider
.
selectedStateId
=
value
!.
id
!;
provider
.
selectedStateValue
=
value
!.
name
!;
if
(
provider
.
districtsList
.
isNotEmpty
)
{
provider
.
districtsList
.
clear
();
// provider.selectedDistricts = null;
provider
.
selectedDistrictId
=
null
;
provider
.
selectedDistrictValue
=
""
;
}
provider
.
crmLeadListDistrictsOnStateAPIFunction
(
context
,
widget
.
mode
,
provider
.
selectedStateId
,
);
}
}
},
isExpanded:
true
,
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
),
),
TextWidget
(
context
,
"District"
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
Districts
>(
hint:
Text
(
"Select District"
,
style:
TextStyle
(
fontSize:
14
),
),
items:
provider
.
districtsList
.
map
(
(
slist
)
=>
DropdownMenuItem
<
Districts
>(
value:
slist
,
child:
Text
(
slist
.
district
!,
style:
TextStyle
(
fontSize:
14
,
),
),
),
)
.
toList
(),
value:
provider
.
selectedDistricts
,
onChanged:
(
Districts
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
districtsList
.
isNotEmpty
)
{
provider
.
selectedDistricts
=
value
;
provider
.
selectedDistrictId
=
value
!.
id
!;
provider
.
selectedDistrictValue
=
value
!.
district
!;
if
(
provider
.
subLocationsList
.
isNotEmpty
)
{
provider
.
subLocationsList
.
clear
();
// provider.selectedSubLocations =
// null;
provider
.
selectedSubLocationId
=
null
;
provider
.
selectedSubLocationValue
=
""
;
}
provider
.
crmLeadListSubLocOnDistrictAPIFunction
(
context
,
widget
.
mode
,
provider
.
selectedDistrictId
,
);
}
}
},
isExpanded:
true
,
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
),
),
TextWidget
(
context
,
"Sub Location"
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
SubLocations
>(
hint:
Text
(
"Select Sub Location"
,
style:
TextStyle
(
fontSize:
14
),
),
items:
provider
.
subLocationsList
.
map
(
(
slist
)
=>
DropdownMenuItem
<
SubLocations
>(
value:
slist
,
child:
Text
(
slist
.
subLocality
!,
style:
TextStyle
(
fontSize:
14
,
),
),
),
)
.
toList
(),
value:
provider
.
selectedSubLocations
,
onChanged:
(
SubLocations
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
subLocationsList
.
isNotEmpty
)
{
provider
.
selectedSubLocations
=
value
;
provider
.
selectedSubLocationId
=
value
!.
id
!;
provider
.
selectedSubLocationValue
=
value
!.
subLocality
!;
}
}
},
isExpanded:
true
,
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
),
),
InkResponse
(
onTap:
()
{
provider
.
crmLeadListAPIFunction
(
context
,
widget
.
mode
,
provider
.
selectedEmployeeId
,
provider
.
selectedLeadStatus
,
provider
.
selectedOpenStatus
,
provider
.
selectedSourceId
,
provider
.
selectedReferenceId
,
provider
.
selectedTeamId
,
provider
.
selectedSegmentId
,
provider
.
selectedStateId
,
provider
.
selectedDistrictId
,
provider
.
selectedSubLocationId
,
);
Navigator
.
pop
(
context
);
},
child:
Container
(
height:
45
,
alignment:
Alignment
.
center
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
15
),
),
child:
Text
(
"Submit"
,
style:
TextStyle
(
fontSize:
15
,
fontFamily:
"JakartaMedium"
,
color:
Colors
.
white
,
),
),
),
),
],
),
),
);
},
),
);
},
);
},
);
}
}
lib/screens/old/prospectListold.dart
0 → 100644
View file @
c0252747
import
'dart:io'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:dropdown_button2/dropdown_button2.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:generp/Utils/dropdownTheme.dart'
;
import
'package:generp/screens/crm/ProspectDetailsByMode.dart'
;
import
'package:provider/provider.dart'
;
import
'../../Models/crmModels/ProspectListViewResponse.dart'
;
import
'../../Notifiers/crmProvider/ProspectListProvider.dart'
;
import
'../../Utils/app_colors.dart'
;
import
'../../Utils/commonWidgets.dart'
;
class
ProspectListByModeold
extends
StatefulWidget
{
final
pageTitleName
;
final
mode
;
const
ProspectListByModeold
({
super
.
key
,
this
.
pageTitleName
,
this
.
mode
});
@override
State
<
ProspectListByModeold
>
createState
()
=>
_ProspectListByModeoldState
();
}
class
_ProspectListByModeoldState
extends
State
<
ProspectListByModeold
>
{
Dropdowntheme
ddtheme
=
Dropdowntheme
();
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
source
)
{
setState
(()
=>
_source
=
source
);
});
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
final
provider
=
Provider
.
of
<
ProspectListProvider
>(
context
,
listen:
false
,
);
provider
.
crmProspectListViewAPIFunction
(
context
,
widget
.
mode
);
provider
.
crmProspectListAPIFunction
(
context
,
widget
.
mode
,
""
);
});
}
@override
void
dispose
()
{
// TODO: implement dispose
super
.
dispose
();
_connectivity
.
disposeStream
();
}
@override
Widget
build
(
BuildContext
context
)
{
switch
(
_source
.
keys
.
toList
()[
0
])
{
case
ConnectivityResult
.
mobile
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
wifi
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
none
:
default
:
connection
=
'Offline'
;
}
return
(
connection
==
"Online"
)
?
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
ProspectListProvider
>(
builder:
(
context
,
provider
,
child
)
{
final
crmLists
=
provider
.
accountList
;
// ignore: deprecated_member_use
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar2
(
context
,
widget
.
pageTitleName
,
provider
.
resetForm
,
Row
(
children:
[
InkResponse
(
onTap:
()
async
{
_showFilterSheet
(
context
);
},
child:
SvgPicture
.
asset
(
"assets/svg/filter_ic.svg"
,
height:
25
,
),
),
],
),
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
provider
.
isLoading
?
Center
(
child:
CircularProgressIndicator
.
adaptive
(
valueColor:
AlwaysStoppedAnimation
<
Color
>(
AppColors
.
app_blue
,
),
),
)
:
crmLists
.
isNotEmpty
?
SizedBox
(
child:
Scrollbar
(
thumbVisibility:
false
,
child:
ListView
.
builder
(
itemCount:
crmLists
.
length
,
shrinkWrap:
true
,
physics:
AlwaysScrollableScrollPhysics
(),
itemBuilder:
(
context
,
index
)
{
if
(
crmLists
.
isEmpty
)
{
return
SizedBox
(
child:
Center
(
child:
Text
(
"No Data Available"
)),
);
}
// if(crmLists[index].aid=="1726"){
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Column
(
children:
[
Row
(
children:
[
Expanded
(
flex:
1
,
child:
Container
(
height:
50
,
width:
35
,
padding:
EdgeInsets
.
all
(
8.0
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFE6F6FF
),
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
].
aname
!,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
semi_black
,
),
),
],
),
),
),
],
),
Divider
(
thickness:
0.5
,
color:
Color
(
0xFFD7D7D7
),
),
...
List
.
generate
(
6
,
(
j
)
{
final
headings
=
[
"Account Manager"
,
"Contact Person"
,
"Mobile Number"
,
"Address"
,
"Account Age"
,
"GST Number"
,
];
final
subHeadings
=
[
crmLists
[
index
].
accman
,
crmLists
[
index
].
cname
,
crmLists
[
index
].
mob1
,
crmLists
[
index
].
address
,
"
${crmLists[index].age}
days old"
,
crmLists
[
index
].
gstNumber
,
];
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
),
),
),
),
],
),
);
}),
InkResponse
(
onTap:
()
async
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
ProspectDetailsByMode
(
pageTitleName:
widget
.
pageTitleName
,
mode:
widget
.
mode
,
leadId:
provider
.
accountList
[
index
]
.
aid
,
),
),
);
},
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Text
(
"View Details"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
app_blue
,
),
),
SizedBox
(
width:
5
),
SvgPicture
.
asset
(
"assets/svg/next_button.svg"
,
),
],
),
),
),
],
),
);
},
),
),
)
:
Emptywidget
(
context
),
);
},
);
}
Future
<
void
>
_showFilterSheet
(
BuildContext
context
)
{
return
showModalBottomSheet
(
useSafeArea:
true
,
isDismissible:
true
,
isScrollControlled:
true
,
showDragHandle:
true
,
backgroundColor:
Colors
.
white
,
enableDrag:
true
,
context:
context
,
builder:
(
context
)
{
return
StatefulBuilder
(
builder:
(
context
,
setState
)
{
return
SafeArea
(
child:
Consumer
<
ProspectListProvider
>(
builder:
(
context
,
provider
,
child
)
{
return
Container
(
margin:
EdgeInsets
.
only
(
bottom:
15
,
left:
15
,
right:
15
,
top:
10
,
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
SizedBox
(
height:
15
),
Row
(
children:
[
Expanded
(
child:
Text
(
"Filter"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
14
,
),
),
),
],
),
if
(
widget
.
mode
!=
"executive"
)
...[
TextWidget
(
context
,
"Employee"
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
Employees
>(
hint:
Text
(
"Select Source"
,
style:
TextStyle
(
fontSize:
14
),
),
items:
provider
.
employeesList
.
map
(
(
slist
)
=>
DropdownMenuItem
<
Employees
>(
value:
slist
,
child:
Text
(
slist
.
name
!,
style:
TextStyle
(
fontSize:
14
,
),
),
),
)
.
toList
(),
value:
provider
.
employeesList
.
contains
(
provider
.
selectedEmployees
,
)
?
provider
.
selectedEmployees
:
null
,
// value: provider.selectedEmployees,
onChanged:
(
Employees
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
employeesList
.
isNotEmpty
)
{
provider
.
selectedEmployees
=
value
;
provider
.
selectedEmployeeId
=
value
!.
id
!;
provider
.
selectedEmployeeValue
=
value
!.
name
!;
}
}
},
isExpanded:
true
,
dropdownSearchData:
DropdownSearchData
(
searchInnerWidgetHeight:
50
,
searchController:
provider
.
searchController
,
searchInnerWidget:
Padding
(
padding:
const
EdgeInsets
.
all
(
8
),
child:
TextFormField
(
controller:
provider
.
searchController
,
decoration:
InputDecoration
(
isDense:
true
,
contentPadding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
8
,
),
hintText:
'Search account...'
,
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
8
),
),
),
),
),
searchMatchFn:
(
item
,
searchValue
)
{
return
item
.
value
?.
name
?.
toLowerCase
()
.
contains
(
searchValue
.
toLowerCase
(),
)
??
false
;
},
),
onMenuStateChange:
(
isOpen
)
{
if
(!
isOpen
)
{
provider
.
searchController
.
clear
();
}
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
),
),
],
textControllerWidget
(
context
,
provider
.
mobileNumberController
,
"Mobile Number"
,
"Enter Mobile Number"
,
provider
.
onChangedMobileNum
,
TextInputType
.
number
,
false
,
FilteringTextInputFormatter
.
digitsOnly
,
),
textControllerWidget
(
context
,
provider
.
companyNameController
,
"Company Name"
,
"Enter Company Name"
,
provider
.
onChangedCompanyName
,
TextInputType
.
text
,
false
,
null
,
),
InkResponse
(
onTap:
()
{
provider
.
crmProspectListAPIFunction
(
context
,
widget
.
mode
,
provider
.
selectedEmployeeId
,
);
Navigator
.
pop
(
context
);
},
child:
Container
(
height:
45
,
alignment:
Alignment
.
center
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
15
),
),
child:
Text
(
"Submit"
,
style:
TextStyle
(
fontSize:
15
,
fontFamily:
"JakartaMedium"
,
color:
Colors
.
white
,
),
),
),
),
],
),
),
);
},
),
);
},
);
},
);
}
}
lib/screens/screensExports.dart
View file @
c0252747
...
@@ -3,6 +3,7 @@ export 'package:generp/screens/WebERPIOS.dart';
...
@@ -3,6 +3,7 @@ export 'package:generp/screens/WebERPIOS.dart';
export
"package:generp/screens/WebERPScreen.dart"
;
export
"package:generp/screens/WebERPScreen.dart"
;
export
"package:generp/screens/WebWhizzdomScreen.dart"
;
export
"package:generp/screens/WebWhizzdomScreen.dart"
;
export
'package:generp/screens/inventory/InventoryScreen.dart'
;
export
'AttendanceScreen.dart'
;
export
'AttendanceScreen.dart'
;
export
'package:generp/screens/finance/financeDashboard.dart'
;
export
'package:generp/screens/finance/financeDashboard.dart'
;
export
'package:generp/screens/genTracker/GenTrackerDashboard.dart'
;
export
'package:generp/screens/genTracker/GenTrackerDashboard.dart'
;
...
...
lib/screens/serviceEngineer/serviceEngineerDashboard.dart
View file @
c0252747
...
@@ -79,7 +79,6 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> {
...
@@ -79,7 +79,6 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> {
resizeToAvoidBottomInset:
true
,
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
AppBar
(
appBar:
AppBar
(
elevation:
2
,
automaticallyImplyLeading:
false
,
automaticallyImplyLeading:
false
,
title:
SizedBox
(
title:
SizedBox
(
child:
Row
(
child:
Row
(
...
@@ -132,11 +131,11 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> {
...
@@ -132,11 +131,11 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> {
],
],
),
),
),
),
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:
SingleChildScrollView
(
child:
Column
(
child:
Column
(
...
@@ -145,30 +144,29 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> {
...
@@ -145,30 +144,29 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> {
Container
(
Container
(
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
color:
Colors
.
white
,
// borderRadius: BorderRadius.vertical(
borderRadius:
BorderRadius
.
vertical
(
// bottom: Radius.circular(20),
bottom:
Radius
.
circular
(
20
),
// ),
),
borderRadius:
BorderRadius
.
circular
(
20
)
),
),
child:
Column
(
child:
Column
(
// crossAxisAlignment: CrossAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.start,
children:
[
children:
[
//
Container(
Container
(
//
height: 200,
height:
200
,
//
decoration: BoxDecoration(
decoration:
BoxDecoration
(
//
image: DecorationImage(
image:
DecorationImage
(
//
image: AssetImage(
image:
AssetImage
(
//
"assets/svg/service/service_dashboard.png",
"assets/svg/service/service_dashboard.png"
,
//
),
),
//
fit: BoxFit.contain,
fit:
BoxFit
.
contain
,
//
),
),
//
gradient: LinearGradient(
gradient:
LinearGradient
(
//
colors: [Color(0xFFFFFFFF), AppColors.white],
colors:
[
Color
(
0xFFFFFFFF
),
AppColors
.
white
],
//
begin: Alignment.topCenter,
begin:
Alignment
.
topCenter
,
//
end: Alignment.bottomCenter,
end:
Alignment
.
bottomCenter
,
//
),
),
//
),
),
//
),
),
GridView
.
builder
(
GridView
.
builder
(
padding:
EdgeInsets
.
symmetric
(
padding:
EdgeInsets
.
symmetric
(
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment