Commit c62a2345 by Ramesh Babu Puvvadi

few changes

parent a41737ae
......@@ -16,7 +16,7 @@ class CheckRegistration extends StatefulWidget {
class _CheckRegistration extends State<CheckRegistration> {
final TextEditingController _empId = TextEditingController();
late final ImagePicker _picker = ImagePicker();
late final ImagePicker _picker = ImagePicker();
XFile? image;
File? newVideoFile;
var store = '';
......@@ -143,7 +143,7 @@ class _CheckRegistration extends State<CheckRegistration> {
if (image != null) {
File file = File(image!.path);
String filecontents = await fileToString(file);
//String filecontents = await fileToString(file);
String fileName = file.path.split(Platform.pathSeparator).last;
final response =
......@@ -183,13 +183,14 @@ class _CheckRegistration extends State<CheckRegistration> {
void getValidReg(String text) async {
var data = await RemoteData().getValidEmp(text);
if (data.statusCode != 200) {
Constants('Review', data.statusCode.toString())
.showAlertDialog(context, false);
Constants('Review', data.statusCode.toString()).showAlertDialog(context, false);
return;
}
Map<String, dynamic> responseMap = jsonDecode(data.body);
CheckReg checkReg = CheckReg.fromJson(responseMap);
print('response:$responseMap');
if (kDebugMode) {
print('response:$responseMap');
}
if (checkReg.status == 'Success') {
getVideo(text);
} else {
......@@ -204,7 +205,9 @@ class _CheckRegistration extends State<CheckRegistration> {
return await file.readAsString();
}
} catch (e) {
print("Error reading file: $e");
if (kDebugMode) {
print("Error reading file: $e");
}
}
return '';
}
......
......@@ -11,7 +11,8 @@ import 'Constants.dart';
class FootFall extends StatefulWidget {
final String message;
final String selecteddate;
const FootFall({super.key, required this.message, required this.selecteddate});
const FootFall(
{super.key, required this.message, required this.selecteddate});
@override
_FootFall createState() => _FootFall();
......@@ -25,7 +26,7 @@ class _FootFall extends State<FootFall> {
var isMeeters = '';
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
void initState() {
......
......@@ -5,7 +5,7 @@ import 'package:permission_handler/permission_handler.dart';
//import 'package:need_resume/need_resume.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:storemonitor/Screens/Issue.dart';
import 'package:storemonitor/Screens/MyHomePage.dart';
import 'package:storemonitor/Screens/SurvellianceView.dart';
import '../Services/RemoteData.dart';
import 'Constants.dart';
......@@ -263,35 +263,35 @@ class _IssueVideos extends State<IssueVideos> {
child: GestureDetector(
onTap: () {
requestStoragePermission();
// Navigator.of(context)
// .push(
// MaterialPageRoute(
// builder: (_) => SurvellianceView(
// message: notificationslist![index]
// .VIDEOURL,
// id: notificationslist![index]
// .VIDNOTID
// .toString(),
// comment: notificationslist![index]
// .COMMENTS,
// desc: notificationslist![index]
// .DESCRIPTION,
// store:
// notificationslist![index].STORE,
// location: notificationslist![index]
// .LOCATION,
// time: notificationslist![index]
// .TIMESTAMP,
// )),
// )
// .then((val) => (val != null)
// ? (val
// ? getData(selectedDropdownItem!)
// : true)
// : false);
Navigator.of(context)
.push(
MaterialPageRoute(
builder: (_) => SurvellianceView(
message: notificationslist![index]
.VIDEOURL,
id: notificationslist![index]
.VIDNOTID
.toString(),
comment: notificationslist![index]
.COMMENTS,
desc: notificationslist![index]
.DESCRIPTION,
store:
notificationslist![index].STORE,
location: notificationslist![index]
.LOCATION,
time: notificationslist![index]
.TIMESTAMP,
)),
)
.then((val) => (val != null)
? (val
? getData(selectedDropdownItem!)
: true)
: false);
Navigator.of(context).push(MaterialPageRoute(
builder: (_) => MyHomePage()));
// Navigator.of(context).push(MaterialPageRoute(
// builder: (_) => MyHomePage()));
},
child: Row(
children: [
......
......@@ -49,7 +49,7 @@ class LoginPage extends StatelessWidget {
// 'assets/images/login_header_image.png',
// height: 350,
// width: 350,
// ),
//),
const SizedBox(height: 30),
const LoginForm(),
],
......
......@@ -3,7 +3,6 @@ import 'dart:core';
import 'package:flutter/material.dart';
import 'package:http/src/response.dart';
import 'package:shared_preferences/shared_preferences.dart';
//this below one is DateFormat Libray its not imported automatically
import 'package:intl/intl.dart';
import '../Models/Notifications.dart';
import '../Services/RemoteData.dart';
......@@ -13,8 +12,9 @@ class NotificationReport extends StatefulWidget {
final String message;
final String selecteddate;
const NotificationReport({super.key, required this.message, required this.selecteddate});
const NotificationReport(
{super.key, required this.message, required this.selecteddate});
@override
_NotificationReport createState() => _NotificationReport();
}
......@@ -115,8 +115,7 @@ class _NotificationReport extends State<NotificationReport> {
data = await RemoteData().getNotificationReport(selectedDropdownItem!,
'${_selectedDate1.year}-$selectedmonth-$selectedday');
if (data.statusCode != 200) {
Constants('NotificationReport', data.statusCode.toString())
.showAlertDialog(context, false);
Constants('NotificationReport', data.statusCode.toString()).showAlertDialog(context, false);
return;
}
Navigator.of(context).pop();
......@@ -293,9 +292,9 @@ class _NotificationReport extends State<NotificationReport> {
width: 0,
height: 15,
),
Row(
const Row(
mainAxisAlignment: MainAxisAlignment.start,
children: const [
children: [
Text('Summary',
textAlign: TextAlign.left,
style: Constants.headerfontStyle),
......@@ -411,9 +410,9 @@ class _NotificationReport extends State<NotificationReport> {
height: 15,
width: 1,
),
Row(
const Row(
mainAxisAlignment: MainAxisAlignment.start,
children: const [
children: [
Text('Details',
textAlign: TextAlign.left,
style: Constants.headerfontStyle),
......@@ -449,8 +448,8 @@ class _NotificationReport extends State<NotificationReport> {
),
//color: Color.fromARGB(255, 123, 50, 254),
height: 40,
child: Row(
children: const [
child: const Row(
children: [
Expanded(
child: Text(
'REASON',
......@@ -517,10 +516,11 @@ class _NotificationReport extends State<NotificationReport> {
width: MediaQuery.of(context).size.width / 4.3,
// height: 40,
child: Text(
notificationslist![index]
.reason
.toString()
.toLowerCase(),
Constants.capitalizeFirstLetter(
notificationslist![index]
.reason
.toString()
.toLowerCase()),
style: Constants.headerlistitems,
maxLines: 5,
overflow: TextOverflow.ellipsis,
......
......@@ -16,7 +16,6 @@ import '../Services/RemoteData.dart';
import 'Constants.dart';
import 'ImageZoomin.dart';
class Review extends StatefulWidget {
//const Review({super.key});
final String message;
......@@ -407,8 +406,8 @@ class _Review extends State<Review> {
child: Container(
margin: const EdgeInsets.all(15.0),
child: Column(
//crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
//mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
......
......@@ -16,7 +16,7 @@ class NetworkApiServices extends BaseApiServices {
} on SocketException {
throw FetchDataException('No Internet Connection');
}
return responseJson;
}
......
name: storemonitor
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
environment:
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