Commit c62a2345 by Ramesh Babu Puvvadi

few changes

parent a41737ae
...@@ -16,7 +16,7 @@ class CheckRegistration extends StatefulWidget { ...@@ -16,7 +16,7 @@ class CheckRegistration extends StatefulWidget {
class _CheckRegistration extends State<CheckRegistration> { class _CheckRegistration extends State<CheckRegistration> {
final TextEditingController _empId = TextEditingController(); final TextEditingController _empId = TextEditingController();
late final ImagePicker _picker = ImagePicker(); late final ImagePicker _picker = ImagePicker();
XFile? image; XFile? image;
File? newVideoFile; File? newVideoFile;
var store = ''; var store = '';
...@@ -143,7 +143,7 @@ class _CheckRegistration extends State<CheckRegistration> { ...@@ -143,7 +143,7 @@ class _CheckRegistration extends State<CheckRegistration> {
if (image != null) { if (image != null) {
File file = File(image!.path); File file = File(image!.path);
String filecontents = await fileToString(file); //String filecontents = await fileToString(file);
String fileName = file.path.split(Platform.pathSeparator).last; String fileName = file.path.split(Platform.pathSeparator).last;
final response = final response =
...@@ -183,13 +183,14 @@ class _CheckRegistration extends State<CheckRegistration> { ...@@ -183,13 +183,14 @@ class _CheckRegistration extends State<CheckRegistration> {
void getValidReg(String text) async { void getValidReg(String text) async {
var data = await RemoteData().getValidEmp(text); var data = await RemoteData().getValidEmp(text);
if (data.statusCode != 200) { if (data.statusCode != 200) {
Constants('Review', data.statusCode.toString()) Constants('Review', data.statusCode.toString()).showAlertDialog(context, false);
.showAlertDialog(context, false);
return; return;
} }
Map<String, dynamic> responseMap = jsonDecode(data.body); Map<String, dynamic> responseMap = jsonDecode(data.body);
CheckReg checkReg = CheckReg.fromJson(responseMap); CheckReg checkReg = CheckReg.fromJson(responseMap);
print('response:$responseMap'); if (kDebugMode) {
print('response:$responseMap');
}
if (checkReg.status == 'Success') { if (checkReg.status == 'Success') {
getVideo(text); getVideo(text);
} else { } else {
...@@ -204,7 +205,9 @@ class _CheckRegistration extends State<CheckRegistration> { ...@@ -204,7 +205,9 @@ class _CheckRegistration extends State<CheckRegistration> {
return await file.readAsString(); return await file.readAsString();
} }
} catch (e) { } catch (e) {
print("Error reading file: $e"); if (kDebugMode) {
print("Error reading file: $e");
}
} }
return ''; return '';
} }
......
...@@ -11,7 +11,8 @@ import 'Constants.dart'; ...@@ -11,7 +11,8 @@ import 'Constants.dart';
class FootFall extends StatefulWidget { class FootFall extends StatefulWidget {
final String message; final String message;
final String selecteddate; final String selecteddate;
const FootFall({super.key, required this.message, required this.selecteddate}); const FootFall(
{super.key, required this.message, required this.selecteddate});
@override @override
_FootFall createState() => _FootFall(); _FootFall createState() => _FootFall();
...@@ -25,7 +26,7 @@ class _FootFall extends State<FootFall> { ...@@ -25,7 +26,7 @@ class _FootFall extends State<FootFall> {
var isMeeters = ''; var isMeeters = '';
List<String>? storesList; List<String>? storesList;
//var graph = """<!DOCTYPE html>\n<html>\n<script type=\"text/javascript\" src=\"https://www.gstatic.com/charts/loader.js\"></script>\n\n<body>\n<div id=\"Employees\" style=\"width:50%; max-width:150px; height:50px;\"></div>\n\n<script>\ngoogle.charts.load('current', {'packages':['corechart']});\ngoogle.charts.setOnLoadCallback(drawChart);\n\nfunction drawChart() {\n var data = google.visualization.arrayToDataTable([\n ['TIME OF DAY', 'MALE',{ role: 'annotation'},'FEMALE',{ role: 'annotation'},],\n['10-11', 8, '8', 19, '19'], ['11-12', 12, '12', 21, '21'], ['12-13', 18, '18', 13, '13'], ['13-14', 17, '17', 14, '14'], ['14-15', 10, '10', 20, '20'], ['15-16', 8, '8', 21, '21'], ['16-17', 11, '11', 19, '19'], ['17-18', 12, '12', 13, '13'], ['18-19', 13, '13', 16, '16'], ['19-20', 8, '8', 22, '22'], ['20-21', 14, '14', 15, '15'], ['21-22', 7, '7', 17, '17'],\n \n ]);\n\n var options = {\n \t \n \t \n legend:'top',\n chartArea:{left:30,bottom:50,top:40,width:\"90%\",height:\"50%\"},\n width:1080,\n height:800,\n \n colors: ['#65d9eb', '#e263eb'],\n hAxis:{\n title:'---- Time of Day ----',\n titleTextStyle:{\n\t\t\t fontSize: 18,\n bold: true,},\n }, \n vAxis:{\n \t\t fontSize: 18,\n bold:true,\n title:'Footfall --->',\n \n titleTextStyle:{\n\t\t\t fontSize: 18,\n bold: true,},},\n annotations:{\n alwaysOutside: false,\n highContrast: true, // default is true, but be sure\n textStyle: {\n \tfontSize: 14,\n bold: true\n } \n\n },\n\n\n };\n\n var chart = new google.visualization.AreaChart(document.getElementById('Employees'));\n chart.draw(data, options);\n }\n</script>\n\n</body>\n</html>\n"""; //var graph = """<!DOCTYPE html>\n<html>\n<script type=\"text/javascript\" src=\"https://www.gstatic.com/charts/loader.js\"></script>\n\n<body>\n<div id=\"Employees\" style=\"width:50%; max-width:150px; height:50px;\"></div>\n\n<script>\ngoogle.charts.load('current', {'packages':['corechart']});\ngoogle.charts.setOnLoadCallback(drawChart);\n\nfunction drawChart() {\n var data = google.visualization.arrayToDataTable([\n ['TIME OF DAY', 'MALE',{ role: 'annotation'},'FEMALE',{ role: 'annotation'},],\n['10-11', 8, '8', 19, '19'], ['11-12', 12, '12', 21, '21'], ['12-13', 18, '18', 13, '13'], ['13-14', 17, '17', 14, '14'], ['14-15', 10, '10', 20, '20'], ['15-16', 8, '8', 21, '21'], ['16-17', 11, '11', 19, '19'], ['17-18', 12, '12', 13, '13'], ['18-19', 13, '13', 16, '16'], ['19-20', 8, '8', 22, '22'], ['20-21', 14, '14', 15, '15'], ['21-22', 7, '7', 17, '17'],\n \n ]);\n\n var options = {\n \t \n \t \n legend:'top',\n chartArea:{left:30,bottom:50,top:40,width:\"90%\",height:\"50%\"},\n width:1080,\n height:800,\n \n colors: ['#65d9eb', '#e263eb'],\n hAxis:{\n title:'---- Time of Day ----',\n titleTextStyle:{\n\t\t\t fontSize: 18,\n bold: true,},\n }, \n vAxis:{\n \t\t fontSize: 18,\n bold:true,\n title:'Footfall --->',\n \n titleTextStyle:{\n\t\t\t fontSize: 18,\n bold: true,},},\n annotations:{\n alwaysOutside: false,\n highContrast: true, // default is true, but be sure\n textStyle: {\n \tfontSize: 14,\n bold: true\n } \n\n },\n\n\n };\n\n var chart = new google.visualization.AreaChart(document.getElementById('Employees'));\n chart.draw(data, options);\n }\n</script>\n\n</body>\n</html>\n""";]
@override @override
void initState() { void initState() {
......
...@@ -132,220 +132,185 @@ class _Home extends State<Home> { ...@@ -132,220 +132,185 @@ class _Home extends State<Home> {
), ),
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: GestureDetector(
margin: const EdgeInsets.all(12.0), onHorizontalDragUpdate: (dragDetail) {
child: Column( print('Testing');
crossAxisAlignment: CrossAxisAlignment.start, if (dragDetail.delta.direction > 0) {
mainAxisAlignment: MainAxisAlignment.start, Navigator.pop(context);
children: [ print('Hitted =====>');
Container( }
padding: const EdgeInsets.symmetric(horizontal: 10.0), },
decoration: BoxDecoration( child: Container(
border: Border.all(color: Colors.grey), margin: const EdgeInsets.all(12.0),
borderRadius: BorderRadius.circular(5.0), child: Column(
), crossAxisAlignment: CrossAxisAlignment.start,
child: DropdownButtonHideUnderline( mainAxisAlignment: MainAxisAlignment.start,
child: DropdownButton<String>( children: [
menuMaxHeight: Constants.getDropdownItemHeight(context), Container(
value: selectedDropdownItem, padding: const EdgeInsets.symmetric(horizontal: 10.0),
onChanged: (newValue) { decoration: BoxDecoration(
setState(() { border: Border.all(color: Colors.grey),
selectedDropdownItem = newValue;
getupdateData(selectedDropdownItem);
if (selectedDropdownItem == 'WH KISMATPUR' ||
selectedDropdownItem == 'WH BANGALORE' ||
selectedDropdownItem == 'WH VIJAYAWADA' ||
selectedDropdownItem == 'WH KANCHI') {
iswarehouserelated = true;
} else {
iswarehouserelated = false;
}
});
},
items: namesList?.map((item) {
return DropdownMenuItem<String>(
value: item,
child: Text(item),
);
}).toList(),
icon: const Icon(Icons.arrow_drop_down),
isExpanded: true,
),
),
),
const SizedBox(
height: 15,
width: 1,
),
TextFormField(
controller: _dateTime,
onTap: () {},
decoration: InputDecoration(
contentPadding:
const EdgeInsets.symmetric(vertical: 15, horizontal: 10),
isDense: true,
hintText: 'Select date',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(5.0), borderRadius: BorderRadius.circular(5.0),
), ),
suffixIcon: IconButton( child: DropdownButtonHideUnderline(
icon: Image.asset( child: DropdownButton<String>(
'assets/images/date_icon.png', menuMaxHeight: Constants.getDropdownItemHeight(context),
width: 24, value: selectedDropdownItem,
height: 24, onChanged: (newValue) {
setState(() {
selectedDropdownItem = newValue;
getupdateData(selectedDropdownItem);
if (selectedDropdownItem == 'WH KISMATPUR' ||
selectedDropdownItem == 'WH BANGALORE' ||
selectedDropdownItem == 'WH VIJAYAWADA' ||
selectedDropdownItem == 'WH KANCHI') {
iswarehouserelated = true;
} else {
iswarehouserelated = false;
}
});
},
items: namesList?.map((item) {
return DropdownMenuItem<String>(
value: item,
child: Text(item),
);
}).toList(),
icon: const Icon(Icons.arrow_drop_down),
isExpanded: true,
), ),
onPressed: () => _selectDate(context),
), ),
), ),
), const SizedBox(
const SizedBox(height: 10), height: 15,
const Text('AI Powered Alerts', width: 1,
textAlign: TextAlign.right, style: Constants.headerfontStyle),
const SizedBox(
width: 0,
height: 5,
),
Container(
height: 2,
width: 60,
color: const Color.fromARGB(255, 170, 57, 243),
),
const SizedBox(
height: 15,
width: 1,
),
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10.0),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 2,
blurRadius: 5,
offset: const Offset(0, 2),
),
],
), ),
child: SfCircularChart( TextFormField(
//backgroundColor: Colors.white, controller: _dateTime,
margin: const EdgeInsets.all(10), onTap: () {},
legend: Legend( decoration: InputDecoration(
isVisible: true, contentPadding: const EdgeInsets.symmetric(
position: LegendPosition.top, vertical: 15, horizontal: 10),
), isDense: true,
tooltipBehavior: TooltipBehavior( hintText: 'Select date',
enable: true, border: OutlineInputBorder(
textStyle: borderRadius: BorderRadius.circular(5.0),
const TextStyle(fontSize: 22.0, color: Colors.white), ),
), suffixIcon: IconButton(
icon: Image.asset(
palette: const <Color>[ 'assets/images/date_icon.png',
Color.fromARGB(255, 4, 145, 74), width: 24,
Color.fromARGB(255, 241, 92, 34) height: 24,
],
series: <CircularSeries>[
PieSeries<GDPData, String>(
dataSource: _chartData,
xValueMapper: (GDPData data, _) => data.continent,
yValueMapper: (GDPData data, _) => data.gdp,
dataLabelSettings: const DataLabelSettings(
isVisible: true,
textStyle:
TextStyle(fontSize: 32.0, color: Colors.white),
), ),
enableTooltip: true, onPressed: () => _selectDate(context),
radius: '100%',
explode: true,
), ),
], ),
onDataLabelRender: (DataLabelRenderArgs args) {
args.textStyle = args.textStyle.copyWith(
fontSize: 18, // Set the desired font size
fontFamily: 'Poppins',
fontWeight: FontWeight.bold,
); // Set the desired font size
},
), ),
), const SizedBox(height: 10),
const SizedBox( const Text('AI Powered Alerts',
height: 15, textAlign: TextAlign.right,
width: 1, style: Constants.headerfontStyle),
), const SizedBox(
Row(mainAxisAlignment: MainAxisAlignment.start, children: [ width: 0,
Expanded( height: 5,
child: SizedBox( ),
width: MediaQuery.of(context).size.width * 0.448, Container(
child: GestureDetector( height: 2,
onTap: () { width: 60,
Navigator.push( color: const Color.fromARGB(255, 170, 57, 243),
context, ),
MaterialPageRoute( const SizedBox(
builder: (context) => Review( height: 15,
message: selectedDropdownItem.toString(), width: 1,
selecteddate: ),
'${_selectedDate.year}/${_selectedDate.month}/${_selectedDate.day}', Container(
)), decoration: BoxDecoration(
); color: Colors.white,
}, borderRadius: BorderRadius.circular(10.0),
child: Container( boxShadow: [
margin: const EdgeInsets.only( BoxShadow(
left: 0, top: 0, right: 2, bottom: 0), color: Colors.grey.withOpacity(0.5),
width: MediaQuery.of(context).size.width * 0.44, spreadRadius: 2,
height: MediaQuery.of(context).size.width * 0.22, blurRadius: 5,
padding: const EdgeInsets.all(5), offset: const Offset(0, 2),
decoration: BoxDecoration(
gradient: const LinearGradient(
begin: Alignment.bottomLeft,
end: Alignment.bottomRight,
colors: [
Color(0xFFFF1412),
//Color(0xFFC2185B),
Color(0xFFFF714C),
],
),
borderRadius: BorderRadius.circular(7),
),
child: Row(
children: [
Image.asset(
'assets/images/review.png',
), // replace with your image
],
),
), ),
],
),
child: SfCircularChart(
//backgroundColor: Colors.white,
margin: const EdgeInsets.all(10),
legend: Legend(
isVisible: true,
position: LegendPosition.top,
),
tooltipBehavior: TooltipBehavior(
enable: true,
textStyle:
const TextStyle(fontSize: 22.0, color: Colors.white),
), ),
palette: const <Color>[
Color.fromARGB(255, 4, 145, 74),
Color.fromARGB(255, 241, 92, 34)
],
series: <CircularSeries>[
PieSeries<GDPData, String>(
dataSource: _chartData,
xValueMapper: (GDPData data, _) => data.continent,
yValueMapper: (GDPData data, _) => data.gdp,
dataLabelSettings: const DataLabelSettings(
isVisible: true,
textStyle:
TextStyle(fontSize: 32.0, color: Colors.white),
),
enableTooltip: true,
radius: '100%',
explode: true,
),
],
onDataLabelRender: (DataLabelRenderArgs args) {
args.textStyle = args.textStyle.copyWith(
fontSize: 18, // Set the desired font size
fontFamily: 'Poppins',
fontWeight: FontWeight.bold,
); // Set the desired font size
},
), ),
), ),
const VerticalDivider(width: 10.0), const SizedBox(
Expanded( height: 15,
child: Container( width: 1,
margin: const EdgeInsets.only( ),
left: 0, top: 0, right: 0, bottom: 0), Row(mainAxisAlignment: MainAxisAlignment.start, children: [
width: MediaQuery.of(context).size.width * 0.44, Expanded(
child: Visibility( child: SizedBox(
//visible: isAuthenticated, width: MediaQuery.of(context).size.width * 0.448,
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => EmployeeStatus( builder: (context) => Review(
message: selectedDropdownItem.toString())), message: selectedDropdownItem.toString(),
selecteddate:
'${_selectedDate.year}/${_selectedDate.month}/${_selectedDate.day}',
)),
); );
}, },
child: Container( child: Container(
margin: const EdgeInsets.only(
left: 0, top: 0, right: 2, bottom: 0),
width: MediaQuery.of(context).size.width * 0.44, width: MediaQuery.of(context).size.width * 0.44,
height: MediaQuery.of(context).size.width * 0.22, height: MediaQuery.of(context).size.width * 0.22,
padding: const EdgeInsets.all(5), padding: const EdgeInsets.all(5),
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: const LinearGradient( gradient: const LinearGradient(
begin: Alignment.bottomLeft, begin: Alignment.bottomLeft,
end: Alignment.bottomCenter, end: Alignment.bottomRight,
colors: [ colors: [
Color(0xFFc89181), Color(0xFFFF1412),
Color(0xFFf5b97e),
//Color(0xFFC2185B), //Color(0xFFC2185B),
Color(0xFFFF714C),
], ],
), ),
borderRadius: BorderRadius.circular(7), borderRadius: BorderRadius.circular(7),
...@@ -353,29 +318,19 @@ class _Home extends State<Home> { ...@@ -353,29 +318,19 @@ class _Home extends State<Home> {
child: Row( child: Row(
children: [ children: [
Image.asset( Image.asset(
'assets/images/emp.png', 'assets/images/review.png',
// width: 145, ), // replace with your image
// height: 160,
),
], ],
), ),
), ),
), ),
), ),
), ),
), const VerticalDivider(width: 10.0),
]),
const SizedBox(
height: 10,
width: 1,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded( Expanded(
child: Container( child: Container(
margin: const EdgeInsets.only( margin: const EdgeInsets.only(
left: 0, top: 0, right: 2, bottom: 0), left: 0, top: 0, right: 0, bottom: 0),
width: MediaQuery.of(context).size.width * 0.44, width: MediaQuery.of(context).size.width * 0.44,
child: Visibility( child: Visibility(
//visible: isAuthenticated, //visible: isAuthenticated,
...@@ -384,12 +339,9 @@ class _Home extends State<Home> { ...@@ -384,12 +339,9 @@ class _Home extends State<Home> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => NotificationReport( builder: (context) => EmployeeStatus(
message: message:
selectedDropdownItem.toString(), selectedDropdownItem.toString())),
selecteddate:
'${_selectedDate.year}/${_selectedDate.month}/${_selectedDate.day}',
)),
); );
}, },
child: Container( child: Container(
...@@ -401,9 +353,9 @@ class _Home extends State<Home> { ...@@ -401,9 +353,9 @@ class _Home extends State<Home> {
begin: Alignment.bottomLeft, begin: Alignment.bottomLeft,
end: Alignment.bottomCenter, end: Alignment.bottomCenter,
colors: [ colors: [
Color(0xFF6e87d6), Color(0xFFc89181),
Color(0xFFf5b97e),
//Color(0xFFC2185B), //Color(0xFFC2185B),
Color(0xFF48c5ef),
], ],
), ),
borderRadius: BorderRadius.circular(7), borderRadius: BorderRadius.circular(7),
...@@ -411,22 +363,10 @@ class _Home extends State<Home> { ...@@ -411,22 +363,10 @@ class _Home extends State<Home> {
child: Row( child: Row(
children: [ children: [
Image.asset( Image.asset(
'assets/images/accuracy.png', 'assets/images/emp.png',
// width: 145, // width: 145,
// height: 160, // height: 160,
), ),
// replace with your image
// const SizedBox(
// width:
// 10), // add some space between the image and the text
// const Expanded(
// child: Text(
// 'Accuracy',
// overflow: TextOverflow.ellipsis,
// style: Constants.buttonsfontStyle,
// textAlign: TextAlign.center,
// ),
// ),
], ],
), ),
), ),
...@@ -434,158 +374,175 @@ class _Home extends State<Home> { ...@@ -434,158 +374,175 @@ class _Home extends State<Home> {
), ),
), ),
), ),
const VerticalDivider(width: 10.0), ]),
Expanded( const SizedBox(
child: Container( height: 10,
margin: const EdgeInsets.only( width: 1,
left: 0, top: 0, right: 0, bottom: 0), ),
width: MediaQuery.of(context).size.width * 0.44, Row(
child: Visibility( mainAxisAlignment: MainAxisAlignment.start,
//visible: isAuthenticated, children: [
child: GestureDetector( Expanded(
onTap: () { child: Container(
Navigator.push( margin: const EdgeInsets.only(
context, left: 0, top: 0, right: 2, bottom: 0),
MaterialPageRoute( width: MediaQuery.of(context).size.width * 0.44,
builder: (context) => FootFall( child: Visibility(
message: //visible: isAuthenticated,
selectedDropdownItem.toString(), child: GestureDetector(
selecteddate: onTap: () {
'${_selectedDate.year}/${_selectedDate.month}/${_selectedDate.day}', Navigator.push(
)), context,
); MaterialPageRoute(
}, builder: (context) => NotificationReport(
child: Container( message:
width: MediaQuery.of(context).size.width * 0.44, selectedDropdownItem.toString(),
height: MediaQuery.of(context).size.width * 0.22, selecteddate:
padding: const EdgeInsets.all(3), '${_selectedDate.year}/${_selectedDate.month}/${_selectedDate.day}',
decoration: BoxDecoration( )),
gradient: const LinearGradient( );
begin: Alignment.bottomLeft, },
end: Alignment.bottomCenter, child: Container(
colors: [ width: MediaQuery.of(context).size.width * 0.44,
Color(0xFF872b8e), height: MediaQuery.of(context).size.width * 0.22,
//Color(0xFFC2185B), padding: const EdgeInsets.all(5),
Color(0xFFcf2b72), decoration: BoxDecoration(
gradient: const LinearGradient(
begin: Alignment.bottomLeft,
end: Alignment.bottomCenter,
colors: [
Color(0xFF6e87d6),
//Color(0xFFC2185B),
Color(0xFF48c5ef),
],
),
borderRadius: BorderRadius.circular(7),
),
child: Row(
children: [
Image.asset(
'assets/images/accuracy.png',
// width: 145,
// height: 160,
),
// replace with your image
// const SizedBox(
// width:
// 10), // add some space between the image and the text
// const Expanded(
// child: Text(
// 'Accuracy',
// overflow: TextOverflow.ellipsis,
// style: Constants.buttonsfontStyle,
// textAlign: TextAlign.center,
// ),
// ),
], ],
), ),
borderRadius: BorderRadius.circular(7),
),
child: Row(
children: [
Image.asset(
'assets/images/footfall.png',
// width: 145,
// height: 160,
),
// replace with your image
// const SizedBox(
// width:
// 10), // add some space between the image and the text
// const Expanded(
// child: Text(
// 'Foot Fall',
// overflow: TextOverflow.ellipsis,
// style: Constants.buttonsfontStyle,
// textAlign: TextAlign.center,
// ),
// ),
],
), ),
), ),
), ),
), ),
), ),
), const VerticalDivider(width: 10.0),
], Expanded(
), child: Container(
const SizedBox( margin: const EdgeInsets.only(
height: 10, left: 0, top: 0, right: 0, bottom: 0),
width: 1, width: MediaQuery.of(context).size.width * 0.44,
), child: Visibility(
Row( //visible: isAuthenticated,
mainAxisAlignment: MainAxisAlignment.start, child: GestureDetector(
children: [ onTap: () {
Expanded( Navigator.push(
child: Container( context,
margin: const EdgeInsets.only( MaterialPageRoute(
left: 0, top: 0, right: 0, bottom: 0), builder: (context) => FootFall(
width: MediaQuery.of(context).size.width * 0.44, message:
child: GestureDetector( selectedDropdownItem.toString(),
onTap: () { selecteddate:
Navigator.push( '${_selectedDate.year}/${_selectedDate.month}/${_selectedDate.day}',
context, )),
MaterialPageRoute( );
builder: (context) => UserRegistration( },
message: selectedDropdownItem.toString())), child: Container(
); width: MediaQuery.of(context).size.width * 0.44,
}, height: MediaQuery.of(context).size.width * 0.22,
child: Container( padding: const EdgeInsets.all(3),
width: MediaQuery.of(context).size.width * 0.44, decoration: BoxDecoration(
height: MediaQuery.of(context).size.width * 0.22, gradient: const LinearGradient(
padding: const EdgeInsets.all(5), begin: Alignment.bottomLeft,
decoration: BoxDecoration( end: Alignment.bottomCenter,
gradient: const LinearGradient( colors: [
begin: Alignment.bottomLeft, Color(0xFF872b8e),
end: Alignment.bottomRight, //Color(0xFFC2185B),
colors: [ Color(0xFFcf2b72),
Color(0xFF6a706f), ],
//Color(0xFFC2185B), ),
Color(0xFF91b3b1), borderRadius: BorderRadius.circular(7),
],
),
borderRadius: BorderRadius.circular(7),
),
child: Row(
children: [
Image.asset(
'assets/images/emp_registration.png',
// width: 145,
// height: 160,
), ),
], child: Row(
children: [
Image.asset(
'assets/images/footfall.png',
// width: 145,
// height: 160,
),
// replace with your image
// const SizedBox(
// width:
// 10), // add some space between the image and the text
// const Expanded(
// child: Text(
// 'Foot Fall',
// overflow: TextOverflow.ellipsis,
// style: Constants.buttonsfontStyle,
// textAlign: TextAlign.center,
// ),
// ),
],
),
),
), ),
), ),
), ),
), ),
), ],
const VerticalDivider(width: 10.0), ),
Expanded( const SizedBox(
child: Container( height: 10,
margin: const EdgeInsets.only( width: 1,
left: 0, top: 0, right: 0, bottom: 0), ),
width: MediaQuery.of(context).size.width * 0.44, Row(
child: Visibility( mainAxisAlignment: MainAxisAlignment.start,
//visible: iswarehouserelated, children: [
Expanded(
child: Container(
margin: const EdgeInsets.only(
left: 0, top: 0, right: 0, bottom: 0),
width: MediaQuery.of(context).size.width * 0.44,
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => IssueVideos( builder: (context) => UserRegistration(
message: message:
selectedDropdownItem.toString(), selectedDropdownItem.toString())),
)),
); );
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => CameraGridItems()),
// );
}, },
child: Container( child: Container(
width: MediaQuery.of(context).size.width * 0.44, width: MediaQuery.of(context).size.width * 0.44,
height: MediaQuery.of(context).size.width * 0.22, height: MediaQuery.of(context).size.width * 0.22,
padding: const EdgeInsets.all(3), padding: const EdgeInsets.all(5),
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: const LinearGradient( gradient: const LinearGradient(
begin: Alignment.bottomLeft, begin: Alignment.bottomLeft,
end: Alignment.bottomRight, end: Alignment.bottomRight,
colors: [ colors: [
Color(0xFF525589), Color(0xFF6a706f),
Color(0xFFaca8e0),
//Color(0xFFC2185B), //Color(0xFFC2185B),
Color(0xFF91b3b1),
], ],
), ),
borderRadius: BorderRadius.circular(7), borderRadius: BorderRadius.circular(7),
...@@ -593,7 +550,7 @@ class _Home extends State<Home> { ...@@ -593,7 +550,7 @@ class _Home extends State<Home> {
child: Row( child: Row(
children: [ children: [
Image.asset( Image.asset(
'assets/images/videos.png', 'assets/images/emp_registration.png',
// width: 145, // width: 145,
// height: 160, // height: 160,
), ),
...@@ -603,10 +560,65 @@ class _Home extends State<Home> { ...@@ -603,10 +560,65 @@ class _Home extends State<Home> {
), ),
), ),
), ),
), const VerticalDivider(width: 10.0),
], Expanded(
), child: Container(
], margin: const EdgeInsets.only(
left: 0, top: 0, right: 0, bottom: 0),
width: MediaQuery.of(context).size.width * 0.44,
child: Visibility(
//visible: iswarehouserelated,
child: GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => IssueVideos(
message:
selectedDropdownItem.toString(),
)),
);
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => CameraGridItems()),
// );
},
child: Container(
width: MediaQuery.of(context).size.width * 0.44,
height: MediaQuery.of(context).size.width * 0.22,
padding: const EdgeInsets.all(3),
decoration: BoxDecoration(
gradient: const LinearGradient(
begin: Alignment.bottomLeft,
end: Alignment.bottomRight,
colors: [
Color(0xFF525589),
Color(0xFFaca8e0),
//Color(0xFFC2185B),
],
),
borderRadius: BorderRadius.circular(7),
),
child: Row(
children: [
Image.asset(
'assets/images/videos.png',
// width: 145,
// height: 160,
),
],
),
),
),
),
),
),
],
),
],
),
), ),
), ),
), ),
......
...@@ -5,7 +5,7 @@ import 'package:permission_handler/permission_handler.dart'; ...@@ -5,7 +5,7 @@ import 'package:permission_handler/permission_handler.dart';
//import 'package:need_resume/need_resume.dart'; //import 'package:need_resume/need_resume.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:storemonitor/Screens/Issue.dart'; import 'package:storemonitor/Screens/Issue.dart';
import 'package:storemonitor/Screens/MyHomePage.dart'; import 'package:storemonitor/Screens/SurvellianceView.dart';
import '../Services/RemoteData.dart'; import '../Services/RemoteData.dart';
import 'Constants.dart'; import 'Constants.dart';
...@@ -263,35 +263,35 @@ class _IssueVideos extends State<IssueVideos> { ...@@ -263,35 +263,35 @@ class _IssueVideos extends State<IssueVideos> {
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
requestStoragePermission(); requestStoragePermission();
// Navigator.of(context) Navigator.of(context)
// .push( .push(
// MaterialPageRoute( MaterialPageRoute(
// builder: (_) => SurvellianceView( builder: (_) => SurvellianceView(
// message: notificationslist![index] message: notificationslist![index]
// .VIDEOURL, .VIDEOURL,
// id: notificationslist![index] id: notificationslist![index]
// .VIDNOTID .VIDNOTID
// .toString(), .toString(),
// comment: notificationslist![index] comment: notificationslist![index]
// .COMMENTS, .COMMENTS,
// desc: notificationslist![index] desc: notificationslist![index]
// .DESCRIPTION, .DESCRIPTION,
// store: store:
// notificationslist![index].STORE, notificationslist![index].STORE,
// location: notificationslist![index] location: notificationslist![index]
// .LOCATION, .LOCATION,
// time: notificationslist![index] time: notificationslist![index]
// .TIMESTAMP, .TIMESTAMP,
// )), )),
// ) )
// .then((val) => (val != null) .then((val) => (val != null)
// ? (val ? (val
// ? getData(selectedDropdownItem!) ? getData(selectedDropdownItem!)
// : true) : true)
// : false); : false);
Navigator.of(context).push(MaterialPageRoute( // Navigator.of(context).push(MaterialPageRoute(
builder: (_) => MyHomePage())); // builder: (_) => MyHomePage()));
}, },
child: Row( child: Row(
children: [ children: [
......
...@@ -49,7 +49,7 @@ class LoginPage extends StatelessWidget { ...@@ -49,7 +49,7 @@ class LoginPage extends StatelessWidget {
// 'assets/images/login_header_image.png', // 'assets/images/login_header_image.png',
// height: 350, // height: 350,
// width: 350, // width: 350,
// ), //),
const SizedBox(height: 30), const SizedBox(height: 30),
const LoginForm(), const LoginForm(),
], ],
......
...@@ -3,7 +3,6 @@ import 'dart:core'; ...@@ -3,7 +3,6 @@ import 'dart:core';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:http/src/response.dart'; import 'package:http/src/response.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
//this below one is DateFormat Libray its not imported automatically
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import '../Models/Notifications.dart'; import '../Models/Notifications.dart';
import '../Services/RemoteData.dart'; import '../Services/RemoteData.dart';
...@@ -13,8 +12,9 @@ class NotificationReport extends StatefulWidget { ...@@ -13,8 +12,9 @@ class NotificationReport extends StatefulWidget {
final String message; final String message;
final String selecteddate; final String selecteddate;
const NotificationReport({super.key, required this.message, required this.selecteddate}); const NotificationReport(
{super.key, required this.message, required this.selecteddate});
@override @override
_NotificationReport createState() => _NotificationReport(); _NotificationReport createState() => _NotificationReport();
} }
...@@ -115,8 +115,7 @@ class _NotificationReport extends State<NotificationReport> { ...@@ -115,8 +115,7 @@ class _NotificationReport extends State<NotificationReport> {
data = await RemoteData().getNotificationReport(selectedDropdownItem!, data = await RemoteData().getNotificationReport(selectedDropdownItem!,
'${_selectedDate1.year}-$selectedmonth-$selectedday'); '${_selectedDate1.year}-$selectedmonth-$selectedday');
if (data.statusCode != 200) { if (data.statusCode != 200) {
Constants('NotificationReport', data.statusCode.toString()) Constants('NotificationReport', data.statusCode.toString()).showAlertDialog(context, false);
.showAlertDialog(context, false);
return; return;
} }
Navigator.of(context).pop(); Navigator.of(context).pop();
...@@ -293,9 +292,9 @@ class _NotificationReport extends State<NotificationReport> { ...@@ -293,9 +292,9 @@ class _NotificationReport extends State<NotificationReport> {
width: 0, width: 0,
height: 15, height: 15,
), ),
Row( const Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: const [ children: [
Text('Summary', Text('Summary',
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: Constants.headerfontStyle), style: Constants.headerfontStyle),
...@@ -411,9 +410,9 @@ class _NotificationReport extends State<NotificationReport> { ...@@ -411,9 +410,9 @@ class _NotificationReport extends State<NotificationReport> {
height: 15, height: 15,
width: 1, width: 1,
), ),
Row( const Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: const [ children: [
Text('Details', Text('Details',
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: Constants.headerfontStyle), style: Constants.headerfontStyle),
...@@ -449,8 +448,8 @@ class _NotificationReport extends State<NotificationReport> { ...@@ -449,8 +448,8 @@ class _NotificationReport extends State<NotificationReport> {
), ),
//color: Color.fromARGB(255, 123, 50, 254), //color: Color.fromARGB(255, 123, 50, 254),
height: 40, height: 40,
child: Row( child: const Row(
children: const [ children: [
Expanded( Expanded(
child: Text( child: Text(
'REASON', 'REASON',
...@@ -517,10 +516,11 @@ class _NotificationReport extends State<NotificationReport> { ...@@ -517,10 +516,11 @@ class _NotificationReport extends State<NotificationReport> {
width: MediaQuery.of(context).size.width / 4.3, width: MediaQuery.of(context).size.width / 4.3,
// height: 40, // height: 40,
child: Text( child: Text(
notificationslist![index] Constants.capitalizeFirstLetter(
.reason notificationslist![index]
.toString() .reason
.toLowerCase(), .toString()
.toLowerCase()),
style: Constants.headerlistitems, style: Constants.headerlistitems,
maxLines: 5, maxLines: 5,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
......
...@@ -16,7 +16,6 @@ import '../Services/RemoteData.dart'; ...@@ -16,7 +16,6 @@ import '../Services/RemoteData.dart';
import 'Constants.dart'; import 'Constants.dart';
import 'ImageZoomin.dart'; import 'ImageZoomin.dart';
class Review extends StatefulWidget { class Review extends StatefulWidget {
//const Review({super.key}); //const Review({super.key});
final String message; final String message;
...@@ -407,8 +406,8 @@ class _Review extends State<Review> { ...@@ -407,8 +406,8 @@ class _Review extends State<Review> {
child: Container( child: Container(
margin: const EdgeInsets.all(15.0), margin: const EdgeInsets.all(15.0),
child: Column( child: Column(
//crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, //mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Container( Container(
padding: const EdgeInsets.symmetric(horizontal: 10.0), padding: const EdgeInsets.symmetric(horizontal: 10.0),
......
...@@ -16,7 +16,7 @@ class NetworkApiServices extends BaseApiServices { ...@@ -16,7 +16,7 @@ class NetworkApiServices extends BaseApiServices {
} on SocketException { } on SocketException {
throw FetchDataException('No Internet Connection'); throw FetchDataException('No Internet Connection');
} }
return responseJson; return responseJson;
} }
......
name: storemonitor name: storemonitor
description: A new Flutter project. description: A new Flutter project.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev publish_to: 'none'
version: 1.0.4+4 version: 1.0.4+4
environment: environment:
sdk: '>=2.18.4 <3.0.0' sdk: '>=2.18.4 <3.0.0'
......
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