Commit 528df0d2 authored by Sai Srinivas's avatar Sai Srinivas
Browse files

14-05-2025 By Sai Srinivas

All UI Adjustments and Font Sizes
parent fd946558
...@@ -15,12 +15,16 @@ PreferredSizeWidget appbar(BuildContext context, title) { ...@@ -15,12 +15,16 @@ PreferredSizeWidget appbar(BuildContext context, title) {
onTap: () => Navigator.pop(context, true), onTap: () => Navigator.pop(context, true),
child: SvgPicture.asset("assets/svg/app_bar_back.svg", height: 25), child: SvgPicture.asset("assets/svg/app_bar_back.svg", height: 25),
), ),
Text( InkResponse(
title, onTap: () => Navigator.pop(context,true),
style: TextStyle( child: Text(
fontSize: 16, title,
height: 1.1, style: TextStyle(
color: AppColors.semi_black, fontSize: 16,
height: 1.1,
fontFamily: "JakartaSemiBold",
color: AppColors.semi_black,
),
), ),
), ),
], ],
...@@ -47,12 +51,16 @@ PreferredSizeWidget appbar2(BuildContext context, title,widget) { ...@@ -47,12 +51,16 @@ PreferredSizeWidget appbar2(BuildContext context, title,widget) {
onTap: () => Navigator.pop(context, true), onTap: () => Navigator.pop(context, true),
child: SvgPicture.asset("assets/svg/app_bar_back.svg", height: 25), child: SvgPicture.asset("assets/svg/app_bar_back.svg", height: 25),
), ),
Text( InkResponse(
title, onTap: () => Navigator.pop(context, true),
style: TextStyle( child: Text(
fontSize: 16, title,
height: 1.1, style: TextStyle(
color: AppColors.semi_black, fontSize: 16,
height: 1.1,
fontFamily: "JakartaSemiBold",
color: AppColors.semi_black,
),
), ),
), ),
Spacer(), Spacer(),
...@@ -67,3 +75,16 @@ PreferredSizeWidget appbar2(BuildContext context, title,widget) { ...@@ -67,3 +75,16 @@ PreferredSizeWidget appbar2(BuildContext context, title,widget) {
), ),
); );
} }
Future<bool> onBackPressed(BuildContext context) async {
Navigator.pop(context, true);
return true;
}
Widget Emptywidget(BuildContext context){
return SizedBox(
height: MediaQuery.of(context).size.height*0.8,
child: Center(
child: Text("No Data Available")),
);
}
\ No newline at end of file
...@@ -21,7 +21,7 @@ import 'package:generp/Notifiers/PendingComplaintsProvider.dart'; ...@@ -21,7 +21,7 @@ import 'package:generp/Notifiers/PendingComplaintsProvider.dart';
import 'package:generp/Notifiers/ProfileNotifier.dart'; import 'package:generp/Notifiers/ProfileNotifier.dart';
import 'package:generp/Notifiers/ServiceEngineerDashboardProvider.dart'; import 'package:generp/Notifiers/ServiceEngineerDashboardProvider.dart';
import 'package:generp/Notifiers/TodayMontlyVisitsProvider.dart'; import 'package:generp/Notifiers/TodayMontlyVisitsProvider.dart';
import 'package:generp/Notifiers/UpdatePasswordProvider'; import 'package:generp/Notifiers/UpdatePasswordProvider.dart';
import 'package:generp/Notifiers/VisitDetailsProvider.dart'; import 'package:generp/Notifiers/VisitDetailsProvider.dart';
import 'package:generp/Notifiers/loginNotifier.dart'; import 'package:generp/Notifiers/loginNotifier.dart';
import 'package:generp/Notifiers/scanLoginProvider.dart'; import 'package:generp/Notifiers/scanLoginProvider.dart';
...@@ -82,18 +82,18 @@ void main() async { ...@@ -82,18 +82,18 @@ void main() async {
} }
} }
if (Platform.isAndroid) { // if (Platform.isAndroid) {
await Firebase.initializeApp( // await Firebase.initializeApp(
options: FirebaseOptions( // options: FirebaseOptions(
apiKey: "AIzaSyBmkmKdYfBt2n5QRlmZJ9MV_Amh9xR3UOY", // apiKey: "AIzaSyBmkmKdYfBt2n5QRlmZJ9MV_Amh9xR3UOY",
appId: "1:329382566569:android:26dc8519537b04deff67b8", // appId: "1:329382566569:android:26dc8519537b04deff67b8",
messagingSenderId: "329382566569", // messagingSenderId: "329382566569",
projectId: "generp-fe09d", // projectId: "generp-fe09d",
), // ),
); // );
} else if (Platform.isIOS) { // } else if (Platform.isIOS) {
await Firebase.initializeApp(); await Firebase.initializeApp();
} // }
FirebaseMessaging messaging = FirebaseMessaging.instance; FirebaseMessaging messaging = FirebaseMessaging.instance;
...@@ -149,7 +149,7 @@ void main() async { ...@@ -149,7 +149,7 @@ void main() async {
sound: true, sound: true,
); );
FirebaseMessaging.instance.getToken().then((value) { await FirebaseMessaging.instance.getToken().then((value) {
String? token = value; String? token = value;
if (kDebugMode) { if (kDebugMode) {
print("fbstoken:{$token}"); print("fbstoken:{$token}");
...@@ -209,7 +209,7 @@ class MyApp extends StatelessWidget { ...@@ -209,7 +209,7 @@ class MyApp extends StatelessWidget {
return MaterialApp( return MaterialApp(
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
theme: ThemeData( theme: ThemeData(
fontFamily: 'Lexend', fontFamily: 'JakartaRegular',
splashColor: Colors.transparent, splashColor: Colors.transparent,
highlightColor: Colors.transparent, highlightColor: Colors.transparent,
hoverColor: Colors.transparent, hoverColor: Colors.transparent,
......
...@@ -97,534 +97,626 @@ class _AttendanceScreenState extends State<AttendanceScreen> { ...@@ -97,534 +97,626 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
onRefresh: () async { onRefresh: () async {
await Future.delayed(const Duration(milliseconds: 600)); await Future.delayed(const Duration(milliseconds: 600));
attendance.getAttendanceList(homeProvider, context); attendance.getAttendanceList(homeProvider, context);
attendance.init(homeProvider, context);
attendance.loadAttendanceDetails(homeProvider, context);
}, },
child: Scaffold( child: WillPopScope(
backgroundColor: AppColors.scaffold_bg_color, onWillPop: () => onBackPressed(context),
appBar: appbar(context, "Attendance"), child: Scaffold(
body: Container( resizeToAvoidBottomInset: true,
child: SingleChildScrollView( backgroundColor: AppColors.scaffold_bg_color,
child: Column( appBar: appbar(context, "Attendance"),
crossAxisAlignment: CrossAxisAlignment.start, body: Container(
children: [ child: SingleChildScrollView(
Container( child: Column(
margin: EdgeInsets.only(top: 15, bottom: 15), crossAxisAlignment: CrossAxisAlignment.start,
decoration: BoxDecoration( children: [
color: Colors.white, Container(
borderRadius: BorderRadius.circular(16), margin: EdgeInsets.only(top: 15, bottom: 15),
), decoration: BoxDecoration(
child: Column( color: Colors.white,
crossAxisAlignment: CrossAxisAlignment.start, borderRadius: BorderRadius.circular(16),
children: [ ),
Container( child: Column(
padding: EdgeInsets.only( crossAxisAlignment: CrossAxisAlignment.start,
left: 10, children: [
right: 10, Container(
top: 15, padding: EdgeInsets.only(
), left: 15,
child: Row( right: 10,
children: [ top: 15,
Expanded(child: Text("Check-in")), ),
Expanded(child: Text("Check-out")), child: Row(
], children: [
Expanded(child: Text("Check-in")),
Expanded(child: Text("Check-out")),
],
),
), ),
), SizedBox(
SizedBox( child: Row(
child: Row( children: [
children: [ Expanded(
Expanded( child: Container(
child: Container( padding: EdgeInsets.symmetric(
padding: EdgeInsets.symmetric( horizontal: 10,
horizontal: 10, vertical: 15,
vertical: 15, ),
), margin: EdgeInsets.symmetric(
margin: EdgeInsets.symmetric( horizontal: 10,
horizontal: 10, vertical: 15,
vertical: 15, ),
), decoration: BoxDecoration(
decoration: BoxDecoration( color: Color(0xFFFFEFEF),
color: Color(0xFFFFEFEF), borderRadius: BorderRadius.circular(16),
borderRadius: BorderRadius.circular(16), ),
), child: Column(
child: Column( crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start, children: [
children: [ RichText(
RichText( text: TextSpan(
text: TextSpan( children: [
children: [ TextSpan(
TextSpan( text: formattedTime,
text: formattedTime, style: TextStyle(
style: TextStyle( color: Color(0xFFED3424),
color: Color(0xFFED3424), fontFamily:
fontSize: 18, "JakartaRegular",
fontSize: 30,
),
), ),
), TextSpan(
TextSpan( text: period,
text: period, style: TextStyle(
style: TextStyle( color: Color(0xFFED3424),
color: Color(0xFFED3424), fontFamily:
"JakartaRegular",
),
), ),
), ],
], ),
), ),
), Text(
Text( "${attendance.attendanceHistory.firstOrNull?['check_in_location']}",
"${attendance.attendanceHistory.firstOrNull?['check_in_location']}", style: TextStyle(
), color: Color(0xFF818181),
], ),
),
],
),
), ),
), ),
), Expanded(
Expanded( child: Container(
child: Container( padding: EdgeInsets.symmetric(
padding: EdgeInsets.symmetric( horizontal: 10,
horizontal: 10, vertical: 15,
vertical: 15, ),
), margin: EdgeInsets.symmetric(
margin: EdgeInsets.symmetric( horizontal: 10,
horizontal: 10, vertical: 15,
vertical: 15, ),
), decoration: BoxDecoration(
decoration: BoxDecoration( color: Color(0xFFFFEFEF),
color: Color(0xFFFFEFEF), borderRadius: BorderRadius.circular(16),
borderRadius: BorderRadius.circular(16), ),
), child: Column(
child: Column( crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start, children: [
children: [ RichText(
RichText( text: TextSpan(
text: TextSpan( children: [
children: [ TextSpan(
TextSpan( text: formattedTime2,
text: formattedTime2, style: TextStyle(
style: TextStyle( color: Color(0xFFED3424),
color: Color(0xFFED3424), fontFamily:
fontSize: 18, "JakartaRegular",
fontSize: 30,
),
), ),
), TextSpan(
TextSpan( text: period2,
text: period2, style: TextStyle(
style: TextStyle( color: Color(0xFFED3424),
color: Color(0xFFED3424), fontFamily:
"JakartaRegular",
),
), ),
), ],
], ),
), ),
), Text(
Text( "${attendance.attendanceHistory.firstOrNull?['check_out_location']}",
"${attendance.attendanceHistory.firstOrNull?['check_out_location']}", style: TextStyle(
), color: Color(0xFF818181),
], ),
),
],
),
), ),
), ),
), ],
], ),
), ),
), ],
], ),
), ),
), Container(
Text( padding: EdgeInsets.symmetric(
"Attendance Details", horizontal: 10,
style: TextStyle(color: Color(0xFF818181)), vertical: 10,
), ),
Container( child: Text(
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10), "Attendance Details",
decoration: BoxDecoration( style: TextStyle(
color: Colors.white, fontFamily: "JakartaSemiBold",
borderRadius: BorderRadius.circular(16), fontSize: 14,
color: Color(0xFF818181),
),
),
), ),
child: GridView.builder( Container(
itemCount: 4, padding: EdgeInsets.symmetric(
shrinkWrap: true, horizontal: 10,
physics: NeverScrollableScrollPhysics(), vertical: 10,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: 10,
mainAxisSpacing: 10,
childAspectRatio: 20 / 10,
), ),
itemBuilder: (context, index) { decoration: BoxDecoration(
final numbers = [ color: Colors.white,
attendance.presentDays, borderRadius: BorderRadius.circular(16),
attendance.absentDays, ),
attendance.holidays, child: GridView.builder(
attendance.latePenalties, itemCount: 4,
]; shrinkWrap: true,
final names = [ physics: NeverScrollableScrollPhysics(),
"Present Days", gridDelegate:
"Absent Days", SliverGridDelegateWithFixedCrossAxisCount(
"Holidays", crossAxisCount: 2,
"Late Points", crossAxisSpacing: 10,
]; mainAxisSpacing: 10,
final colors = [ childAspectRatio: 20 / 10,
0xFFE7FFE5, ),
0xFFFFEFEF, itemBuilder: (context, index) {
0xFFF3EDFF, final numbers = [
0xFFFFF6F0, attendance.presentDays,
]; attendance.absentDays,
final textcolors = [ attendance.holidays,
0xFF0D9C00, attendance.latePenalties,
0xFFFF0000, ];
0xFF493272, final names = [
0xFF91481B, "Present Days",
]; "Absent Days",
return Container( "Holidays",
padding: EdgeInsets.symmetric(horizontal: 13), "Late Points",
decoration: BoxDecoration( ];
color: Color(colors[index]), final colors = [
borderRadius: BorderRadius.circular(12), 0xFFE7FFE5,
), 0xFFFFEFEF,
child: Column( 0xFFF3EDFF,
crossAxisAlignment: CrossAxisAlignment.start, 0xFFFFF6F0,
mainAxisAlignment: MainAxisAlignment.center, ];
children: [ final textcolors = [
Text( 0xFF0D9C00,
numbers[index].toString(), 0xFFFF0000,
style: TextStyle( 0xFF493272,
fontSize: 30, 0xFF91481B,
color: Color(textcolors[index]), ];
return Container(
padding: EdgeInsets.symmetric(horizontal: 13),
decoration: BoxDecoration(
color: Color(colors[index]),
borderRadius: BorderRadius.circular(12),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
numbers[index].toString(),
style: TextStyle(
fontSize: 30,
fontFamily: "JakartaMedium",
color: Color(textcolors[index]),
),
), ),
), Text(
Text( names[index],
names[index], style: TextStyle(color: Color(0xFF818181)),
style: TextStyle(color: Color(0xFF818181)), ),
), ],
], ),
), );
); },
}, ),
), ),
),
///calendar ///calendar
Container( Container(
// padding: EdgeInsets.symmetric(horizontal: 10,vertical: 5), // padding: EdgeInsets.symmetric(horizontal: 10,vertical: 5),
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 5), margin: EdgeInsets.symmetric(
decoration: BoxDecoration( horizontal: 10,
borderRadius: BorderRadius.circular(16), vertical: 5,
color: Colors.white, ),
), decoration: BoxDecoration(
child: Column( borderRadius: BorderRadius.circular(16),
children: [ color: Colors.white,
Padding( ),
padding: const EdgeInsets.fromLTRB(30, 10, 30, 0), child: Column(
child: Container( children: [
child: Row( Padding(
mainAxisAlignment: MainAxisAlignment.spaceBetween, padding: const EdgeInsets.fromLTRB(30, 10, 30, 0),
children: [ child: Container(
SizedBox( child: Row(
child: Row( mainAxisAlignment:
children: [ MainAxisAlignment.spaceBetween,
GestureDetector( children: [
onTap: () { SizedBox(
attendance.setPreviousMonth( child: Row(
homeProvider, children: [
context, GestureDetector(
); onTap: () {
}, attendance.setPreviousMonth(
child: Icon( homeProvider,
Icons.arrow_back_ios, context,
color: AppColors.semi_black, );
size: 20.0, },
child: SvgPicture.asset(
"assets/svg/arrow_left.svg",
),
), ),
), Text(
Text( monthLabel,
monthLabel, style: TextStyle(
style: TextStyle( overflow: TextOverflow.ellipsis,
fontWeight: FontWeight.w500, fontFamily: "JakartaMedium",
overflow: TextOverflow.ellipsis, color: Color(0xFF2D2D2D),
color: Colors.black, ),
), ),
), GestureDetector(
GestureDetector( onTap: () {
onTap: () { attendance.setNextMonth(
attendance.setNextMonth( homeProvider,
homeProvider, context,
context, );
); },
}, child: SvgPicture.asset(
child: Icon( "assets/svg/arrow_right_new.svg",
Icons.arrow_forward_ios, ),
color: AppColors.semi_black,
size: 20.0,
), ),
), ],
], ),
), ),
),
InkResponse( InkResponse(
onTap: () { onTap: () {
_showInfoBottomSheet(context); _showInfoBottomSheet(context);
}, },
child: SizedBox( child: SizedBox(
width: 20,
height: 20,
child: SvgPicture.asset(
"assets/svg/ic_info_new.svg",
width: 20, width: 20,
height: 20, height: 20,
child: SvgPicture.asset(
"assets/svg/ic_info_new.svg",
width: 20,
height: 20,
),
), ),
), ),
), ],
], ),
), ),
), ),
), SizedBox(height: 5),
SizedBox(height: 5,), Padding(
Padding( padding: const EdgeInsets.fromLTRB(8, 10, 8, 0),
padding: const EdgeInsets.fromLTRB(8, 10, 8, 0), child: Container(
child: Container( child: Row(
child: Row( children: [
children: [ for (
for ( var i = 0;
var i = 0; i <
i < [
[ 'S',
'S', 'M',
'M', 'T',
'T', 'W',
'W', 'T',
'T', 'F',
'F', 'S',
'S', ].length;
].length; i++
i++ )
) Expanded(
Expanded( child: Text(
child: Text( [
['S', 'M', 'T', 'W', 'T', 'F', 'S'][i], 'S',
textAlign: TextAlign.center, 'M',
style: TextStyle( 'T',
overflow: TextOverflow.ellipsis, 'W',
color: 'T',
i == 0 'F',
? Color(0xFFFF0000) 'S',
: AppColors.semi_black, ][i],
textAlign: TextAlign.center,
style: TextStyle(
overflow: TextOverflow.ellipsis,
color:
i == 0
? Color(0xFFFF0000)
: AppColors.semi_black,
),
), ),
), ),
), ],
], ),
), ),
), ),
),
Padding(
padding: const EdgeInsets.fromLTRB(0, 0, 0, 10),
child: Container(
child: GridView.builder(
itemCount: daysInPeriod + startingIndex,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 7,
crossAxisSpacing: 2,
mainAxisSpacing: 1,
childAspectRatio: (255 / 245),
),
padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
if (index < startingIndex) {
return SizedBox.shrink();
}
final dayIndex = index - startingIndex;
final currentDateInPeriod = startDate.add(
Duration(days: dayIndex),
);
final currentDay = currentDateInPeriod.day;
final isFutureDate = currentDateInPeriod
.isAfter(currentDate);
// Find matching date in dateArrayList
Map<String, dynamic>? dateMap;
try {
dateMap = dateArrayList[dayIndex];
} catch (e) {
dateMap = {};
}
// Find matching penalty Padding(
Map<String, dynamic>? penaltyMap; padding: const EdgeInsets.fromLTRB(0, 0, 0, 10),
try { child: Container(
penaltyMap = penalityArrayList[dayIndex]; child: GridView.builder(
} catch (e) { itemCount: daysInPeriod + startingIndex,
penaltyMap = {}; gridDelegate:
} SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 7,
String? dateColor = crossAxisSpacing: 2,
dateMap.isNotEmpty mainAxisSpacing: 1,
? dateMap.values.first childAspectRatio: (255 / 245),
: null; ),
String? penaltyKey = padding: const EdgeInsets.fromLTRB(
penaltyMap.isNotEmpty 0,
? penaltyMap.keys.first 0,
: null; 0,
int? datePenalty = 0,
penaltyMap.isNotEmpty ),
? penaltyMap.values.first shrinkWrap: true,
: 0; physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
// Determine if this is the current day if (index < startingIndex) {
final isCurrentDay = return SizedBox.shrink();
currentDateInPeriod.day == }
currentDate.day &&
currentDateInPeriod.month == final dayIndex = index - startingIndex;
currentDate.month && final currentDateInPeriod = startDate.add(
currentDateInPeriod.year == Duration(days: dayIndex),
currentDate.year; );
final currentDay = currentDateInPeriod.day;
return InkWell( final isFutureDate = currentDateInPeriod
onTap: .isAfter(currentDate);
isFutureDate
? null // Find matching date in dateArrayList
: () { Map<String, dynamic>? dateMap;
selectedIndex = index; try {
if (penaltyKey != null) { dateMap = dateArrayList[dayIndex];
attendance.dateWiseAttendance( } catch (e) {
homeProvider, dateMap = {};
penaltyKey, }
// Find matching penalty
Map<String, dynamic>? penaltyMap;
try {
penaltyMap = penalityArrayList[dayIndex];
} catch (e) {
penaltyMap = {};
}
String? dateColor =
dateMap.isNotEmpty
? dateMap.values.first
: null;
String? penaltyKey =
penaltyMap.isNotEmpty
? penaltyMap.keys.first
: null;
int? datePenalty =
penaltyMap.isNotEmpty
? penaltyMap.values.first
: 0;
// Determine if this is the current day
final isCurrentDay =
currentDateInPeriod.day ==
currentDate.day &&
currentDateInPeriod.month ==
currentDate.month &&
currentDateInPeriod.year ==
currentDate.year;
return InkWell(
onTap:
isFutureDate
? null
: () {
selectedIndex = index;
if (penaltyKey != null) {
attendance.dateWiseAttendance(
homeProvider,
penaltyKey,
context,
);
}
attendance.selectedDate =
currentDay.toString();
_showAttDetailsBottomSheet(
context, context,
); );
} },
attendance.selectedDate = child: Card(
currentDay.toString(); elevation: 0,
_showAttDetailsBottomSheet(context); child: Column(
}, children: [
child: Card( // Row(
elevation: 0, // mainAxisAlignment:
child: Column( // MainAxisAlignment.center,
children: [ // children: [
Row( // Text(
mainAxisAlignment: // "($datePenalty)",
MainAxisAlignment.center, // style: TextStyle(
children: [ // fontWeight: FontWeight.w400,
Text( // color: Colors.black,
datePenalty != 0 // fontSize: 5
? "($datePenalty)" // ),
: "", // ),
style: TextStyle( // ],
fontWeight: FontWeight.w400, // ),
color: Colors.black, Center(
), child: Container(
), decoration: BoxDecoration(
], shape: BoxShape.circle,
), border: Border.all(
Center(
child: Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
color:
isFutureDate
? Colors.transparent
: (isCurrentDay ||
(selectedIndex ==
index))
? Color(0xFFF6F0FF)
: dateColor == 'g'
? Color(0xFFE8FFE6)
: dateColor == 'r'
? Color(0xFFFFEFEF)
: dateColor == 'b'
? Color(0xFFFFE8D0)
: dateColor == 'br'
? Colors.brown
: dateColor == 'y'
? Color(0xFFFFF9B2)
: Colors.transparent,
),
child: Center(
child: Text(
currentDay.toString(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400,
color: color:
isFutureDate (isCurrentDay ||
? AppColors.semi_black
: (isCurrentDay ||
(selectedIndex == (selectedIndex ==
index)) index))
? Color(0xFF493272) ? Color(0xFF1487C9)
: dateColor == 'g' : Colors
? Color(0xFF6B3A02) .transparent,
: dateColor == 'r' ),
? Color(0xFFFF0000) color:
: dateColor == 'b' isFutureDate
? Color(0xFF493272) ? Colors.transparent
: dateColor == 'br' : (isCurrentDay ||
? Colors.brown (selectedIndex ==
: dateColor == 'y' index))
? Color(0xFF605C00) ? Color(0xFFFFFFFF)
: Colors.transparent, : dateColor == 'g'
? Color(0xFFE8FFE6)
: dateColor == 'r'
? Color(0xFFFFEFEF)
: dateColor == 'b'
? Color(0xFFFFE8D0)
: dateColor == 'br'
? Color(0xFFFFE8D0)
: dateColor == 'y'
? Color(0xFFFFF9B2)
: Colors.transparent,
),
child: Center(
child: Text(
currentDay.toString(),
style: TextStyle(
fontSize: 14,
fontWeight:
FontWeight.w400,
color:
isFutureDate
? AppColors
.semi_black
: (isCurrentDay ||
(selectedIndex ==
index))
? Color(
0xFF2D2D2D,
)
: dateColor == 'g'
? Color(
0xFF6B3A02,
)
: dateColor == 'r'
? Color(
0xFFFF0000,
)
: dateColor == 'b'
? Color(
0xFF493272,
)
: dateColor ==
'br'
? Color(
0xFF6B3A02,
)
: dateColor == 'y'
? Color(
0xFF605C00,
)
: Colors
.transparent,
),
), ),
), ),
), ),
), ),
), ],
], ),
), ),
), );
); },
}, ),
), ),
), ),
), ],
], ),
), ),
), SizedBox(height: 70),
SizedBox(height: 70), ],
],
),
),
),
floatingActionButton:attendance.attendanceStatus==0||attendance.attendanceStatus==1? Align(
alignment: Alignment.bottomCenter,
child: InkWell(
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => CheckInOutScreen(
getAttendanceStatus: attendance.attendanceStatus,
),
),
);
if(res==true){
attendance.getAttendanceList(homeProvider, context);
}
var f = FocusScope.of(context);
if (!f.hasPrimaryFocus) {
f.unfocus();
}
},
child: Container(
alignment: Alignment.bottomCenter,
height: 45,
margin: EdgeInsets.symmetric(horizontal: 10),
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(30.0),
),
child: Center(
child: Text(
attendance.attendanceStatus == 0 ? "Check In" : "Check Out",
textAlign: TextAlign.center,
style: TextStyle(color: Colors.white),
),
), ),
), ),
), ),
):SizedBox(height: 0,), floatingActionButton:
floatingActionButtonLocation: attendance.attendanceStatus == 0 ||
FloatingActionButtonLocation.centerFloat, attendance.attendanceStatus == 1
? Align(
alignment: Alignment.bottomCenter,
child: InkWell(
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => CheckInOutScreen(
getAttendanceStatus:
attendance.attendanceStatus,
),
),
);
if (res == true) {
attendance.getAttendanceList(
homeProvider,
context,
);
attendance.init(homeProvider, context);
attendance.loadAttendanceDetails(
homeProvider,
context,
);
}
var f = FocusScope.of(context);
if (!f.hasPrimaryFocus) {
f.unfocus();
}
},
child: Container(
alignment: Alignment.bottomCenter,
height: 45,
margin: EdgeInsets.symmetric(horizontal: 10),
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15.0),
),
child: Center(
child: Text(
attendance.attendanceStatus == 0
? "Check In"
: "Check Out",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16,
color: Colors.white,
fontFamily: "JakartaMedium",
),
),
),
),
),
)
: SizedBox(height: 0),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
),
), ),
); );
}, },
...@@ -663,6 +755,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> { ...@@ -663,6 +755,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
"Indicators Info", "Indicators Info",
style: TextStyle( style: TextStyle(
color: AppColors.app_blue, color: AppColors.app_blue,
fontFamily: "JakartaSemiBold",
fontSize: 16, fontSize: 16,
), ),
), ),
...@@ -766,6 +859,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> { ...@@ -766,6 +859,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
"Attendance Info", "Attendance Info",
style: TextStyle( style: TextStyle(
color: AppColors.app_blue, color: AppColors.app_blue,
fontFamily: "JakartaSemiBold",
fontSize: 16, fontSize: 16,
), ),
), ),
...@@ -790,7 +884,9 @@ class _AttendanceScreenState extends State<AttendanceScreen> { ...@@ -790,7 +884,9 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
), ),
child: Row( child: Row(
children: [ children: [
Text("Late Points "), Text("Late Points ",style: TextStyle(
fontFamily: "JakartaMedium",
),),
Text( Text(
provider.penalties, provider.penalties,
style: TextStyle( style: TextStyle(
...@@ -831,6 +927,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> { ...@@ -831,6 +927,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
child: Text( child: Text(
values[j], values[j],
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium",
color: AppColors.semi_black, color: AppColors.semi_black,
), ),
), ),
...@@ -838,7 +935,9 @@ class _AttendanceScreenState extends State<AttendanceScreen> { ...@@ -838,7 +935,9 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
Expanded( Expanded(
child: Text( child: Text(
subvalues[j], subvalues[j],
style: TextStyle(color: Color(0xFF818181)), style: TextStyle(
color: Color(0xFF818181),
),
), ),
), ),
], ],
......
...@@ -48,29 +48,29 @@ class _CheckInOutScreenState extends State<CheckInOutScreen> { ...@@ -48,29 +48,29 @@ class _CheckInOutScreenState extends State<CheckInOutScreen> {
return Consumer<CheckInOutProvider>( return Consumer<CheckInOutProvider>(
builder: (context, provider, child) { builder: (context, provider, child) {
return Scaffold( return WillPopScope(
appBar: appbar(context, widget.getAttendanceStatus==0? "Check In":"Check Out"), onWillPop: () => onBackPressed(context),
body:Container( child: Scaffold(
child: SafeArea( resizeToAvoidBottomInset: true,
child: Column( appBar: appbar(context, widget.getAttendanceStatus==0? "Check In":"Check Out"),
children: [ body:Container(
Expanded( child: SafeArea(
child: ClipRRect( child: Column(
borderRadius: BorderRadius.only( children: [
topLeft: Radius.circular(30.0), Expanded(
topRight: Radius.circular(30.0),
),
child: Stack( child: Stack(
children: [ children: [
GoogleMap( GoogleMap(
myLocationEnabled: true, myLocationEnabled: true,
zoomGesturesEnabled: true, zoomGesturesEnabled: true,
scrollGesturesEnabled: false,
initialCameraPosition: CameraPosition( initialCameraPosition: CameraPosition(
target: provider.currentLocationLatLng ?? target: provider.currentLocationLatLng ??
provider.startLocation, provider.startLocation,
zoom: 20.0, zoom: 20.0,
), ),
markers: provider.markers.toSet(), markers: provider.markers.toSet(),
myLocationButtonEnabled: true,
mapType: MapType.normal, mapType: MapType.normal,
onMapCreated: (controller) { onMapCreated: (controller) {
provider.mapController = controller; provider.mapController = controller;
...@@ -99,15 +99,29 @@ class _CheckInOutScreenState extends State<CheckInOutScreen> { ...@@ -99,15 +99,29 @@ class _CheckInOutScreenState extends State<CheckInOutScreen> {
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
SizedBox(height: 25), SizedBox(height: 25),
Padding( Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 20.0), horizontal: 20.0),
child: Text( child: Column(
"Location", crossAxisAlignment: CrossAxisAlignment.start,
style: TextStyle( children: [
fontWeight: FontWeight.w400, Text(
color: Colors.grey, "Share Your Details",
), style: TextStyle(
color: AppColors.app_blue,
fontFamily: "JakartaSemiBold"
),
),
SizedBox(height: 10,),
Text(
"Location",
style: TextStyle(
fontFamily: "JakartaMedium",
color: AppColors.semi_black,
),
),
],
), ),
), ),
SizedBox(height: 5), SizedBox(height: 5),
...@@ -121,7 +135,7 @@ class _CheckInOutScreenState extends State<CheckInOutScreen> { ...@@ -121,7 +135,7 @@ class _CheckInOutScreenState extends State<CheckInOutScreen> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.text_field_color, color: AppColors.text_field_color,
borderRadius: borderRadius:
BorderRadius.circular(25), BorderRadius.circular(14),
), ),
child: Padding( child: Padding(
padding: padding:
...@@ -138,7 +152,8 @@ class _CheckInOutScreenState extends State<CheckInOutScreen> { ...@@ -138,7 +152,8 @@ class _CheckInOutScreenState extends State<CheckInOutScreen> {
"Enter Check ${widget.getAttendanceStatus==0?"In":"Out"} Location", "Enter Check ${widget.getAttendanceStatus==0?"In":"Out"} Location",
hintStyle: TextStyle( hintStyle: TextStyle(
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
fontSize: 14 fontSize: 14,
color: Color(0xFF818181)
), ),
enabledBorder: enabledBorder:
InputBorder.none, InputBorder.none,
...@@ -201,12 +216,13 @@ class _CheckInOutScreenState extends State<CheckInOutScreen> { ...@@ -201,12 +216,13 @@ class _CheckInOutScreenState extends State<CheckInOutScreen> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.app_blue, color: AppColors.app_blue,
borderRadius: borderRadius:
BorderRadius.circular(30.0), BorderRadius.circular(15.0),
), ),
child: Text( child: Text(
widget.getAttendanceStatus==0? "Check In":"Check Out", widget.getAttendanceStatus==0? "Check In":"Check Out",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w500, fontFamily: "JakartaMedium",
fontSize: 16,
color: Colors.white color: Colors.white
), ),
), ),
...@@ -220,8 +236,8 @@ class _CheckInOutScreenState extends State<CheckInOutScreen> { ...@@ -220,8 +236,8 @@ class _CheckInOutScreenState extends State<CheckInOutScreen> {
], ],
), ),
), ),
), ],
], ),
), ),
), ),
), ),
......
...@@ -13,10 +13,12 @@ import 'package:generp/screens/ScannerLogin.dart'; ...@@ -13,10 +13,12 @@ import 'package:generp/screens/ScannerLogin.dart';
import 'package:generp/screens/WebERPScreen.dart'; import 'package:generp/screens/WebERPScreen.dart';
import 'package:generp/screens/WebWhizzdomScreen.dart'; import 'package:generp/screens/WebWhizzdomScreen.dart';
import 'package:generp/screens/genTracker/GenTrackerDashboard.dart'; import 'package:generp/screens/genTracker/GenTrackerDashboard.dart';
import 'package:generp/screens/serviceEngineer/NearbyGenerators.dart';
import 'package:generp/screens/serviceEngineer/serviceEngineerDashboard.dart'; import 'package:generp/screens/serviceEngineer/serviceEngineerDashboard.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 '../Utils/app_colors.dart'; import '../Utils/app_colors.dart';
import 'AttendanceScreen.dart'; import 'AttendanceScreen.dart';
import 'inventory/InventoryScreen.dart'; import 'inventory/InventoryScreen.dart';
...@@ -42,57 +44,105 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -42,57 +44,105 @@ class _MyHomePageState extends State<MyHomePage> {
Future.delayed(Duration(milliseconds: 600), () { Future.delayed(Duration(milliseconds: 600), () {
prof_prov.ProfileApiFunction(prov, context); prof_prov.ProfileApiFunction(prov, context);
prof_prov.VersionApiFunction(); prof_prov.VersionApiFunction();
}); });
super.initState(); super.initState();
} }
Future<bool> onBackPressed() async { Future<bool> onBackPressed() async {
return await showDialog<bool>( return await showDialog<bool>(
context: context, context: context,
builder: (context) => AlertDialog( builder:
title: const Text('Are you sure?'), (context) => AlertDialog(
content: const Text('Do you want to exit the App'), title: const Text('Are you sure?'),
actions: [ content: const Text('Do you want to exit the App'),
TextButton( actions: [
style: ButtonStyle( TextButton(
backgroundColor: MaterialStateProperty.all(Colors.white), style: ButtonStyle(
overlayColor: MaterialStateProperty.all(Colors.white), backgroundColor: MaterialStateProperty.all(Colors.white),
), overlayColor: MaterialStateProperty.all(Colors.white),
onPressed: () => Navigator.of(context).pop(false), ),
child: Text( onPressed: () => Navigator.of(context).pop(false),
"NO", child: Text(
style: TextStyle( "NO",
fontWeight: FontWeight.w500, style: TextStyle(fontWeight: FontWeight.w500),
), ),
), ),
), const SizedBox(height: 16),
const SizedBox(height: 16), TextButton(
TextButton( style: ButtonStyle(
style: ButtonStyle( backgroundColor: MaterialStateProperty.all(Colors.white),
backgroundColor: MaterialStateProperty.all(Colors.white), overlayColor: MaterialStateProperty.all(Colors.white70),
overlayColor: MaterialStateProperty.all(Colors.white70), ),
), onPressed:
onPressed: () => () => SystemChannels.platform.invokeMethod(
SystemChannels.platform.invokeMethod('SystemNavigator.pop'), 'SystemNavigator.pop',
child: Text( ),
"YES", child: Text(
style: TextStyle( "YES",
fontWeight: FontWeight.w500, style: TextStyle(fontWeight: FontWeight.w500),
),
),
],
elevation: 30.0,
), ),
), barrierDismissible: false,
), ) ??
],
elevation: 30.0,
),
barrierDismissible: false,
) ??
false; false;
} }
Future<void> requestGpsPermission() async {
bool isLocationEnabled = false;
bool hasLocationPermission = false;
isLocationEnabled = await Geolocator.isLocationServiceEnabled();
// Check if the app has been granted location permission
LocationPermission permission = await Geolocator.checkPermission();
hasLocationPermission =
permission == LocationPermission.always ||
permission == LocationPermission.whileInUse;
final loc.Location location = loc.Location();
bool serviceEnabled;
serviceEnabled = await location.serviceEnabled();
if (!serviceEnabled) {
serviceEnabled = await location.requestService();
if (!serviceEnabled) {
return;
}
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Consumer2<HomescreenNotifier, ProfileNotifer>( return Consumer2<HomescreenNotifier, ProfileNotifer>(
builder: (context, homescreen, profile, child) { builder: (context, homescreen, profile, child) {
// Define the original data
final names = [
"Attendance",
"ERP",
"Gen Tracker",
"Service Engineer",
"Nearby",
"Inventory",
"Whizzdom",
];
final icons = [
"assets/svg/home_icons_1.svg",
"assets/svg/home_icons_2.svg",
"assets/svg/home_icons_31.svg",
"assets/svg/home_icons_4.svg",
"assets/svg/home_icons_5.svg",
"assets/svg/home_icons_6.svg",
"assets/svg/home_icons_81.svg",
];
final requiredRoles = ["430", "431", "434", "433", "433", "432", "431"];
final filteredItems = <Map<String, String>>[];
for (int i = 0; i < names.length; i++) {
if (homescreen.roleStatus.contains(requiredRoles[i])) {
filteredItems.add({'name': names[i], 'icon': icons[i]});
}
}
return WillPopScope( return WillPopScope(
onWillPop: onBackPressed, onWillPop: onBackPressed,
child: RefreshIndicator.adaptive( child: RefreshIndicator.adaptive(
...@@ -101,9 +151,9 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -101,9 +151,9 @@ class _MyHomePageState extends State<MyHomePage> {
onRefresh: () async { onRefresh: () async {
await Future.delayed(const Duration(milliseconds: 600)); await Future.delayed(const Duration(milliseconds: 600));
homescreen.DashboardApiFunction(context); homescreen.DashboardApiFunction(context);
}, },
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: Container( body: Container(
...@@ -129,7 +179,10 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -129,7 +179,10 @@ class _MyHomePageState extends State<MyHomePage> {
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30), borderRadius: BorderRadius.circular(30),
gradient: LinearGradient( gradient: LinearGradient(
colors: [AppColors.profile_card_gradient1, AppColors.profile_card_gradient2], colors: [
AppColors.profile_card_gradient1,
AppColors.profile_card_gradient2,
],
), ),
), ),
child: Row( child: Row(
...@@ -143,40 +196,50 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -143,40 +196,50 @@ class _MyHomePageState extends State<MyHomePage> {
children: [ children: [
SizedBox( SizedBox(
width:66, width: 66,
height: 66, height: 66,
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(50), borderRadius: BorderRadius.circular(
50,
),
child: CachedNetworkImage( child: CachedNetworkImage(
cacheKey: profile.profileImage, cacheKey: profile.profileImage,
fit: BoxFit.cover, fit: BoxFit.cover,
imageUrl: "${profile.profileImage}", imageUrl: "${profile.profileImage}",
useOldImageOnUrlChange: false, useOldImageOnUrlChange: false,
placeholder: (context, url) => CircularProgressIndicator.adaptive( placeholder:
(context, url) =>
), CircularProgressIndicator.adaptive(),
errorWidget: (context, url, error) => Icon(Icons.error), errorWidget:
(context, url, error) =>
Icon(Icons.error),
), ),
), ),
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment:
MainAxisAlignment.center,
children: [ children: [
Container( Container(
width: 10, width: 13,
height: 10, height: 13,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: homescreen.onlineStatus=="Online"?Colors.green:Colors.yellow, color:
homescreen.onlineStatus ==
"Online"
? Colors.green
: Colors.yellow,
), ),
), ),
SizedBox(width: 5), SizedBox(width: 6),
Text( Text(
"${homescreen.onlineStatus}", "${homescreen.onlineStatus}",
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 16,
color: Colors.black, fontFamily: "JakartaMedium",
color: Color(0xFF2D2D2D),
), ),
), ),
], ],
...@@ -189,20 +252,23 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -189,20 +252,23 @@ class _MyHomePageState extends State<MyHomePage> {
flex: 3, flex: 3,
child: SizedBox( child: SizedBox(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text( Text(
"${profile.employeeName}", "${profile.employeeName}",
style: TextStyle( style: TextStyle(
color: AppColors.app_blue, color: AppColors.app_blue,
fontSize: 16, fontFamily: "JakartaSemiBold",
fontSize: 18,
), ),
), ),
Text( Text(
"${profile.designation}", "${profile.designation}",
style: TextStyle( style: TextStyle(
color: AppColors.semi_black, color: AppColors.semi_black,
fontFamily: "JakartaRegular",
fontSize: 14, fontSize: 14,
), ),
), ),
...@@ -210,6 +276,7 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -210,6 +276,7 @@ class _MyHomePageState extends State<MyHomePage> {
"${profile.employeeeID}", "${profile.employeeeID}",
style: TextStyle( style: TextStyle(
color: AppColors.semi_black, color: AppColors.semi_black,
fontFamily: "JakartaRegular",
fontSize: 14, fontSize: 14,
), ),
), ),
...@@ -227,7 +294,8 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -227,7 +294,8 @@ class _MyHomePageState extends State<MyHomePage> {
"View Profile", "View Profile",
style: TextStyle( style: TextStyle(
color: AppColors.app_blue, color: AppColors.app_blue,
fontSize: 16, fontFamily: "JakartaRegular",
fontSize: 14,
), ),
), ),
SizedBox(width: 5), SizedBox(width: 5),
...@@ -262,60 +330,109 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -262,60 +330,109 @@ class _MyHomePageState extends State<MyHomePage> {
bottom: 10, bottom: 10,
), ),
child: GridView.builder( child: GridView.builder(
itemCount: 8, itemCount: filteredItems.length,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate:
crossAxisCount: 2, SliverGridDelegateWithFixedCrossAxisCount(
crossAxisSpacing: 10, crossAxisCount: 2,
mainAxisSpacing: 10, crossAxisSpacing: 10,
), mainAxisSpacing: 10,
),
itemBuilder: (context, index) { itemBuilder: (context, index) {
var roles = homescreen.roleStatus; final item = filteredItems[index];
final names = [
"Attendance",
"ERP",
"Gen Tracker",
"Service Engineer",
"Nearby",
"Inventory",
"Whizzdom",
"CRM",
];
return InkResponse( return InkResponse(
onTap: () async { onTap: () async {
var res; var res;
switch (names[index]) { switch (item['name']) {
case "Attendance": case "Attendance":
res = await Navigator.push(context,MaterialPageRoute(builder: (context) => AttendanceScreen())); res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => AttendanceScreen(),
),
);
break; break;
case "ERP": case "ERP":
res = await Navigator.push(context,MaterialPageRoute(builder: (context) => WebErpScreen(erp_url: homescreen.webPageUrl))); bool isGpsEnabled =
await Geolocator.isLocationServiceEnabled();
if (isGpsEnabled) {
res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => WebErpScreen(
erp_url: homescreen.webPageUrl,
),
),
);
} else {
requestGpsPermission();
}
break; break;
case "Gen Tracker": case "Gen Tracker":
res = await Navigator.push(context, MaterialPageRoute(builder: (context)=>Gentrackerdashboard())); res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Gentrackerdashboard(),
),
);
break; break;
case "Service Engineer": case "Service Engineer":
res = await Navigator.push(context, MaterialPageRoute(builder: (context)=>Serviceengineerdashboard())); res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Serviceengineerdashboard(),
),
);
break; break;
case "Nearby": case "Nearby":
//res = await Navigator.push(context, MaterialPageRoute(builder: (context)=>NearByGeneratorsScreen())); res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Nearbygenerators(),
),
);
break; break;
case "Inventory": case "Inventory":
res = await Navigator.push(context, MaterialPageRoute(builder: (context)=>InventoryScreen())); res = await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => InventoryScreen(),
),
);
break; break;
case "Whizzdom": case "Whizzdom":
res = await Navigator.push(context, MaterialPageRoute(builder: (context)=>WebWhizzdomScreen( bool isGpsEnabled =
whizzdom_url: await Geolocator.isLocationServiceEnabled();
homescreen.whizzdomPageUrl if (isGpsEnabled) {
))); res = await Navigator.push(
break; context,
case "CRM": MaterialPageRoute(
//res = await Navigator.push(context, MaterialPageRoute(builder: (context)=>CRMScreen())); builder:
(context) => WebWhizzdomScreen(
whizzdom_url:
homescreen.whizzdomPageUrl,
),
),
);
} else {
requestGpsPermission();
}
break; break;
// case "CRM":
// //res = await Navigator.push(context, MaterialPageRoute(builder: (context)=>CRMScreen()));
// break;
default: default:
print("111"); print("111");
break; break;
} }
if(res==true){ if (res == true) {
homescreen.DashboardApiFunction(context); homescreen.DashboardApiFunction(context);
} }
}, },
...@@ -328,10 +445,9 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -328,10 +445,9 @@ class _MyHomePageState extends State<MyHomePage> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
SvgPicture.asset( SvgPicture.asset(item['icon']!, height: 45),
"assets/svg/home_icons_${index + 1}.svg", SizedBox(height: 10),
), Text(item['name']!),
Text(names[index]),
], ],
), ),
), ),
...@@ -396,7 +512,12 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -396,7 +512,12 @@ class _MyHomePageState extends State<MyHomePage> {
Spacer(), Spacer(),
InkResponse( InkResponse(
onTap: () { onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (context) => Scannerlogin(),)); Navigator.push(
context,
MaterialPageRoute(
builder: (context) => Scannerlogin(),
),
);
}, },
child: SizedBox( child: SizedBox(
height: 25, height: 25,
...@@ -414,7 +535,10 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -414,7 +535,10 @@ class _MyHomePageState extends State<MyHomePage> {
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30), borderRadius: BorderRadius.circular(30),
gradient: LinearGradient( gradient: LinearGradient(
colors: [AppColors.profile_card_gradient1, AppColors.profile_card_gradient2], colors: [
AppColors.profile_card_gradient1,
AppColors.profile_card_gradient2,
],
), ),
), ),
child: Column( child: Column(
...@@ -422,8 +546,8 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -422,8 +546,8 @@ class _MyHomePageState extends State<MyHomePage> {
children: [ children: [
Padding( Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child:SizedBox( child: SizedBox(
width:70, width: 70,
height: 70, height: 70,
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(50), borderRadius: BorderRadius.circular(50),
...@@ -432,10 +556,12 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -432,10 +556,12 @@ class _MyHomePageState extends State<MyHomePage> {
fit: BoxFit.cover, fit: BoxFit.cover,
imageUrl: "${profile.profileImage}", imageUrl: "${profile.profileImage}",
useOldImageOnUrlChange: false, useOldImageOnUrlChange: false,
placeholder: (context, url) => CircularProgressIndicator.adaptive( placeholder:
(context, url) =>
), CircularProgressIndicator.adaptive(),
errorWidget: (context, url, error) => Icon(Icons.error), errorWidget:
(context, url, error) =>
Icon(Icons.error),
), ),
), ),
), ),
...@@ -444,7 +570,8 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -444,7 +570,8 @@ class _MyHomePageState extends State<MyHomePage> {
"${profile.employeeName}", "${profile.employeeName}",
style: TextStyle( style: TextStyle(
color: AppColors.app_blue, color: AppColors.app_blue,
fontSize: 16, fontFamily: "JakartaSemiBold",
fontSize: 18,
), ),
), ),
Text( Text(
...@@ -487,6 +614,7 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -487,6 +614,7 @@ class _MyHomePageState extends State<MyHomePage> {
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
fontFamily: "JakartaMedium",
color: AppColors.app_blue, color: AppColors.app_blue,
), ),
), ),
...@@ -533,6 +661,7 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -533,6 +661,7 @@ class _MyHomePageState extends State<MyHomePage> {
], ],
), ),
), ),
SizedBox(height: 10),
InkWell( InkWell(
onTap: () { onTap: () {
// LoginApiFunction(); // LoginApiFunction();
...@@ -556,7 +685,7 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -556,7 +685,7 @@ class _MyHomePageState extends State<MyHomePage> {
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.app_blue, //1487C9 color: AppColors.app_blue, //1487C9
borderRadius: BorderRadius.circular(30.0), borderRadius: BorderRadius.circular(15.0),
), ),
child: Center( child: Center(
child: Text( child: Text(
...@@ -622,16 +751,15 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -622,16 +751,15 @@ class _MyHomePageState extends State<MyHomePage> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text( Text(
"Are you sure you want \nto logout ?", "Are you sure you want \nto logout ?",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium",
color: AppColors.semi_black, color: AppColors.semi_black,
fontSize: 18, fontSize: 18,
), ),
), ),
], ],
), ),
SizedBox(height: 20), SizedBox(height: 20),
...@@ -658,13 +786,16 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -658,13 +786,16 @@ class _MyHomePageState extends State<MyHomePage> {
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.app_blue, //1487C9 color: AppColors.app_blue, //1487C9
borderRadius: BorderRadius.circular(30.0), borderRadius: BorderRadius.circular(15.0),
), ),
child: Center( child: Center(
child: Text( child: Text(
"Yes, Logout", "Yes, Logout",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(color: Colors.white), style: TextStyle(
color: Colors.white,
fontFamily: "JakartaMedium",
),
), ),
), ),
), ),
...@@ -695,7 +826,10 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -695,7 +826,10 @@ class _MyHomePageState extends State<MyHomePage> {
child: Text( child: Text(
"Cancel", "Cancel",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(color: AppColors.app_blue), style: TextStyle(
color: AppColors.app_blue,
fontFamily: "JakartaMedium",
),
), ),
), ),
), ),
......
...@@ -108,459 +108,499 @@ class _LoginScreenState extends State<LoginScreen> ...@@ -108,459 +108,499 @@ class _LoginScreenState extends State<LoginScreen>
_scrollController.dispose(); _scrollController.dispose();
super.dispose(); super.dispose();
} }
Future<bool> onBackPressed() async {
return await showDialog<bool>(
context: context,
builder:
(context) => AlertDialog(
title: const Text('Are you sure?'),
content: const Text('Do you want to exit the App'),
actions: [
TextButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(Colors.white),
overlayColor: MaterialStateProperty.all(Colors.white),
),
onPressed: () => Navigator.of(context).pop(false),
child: Text(
"NO",
style: TextStyle(fontWeight: FontWeight.w500),
),
),
const SizedBox(height: 16),
TextButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(Colors.white),
overlayColor: MaterialStateProperty.all(Colors.white70),
),
onPressed:
() => SystemChannels.platform.invokeMethod(
'SystemNavigator.pop',
),
child: Text(
"YES",
style: TextStyle(fontWeight: FontWeight.w500),
),
),
],
elevation: 30.0,
),
barrierDismissible: false,
) ??
false;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var loginProv = Provider.of<Loginnotifier>(context,listen: true); var loginProv = Provider.of<Loginnotifier>(context,listen: true);
double screenWidth = MediaQuery.of(context).size.width; double screenWidth = MediaQuery.of(context).size.width;
double screenHeight = MediaQuery.of(context).size.height; double screenHeight = MediaQuery.of(context).size.height;
return Scaffold( return WillPopScope(
backgroundColor: AppColors.scaffold_bg_color, onWillPop: onBackPressed,
body: KeyboardVisibilityProvider( child: Scaffold(
controller: _keyboardVisibilityController, resizeToAvoidBottomInset: true,
child: Stack( backgroundColor: AppColors.scaffold_bg_color,
alignment: Alignment.center, body: KeyboardVisibilityProvider(
children: [ controller: _keyboardVisibilityController,
// Background scrolling logos child: Stack(
ListView.builder( alignment: Alignment.center,
controller: _scrollController, children: [
itemBuilder: (context, index) { // Background scrolling logos
int logoIndex = index % logos.length; ListView.builder(
return Padding( controller: _scrollController,
padding: const EdgeInsets.all(5.0), itemBuilder: (context, index) {
child: CustomGridRow(logos: logos, logoIndex: logoIndex), int logoIndex = index % logos.length;
); return Padding(
}, padding: const EdgeInsets.all(3.0),
), child: CustomGridRow(logos: logos, logoIndex: logoIndex),
AnimatedPositioned( );
bottom: 0, },
left: 0, ),
right: 0, AnimatedPositioned(
duration: Duration(milliseconds: 300), bottom: 0,
child: Container( left: 0,
clipBehavior: Clip.antiAlias, right: 0,
decoration: BoxDecoration( duration: Duration(milliseconds: 300),
gradient: LinearGradient( child: Container(
begin: Alignment(-0.00, -1.00), clipBehavior: Clip.antiAlias,
end: Alignment(0, 1), decoration: BoxDecoration(
colors: [ gradient: LinearGradient(
Colors.white.withOpacity(0.0), begin: Alignment(-0.00, -1.00),
// Fully transparent at the very top end: Alignment(0, 1),
Colors.white.withOpacity(0.3), colors: [
// Light fade-in Colors.white.withOpacity(0.0),
Colors.white.withOpacity(0.6), // Fully transparent at the very top
// Mid fade Colors.white.withOpacity(0.3),
Colors.white, // Light fade-in
// Solid white for the rest Colors.white.withOpacity(0.6),
], // Mid fade
stops: [0.0, 0.05, 0.1, 0.15], Colors.white,
// Solid white for the rest
],
stops: [0.0, 0.05, 0.1, 0.15],
),
), ),
), child: SingleChildScrollView(
child: SingleChildScrollView( child: Stack(
child: Stack( alignment: Alignment.center,
alignment: Alignment.center, children: [
children: [ Container(
Container( alignment: Alignment.center,
alignment: Alignment.center, padding: EdgeInsets.symmetric(
padding: EdgeInsets.symmetric( horizontal: 15,
horizontal: 15, vertical: 10,
vertical: 10, ),
), child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, children: [
children: [ AnimatedContainer(
AnimatedContainer( duration: const Duration(milliseconds: 1200),
duration: const Duration(milliseconds: 1200), curve: Curves.easeInOut,
curve: Curves.easeInOut, child:
child: _isTextFieldFocused
_isTextFieldFocused ? Row(
? Row( mainAxisAlignment:
mainAxisAlignment: MainAxisAlignment.center,
MainAxisAlignment.center, crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.center,
CrossAxisAlignment.center, children: [
children: [ Expanded(
Expanded( flex: 1,
flex: 1, child: SizedBox(width: 10),
child: SizedBox(width: 10),
),
Expanded(
flex: 2,
child: Image.asset(
"assets/images/gen_logo.png",
), ),
), Expanded(
const SizedBox(width: 10), flex: 2,
Expanded( child: Image.asset(
flex: 3, "assets/images/gen_logo.png",
child: Text(
"GEN ERP",
style: TextStyle(
fontFamily: 'LexendSemiBold',
color: AppColors.ERP_text_color,
fontSize: 25,
), ),
), ),
), const SizedBox(width: 10),
Expanded( Expanded(
flex: 1, flex: 3,
child: SizedBox(width: 10), child: Image.asset("assets/images/gen_logo_grad.png"),
),
],
)
: Column(
children: [
Container(
width: 180,
height: 120,
child: Image.asset(
"assets/images/gen_logo.png",
), ),
), Expanded(
Text( flex: 1,
"GEN ERP", child: SizedBox(width: 10),
style: TextStyle(
fontFamily: 'LexendSemiBold',
color: AppColors.ERP_text_color,
fontSize: 25,
), ),
), ],
], )
), : Column(
), children: [
Text( Container(
"Login to enter", width: 180,
style: TextStyle( height: 120,
fontSize: 14, child: Image.asset(
color: AppColors.app_blue, "assets/images/gen_logo.png",
),
),
Image.asset("assets/images/gen_logo_grad.png",width: 150,),
],
),
), ),
), SizedBox(height: 10,),
Container( Text(
alignment: Alignment.topLeft, "Login to enter",
child: Text(
"Enter Email",
style: TextStyle( style: TextStyle(
color: AppColors.semi_black, fontSize: 14,
fontSize: 12, fontFamily: "JakartaMedium",
color: AppColors.app_blue,
), ),
), ),
), Container(
Container( padding: EdgeInsets.only(left: 10,bottom: 5),
height: 48, alignment: Alignment.topLeft,
alignment: Alignment.center, child: Text(
decoration: BoxDecoration( "Email ID",
color: AppColors.text_field_color, style: TextStyle(
borderRadius: BorderRadius.circular(20), color: AppColors.semi_black,
border: _emailFocusNode.hasFocus?Border.all(color: AppColors.app_blue,width: 0.5):null fontFamily: "JakartaMedium",
fontSize: 14,
),
),
), ),
// alignment: Alignment.center, Container(
margin: EdgeInsets.only(left: 5.0, right: 5.0), height: 48,
child: Padding( alignment: Alignment.center,
padding: const EdgeInsets.fromLTRB( decoration: BoxDecoration(
10.0, color: AppColors.text_field_color,
0.0, borderRadius: BorderRadius.circular(14),
15, border: _emailFocusNode.hasFocus?Border.all(color: AppColors.app_blue,width: 0.5):null
0,
), ),
child: TextField( // alignment: Alignment.center,
controller: email, margin: EdgeInsets.only(left: 5.0, right: 5.0),
keyboardType: TextInputType.emailAddress, child: Padding(
focusNode: _emailFocusNode, padding: const EdgeInsets.fromLTRB(
style: TextStyle( 10.0,
fontSize: 14 0.0,
15,
0,
), ),
onChanged: (value) { child: TextField(
loginProv.updateEmail(email.text); controller: email,
}, keyboardType: TextInputType.emailAddress,
onTapOutside: (event) { focusNode: _emailFocusNode,
// Handle onTapOutside style: TextStyle(
FocusScope.of(context).unfocus(); fontSize: 14
}, ),
decoration: InputDecoration( onChanged: (value) {
isDense: true, loginProv.updateEmail(email.text);
hintStyle: TextStyle( },
fontWeight: FontWeight.w400, onTapOutside: (event) {
fontSize: 14 // Handle onTapOutside
FocusScope.of(context).unfocus();
},
decoration: InputDecoration(
isDense: true,
hintStyle: TextStyle(
fontWeight: FontWeight.w400,
fontSize: 14,
color: Color(0xFF818181)
),
//contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0),
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
hintText: 'Enter Your Email',
), ),
//contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0),
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
hintText: 'Enter Email',
), ),
), ),
), ),
), if (loginProv.emailError != null) ...[
if (loginProv.emailError != null) ...[ Container(
alignment: Alignment.topLeft,
margin: EdgeInsets.only(
top: 2.5,
bottom: 2.5,
left: 25,
),
child: Text(
loginProv.emailError,
textAlign: TextAlign.start,
style: TextStyle(color: Colors.red),
),
),
] else ...[
SizedBox(height: 10.0),
],
Container( Container(
padding: EdgeInsets.only(left: 10,bottom: 5),
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
margin: EdgeInsets.only(
top: 2.5,
bottom: 2.5,
left: 25,
),
child: Text( child: Text(
loginProv.emailError, "Password",
textAlign: TextAlign.start, style: TextStyle(
style: TextStyle(color: Colors.red), color: AppColors.semi_black,
), fontFamily: "JakartaMedium",
), fontSize: 14,
] else ...[ ),
SizedBox(height: 15.0),
],
Container(
alignment: Alignment.topLeft,
child: Text(
"Enter Password",
style: TextStyle(
color: AppColors.semi_black,
fontSize: 12,
), ),
), ),
), Container(
Container( height: 48,
height: 48, alignment: Alignment.center,
alignment: Alignment.center, decoration: BoxDecoration(
decoration: BoxDecoration( color: AppColors.text_field_color,
color: AppColors.text_field_color, borderRadius: BorderRadius.circular(14),
borderRadius: BorderRadius.circular(20), border: _passwordFocusNode.hasFocus?Border.all(color: AppColors.app_blue,width: 0.5):null
border: _passwordFocusNode.hasFocus?Border.all(color: AppColors.app_blue,width: 0.5):null
),
// alignment: Alignment.center,
margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: Padding(
padding: const EdgeInsets.fromLTRB(
10.0,
0.0,
0,
0,
), ),
child: TextField( // alignment: Alignment.center,
controller: password, margin: EdgeInsets.only(left: 5.0, right: 5.0),
focusNode: _passwordFocusNode, child: Padding(
obscureText: !loginProv.pwdVisible, padding: const EdgeInsets.fromLTRB(
keyboardType: TextInputType.visiblePassword, 10.0,
style: TextStyle( 0.0,
fontSize: 14 0,
0,
), ),
onChanged: (value) { child: TextField(
loginProv.updatePassword(password.text); controller: password,
}, focusNode: _passwordFocusNode,
onEditingComplete: () { obscureText: !loginProv.pwdVisible,
keyboardType: TextInputType.visiblePassword,
style: TextStyle(
fontSize: 14,
),
onChanged: (value) {
loginProv.updatePassword(password.text);
},
onEditingComplete: () {
}, },
decoration: InputDecoration( decoration: InputDecoration(
contentPadding: EdgeInsets.fromLTRB( contentPadding: EdgeInsets.fromLTRB(
0, 0,
10, 10,
0, 0,
0, 0,
),
hintText: "Enter Password",
suffixIcon: IconButton(
icon: Icon(
loginProv.pwdVisible
? CupertinoIcons.eye_solid
: CupertinoIcons.eye_slash_fill,
size: 30,
), ),
onPressed: () { hintText: "Enter Password",
loginProv.visibility_ov(); suffixIcon: IconButton(
}, icon: Icon(
), loginProv.pwdVisible
hintStyle: TextStyle( ? CupertinoIcons.eye_solid
fontSize: 14, : CupertinoIcons.eye_slash_fill,
fontWeight: FontWeight.w400, size: 30,
),
onPressed: () {
loginProv.visibility_ov();
},
),
hintStyle: TextStyle(
fontSize: 14,
color: Color(0xFF818181),
fontWeight: FontWeight.w400,
),
isDense: true,
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
), ),
isDense: true,
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
), ),
), ),
), ),
), if (loginProv.passwordError != null) ...[
if (loginProv.passwordError != null) ...[ Container(
Container( alignment: Alignment.topLeft,
alignment: Alignment.topLeft,
margin: EdgeInsets.only(
top: 2.5,
bottom: 2.5,
left: 25,
),
child: Text(
loginProv.passwordError,
textAlign: TextAlign.start,
style: TextStyle(color: Colors.red),
),
),
] else ...[
SizedBox(height: 25.0),
],
Container(
child: InkWell(
onTap: () {
// LoginApiFunction();
loginProv.LoginApiFunction(context, email.text, password.text);
var f = FocusScope.of(context);
if (!f.hasPrimaryFocus) {
f.unfocus();
}
// Navigator.push(context,MaterialPageRoute(builder: (context)=>Profile()));
},
child: Container(
alignment: Alignment.center,
height: 45,
width: screenWidth,
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 5.0, top: 2.5,
right: 5.0, bottom: 2.5,
left: 25,
), ),
decoration: BoxDecoration( child: Text(
color: loginProv.isButtonEnabled?AppColors.app_blue:AppColors.button_disabled, //1487C9 loginProv.passwordError,
borderRadius: BorderRadius.circular(30.0), textAlign: TextAlign.start,
style: TextStyle(color: Colors.red),
), ),
child: Center( ),
child: Text( ] else ...[
"Login", SizedBox(height: 25.0),
textAlign: TextAlign.center, ],
style: TextStyle(color: Colors.white), Container(
child: InkWell(
onTap: () {
// LoginApiFunction();
loginProv.LoginApiFunction(context, email.text, password.text);
var f = FocusScope.of(context);
if (!f.hasPrimaryFocus) {
f.unfocus();
}
// Navigator.push(context,MaterialPageRoute(builder: (context)=>Profile()));
},
child: Container(
alignment: Alignment.center,
height: 45,
width: screenWidth,
margin: EdgeInsets.only(
left: 5.0,
right: 5.0,
),
decoration: BoxDecoration(
color: loginProv.isButtonEnabled?AppColors.app_blue:AppColors.button_disabled, //1487C9
borderRadius: BorderRadius.circular(15.0),
),
child: Center(
child: Text(
"Login",
textAlign: TextAlign.center,
style: TextStyle(color: Colors.white,
fontFamily: "JakartaRegular",),
),
), ),
), ),
), ),
), ),
), ],
], ),
), ),
), ],
], ),
), ),
), ),
), ),
), Positioned(
Positioned( top: 50,
top: 50, right: 20,
right: 20, child: InkResponse(
child: InkResponse(
child: GestureDetector( child: GestureDetector(
onTap: () async { onTap: () async {
await tooltipcontroller.showTooltip(); await tooltipcontroller.showTooltip();
}, },
child: SuperTooltip( child: SuperTooltip(
controller: tooltipcontroller, controller: tooltipcontroller,
popupDirection: TooltipDirection.down, popupDirection: TooltipDirection.down,
backgroundColor: Colors.white, backgroundColor: Colors.white,
borderColor: Colors.white, borderColor: Colors.white,
showCloseButton: true, showCloseButton: true,
left: 50, left: 50,
right: 30, right: 30,
barrierColor: Colors.transparent, barrierColor: Colors.transparent,
arrowTipDistance: 20.0, arrowTipDistance: 20.0,
minimumOutsideMargin: 120, minimumOutsideMargin: 120,
arrowBaseWidth: 20.0, arrowBaseWidth: 20.0,
arrowLength: 20.0, arrowLength: 20.0,
borderWidth: 2.0, borderWidth: 2.0,
constraints: const BoxConstraints( constraints: const BoxConstraints(
minHeight: 0.0, minHeight: 0.0,
maxHeight: 100, maxHeight: 100,
minWidth: 0.0, minWidth: 0.0,
maxWidth: 100, maxWidth: 100,
), ),
touchThroughAreaShape: ClipAreaShape.rectangle, touchThroughAreaShape: ClipAreaShape.rectangle,
touchThroughAreaCornerRadius: 30, touchThroughAreaCornerRadius: 30,
content: Container( content: Container(
height: 100, height: 100,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text("Device ID", Text("Device ID",
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
color: AppColors.app_blue fontFamily: "JakartaMedium",
),), color: AppColors.app_blue
SizedBox(height: 15,), ),),
Row( SizedBox(height: 15,),
mainAxisAlignment: MainAxisAlignment.start, Row(
children: [ mainAxisAlignment: MainAxisAlignment.start,
Container( children: [
height: 50, Container(
padding: EdgeInsets.symmetric(horizontal: 10,vertical: 10), height: 50,
decoration: BoxDecoration( padding: EdgeInsets.symmetric(horizontal: 10,vertical: 10),
borderRadius: BorderRadius.circular(18), decoration: BoxDecoration(
color: AppColors.text_field_color borderRadius: BorderRadius.circular(18),
), color: AppColors.text_field_color
child: Row( ),
children: [ child: Row(
Container( children: [
width: 180, Container(
height: 45, width: 180,
alignment: Alignment.center, height: 45,
margin: EdgeInsets.only(right: 5.0), alignment: Alignment.center,
decoration: BoxDecoration( margin: EdgeInsets.only(right: 5.0),
borderRadius: BorderRadius.circular(10.0)), decoration: BoxDecoration(
child: Text( borderRadius: BorderRadius.circular(10.0)),
'${loginProv.deviceId}', child: Text(
style: TextStyle( '${loginProv.deviceId}',
fontSize: 16, style: TextStyle(
color: AppColors.semi_black fontSize: 16,
color: AppColors.semi_black
),
)),
Container(
child: InkWell(
onTap: () async {
Clipboard.setData(ClipboardData(text: loginProv.deviceId.trim()));
toast(context, "Device ID has been copied!");
},
child: Icon(
Icons.copy
), ),
)),
Container(
child: InkWell(
onTap: () async {
Clipboard.setData(ClipboardData(text: loginProv.deviceId.trim()));
toast(context, "Device ID has been copied!");
},
child: Icon(
Icons.copy
), ),
), ),
), ],
], ),
),
),
Spacer(),
Container(
width: 60,
height: 50,
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(18)
), ),
child: InkWell( Spacer(),
onTap: () { Container(
Share.share("${loginProv.deviceId}"); width: 60,
}, height: 50,
child: Icon( decoration: BoxDecoration(
Icons.share_outlined, color: AppColors.app_blue,
color: Colors.white, borderRadius: BorderRadius.circular(18)
), ),
)), child: InkWell(
], onTap: () {
), Share.share("${loginProv.deviceId}");
], },
), child: Icon(
), Icons.share_outlined,
child: Align( color: Colors.white,
alignment: Alignment.topRight, ),
child: Container( )),
width: 100, ],
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5), ),
decoration: BoxDecoration( ],
color: AppColors.overlay_box_color,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: AppColors.app_blue, width: 0.5),
), ),
child: Center( ),
child: Text( child: Align(
"Device ID", alignment: Alignment.topRight,
textAlign: TextAlign.center, child: Container(
style: TextStyle( width: 100,
color: AppColors.app_blue, padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
fontSize: 14, decoration: BoxDecoration(
color: AppColors.overlay_box_color,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: AppColors.app_blue, width: 0.5),
),
child: Center(
child: Text(
"Device ID",
textAlign: TextAlign.center,
style: TextStyle(
color: AppColors.app_blue,
fontSize: 14,
),
), ),
), ),
), ),
...@@ -569,9 +609,9 @@ class _LoginScreenState extends State<LoginScreen> ...@@ -569,9 +609,9 @@ class _LoginScreenState extends State<LoginScreen>
), ),
), ),
), ),
),
], ],
),
), ),
), ),
); );
...@@ -611,8 +651,8 @@ class LogoWidget extends StatelessWidget { ...@@ -611,8 +651,8 @@ class LogoWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
width: 80, width: MediaQuery.of(context).size.width/4.5,
height: 80, height: MediaQuery.of(context).size.width/4.5,
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage(image: AssetImage(imagePath), fit: BoxFit.cover), image: DecorationImage(image: AssetImage(imagePath), fit: BoxFit.cover),
), ),
......
...@@ -18,51 +18,55 @@ class _ScannerloginState extends State<Scannerlogin> { ...@@ -18,51 +18,55 @@ class _ScannerloginState extends State<Scannerlogin> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Consumer<Scanloginprovider>( return Consumer<Scanloginprovider>(
builder: (context, provider, child) { builder: (context, provider, child) {
return Scaffold( return WillPopScope(
backgroundColor: AppColors.scaffold_bg_color, onWillPop: () => onBackPressed(context),
appBar: appbar(context, "QR Login"), child: Scaffold(
body: Container( resizeToAvoidBottomInset: true,
decoration: BoxDecoration(color: Colors.black), backgroundColor: AppColors.scaffold_bg_color,
child: Column( appBar: appbar(context, "QR Login"),
children: [ body: Container(
Spacer(), decoration: BoxDecoration(color: Colors.black),
Container( child: Column(
height: 250, children: [
Spacer(),
Container(
height: 250,
child: QRView( child: QRView(
key: provider.scannerKey, key: provider.scannerKey,
onQRViewCreated: (p0) { onQRViewCreated: (p0) {
provider.onQRViewCreated(p0, context); provider.onQRViewCreated(p0, context);
}, },
formatsAllowed: [BarcodeFormat.qrcode], formatsAllowed: [BarcodeFormat.qrcode],
cameraFacing: CameraFacing.back, cameraFacing: CameraFacing.back,
overlay: QrScannerOverlayShape( overlay: QrScannerOverlayShape(
borderColor: AppColors.app_blue, borderColor: AppColors.app_blue,
borderRadius: 20, borderRadius: 20,
borderLength: 60, borderLength: 60,
borderWidth: 10, borderWidth: 10,
cutOutSize: 250.0, cutOutSize: 250.0,
),
), ),
), ),
), SizedBox(height: 25),
SizedBox(height: 25), Text(
Text( "Scan QR",
"Scan QR", textAlign: TextAlign.center,
textAlign: TextAlign.center, style: TextStyle(fontSize: 18, color: Colors.white),
style: TextStyle(fontSize: 18, color: Colors.white), ),
), Text(
Text( "to Login",
"to Login", textAlign: TextAlign.center,
textAlign: TextAlign.center, style: TextStyle(fontSize: 14, color: Colors.white),
style: TextStyle(fontSize: 14, color: Colors.white), ),
), Spacer(),
Spacer(),
SizedBox(height: 50), SizedBox(height: 50),
], ],
),
), ),
), ),
); );
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:generp/Notifiers/UpdatePasswordProvider'; import 'package:generp/Notifiers/UpdatePasswordProvider.dart';
import 'package:generp/Utils/app_colors.dart'; import 'package:generp/Utils/app_colors.dart';
import 'package:generp/Utils/commonWidgets.dart'; import 'package:generp/Utils/commonWidgets.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
...@@ -11,71 +11,92 @@ class UpdatePassword extends StatelessWidget { ...@@ -11,71 +11,92 @@ class UpdatePassword extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final provider = Provider.of<UpdatePasswordProvider>(context); final provider = Provider.of<UpdatePasswordProvider>(context);
return Scaffold( return WillPopScope(
appBar: appbar(context, "Update Password"), onWillPop: () => onBackPressed(context),
backgroundColor: AppColors.scaffold_bg_color, child: Scaffold(
body: Container( resizeToAvoidBottomInset: true,
child: Column( appBar: appbar(context, "Update Password"),
children: [ backgroundColor: AppColors.scaffold_bg_color,
Expanded( body: Container(
child: Container( child: Column(
width: double.infinity, children: [
decoration: BoxDecoration( Expanded(
borderRadius: BorderRadius.vertical( child: Container(
top: Radius.circular(30.0), width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.vertical(
top: Radius.circular(30.0),
),
), ),
), padding: EdgeInsets.all(10),
padding: EdgeInsets.all(10), child: Column(
child: Column( children: [
children: [ Container(
Container( height: 280,
height: 280, decoration: BoxDecoration(
decoration: BoxDecoration( color: Colors.white,
color: Colors.white, borderRadius: BorderRadius.circular(20.0),
borderRadius: BorderRadius.circular(20.0), ),
), child: Column(
child: Column( children: [
children: [ SizedBox(height: 10),
SizedBox(height: 10), Container(
_buildTextField( alignment: Alignment.topLeft,
controller: provider.password, padding: EdgeInsets.symmetric(horizontal: 10),
hintText: "New Password*", child: Text("New Password",style: TextStyle(
errorText: provider.passwordError, color: AppColors.semi_black
), ),)),
SizedBox(height: 10), SizedBox(height: 5),
_buildTextField( _buildTextField(
controller: provider.confPassword, controller: provider.password,
hintText: "Confirm New Password*", hintText: "New Password*",
errorText: provider.confirmPasswordError, errorText: provider.passwordError,
), ),
Spacer(), SizedBox(height: 10),
provider.isLoading Container(
? CircularProgressIndicator() alignment: Alignment.topLeft,
: InkWell( padding: EdgeInsets.symmetric(horizontal: 10),
onTap: () => provider.updatePassword(context), child: Text("Confirm Password",style: TextStyle(
child: Container( color: AppColors.semi_black
alignment: Alignment.center, ),)),
height: 45, SizedBox(height: 5),
margin: EdgeInsets.symmetric(horizontal: 15), _buildTextField(
decoration: BoxDecoration( controller: provider.confPassword,
color: AppColors.app_blue, hintText: "Confirm New Password*",
borderRadius: BorderRadius.circular(30.0), errorText: provider.confirmPasswordError,
), ),
child: Text( Spacer(),
"Update", InkWell(
style: TextStyle(color: Colors.white), onTap: () => provider.updatePassword(context),
child: Container(
alignment: Alignment.center,
height: 45,
margin: EdgeInsets.symmetric(horizontal: 15),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15.0),
),
child:provider.isLoading
? CircularProgressIndicator(
color: Colors.white,
)
: Text(
"Update",
style: TextStyle(color: Colors.white),
),
), ),
), ),
), SizedBox(height: 10),
SizedBox(height: 10), ],
], ),
), ),
), ],
], ),
), ),
), ),
), ],
], ),
), ),
), ),
); );
...@@ -103,7 +124,8 @@ class UpdatePassword extends StatelessWidget { ...@@ -103,7 +124,8 @@ class UpdatePassword extends StatelessWidget {
obscureText: true, obscureText: true,
decoration: InputDecoration( decoration: InputDecoration(
hintText: hintText, hintText: hintText,
hintStyle: TextStyle(color: Color(0xFF818181)), hintStyle: TextStyle(color: Color(0xFF818181),
fontSize: 14),
border: InputBorder.none, border: InputBorder.none,
), ),
), ),
......
...@@ -80,6 +80,7 @@ class _WebErpScreenState extends State<WebErpScreen> { ...@@ -80,6 +80,7 @@ class _WebErpScreenState extends State<WebErpScreen> {
return true; // Allow default back button behavior return true; // Allow default back button behavior
}, },
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: true,
appBar:appbar(context, "Web ERP"), appBar:appbar(context, "Web ERP"),
body: Container( body: Container(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
......
...@@ -78,6 +78,7 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> { ...@@ -78,6 +78,7 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> {
return true; // Allow default back button behavior return true; // Allow default back button behavior
}, },
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Whizzdom"), appBar: appbar(context, "Whizzdom"),
body: Container( body: Container(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
......
...@@ -34,96 +34,104 @@ class _ComplainthistoryState extends State<Complainthistory> { ...@@ -34,96 +34,104 @@ class _ComplainthistoryState extends State<Complainthistory> {
return Consumer<Generatordetailsprovider>( return Consumer<Generatordetailsprovider>(
builder: (context, provider, child) { builder: (context, provider, child) {
return Scaffold( return WillPopScope(
appBar: appbar(context, "Complaint History"), onWillPop: () => onBackPressed(context),
backgroundColor: AppColors.scaffold_bg_color, child: Scaffold(
body: Container( resizeToAvoidBottomInset: true,
child: SingleChildScrollView( appBar: appbar(context, "Complaint History"),
child: Column( backgroundColor: AppColors.scaffold_bg_color,
children: [ body: Container(
ListView.builder( child: SingleChildScrollView(
shrinkWrap: true, child: Column(
physics: NeverScrollableScrollPhysics(),
itemCount: provider.complaintList.length,
itemBuilder: (context, index) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("${ provider.complaintList[index].compRegdate}",style: TextStyle(
color: Color(0xFF818181)
),),
Container(
margin: EdgeInsets.symmetric(horizontal: 10,vertical: 5),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
), children: [
child: Column( if(provider.complaintList.isNotEmpty)...[
children: [ ListView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: provider.complaintList.length,
itemBuilder: (context, index) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("${ provider.complaintList[index].compRegdate}",style: TextStyle(
color: Color(0xFF818181)
),),
Container(
margin: EdgeInsets.symmetric(horizontal: 10,vertical: 5),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
...List.generate(4, (index) { ...List.generate(4, (index) {
final headings = [ final headings = [
"Technician Name", "Technician Name",
"ID", "ID",
"Complaint Type", "Complaint Type",
"Complaint Status",]; "Complaint Status",];
final values = [ final values = [
provider.complaintList[index].techName, provider.complaintList[index].techName,
provider.complaintList[index].compId, provider.complaintList[index].compId,
provider.complaintList[index].compType, provider.complaintList[index].compType,
provider.complaintList[index].compStatus, provider.complaintList[index].compStatus,
]; ];
return Container( return Container(
padding: EdgeInsets.symmetric(horizontal: 15,vertical: 15), padding: EdgeInsets.symmetric(horizontal: 15,vertical: 15),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
child: SizedBox( child: SizedBox(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Text("${headings[index]}"), Text("${headings[index]}"),
], ],
),
), ),
), ),
), Expanded(
Expanded( child: SizedBox(
child: SizedBox( child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, children: [
children: [ Text("${values[index]}",
Text("${values[index]}", style: TextStyle(
style: TextStyle( color: Color(0xFF818181)
color: Color(0xFF818181) ),),
),),
], ],
),
), ),
), ),
), ],
], ),
), );
); },),
},), ]
] ),
), ),
), ],
], );
); },),
},), ]else...[
Emptywidget(context)
], ]
],
),
), ),
), ),
),
),
); );
}, },
); );
......
...@@ -18,64 +18,75 @@ class Gentrackerdashboard extends StatefulWidget { ...@@ -18,64 +18,75 @@ class Gentrackerdashboard extends StatefulWidget {
class _GentrackerdashboardState extends State<Gentrackerdashboard> { class _GentrackerdashboardState extends State<Gentrackerdashboard> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return WillPopScope(
backgroundColor: AppColors.scaffold_bg_color, onWillPop: () => onBackPressed(context),
appBar: appbar(context, "Gen Tracker"), child: Scaffold(
body: GridView.builder( resizeToAvoidBottomInset: true,
padding: EdgeInsets.symmetric(vertical: 10,horizontal: 10), backgroundColor: AppColors.scaffold_bg_color,
itemCount: 4, appBar: appbar(context, "Gen Tracker"),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( body: GridView.builder(
crossAxisCount: 2, padding: EdgeInsets.symmetric(vertical: 10,horizontal: 10),
crossAxisSpacing: 10, itemCount: 4,
mainAxisSpacing: 10, gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
), crossAxisCount: 2,
itemBuilder: (context, index) { crossAxisSpacing: 10,
final names = [ mainAxisSpacing: 10,
"Generator Details", ),
"Register Complaint", itemBuilder: (context, index) {
"Tag Location", final names = [
"Tag Generator", "Generator Details",
"Register Complaint",
"Tag Location",
"Tag Generator",
]; ];
return InkResponse( final icons = [
onTap: () { "gent_gen_det",
switch (names[index]) { "gent_reg_comp",
case "Generator Details": "gent_tag_loc",
Navigator.push(context,MaterialPageRoute(builder: (context) => Scanentergeneratoridscreen(from: "Generator Details",))); "gent_tag_den",
break; ];
case "Register Complaint": return InkResponse(
Navigator.push(context,MaterialPageRoute(builder: (context) => Scanentergeneratoridscreen(from: "Register Complaint",))); onTap: () {
break; switch (names[index]) {
case "Tag Location": case "Generator Details":
Navigator.push(context, MaterialPageRoute(builder: (context)=>Scanentergeneratoridscreen(from: "Tag Location",))); Navigator.push(context,MaterialPageRoute(builder: (context) => Scanentergeneratoridscreen(from: "Generator Details",)));
break; break;
case "Tag Generator": case "Register Complaint":
Navigator.push(context, MaterialPageRoute(builder: (context)=>Scanentergeneratoridscreen(from: "Tag Generator",))); Navigator.push(context,MaterialPageRoute(builder: (context) => Scanentergeneratoridscreen(from: "Register Complaint",)));
break; break;
case "Tag Location":
Navigator.push(context, MaterialPageRoute(builder: (context)=>Scanentergeneratoridscreen(from: "Tag Location",)));
break;
case "Tag Generator":
Navigator.push(context, MaterialPageRoute(builder: (context)=>Scanentergeneratoridscreen(from: "Tag Generator",)));
break;
default: default:
print("111"); print("111");
break; break;
} }
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(30), borderRadius: BorderRadius.circular(30),
), ),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
SvgPicture.asset( SvgPicture.asset(
"assets/svg/home_icons_${index + 1}.svg", "assets/svg/${icons[index]}.svg",
), ),
Text(names[index]), SizedBox(height: 10,),
], Text(names[index]),
],
),
), ),
), );
); },
}, ),
), ),
); );
} }
......
...@@ -53,7 +53,7 @@ class _GeneratordetailsState extends State<Generatordetails> { ...@@ -53,7 +53,7 @@ class _GeneratordetailsState extends State<Generatordetails> {
homeProvider, homeProvider,
context, context,
"", "",
details.genID, widget.generatorId,
); );
} }
}); });
...@@ -89,227 +89,284 @@ class _GeneratordetailsState extends State<Generatordetails> { ...@@ -89,227 +89,284 @@ class _GeneratordetailsState extends State<Generatordetails> {
child: Icon(Icons.directions), child: Icon(Icons.directions),
), ),
); );
return Scaffold( return WillPopScope(
appBar: onWillPop: () => onBackPressed(context),
widget.activityName == "NearByGenerators" child: Scaffold(
? appbar2(context, "Generator Details", sendwidget) resizeToAvoidBottomInset: true,
: appbar(context, "Generator Details"), appBar:
backgroundColor: AppColors.scaffold_bg_color, widget.activityName == "NearByGenerators"
body: Container( ? appbar2(context, "Generator Details", sendwidget)
child: SingleChildScrollView( : appbar(context, "Generator Details"),
child: Column( backgroundColor: AppColors.scaffold_bg_color,
crossAxisAlignment: CrossAxisAlignment.start, body: Container(
children: [ child: SingleChildScrollView(
Text("Customer Details"), child: Column(
Container( crossAxisAlignment: CrossAxisAlignment.start,
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 5), children: [
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 10), Container(
decoration: BoxDecoration( padding: EdgeInsets.symmetric(horizontal: 10,vertical: 5),
color: Colors.white, child: Text(
borderRadius: BorderRadius.circular(20), "Customer Details",
style: TextStyle(color: Color(0xFF818181),
fontFamily: "JakartaMedium"),
),
), ),
child: Column( Container(
children: [ margin: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
Row( padding: EdgeInsets.symmetric(
children: [ horizontal: 15,
Column( vertical: 10,
crossAxisAlignment: CrossAxisAlignment.start, ),
children: List.generate(4, (j) { decoration: BoxDecoration(
final textheads = [ color: Colors.white,
"${provider.cname}", borderRadius: BorderRadius.circular(20),
"Mobile Number", ),
"Contact Person Number", child: Column(
"Mail ID", children: [
]; Container(
final textSubheads = [ padding: EdgeInsets.symmetric(
"${provider.aname}", vertical: 3,
"${provider.mob1}", horizontal: 0,
"${provider.mob2}", ),
"${provider.mail}", child: Row(
]; mainAxisAlignment:
return Container( MainAxisAlignment.spaceBetween,
padding: EdgeInsets.symmetric(vertical: 3), children: [
child: Container(
padding: EdgeInsets.symmetric( SvgPicture.asset(
vertical: 3, "assets/svg/se_block_head.svg",
horizontal: 0, ),
SizedBox(width: 5),
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
SizedBox(
width:
MediaQuery.of(
context,
).size.width *
0.75,
child: Text(
"${provider.cname}",
maxLines: 2,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14
),
),
), ),
child: Column( SizedBox(
children: [ // height:45,
Row( width:
mainAxisAlignment: MediaQuery.of(
MainAxisAlignment.spaceBetween, context,
children: [ ).size.width *
if (j == 0) ...[ 0.75,
SvgPicture.asset( child: Text(
"assets/svg/se_block_head.svg", "${provider.aname}",
), maxLines: 2,
SizedBox(width: 5), overflow:
], TextOverflow.ellipsis,
Column( style: TextStyle(
crossAxisAlignment: fontSize: 14,
CrossAxisAlignment.start, color: Color(
children: [ 0xFF818181,
SizedBox( ),
width:
MediaQuery.of(
context,
).size.width *
0.75,
child: Text(textheads[j].toString(),maxLines: 2,
overflow: TextOverflow.ellipsis,),
),
SizedBox(
// height:45,
width:
MediaQuery.of(
context,
).size.width *
0.75,
child: Text(
textSubheads[j],
maxLines: 2,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF818181),
),
),
),
],
),
],
), ),
], ),
), ),
), ],
); ),
}), ],
), ),
], ),
), Column(
], crossAxisAlignment: CrossAxisAlignment.start,
), children: List.generate(3, (j) {
), final textheads = [
"Mobile Number",
"Contact Person Number",
"Mail ID",
];
final textSubheads = [
"${provider.mob1}",
"${provider.mob2}",
"${provider.mail}",
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 6,
horizontal: 0,
),
child: Row(
Text("Generator Details"), children: [
Container(
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 5), Expanded(
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 10), flex:1,
decoration: BoxDecoration( child: SizedBox(
color: Colors.white,
borderRadius: BorderRadius.circular(20), child: Text(
), textheads[j].toString(),
child: Column( maxLines: 2,
children: [ overflow:
Row( TextOverflow.ellipsis,
children: [ style: TextStyle(
SvgPicture.asset("assetName"), fontFamily: "JakartaMedium",
Column( fontSize: 14
crossAxisAlignment: CrossAxisAlignment.start, ),
children: List.generate(6, (j) { ),
final textheads = [ ),
"Gen ID", ),
"Engine Number", SizedBox(width: 5,),
"Address", Expanded(
"Product Name", flex: 2,
"Engine Model", child: SizedBox(
"Date Of Supply",
]; child: Text(
final textSubheads = [ textSubheads[j],
"${provider.genID}", maxLines: 2,
"${provider.engineNo}", overflow:
"${provider.address}", TextOverflow.ellipsis,
"${provider.spname}", style: TextStyle(
"${provider.emodel}", fontSize: 14,
"${provider.dateOfEngineSale}", color: Color(
]; 0xFF818181,
return Container(
padding: EdgeInsets.symmetric(vertical: 3),
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Container(
padding: EdgeInsets.symmetric(
vertical: 3,
horizontal: 0,
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(textheads[j].toString()),
SizedBox(
// height:45,
width:
MediaQuery.of(
context,
).size.width *
0.8,
child: Text(
textSubheads[j],
maxLines: 2,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF818181),
),
),
),
],
), ),
), ),
], ),
),
),
],
),
);
}),
),
],
),
),
Container(
padding: EdgeInsets.symmetric(horizontal: 10,vertical: 5),
child: Text(
"Generator Details",
style: TextStyle(color: Color(0xFF818181),
fontFamily: "JakartaMedium"),
),
),
Container(
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
padding: EdgeInsets.symmetric(
horizontal: 15,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: List.generate(6, (j) {
final textheads = [
"Gen ID",
"Engine Number",
"Address",
"Product Name",
"Engine Model",
"Date Of Supply",
];
final textSubheads = [
"${provider.genID}",
"${provider.engineNo}",
"${provider.address}",
"${provider.spname}",
"${provider.emodel}",
"${provider.dateOfEngineSale}",
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 6,
horizontal: 0,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
flex:1,
child: Text(textheads[j].toString(),style: TextStyle(
fontSize: 14,
fontFamily: "JakartaMedium"
),),),
SizedBox(width: 5,),
Expanded(
flex:2,
child: SizedBox(
child: Text(
textSubheads[j],
maxLines: 2,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14,
color: Color(
0xFF818181,
),
), ),
], ),
), ),
); ),
}), ],
), ),
], );
), }),
], ),
), ),
),
SizedBox(height: 75), SizedBox(height: 75),
], ],
),
), ),
), ),
), floatingActionButton: Align(
floatingActionButton: Align( alignment: Alignment.bottomCenter,
alignment: Alignment.bottomCenter, child: InkWell(
child: InkWell( onTap: () {
onTap: () { Navigator.push(
Navigator.push( context,
context, MaterialPageRoute(builder: (context) => Complainthistory()),
MaterialPageRoute(builder: (context) => Complainthistory()), );
); },
}, child: Container(
child: Container( alignment: Alignment.bottomCenter,
alignment: Alignment.bottomCenter, height: 45,
height: 45, width: MediaQuery.of(context).size.width,
width: MediaQuery.of(context).size.width, margin: EdgeInsets.symmetric(horizontal: 10),
margin: EdgeInsets.symmetric(horizontal: 10), decoration: BoxDecoration(
decoration: BoxDecoration( color: AppColors.app_blue,
color: AppColors.app_blue, borderRadius: BorderRadius.circular(15.0),
borderRadius: BorderRadius.circular(30.0), ),
), child: Center(
child: Center( child: Text(
child: Text( "Complaint History",
"Complaint History", textAlign: TextAlign.center,
textAlign: TextAlign.center, style: TextStyle(
style: TextStyle(color: Colors.white), fontFamily: "JakartaMedium",
fontSize: 15,
color: Colors.white),
),
), ),
), ),
), ),
), ),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
), ),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
); );
}, },
); );
......
...@@ -24,579 +24,626 @@ class _RegistercomplaintState extends State<Registercomplaint> { ...@@ -24,579 +24,626 @@ class _RegistercomplaintState extends State<Registercomplaint> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Consumer2<Generatordetailsprovider, HomescreenNotifier>( return Consumer2<Generatordetailsprovider, HomescreenNotifier>(
builder: (context, provider, homeProvider, child) { builder: (context, provider, homeProvider, child) {
return Scaffold( return WillPopScope(
backgroundColor: AppColors.scaffold_bg_color, onWillPop: () => onBackPressed(context),
appBar: appbar(context, "Register Complaint"), child: Scaffold(
body: Container( resizeToAvoidBottomInset: true,
child: SingleChildScrollView( backgroundColor: AppColors.scaffold_bg_color,
child: Column( appBar: appbar(context, "Register Complaint"),
crossAxisAlignment: CrossAxisAlignment.start, body: Container(
children: [ child: SingleChildScrollView(
SizedBox(height: 5.0), child: Column(
Container( crossAxisAlignment: CrossAxisAlignment.start,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0), children: [
SizedBox(height: 5.0),
Container(
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox(height: 25), SizedBox(height: 25),
Text( Container(
"Customer Details", padding: EdgeInsets.symmetric(horizontal: 10),
style: TextStyle(color: Color(0xFF818181)), child: Text(
), "Customer Details",
Container( style: TextStyle(
padding: EdgeInsets.fromLTRB(10, 10, 10, 10), fontFamily: "JakartaMedium",
margin: EdgeInsets.symmetric( color: Color(0xFF818181)),
horizontal: 10, vertical: 5), ),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16)
), ),
child: Column( Container(
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
margin: EdgeInsets.symmetric(
horizontal: 10, vertical: 5),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16)
),
child: Column(
children: [ children: [
Row( Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
flex: 1, flex: 1,
child: SvgPicture.asset( child: SvgPicture.asset(
"assets/svg/se_block_head.svg", "assets/svg/se_block_head.svg",
),
), ),
), SizedBox(width: 10),
SizedBox(width: 10),
Expanded( Expanded(
flex: 9, flex: 9,
child: SizedBox( child: SizedBox(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Text("${provider.cname}"), Text("${provider.cname}",style: TextStyle(
Text( fontFamily: "JakartaMedium"
"${provider.aname}", ),),
maxLines: 2, Text(
overflow: TextOverflow.ellipsis, "${provider.aname}",
style: TextStyle( maxLines: 2,
color: Color(0xFF818181), overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF818181),
),
), ),
), // Text("Gen Pvt. Ltd"),
// Text("Gen Pvt. Ltd"), ],
], ),
), ),
), ),
), ],
], ),
), Divider(thickness: 0.5, color: Color(0xFFD7D7D7)),
Divider(thickness: 0.5, color: Color(0xFFD7D7D7)), ...List.generate(2, (j) {
...List.generate(2, (j) { final textheads = ["Product Name", "Engine ID"];
final textheads = ["Product Name", "Engine ID"]; final textSubheads = [
final textSubheads = [ provider.spname,
provider.spname, provider.engineNo,
provider.engineNo, ];
]; return Container(
return Container( padding: EdgeInsets.symmetric(vertical: 3),
padding: EdgeInsets.symmetric(vertical: 3), child: Column(
child: Column( children: [
children: [ Row(
Row( mainAxisAlignment:
mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween, children: [
children: [ Expanded(
Expanded( child: SizedBox(
child: SizedBox( child: Column(
child: Column( crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start, children: [
children: [ Text(textheads[j].toString(),style: TextStyle(
Text(textheads[j].toString()), fontFamily: "JakartaMedium"
], ),),
],
),
), ),
), ),
), Expanded(
Expanded( child: SizedBox(
child: SizedBox( child: Column(
child: Column( crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start, children: [
children: [ Text(
Text( textSubheads[j].toString(),
textSubheads[j].toString(), style: TextStyle(
style: TextStyle( color: Color(0xFF818181),
color: Color(0xFF818181), ),
), ),
), ],
], ),
), ),
), ),
), ],
], ),
), ],
], ),
), );
); }),
}), SizedBox(height: 10.0),
SizedBox(height: 10.0),
], ],
),
), ),
), Container(
Text("Complaint Details", style: TextStyle( padding: EdgeInsets.symmetric(horizontal: 10),
color: Color(0xFF818181) child: Text(
),), "Complaint Details",
Container( style: TextStyle(
padding: EdgeInsets.fromLTRB(10, 10, 10, 10), fontFamily: "JakartaMedium",
margin: EdgeInsets.symmetric( color: Color(0xFF818181)),
horizontal: 10, vertical: 5), ),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16)
), ),
child: Column( Container(
crossAxisAlignment: CrossAxisAlignment.start, padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
children: [ margin: EdgeInsets.symmetric(
Text("Complaint Type"), horizontal: 10, vertical: 5),
DropdownButtonHideUnderline( decoration: BoxDecoration(
child: Row( color: Colors.white,
children: [ borderRadius: BorderRadius.circular(16)
Expanded( ),
child: DropdownButton2<ComplaintTypeList>( child: Column(
isExpanded: true, crossAxisAlignment: CrossAxisAlignment.start,
hint: const Row( children: [
children: [ Padding(
Expanded( padding: const EdgeInsets.only(bottom: 5.0),
child: Text( child: Text("Complaint Type",style: TextStyle(
'Select Complaint Type', fontFamily: "JakartaMedium",
style: TextStyle( ),),
fontSize: 14, ),
), DropdownButtonHideUnderline(
overflow: TextOverflow.ellipsis, child: Row(
), children: [
), Expanded(
], child: DropdownButton2<ComplaintTypeList>(
), isExpanded: true,
items: hint: const Row(
provider.complaintTypeDropdown children: [
.map( Expanded(
(complaintType) =>
DropdownMenuItem<
ComplaintTypeList>(
value: complaintType,
child: Text( child: Text(
complaintType.name ?? '', 'Select Complaint Type',
style: const TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
), ),
overflow: TextOverflow overflow: TextOverflow.ellipsis,
.ellipsis,
), ),
), ),
) ],
.toList(), ),
value: provider.selectedComplaintType, items:
onChanged: (ComplaintTypeList? value) { provider.complaintTypeDropdown
if (value != null) { .map(
if (provider (complaintType) =>
.complaintCategorydropdown DropdownMenuItem<
.isNotEmpty) { ComplaintTypeList>(
provider.selectedComplaintType = value: complaintType,
value; child: Text(
print( complaintType.name ?? '',
"Selected Complaint Type: ${value style: const TextStyle(
.name}, ID: ${value.id}", fontSize: 14,
); ),
provider.selectedType = overflow: TextOverflow
value?.name; .ellipsis,
provider.selectedTypeId = ),
value?.id; ),
print( )
"hfjkshfg" + .toList(),
provider.selectedTypeId value: provider.selectedComplaintType,
.toString(), onChanged: (ComplaintTypeList? value) {
); if (value != null) {
if (provider
.complaintCategorydropdown
.isNotEmpty) {
provider.selectedComplaintType =
value;
print(
"Selected Complaint Type: ${value
.name}, ID: ${value.id}",
);
provider.selectedType =
value?.name;
provider.selectedTypeId =
value?.id;
print(
"hfjkshfg" +
provider.selectedTypeId
.toString(),
);
}
} }
} },
}, buttonStyleData: ButtonStyleData(
buttonStyleData: ButtonStyleData( height: 50,
height: 50, width: 160,
width: 160, padding: const EdgeInsets.only(
padding: const EdgeInsets.only( left: 14,
left: 14, right: 14,
right: 14, ),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
14),
color: AppColors.text_field_color,
),
), ),
decoration: BoxDecoration( iconStyleData: const IconStyleData(
borderRadius: BorderRadius.circular( icon: Icon(Icons.keyboard_arrow_down),
14), iconSize: 12,
color: AppColors.text_field_color, iconEnabledColor: Color(0xFF2D2D2D),
iconDisabledColor: Colors.grey,
), ),
), dropdownStyleData: DropdownStyleData(
iconStyleData: const IconStyleData( maxHeight: 200,
icon: Icon(Icons.keyboard_arrow_down), width: 350,
iconSize: 12, decoration: BoxDecoration(
iconEnabledColor: Color(0xFF2D2D2D), borderRadius: BorderRadius.circular(
iconDisabledColor: Colors.grey, 14),
), color: AppColors.text_field_color,
dropdownStyleData: DropdownStyleData( ),
maxHeight: 200, scrollbarTheme: ScrollbarThemeData(
width: 350, radius: const Radius.circular(15),
decoration: BoxDecoration( thickness: MaterialStateProperty
borderRadius: BorderRadius.circular( .all<double>(6),
14), thumbVisibility:
color: AppColors.text_field_color, MaterialStateProperty.all<bool>(
true),
),
), ),
scrollbarTheme: ScrollbarThemeData( menuItemStyleData: const MenuItemStyleData(
radius: const Radius.circular(15), height: 40,
thickness: MaterialStateProperty padding: EdgeInsets.only(
.all<double>(6), left: 14, right: 14),
thumbVisibility:
MaterialStateProperty.all<bool>(
true),
), ),
), ),
menuItemStyleData: const MenuItemStyleData(
height: 40,
padding: EdgeInsets.only(
left: 14, right: 14),
),
), ),
), ],
], ),
), ),
), SizedBox(height: 10.0),
SizedBox(height: 10.0), Padding(
Text("Complaint Category"), padding: const EdgeInsets.only(bottom: 5.0),
DropdownButtonHideUnderline( child: Text("Complaint Category",style: TextStyle(
child: Row( fontFamily: "JakartaMedium",
children: [ ),),
Expanded( ),
child: DropdownButton2< DropdownButtonHideUnderline(
ComplaintCategoryList>( child: Row(
isExpanded: true, children: [
hint: const Row( Expanded(
children: [ child: DropdownButton2<
Expanded( ComplaintCategoryList>(
child: Text( isExpanded: true,
'Select Complaint Category', hint: const Row(
style: TextStyle( children: [
fontSize: 14, Expanded(
),
overflow: TextOverflow.ellipsis,
),
),
],
),
items:
provider.complaintCategorydropdown
.map(
(Category) =>
DropdownMenuItem<
ComplaintCategoryList
>(
value: Category,
child: Text( child: Text(
Category.name ?? "", 'Select Complaint Category',
style: const TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
), ),
overflow: TextOverflow overflow: TextOverflow.ellipsis,
.ellipsis,
), ),
), ),
) ],
.toList(),
value: provider.selectedCategoryType,
onChanged: (
ComplaintCategoryList? value) {
if (provider
.complaintCategorydropdown
.isNotEmpty) {
provider.selectedCategoryType =
value;
provider.selectedCategory =
value?.name;
provider.selectedCategoryId =
value?.id;
}
},
buttonStyleData: ButtonStyleData(
height: 50,
width: 160,
padding: const EdgeInsets.only(
left: 14,
right: 14,
), ),
decoration: BoxDecoration( items:
borderRadius: BorderRadius.circular( provider.complaintCategorydropdown
14), .map(
color: AppColors.text_field_color, (Category) =>
DropdownMenuItem<
ComplaintCategoryList
>(
value: Category,
child: Text(
Category.name ?? "",
style: const TextStyle(
fontSize: 14,
),
overflow: TextOverflow
.ellipsis,
),
),
)
.toList(),
value: provider.selectedCategoryType,
onChanged: (
ComplaintCategoryList? value) {
if (provider
.complaintCategorydropdown
.isNotEmpty) {
provider.selectedCategoryType =
value;
provider.selectedCategory =
value?.name;
provider.selectedCategoryId =
value?.id;
}
},
buttonStyleData: ButtonStyleData(
height: 50,
width: 160,
padding: const EdgeInsets.only(
left: 14,
right: 14,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
14),
color: AppColors.text_field_color,
),
), ),
), iconStyleData: const IconStyleData(
iconStyleData: const IconStyleData( icon: Icon(Icons.keyboard_arrow_down),
icon: Icon(Icons.keyboard_arrow_down), iconSize: 12,
iconSize: 12, iconEnabledColor: Color(0xFF2D2D2D),
iconEnabledColor: Color(0xFF2D2D2D), iconDisabledColor: Colors.grey,
iconDisabledColor: Colors.grey,
),
dropdownStyleData: DropdownStyleData(
maxHeight: 200,
width: 350,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
14),
color: AppColors.text_field_color,
), ),
scrollbarTheme: ScrollbarThemeData( dropdownStyleData: DropdownStyleData(
radius: const Radius.circular(15), maxHeight: 200,
thickness: width: 350,
MaterialStateProperty.all<double>( decoration: BoxDecoration(
6), borderRadius: BorderRadius.circular(
thumbVisibility: 14),
MaterialStateProperty.all<bool>( color: AppColors.text_field_color,
true), ),
scrollbarTheme: ScrollbarThemeData(
radius: const Radius.circular(15),
thickness:
MaterialStateProperty.all<double>(
6),
thumbVisibility:
MaterialStateProperty.all<bool>(
true),
),
),
menuItemStyleData: const MenuItemStyleData(
height: 40,
padding: EdgeInsets.only(
left: 14, right: 14),
), ),
),
menuItemStyleData: const MenuItemStyleData(
height: 40,
padding: EdgeInsets.only(
left: 14, right: 14),
), ),
), ),
), ],
], ),
), ),
),
SizedBox(height: 10.0), SizedBox(height: 10.0),
Text("Select Description"), Padding(
DropdownButtonHideUnderline( padding: const EdgeInsets.only(bottom: 5.0),
child: Row( child: Text("Select Description",style: TextStyle(
children: [ fontFamily: "JakartaMedium",
Expanded( ),),
child: DropdownButton2< ),
ComplaintDescriptionList>( DropdownButtonHideUnderline(
isExpanded: true, child: Row(
hint: const Row( children: [
children: [ Expanded(
Expanded( child: DropdownButton2<
child: Text( ComplaintDescriptionList>(
'Select Description', isExpanded: true,
style: TextStyle( hint: const Row(
fontSize: 14, children: [
), Expanded(
overflow: TextOverflow.ellipsis,
),
),
],
),
items:
provider.complaintDescriptionDropdown
.map(
(Description) =>
DropdownMenuItem<
ComplaintDescriptionList
>(
value: Description,
child: Text( child: Text(
Description.name ?? "", 'Select Description',
style: const TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
), ),
overflow: TextOverflow overflow: TextOverflow.ellipsis,
.ellipsis,
), ),
), ),
) ],
.toList(),
value: provider.selectedDescriptionType,
onChanged: (
ComplaintDescriptionList? value) {
if (provider
.complaintDescriptionDropdown
.isNotEmpty) {
provider.selectedDescriptionType =
value;
provider.selectedDescription =
value?.name;
provider.selectedDescriptionId =
value?.id;
}
},
buttonStyleData: ButtonStyleData(
height: 50,
width: 160,
padding: const EdgeInsets.only(
left: 14,
right: 14,
), ),
decoration: BoxDecoration( items:
borderRadius: BorderRadius.circular( provider.complaintDescriptionDropdown
14), .map(
color: AppColors.text_field_color, (Description) =>
DropdownMenuItem<
ComplaintDescriptionList
>(
value: Description,
child: Text(
Description.name ?? "",
style: const TextStyle(
fontSize: 14,
),
overflow: TextOverflow
.ellipsis,
),
),
)
.toList(),
value: provider.selectedDescriptionType,
onChanged: (
ComplaintDescriptionList? value) {
if (provider
.complaintDescriptionDropdown
.isNotEmpty) {
provider.selectedDescriptionType =
value;
provider.selectedDescription =
value?.name;
provider.selectedDescriptionId =
value?.id;
}
},
buttonStyleData: ButtonStyleData(
height: 50,
width: 160,
padding: const EdgeInsets.only(
left: 14,
right: 14,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
14),
color: AppColors.text_field_color,
),
), ),
), iconStyleData: const IconStyleData(
iconStyleData: const IconStyleData( icon: Icon(Icons.keyboard_arrow_down),
icon: Icon(Icons.keyboard_arrow_down), iconSize: 12,
iconSize: 12, iconEnabledColor: Color(0xFF2D2D2D),
iconEnabledColor: Color(0xFF2D2D2D), iconDisabledColor: Colors.grey,
iconDisabledColor: Colors.grey,
),
dropdownStyleData: DropdownStyleData(
maxHeight: 200,
width: 350,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
14),
color: AppColors.text_field_color,
), ),
scrollbarTheme: ScrollbarThemeData( dropdownStyleData: DropdownStyleData(
radius: const Radius.circular(15), maxHeight: 200,
thickness: MaterialStateProperty width: 350,
.all<double>( decoration: BoxDecoration(
6, borderRadius: BorderRadius.circular(
14),
color: AppColors.text_field_color,
),
scrollbarTheme: ScrollbarThemeData(
radius: const Radius.circular(15),
thickness: MaterialStateProperty
.all<double>(
6,
),
thumbVisibility:
MaterialStateProperty.all<bool>(
true),
), ),
thumbVisibility:
MaterialStateProperty.all<bool>(
true),
), ),
), menuItemStyleData: const MenuItemStyleData(
menuItemStyleData: const MenuItemStyleData( height: 40,
height: 40, padding: EdgeInsets.only(
padding: EdgeInsets.only( left: 14, right: 14),
left: 14, right: 14), ),
), ),
), ),
), ],
], ),
), ),
),
SizedBox(height: 10.0), SizedBox(height: 10.0),
Text("Duration"), Padding(
Container( padding: const EdgeInsets.only(bottom: 5.0),
height: 50, child: Text("Duration",style: TextStyle(
fontFamily: "JakartaMedium",
alignment: Alignment.center, ),),
decoration: BoxDecoration(
color: AppColors.text_field_color,
borderRadius:
BorderRadius.circular(14),
), ),
child: Padding( Container(
padding: height: 50,
const EdgeInsets.fromLTRB(
10.0, 0.0, 10, 0), alignment: Alignment.center,
child: TextFormField( decoration: BoxDecoration(
controller: color: AppColors.text_field_color,
running_hrs, borderRadius:
keyboardType: BorderRadius.circular(14),
TextInputType.text, ),
decoration: InputDecoration( child: Padding(
padding:
const EdgeInsets.fromLTRB(
10.0, 0.0, 10, 0),
child: TextFormField(
controller:
running_hrs,
keyboardType:
TextInputType.text,
decoration: InputDecoration(
hintText:
"Enter Running Number",
hintStyle: TextStyle(
fontWeight: FontWeight.w400,
color: Color(0xFFB4BEC0),
fontSize: 14
),
hintText: enabledBorder:
"Enter Running Number", InputBorder.none,
hintStyle: TextStyle( focusedBorder:
fontWeight: FontWeight.w400, InputBorder.none,
color: Color(0xFFB4BEC0),
fontSize: 14
), ),
enabledBorder:
InputBorder.none,
focusedBorder:
InputBorder.none,
), ),
), ),
), ),
), SizedBox(height: 10.0),
SizedBox(height: 10.0), Padding(
Text("Message"), padding: const EdgeInsets.only(bottom: 5.0),
Container( child: Text("Message",style: TextStyle(
height: 150, fontFamily: "JakartaMedium",
),),
alignment: Alignment.center,
decoration: BoxDecoration(
color: AppColors.text_field_color,
borderRadius:
BorderRadius.circular(14),
), ),
child: Padding( Container(
padding: height: 150,
const EdgeInsets.fromLTRB(
10.0, 0.0, 10, 0), alignment: Alignment.center,
child: TextFormField( decoration: BoxDecoration(
maxLines: 6, color: AppColors.text_field_color,
controller: borderRadius:
Complaint_Note, BorderRadius.circular(14),
keyboardType: ),
TextInputType.text, child: Padding(
decoration: InputDecoration( padding:
const EdgeInsets.fromLTRB(
10.0, 0.0, 10, 0),
child: TextFormField(
maxLines: 6,
controller:
Complaint_Note,
keyboardType:
TextInputType.text,
decoration: InputDecoration(
hintText: hintText:
"Enter Message", "Enter Message",
hintStyle: TextStyle( hintStyle: TextStyle(
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
color: Color(0xFFB4BEC0), color: Color(0xFFB4BEC0),
fontSize: 14 fontSize: 14
),
enabledBorder:
InputBorder.none,
focusedBorder:
InputBorder.none,
), ),
enabledBorder:
InputBorder.none,
focusedBorder:
InputBorder.none,
), ),
), ),
), ),
), ],
], ),
), ),
),
SizedBox(height: 65.0), SizedBox(height: 65.0),
], ],
),
), ),
), ],
], ),
), ),
), ),
), floatingActionButton: Container(
floatingActionButton: Container( child: InkWell(
child: InkWell( onTap: () {
onTap: () { provider.SubmitComplaintFunction(
provider.SubmitComplaintFunction( context,
context, homeProvider,
homeProvider, provider.genID,
provider.genID, provider.selectedTypeId,
provider.selectedTypeId, provider.selectedDescriptionId,
provider.selectedDescriptionId, running_hrs.text,
running_hrs.text, Complaint_Note.text);
Complaint_Note.text); },
}, child: Container(
child: Container( alignment: Alignment.center,
alignment: Alignment.center, height: 45,
height: 45, margin: EdgeInsets.only(left: 15.0, right: 15.0),
margin: EdgeInsets.only(left: 15.0, right: 15.0), decoration: BoxDecoration(
decoration: BoxDecoration( color: AppColors.app_blue,
color: AppColors.app_blue, borderRadius: BorderRadius.circular(10.0),
borderRadius: BorderRadius.circular(10.0), ),
), child: Text(
child: Text( "Submit Complaint",
"Submit Complaint", textAlign: TextAlign.center,
textAlign: TextAlign.center, style: TextStyle(
style: TextStyle( fontFamily: "JakartaMedium",
color: Colors.white fontSize: 15,
color: Colors.white
),
), ),
), ),
), ),
), ),
floatingActionButtonLocation: FloatingActionButtonLocation
.centerFloat,
), ),
floatingActionButtonLocation: FloatingActionButtonLocation
.centerFloat,
); );
}, },
); );
......
...@@ -47,65 +47,71 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen> ...@@ -47,65 +47,71 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Consumer<Generatordetailsprovider>( return Consumer<Generatordetailsprovider>(
builder: (context, provider, child) { builder: (context, provider, child) {
return Scaffold( return WillPopScope(
backgroundColor: AppColors.scaffold_bg_color, onWillPop: () => onBackPressed(context),
appBar: appbar(context, "${widget.from}"), child: Scaffold(
body: Container( resizeToAvoidBottomInset: true,
decoration: BoxDecoration(color: Colors.black), backgroundColor: AppColors.scaffold_bg_color,
child: Column( appBar: appbar(context, "${widget.from}"),
children: [ body: Container(
Spacer(), decoration: BoxDecoration(color: Colors.black),
Container( child: Column(
height: 250, children: [
Spacer(),
SizedBox(
height: 250,
child: QRView( child: QRView(
key: provider.scannerKey, key: provider.scannerKey,
onQRViewCreated: (p0) { onQRViewCreated: (p0) {
provider.onQRViewCreated(p0, provider.title, context); provider.onQRViewCreated(p0, provider.title, context);
}, },
formatsAllowed: [BarcodeFormat.qrcode], formatsAllowed: [BarcodeFormat.qrcode],
cameraFacing: CameraFacing.back, cameraFacing: CameraFacing.back,
overlay: QrScannerOverlayShape(
overlay: QrScannerOverlayShape(
borderColor: AppColors.app_blue, borderColor: AppColors.app_blue,
borderRadius: 20, borderRadius: 20,
borderLength: 60, borderLength: 60,
borderWidth: 10, borderWidth: 10,
cutOutSize: 250.0, cutOutSize: 250.0,
),
), ),
), ),
), SizedBox(height: 25),
SizedBox(height: 25), Text(
Text( "Scan QR",
"Scan QR", textAlign: TextAlign.center,
textAlign: TextAlign.center, style: TextStyle(fontSize: 18,fontFamily: "JakartaMedium", color: Colors.white),
style: TextStyle(fontSize: 18, color: Colors.white), ),
), Text(
Text( provider.subTitle,
provider.subTitle,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 14, color: Colors.white),
),
Spacer(),
Text(
"or",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 18, color: Colors.white),
),
InkResponse(
onTap: () async {
_showgenIdBottomSheet(context);
},
child: Text(
"Tap to Enter Generator ID",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(fontSize: 14, color: Colors.white), style: TextStyle(fontSize: 14, color: Colors.white),
), ),
), Spacer(),
SizedBox(height: 50), Text(
], "or",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 18,
fontFamily: "JakartaMedium",color: Colors.white),
),
InkResponse(
onTap: () async {
_showgenIdBottomSheet(context);
},
child: Text(
"Tap to Enter Generator ID",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 18,
fontFamily: "JakartaMedium",
color: AppColors.app_blue),
),
),
SizedBox(height: 50),
],
),
), ),
), ),
); );
...@@ -148,12 +154,14 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen> ...@@ -148,12 +154,14 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Container( Container(
padding: EdgeInsets.symmetric(horizontal: 10,vertical: 5),
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Text( child: Text(
"Generator ID", "Generator ID",
style: TextStyle( style: TextStyle(
color: AppColors.semi_black, color: AppColors.semi_black,
fontSize: 12, fontFamily: "JakartaMedium",
fontSize: 14,
), ),
), ),
), ),
...@@ -162,7 +170,7 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen> ...@@ -162,7 +170,7 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.text_field_color, color: AppColors.text_field_color,
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(14),
border: border:
genIDFocusNode.hasFocus genIDFocusNode.hasFocus
? Border.all( ? Border.all(
...@@ -195,7 +203,7 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen> ...@@ -195,7 +203,7 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
hintStyle: TextStyle( hintStyle: TextStyle(
fontWeight: FontWeight.w400, color: Color(0xFF818181),
fontSize: 14, fontSize: 14,
), ),
//contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0), //contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0),
...@@ -206,6 +214,7 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen> ...@@ -206,6 +214,7 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
), ),
), ),
), ),
SizedBox(height: 15,),
InkWell( InkWell(
onTap: () { onTap: () {
switch(widget.from){ switch(widget.from){
...@@ -248,13 +257,16 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen> ...@@ -248,13 +257,16 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.app_blue, //1487C9 color: AppColors.app_blue, //1487C9
borderRadius: BorderRadius.circular(30.0), borderRadius: BorderRadius.circular(15.0),
), ),
child: Center( child: Center(
child: Text( child: Text(
"Submit", "Submit",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white,
fontFamily: "JakartaMedium",
fontSize: 16
),
), ),
), ),
), ),
......
...@@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; ...@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:generp/Notifiers/HomeScreenNotifier.dart'; import 'package:generp/Notifiers/HomeScreenNotifier.dart';
import 'package:generp/Notifiers/InventoryProvider.dart'; import 'package:generp/Notifiers/InventoryProvider.dart';
import 'package:generp/Utils/app_colors.dart'; import 'package:generp/Utils/app_colors.dart';
import 'package:generp/Utils/commonServices.dart';
import 'package:generp/Utils/commonWidgets.dart'; import 'package:generp/Utils/commonWidgets.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
...@@ -9,212 +10,476 @@ class GeneratorPartDetailsScreen extends StatefulWidget { ...@@ -9,212 +10,476 @@ class GeneratorPartDetailsScreen extends StatefulWidget {
const GeneratorPartDetailsScreen({super.key}); const GeneratorPartDetailsScreen({super.key});
@override @override
State<GeneratorPartDetailsScreen> createState() => _GeneratorPartDetailsScreenState(); State<GeneratorPartDetailsScreen> createState() =>
_GeneratorPartDetailsScreenState();
} }
class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen> { class _GeneratorPartDetailsScreenState
extends State<GeneratorPartDetailsScreen> {
FocusNode descriptionFocusNode =FocusNode(); FocusNode descriptionFocusNode = FocusNode();
FocusNode quantityFocusNode = FocusNode(); FocusNode quantityFocusNode = FocusNode();
TextEditingController descriptioncontroller = TextEditingController(); TextEditingController descriptioncontroller = TextEditingController();
TextEditingController quantitycontroller = TextEditingController(); TextEditingController quantitycontroller = TextEditingController();
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
var homeProvider = Provider.of<HomescreenNotifier>(context,listen: false); var homeProvider = Provider.of<HomescreenNotifier>(
context,
listen: false,
);
initialiseFunction(context, homeProvider); initialiseFunction(context, homeProvider);
}); });
} }
void initialiseFunction(BuildContext context,homeProvider) async { void initialiseFunction(BuildContext context, homeProvider) async {
var inventoryProvider = Provider.of<InventoryProvider>(context,listen: false); var inventoryProvider = Provider.of<InventoryProvider>(
inventoryProvider.LoadPartDetailsApifunction(homeProvider, context, "", inventoryProvider.partID); context,
listen: false,
);
inventoryProvider.LoadPartDetailsApifunction(
homeProvider,
context,
"",
inventoryProvider.partID,
);
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Consumer<InventoryProvider>( return Consumer<InventoryProvider>(
builder: (context,provider,child) { builder: (context, provider, child) {
return Scaffold( return WillPopScope(
backgroundColor: AppColors.scaffold_bg_color, onWillPop: () => onBackPressed(context),
appBar: appbar(context, "Gen Inventory"), child: Scaffold(
body: Container( resizeToAvoidBottomInset: true,
child: SingleChildScrollView( backgroundColor: AppColors.scaffold_bg_color,
child: Column( appBar: appbar(context, "Gen Inventory"),
children: [ body: Container(
child: SingleChildScrollView(
child: Column(
Container( children: [
margin: EdgeInsets.only(top: 15, bottom: 15), Container(
decoration: BoxDecoration( margin: EdgeInsets.only(top: 15, bottom: 15),
color: Colors.white, decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16), color: Colors.white,
), borderRadius: BorderRadius.circular(16),
child: Column( ),
children: [ child: Column(
Container( children: [
padding: EdgeInsets.only( Container(
left: 10, padding: EdgeInsets.only(
right: 10, left: 10,
top: 15, right: 10,
), top: 15,
child: Row( ),
children: [ child: Row(
Expanded(child: Text("${provider.partData.prodName}")), children: [
], Expanded(
), child: Text(
), "${provider.partData.prodName}",
Container( style: TextStyle(
padding: EdgeInsets.symmetric( color: AppColors.app_blue,
horizontal: 10, fontFamily: "JakartaMedium",
vertical: 15, ),
), ),
margin: EdgeInsets.symmetric( ),
horizontal: 10, ],
vertical: 15, ),
),
decoration: BoxDecoration(
color: Color(0xFFFFEFEF),
borderRadius: BorderRadius.circular(16),
), ),
child: Row( Container(
mainAxisAlignment: MainAxisAlignment.center, padding: EdgeInsets.symmetric(
children: [ horizontal: 10,
Expanded( vertical: 15,
child: SizedBox( ),
child: Column( margin: EdgeInsets.symmetric(
crossAxisAlignment: CrossAxisAlignment.center, horizontal: 10,
children: [ vertical: 15,
RichText( ),
text: TextSpan( decoration: BoxDecoration(
children: [ color: Color(0xFFE6F6FF),
TextSpan( borderRadius: BorderRadius.circular(16),
text: "${provider.partData.remainingQuantity}", ),
style: TextStyle( child: Row(
color: AppColors.semi_black, mainAxisAlignment: MainAxisAlignment.center,
fontSize: 18, children: [
Expanded(
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
RichText(
text: TextSpan(
children: [
TextSpan(
text:
"${provider.partData.remainingQuantity}",
style: TextStyle(
color: AppColors.app_blue,
fontSize: 30,
),
), ),
), ],
),
],
), ),
Text(
"Remaining Quantity",
style: TextStyle(
color: Color(0xFF818181),
),
),
],
),
),
),
],
),
),
Container(
padding: EdgeInsets.symmetric(
horizontal: 15,
vertical: 15,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: InkResponse(
onTap: () {
_showStockIssueBottomSheet(
context,
"Issue",
);
},
child: Container(
height: 45,
decoration: BoxDecoration(
color: Color(0xFFFFEFEF),
border: Border.all(
color: Color(0xFFED3424),
width: 0.5,
),
borderRadius: BorderRadius.circular(12),
), ),
Text("Remaining Quantity"), child: Center(
], child: Text(
"- Issue",
style: TextStyle(
color: Color(0xFFED3424),
),
),
),
),
), ),
), ),
), SizedBox(width: 10),
Expanded(
], child: InkResponse(
onTap: () {
_showStockIssueBottomSheet(
context,
"Recieve",
);
},
child: Container(
height: 45,
decoration: BoxDecoration(
color: Color(0xFFE7FFE5),
border: Border.all(
color: Color(0xFF0D9C00),
width: 0.5,
),
borderRadius: BorderRadius.circular(12),
),
child: Center(
child: Text(
"+ Recieve",
style: TextStyle(
color: Color(0xFF0D9C00),
),
),
),
),
),
),
],
),
), ),
],
),
),
Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.symmetric(horizontal: 10),
child: Text(
"Product Details",
style: TextStyle(
color: Color(0xFF818181),
fontFamily: "JakartaMedium",
), ),
], ),
), ),
), Container(
Text("Product Details"), padding: EdgeInsets.symmetric(
Container( horizontal: 10,
padding: EdgeInsets.symmetric(horizontal: 10,vertical: 10), vertical: 10,
margin: EdgeInsets.symmetric(horizontal: 10,vertical: 10), ),
decoration: BoxDecoration( margin: EdgeInsets.symmetric(
color: Colors.white, horizontal: 10,
borderRadius: BorderRadius.circular(16) vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: List.generate(3, (index) {
final headings = [
"Product Name",
"Product ID",
"Project",
];
final values = [
provider.partData.prodName,
provider.partData.id,
provider.partData.project,
];
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
flex: 1,
child: Text(
"${headings[index]}",
style: TextStyle(
fontFamily: "JakartaMedium",
),
),
),
Expanded(
flex: 2,
child: Text(
"${values[index]}",
style: TextStyle(color: Color(0xFF818181)),
),
),
],
),
);
}),
),
), ),
child: Column(
children: List.generate(9, (index) {
final headings = [
"Product Name",
"Product ID",
"Project",
"Description",
"Sub Group",
"Vendor 1",
"Vendor 2",
"Units",
"MSL"];
final values = [ Container(
provider.partData.prodName, alignment: Alignment.topLeft,
provider.partData.id, padding: EdgeInsets.symmetric(horizontal: 10),
provider.partData.project, child: Text(
provider.partData.prodDesc, "Vendor Details",
provider.partData.subGroup, style: TextStyle(
provider.partData.vendor1, fontFamily: "JakartaMedium",
provider.partData.vendor2, color: Color(0xFF818181),
provider.partData.units, ),
provider.partData.msl, ),
];
return Container(
padding: EdgeInsets.symmetric(horizontal: 10,vertical: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text("${headings[index]}"),
Text("${values[index]}"),
Divider(thickness: 0.5,color: index==8?Colors.white:Color(0xFFD7D7D7),)
],
),
);
},),
), ),
), Container(
SizedBox(height: 150,) padding: EdgeInsets.symmetric(
], horizontal: 10,
), vertical: 10,
), ),
), margin: EdgeInsets.symmetric(
bottomSheet: Container( horizontal: 10,
padding: EdgeInsets.symmetric(horizontal: 15,vertical: 15), vertical: 10,
child: Row( ),
mainAxisAlignment: MainAxisAlignment.center, decoration: BoxDecoration(
children: [ color: Colors.white,
Expanded(child: InkResponse( borderRadius: BorderRadius.circular(16),
onTap: () { ),
_showStockIssueBottomSheet(context,"Recieve"); child: Column(
}, children: List.generate(2, (index) {
child: Container( final headings = ["Vendor 1", "Vendor 2"];
height: 45,
decoration: BoxDecoration( final values = [
color: Colors.white, provider.partData.vendor1,
border: Border.all(color: AppColors.app_blue,width: 0.5), provider.partData.vendor2,
borderRadius: BorderRadius.circular(12) ];
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
flex: 1,
child: Text(
"${headings[index]}",
style: TextStyle(
fontFamily: "JakartaMedium",
),
),
),
Expanded(
flex: 2,
child: Text(
"${values[index]}",
style: TextStyle(color: Color(0xFF818181)),
),
),
],
),
);
}),
),
),
Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.symmetric(horizontal: 10),
child: Text(
"Other Details",
style: TextStyle(
fontFamily: "JakartaMedium",
color: Color(0xFF818181),
),
),
),
Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: List.generate(3, (index) {
final headings = ["Sub Group", "Units", "MSL"];
final values = [
provider.partData.subGroup,
provider.partData.units,
provider.partData.msl,
];
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
flex: 1,
child: Text(
"${headings[index]}",
style: TextStyle(
fontFamily: "JakartaMedium",
),
),
),
Expanded(
flex: 2,
child: Text(
"${values[index]}",
style: TextStyle(color: Color(0xFF818181)),
),
),
],
),
);
}),
),
), ),
child: Center(child: Text("Recieve",
style: TextStyle( Container(
color: AppColors.app_blue alignment: Alignment.topLeft,
),)),), padding: EdgeInsets.symmetric(horizontal: 10),
)), child: Text(
SizedBox(width: 10,), "Description",
Expanded(child: InkResponse( style: TextStyle(
onTap: () { fontFamily: "JakartaMedium",
_showStockIssueBottomSheet(context,"Issue"); color: Color(0xFF818181),
}, ),
child: Container( ),
height: 45,
decoration: BoxDecoration(
color: AppColors.app_blue,
border: Border.all(color: AppColors.app_blue,width: 0.5),
borderRadius: BorderRadius.circular(12)
), ),
child: Center(child: Text("Issue", Container(
style: TextStyle( padding: EdgeInsets.symmetric(
color: Colors.white horizontal: 10,
),)),), vertical: 10,
)), ),
], margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
child: Row(
children: [
Expanded(
child: SizedBox(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
"Description",
style: TextStyle(
fontFamily: "JakartaMedium",
),
),
Text(
"${provider.partData.prodDesc}",
style: TextStyle(
color: Color(0xFF818181),
),
),
],
),
),
),
],
),
),
),
SizedBox(height: 150),
],
),
),
), ),
), ),
); );
} },
); );
} }
Future<void> _showStockIssueBottomSheet(BuildContext context,type) { Future<void> _showStockIssueBottomSheet(BuildContext context, type) {
return showModalBottomSheet( return showModalBottomSheet(
useSafeArea: true, useSafeArea: true,
isDismissible: true, isDismissible: true,
...@@ -230,9 +495,9 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen> ...@@ -230,9 +495,9 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen>
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
bottom: bottom:
MediaQuery.of( MediaQuery.of(
context, context,
).viewInsets.bottom, // This handles keyboard ).viewInsets.bottom, // This handles keyboard
), ),
child: Container( child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
...@@ -246,20 +511,29 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen> ...@@ -246,20 +511,29 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen>
builder: (context, provider, homeProvider, child) { builder: (context, provider, homeProvider, child) {
return SingleChildScrollView( return SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Text("Inventory ${type}"), Text(
"Inventory ${type}",
style: TextStyle(
color: AppColors.app_blue,
fontWeight: FontWeight.w600,
fontSize: 16,
),
),
SizedBox(height: 10),
Container( Container(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Text( child: Text(
"Quantity", "Quantity",
style: TextStyle( style: TextStyle(
color: AppColors.semi_black, color: AppColors.semi_black,
fontSize: 12, fontSize: 14,
), ),
), ),
), ),
SizedBox(height: 5),
Container( Container(
height: 48, height: 48,
alignment: Alignment.center, alignment: Alignment.center,
...@@ -267,12 +541,12 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen> ...@@ -267,12 +541,12 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen>
color: AppColors.text_field_color, color: AppColors.text_field_color,
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
border: border:
quantityFocusNode.hasFocus quantityFocusNode.hasFocus
? Border.all( ? Border.all(
color: AppColors.app_blue, color: AppColors.app_blue,
width: 0.5, width: 0.5,
) )
: null, : null,
), ),
// alignment: Alignment.center, // alignment: Alignment.center,
margin: EdgeInsets.only(left: 5.0, right: 5.0), margin: EdgeInsets.only(left: 5.0, right: 5.0),
...@@ -288,8 +562,11 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen> ...@@ -288,8 +562,11 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen>
keyboardType: TextInputType.text, keyboardType: TextInputType.text,
focusNode: quantityFocusNode, focusNode: quantityFocusNode,
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
onChanged: (value) { onChanged: (value) {
provider.updateQuantity(quantitycontroller.text); provider.updateQuantity(
quantitycontroller.text,
);
}, },
onTapOutside: (event) { onTapOutside: (event) {
// Handle onTapOutside // Handle onTapOutside
...@@ -298,9 +575,10 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen> ...@@ -298,9 +575,10 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen>
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
hintStyle: TextStyle( hintStyle: TextStyle(
fontWeight: FontWeight.w400, color: Color(0xFF818181),
fontSize: 14, fontSize: 14,
), ),
//contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0), //contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0),
enabledBorder: InputBorder.none, enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none, focusedBorder: InputBorder.none,
...@@ -309,16 +587,18 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen> ...@@ -309,16 +587,18 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen>
), ),
), ),
), ),
SizedBox(height: 10),
Container( Container(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Text( child: Text(
"Description", "Description",
style: TextStyle( style: TextStyle(
color: AppColors.semi_black, color: AppColors.semi_black,
fontSize: 12, fontSize: 14,
), ),
), ),
), ),
SizedBox(height: 5),
Container( Container(
height: 180, height: 180,
alignment: Alignment.center, alignment: Alignment.center,
...@@ -326,12 +606,12 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen> ...@@ -326,12 +606,12 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen>
color: AppColors.text_field_color, color: AppColors.text_field_color,
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
border: border:
descriptionFocusNode.hasFocus descriptionFocusNode.hasFocus
? Border.all( ? Border.all(
color: AppColors.app_blue, color: AppColors.app_blue,
width: 0.5, width: 0.5,
) )
: null, : null,
), ),
// alignment: Alignment.center, // alignment: Alignment.center,
margin: EdgeInsets.only(left: 5.0, right: 5.0), margin: EdgeInsets.only(left: 5.0, right: 5.0),
...@@ -349,7 +629,9 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen> ...@@ -349,7 +629,9 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen>
focusNode: descriptionFocusNode, focusNode: descriptionFocusNode,
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
onChanged: (value) { onChanged: (value) {
provider.updateQuantity(descriptioncontroller.text); provider.updateQuantity(
descriptioncontroller.text,
);
}, },
onTapOutside: (event) { onTapOutside: (event) {
// Handle onTapOutside // Handle onTapOutside
...@@ -358,7 +640,7 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen> ...@@ -358,7 +640,7 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen>
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
hintStyle: TextStyle( hintStyle: TextStyle(
fontWeight: FontWeight.w400, color: Color(0xFF818181),
fontSize: 14, fontSize: 14,
), ),
//contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0), //contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0),
...@@ -370,16 +652,52 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen> ...@@ -370,16 +652,52 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen>
), ),
), ),
InkWell( InkWell(
onTap: () { onTap:
print(provider.isButtonEnabled); provider.isButtonEnabled
if(type=="Recieve"){ ? () {
provider.issuetype = "Recieved"; print(provider.isButtonEnabled);
}else{ if (type == "Recieve") {
provider.issuetype = "Issued"; provider.issuetype = "Recieved";
} } else {
provider.issuetype = "Issued";
}
provider.StockRecieveIssueAPI(homeProvider,context,quantitycontroller.text,descriptioncontroller.text,provider.partID,provider.issuetype); provider.StockRecieveIssueAPI(
}, homeProvider,
context,
quantitycontroller.text,
descriptioncontroller.text,
provider.partID,
provider.issuetype,
);
quantitycontroller.clear();
descriptioncontroller.clear();
}
: () {
if (quantitycontroller.text.isEmpty) {
toast(
context,
"Please Enter Quantity.",
);
} else if (descriptioncontroller
.text
.isEmpty) {
toast(
context,
"Please Enter Description.",
);
} else if (quantitycontroller
.text
.isEmpty &&
descriptioncontroller
.text
.isEmpty) {
toast(
context,
"Quantity and Description are mandatory.",
);
}
},
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
height: 45, height: 45,
...@@ -390,8 +708,12 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen> ...@@ -390,8 +708,12 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen>
bottom: 5.0, bottom: 5.0,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: provider.isButtonEnabled?AppColors.app_blue:AppColors.button_disabled, //1487C9 color:
borderRadius: BorderRadius.circular(30.0), quantitycontroller.text.isEmpty ||
descriptioncontroller.text.isEmpty
? AppColors.button_disabled
: AppColors.app_blue, //1487C9
borderRadius: BorderRadius.circular(12.0),
), ),
child: Center( child: Center(
child: Text( child: Text(
......
...@@ -36,65 +36,72 @@ class _InventoryScreenState extends State<InventoryScreen> { ...@@ -36,65 +36,72 @@ class _InventoryScreenState extends State<InventoryScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Consumer<InventoryProvider>( return Consumer<InventoryProvider>(
builder: (context, provider, child) { builder: (context, provider, child) {
return Scaffold( return WillPopScope(
backgroundColor: AppColors.scaffold_bg_color, onWillPop: () => onBackPressed(context),
appBar: appbar(context, "Gen Inventory"), child: Scaffold(
body: Container( resizeToAvoidBottomInset: true,
decoration: BoxDecoration(color: Colors.black), backgroundColor: AppColors.scaffold_bg_color,
child: Column( appBar: appbar(context, "Gen Inventory"),
children: [ body: Container(
Spacer(), decoration: BoxDecoration(color: Colors.black),
Container( child: Column(
height: 250, children: [
Spacer(),
Container(
height: 250,
child: QRView( child: QRView(
key: provider.scannerKey, key: provider.scannerKey,
onQRViewCreated: (p0) { onQRViewCreated: (p0) {
provider.onQRViewCreated(p0, "inventory", context); provider.onQRViewCreated(p0, "inventory", context);
}, },
formatsAllowed: [BarcodeFormat.qrcode], formatsAllowed: [BarcodeFormat.qrcode],
cameraFacing: CameraFacing.back, cameraFacing: CameraFacing.back,
overlay: QrScannerOverlayShape( overlay: QrScannerOverlayShape(
borderColor: AppColors.app_blue, borderColor: AppColors.app_blue,
borderRadius: 20, borderRadius: 20,
borderLength: 60, borderLength: 60,
borderWidth: 10, borderWidth: 10,
cutOutSize: 250.0, cutOutSize: 250.0,
),
), ),
), ),
), SizedBox(height: 25),
SizedBox(height: 25), Text(
Text( "Scan QR",
"Scan QR", textAlign: TextAlign.center,
textAlign: TextAlign.center, style: TextStyle(fontSize: 18,fontFamily: "JakartaMedium", color: Colors.white),
style: TextStyle(fontSize: 18, color: Colors.white), ),
), Text(
Text( "to open Inventory",
"to open Inventory",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 14, color: Colors.white),
),
Spacer(),
Text(
"or",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 18, color: Colors.white),
),
InkResponse(
onTap: () async {
_showPartIdBottomSheet(context);
},
child: Text(
"Tap To Enter Part ID",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(fontSize: 14, color: Colors.white), style: TextStyle(fontSize: 14, color: Colors.white),
), ),
), Spacer(),
SizedBox(height: 50), Text(
], "or",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 18,
fontFamily: "JakartaMedium",color: Colors.white),
),
InkResponse(
onTap: () async {
_showPartIdBottomSheet(context);
},
child: Text(
"Tap To Enter Part ID",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 17,
fontFamily: "JakartaMedium",
color: AppColors.app_blue),
),
),
SizedBox(height: 50),
],
),
), ),
), ),
); );
...@@ -137,21 +144,24 @@ class _InventoryScreenState extends State<InventoryScreen> { ...@@ -137,21 +144,24 @@ class _InventoryScreenState extends State<InventoryScreen> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Container( Container(
padding: EdgeInsets.symmetric(horizontal: 10),
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Text( child: Text(
"Part ID", "Part ID",
style: TextStyle( style: TextStyle(
color: AppColors.semi_black, color: Color(0xFF818181),
fontSize: 12, fontFamily: "JakartaMedium",
fontSize: 14,
), ),
), ),
), ),
SizedBox(height: 5,),
Container( Container(
height: 48, height: 48,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.text_field_color, color: AppColors.text_field_color,
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(14),
border: border:
partIDfocusNode.hasFocus partIDfocusNode.hasFocus
? Border.all( ? Border.all(
...@@ -173,6 +183,8 @@ class _InventoryScreenState extends State<InventoryScreen> { ...@@ -173,6 +183,8 @@ class _InventoryScreenState extends State<InventoryScreen> {
controller: partIDcontroller, controller: partIDcontroller,
keyboardType: TextInputType.emailAddress, keyboardType: TextInputType.emailAddress,
focusNode: partIDfocusNode, focusNode: partIDfocusNode,
textCapitalization: TextCapitalization.characters,
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
onChanged: (value) {}, onChanged: (value) {},
onTapOutside: (event) { onTapOutside: (event) {
...@@ -182,7 +194,7 @@ class _InventoryScreenState extends State<InventoryScreen> { ...@@ -182,7 +194,7 @@ class _InventoryScreenState extends State<InventoryScreen> {
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
hintStyle: TextStyle( hintStyle: TextStyle(
fontWeight: FontWeight.w400, color: Color(0xFF818181),
fontSize: 14, fontSize: 14,
), ),
//contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0), //contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0),
...@@ -193,6 +205,7 @@ class _InventoryScreenState extends State<InventoryScreen> { ...@@ -193,6 +205,7 @@ class _InventoryScreenState extends State<InventoryScreen> {
), ),
), ),
), ),
SizedBox(height: 15,),
InkWell( InkWell(
onTap: () { onTap: () {
provider.LoadPartDetailsApifunction( provider.LoadPartDetailsApifunction(
...@@ -201,6 +214,7 @@ class _InventoryScreenState extends State<InventoryScreen> { ...@@ -201,6 +214,7 @@ class _InventoryScreenState extends State<InventoryScreen> {
"inventory", "inventory",
partIDcontroller.text, partIDcontroller.text,
); );
partIDcontroller.clear();
}, },
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
...@@ -213,13 +227,15 @@ class _InventoryScreenState extends State<InventoryScreen> { ...@@ -213,13 +227,15 @@ class _InventoryScreenState extends State<InventoryScreen> {
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.app_blue, //1487C9 color: AppColors.app_blue, //1487C9
borderRadius: BorderRadius.circular(30.0), borderRadius: BorderRadius.circular(15.0),
), ),
child: Center( child: Center(
child: Text( child: Text(
"Submit", "Submit",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white,
fontFamily: "JakartaMedium",
fontSize: 15),
), ),
), ),
), ),
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:generp/Notifiers/PaymentCollectionProvider.dart'; import 'package:generp/Notifiers/PaymentCollectionProvider.dart';
import 'package:generp/Utils/app_colors.dart'; import 'package:generp/Utils/app_colors.dart';
import 'package:generp/Utils/commonWidgets.dart'; import 'package:generp/Utils/commonWidgets.dart';
...@@ -14,67 +15,96 @@ class Accountsuggestions extends StatefulWidget { ...@@ -14,67 +15,96 @@ class Accountsuggestions extends StatefulWidget {
class _AccountsuggestionsState extends State<Accountsuggestions> { class _AccountsuggestionsState extends State<Accountsuggestions> {
final TextEditingController _searchController = TextEditingController(); final TextEditingController _searchController = TextEditingController();
FocusNode searchFocusNode = FocusNode();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Consumer<Paymentcollectionprovider>( return Consumer<Paymentcollectionprovider>(
builder: (context,provider,child) { builder: (context, provider, child) {
return Scaffold( return WillPopScope(
appBar: appbar(context, "Accounts"), onWillPop: () => onBackPressed(context),
backgroundColor: AppColors.scaffold_bg_color, child: Scaffold(
body: Column( resizeToAvoidBottomInset: true,
children: [ appBar: appbar(context, "Accounts"),
const SizedBox( backgroundColor: AppColors.scaffold_bg_color,
height: 10, body: Container(
), decoration: BoxDecoration(color: Colors.white),
Container( child: Column(
alignment: Alignment.center, children: [
height: 55, const SizedBox(height: 10),
margin: EdgeInsets.only(left: 15.0, right: 15.0), Container(
child: TextField( alignment: Alignment.topLeft,
controller: _searchController, padding: EdgeInsets.symmetric(horizontal: 10),
keyboardType: TextInputType.text, child: Text(
onChanged: (value) { "Search Account",
style: TextStyle(color: Color(0xFF2d2d2d)),
if (value.length >= 3) { ),
provider.AccountSuggestionAPI(context, value); ),
} SizedBox(height: 5),
}, Container(
decoration: InputDecoration( height: 48,
hintText: "Enter Account Name.....", alignment: Alignment.center,
hintStyle: TextStyle( decoration: BoxDecoration(
fontWeight: FontWeight.w400), color: AppColors.text_field_color,
filled: true, borderRadius: BorderRadius.circular(16),
border:
searchFocusNode.hasFocus
? Border.all(color: AppColors.app_blue, width: 0.5)
: null,
),
// alignment: Alignment.center,
margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: Padding(
padding: const EdgeInsets.fromLTRB(10.0, 0.0, 15, 0),
child: TextField(
controller: _searchController,
keyboardType: TextInputType.text,
focusNode: searchFocusNode,
textCapitalization: TextCapitalization.characters,
style: TextStyle(fontSize: 14),
onChanged: (value) {
if (value.length >= 3) {
provider.AccountSuggestionAPI(context, value);
}
},
onTapOutside: (event) {
// Handle onTapOutside
FocusScope.of(context).unfocus();
},
decoration: InputDecoration(
isDense: true,
hintStyle: TextStyle(
fontWeight: FontWeight.w400,
color: Color(0xFF818181),
fontSize: 14,
),
//contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0),
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
hintText: 'Enter Account Name',
),
),
),
), ),
), Container(
), margin: EdgeInsets.only(top: 5.0, left: 25.0),
Container( alignment: Alignment.topLeft,
margin: EdgeInsets.only(top: 5.0, left: 25.0), child: Text(
alignment: Alignment.topLeft, "Note: Enter Minimum 3 Characters",
child: Text( style: TextStyle(fontWeight: FontWeight.w300),
"Note: Enter Minimum 3 Characters", ),
style: TextStyle(
fontWeight: FontWeight.w300,
), ),
),
),
Expanded( Expanded(
child: SingleChildScrollView( child: SingleChildScrollView(
physics: AlwaysScrollableScrollPhysics(), physics: AlwaysScrollableScrollPhysics(),
child: Container( child: Container(
child: GridView.builder( child: ListView.builder(
itemCount: provider.accountList!.length, itemCount: provider.accountList!.length,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount:
1, // 4 items in a row for tablet
crossAxisSpacing: 4,
mainAxisSpacing: 2,
childAspectRatio: (100 / 25)),
padding: const EdgeInsets.all(5), padding: const EdgeInsets.all(5),
physics: const BouncingScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (context, index) { itemBuilder: (context, index) {
var accountList = provider.accountList; var accountList = provider.accountList;
...@@ -83,72 +113,113 @@ class _AccountsuggestionsState extends State<Accountsuggestions> { ...@@ -83,72 +113,113 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
onTap: () { onTap: () {
// if(actname == "pendingComplaints"&&status=="Open"){ // if(actname == "pendingComplaints"&&status=="Open"){
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => Paymentdetails( builder:
accountName: "Account", (context) => Paymentdetails(
name: accountName: "Account",
accountList![index].accountName, name: accountList![index].accountName,
genId: "", genId: "",
referenceID: referenceID:
accountList![index].accountId, accountList![index].accountId,
), ),
)); ),
);
// } // }
}, },
child: SizedBox( child: SizedBox(
child: Container( child: Container(
width: MediaQuery.of(context).size.width * 0.9, width:
padding: EdgeInsets.fromLTRB(0, 5, 0, 5), MediaQuery.of(context).size.width * 0.9,
child: Text( padding: EdgeInsets.fromLTRB(0, 5, 0, 10),
"${accountList![index].accountName}", child: Row(
textAlign: TextAlign.start, children: [
maxLines: 3, Expanded(
overflow: TextOverflow.ellipsis, flex: 1,
style: TextStyle( child: Container(
fontWeight: FontWeight.w300, padding: EdgeInsets.symmetric(
), horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Color(0xFFE6F6FF),
borderRadius: BorderRadius.circular(
8,
),
),
child: SvgPicture.asset(
width: 30,
height: 30,
"assets/svg/se_block_head.svg",
),
),
),
SizedBox(width: 10,),
Expanded(
flex: 5,
child: Text(
"${accountList![index].accountName}",
textAlign: TextAlign.start,
maxLines: 3,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: AppColors.semi_black
),
),
),
Expanded(
flex: 1,
child: SvgPicture.asset(
"assets/svg/arrow_right_new.svg",
),
),
],
), ),
), ),
), ),
); );
} else { } else {
return Expanded( return Expanded(
child: SingleChildScrollView( child: SingleChildScrollView(
physics: AlwaysScrollableScrollPhysics(), physics: AlwaysScrollableScrollPhysics(),
child: Container(
width: double.infinity,
height: MediaQuery.of(context).size.height,
// Set width to fill parent width
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30.0),
topRight: Radius.circular(30.0),
),
),
padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
child: Container( child: Container(
width: double.infinity, child: Align(
height: MediaQuery.of(context) alignment: Alignment.center,
.size child: Text(
.height, // Set width to fill parent width "No Data Available",
decoration: BoxDecoration( style: TextStyle(
borderRadius: BorderRadius.only( fontWeight: FontWeight.bold,
topLeft: Radius.circular(30.0), overflow: TextOverflow.ellipsis,
topRight: Radius.circular(30.0),
), ),
), ),
padding: ),
EdgeInsets.fromLTRB(10, 10, 10, 10), ),
child: Container( ),
child: Align( ),
alignment: Alignment.center, );
child: Text(
"No Data Available",
style: TextStyle(
fontWeight: FontWeight.bold,
overflow: TextOverflow.ellipsis,
),
)),
)),
));
} }
}), },
),
),
), ),
)) ),
], ],
),
),
), ),
); );
} },
); );
} }
} }
import 'package:flutter/material.dart';
class Complaintdetailsscreen extends StatefulWidget {
const Complaintdetailsscreen({super.key});
@override
State<Complaintdetailsscreen> createState() => _ComplaintdetailsscreenState();
}
class _ComplaintdetailsscreenState extends State<Complaintdetailsscreen> {
@override
Widget build(BuildContext context) {
return const Placeholder();
}
}
...@@ -34,92 +34,96 @@ class _FollowupdetailsState extends State<Followupdetails> { ...@@ -34,92 +34,96 @@ class _FollowupdetailsState extends State<Followupdetails> {
return Consumer<Visitdetailsprovider>( return Consumer<Visitdetailsprovider>(
builder: (context, provider, child) { builder: (context, provider, child) {
var followups = provider.followUpList; var followups = provider.followUpList;
return Scaffold( return WillPopScope(
appBar: appbar(context, "Follow Up Details"), onWillPop: () => onBackPressed(context),
backgroundColor: AppColors.scaffold_bg_color, child: Scaffold(
body: Container( resizeToAvoidBottomInset: true,
child: ListView.builder( appBar: appbar(context, "Follow Up Details"),
itemCount: provider.followUpList.length, backgroundColor: AppColors.scaffold_bg_color,
itemBuilder: (context, index) { body: Container(
return Container( child: ListView.builder(
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 5), itemCount: provider.followUpList.length,
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 10), itemBuilder: (context, index) {
decoration: BoxDecoration( return Container(
color: Colors.white, margin: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
borderRadius: BorderRadius.circular(20), padding: EdgeInsets.symmetric(horizontal: 15, vertical: 10),
), decoration: BoxDecoration(
child: Column( color: Colors.white,
children: [ borderRadius: BorderRadius.circular(20),
Row( ),
children: [ child: Column(
Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, Row(
children: List.generate(4, (j) { children: [
final textheads = [ Column(
"Name", crossAxisAlignment: CrossAxisAlignment.start,
"Date", children: List.generate(4, (j) {
"Type", final textheads = [
"Time", "Name",
"Feedback", "Date",
]; "Type",
final textSubheads = [ "Time",
"${followups[index].ename}", "Feedback",
"${followups[index].date}", ];
"${followups[index].type}", final textSubheads = [
"${followups[index].time}", "${followups[index].ename}",
"${followups[index].feedback}", "${followups[index].date}",
]; "${followups[index].type}",
return Container( "${followups[index].time}",
padding: EdgeInsets.symmetric(vertical: 3), "${followups[index].feedback}",
child: Container( ];
padding: EdgeInsets.symmetric( return Container(
vertical: 3, padding: EdgeInsets.symmetric(vertical: 3),
horizontal: 0, child: Container(
), padding: EdgeInsets.symmetric(
child: Column( vertical: 3,
children: [ horizontal: 0,
Row( ),
mainAxisAlignment: child: Column(
MainAxisAlignment.spaceBetween, children: [
children: [ Row(
Column( mainAxisAlignment:
crossAxisAlignment: MainAxisAlignment.spaceBetween,
CrossAxisAlignment.start, children: [
children: [ Column(
Text(textheads[j].toString()), crossAxisAlignment:
SizedBox( CrossAxisAlignment.start,
// height:45, children: [
width: Text(textheads[j].toString()),
MediaQuery.of( SizedBox(
context, // height:45,
).size.width * width:
0.8, MediaQuery.of(
child: Text( context,
textSubheads[j], ).size.width *
maxLines: 2, 0.8,
overflow: child: Text(
TextOverflow.ellipsis, textSubheads[j],
style: TextStyle( maxLines: 2,
color: Color(0xFF818181), overflow:
TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF818181),
),
), ),
), ),
), ],
], ),
), ],
], ),
), ],
], ),
), ),
), );
); }),
}), ),
), ],
], ),
), ],
], ),
), );
); },
}, ),
), ),
), ),
); );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment