Commit e2657fa9 by Ramesh Babu Puvvadi

added changes

parent a96d8a62
......@@ -46,7 +46,10 @@ class _CameraGridItemsState extends State<CameraGridItems> {
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => MyHomePage()),
MaterialPageRoute(
builder: (context) => MyHomePage(
message: '',
)),
);
},
child: Container(
......
import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:intl/intl.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
......@@ -229,7 +230,7 @@ class _CheckList extends State<CheckList> {
),
const SizedBox(width: 8),
SizedBox(
width: 60, // Adjust the width as needed
width: 60, //Adjust the width as needed
child: TextFormField(
controller: six,
keyboardType: TextInputType.number,
......@@ -250,7 +251,7 @@ class _CheckList extends State<CheckList> {
),
const SizedBox(width: 8),
SizedBox(
width: 60, // Adjust the width as needed
width: 60, //Adjust the width as needed
child: TextFormField(
controller: seven,
keyboardType: TextInputType.number,
......@@ -404,6 +405,7 @@ class _CheckList extends State<CheckList> {
color: Color.fromARGB(255, 173, 57, 230),
));
});
List<Map<String, dynamic>> jsonArray = [
{
'hour': '10-11',
......@@ -462,8 +464,14 @@ class _CheckList extends State<CheckList> {
'${_selectedDate.year}/${_selectedDate.month}/${_selectedDate.day}');
Map<String, dynamic> responseMap =
jsonDecode(res!.body);
if (kDebugMode) {
print(responseMap);
}
if (responseMap['status'] == 'Success') {
Navigator.pop(context);
Constants('Footfall Verification',
responseMap['status'])
.showAlertDialog(context, false);
setState(() {
one.text = '';
two.text = '';
......@@ -480,9 +488,13 @@ class _CheckList extends State<CheckList> {
});
} else {
Navigator.pop(context);
Constants('Footfall Verification',
responseMap['status'])
.showAlertDialog(context, false);
}
} else {
Constants('CheckList', 'Enter Atleast one item').showAlertDialog(context, false);
Constants('CheckList', 'Enter Atleast one item')
.showAlertDialog(context, false);
}
}
},
......
......@@ -253,7 +253,7 @@ class Constants {
showAlertDialog(BuildContext context, bool val) {
Widget okButton = TextButton(
child: const Text("Cancel"),
child: const Text("Ok"),
onPressed: () {
if (val) {
Navigator.popUntil(context, (route) => route.isFirst);
......
......@@ -73,322 +73,325 @@ class _EmployeeReport extends State<EmployeeReport> {
),
),
),
body: Container(
margin: const EdgeInsets.all(15.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
//mainAxisAlignment: MainAxisAlignment.center,
children: [
// SizedBox(
// width: double.infinity,
// child: DropdownButton(
// isExpanded: true,
// value: selectedItem,
// onChanged: (value) {
// setState(() {
// selectedItem = value;
// getupdateData(selectedItem);
// });
// },
// items: storesList?.map((value) {
// return DropdownMenuItem(
// value: value,
// child: Text(value),
// );
// }).toList(),
// ),
// ),
body: SingleChildScrollView(
child: Container(
margin: const EdgeInsets.all(15.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
//mainAxisAlignment: MainAxisAlignment.center,
children: [
// SizedBox(
// width: double.infinity,
// child: DropdownButton(
// isExpanded: true,
// value: selectedItem,
// onChanged: (value) {
// setState(() {
// selectedItem = value;
// getupdateData(selectedItem);
// });
// },
// items: storesList?.map((value) {
// return DropdownMenuItem(
// value: value,
// child: Text(value),
// );
// }).toList(),
// ),
// ),
Container(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(5.0),
),
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
menuMaxHeight: Constants.getDropdownItemHeight(context),
value: selectedItem,
onChanged: (newValue) {
setState(() {
selectedItem = newValue;
getupdateData(selectedItem);
});
},
items: storesList?.map((item) {
return DropdownMenuItem<String>(
value: item,
child: Text(item),
);
}).toList(),
icon: const Icon(Icons.arrow_drop_down),
isExpanded: true,
Container(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(5.0),
),
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
menuMaxHeight: Constants.getDropdownItemHeight(context),
value: selectedItem,
onChanged: (newValue) {
setState(() {
selectedItem = newValue;
getupdateData(selectedItem);
});
},
items: storesList?.map((item) {
return DropdownMenuItem<String>(
value: item,
child: Text(item),
);
}).toList(),
icon: const Icon(Icons.arrow_drop_down),
isExpanded: true,
),
),
),
),
const SizedBox(
height: 10,
width: 1,
),
const SizedBox(
height: 10,
width: 1,
),
const Text('Summary',
textAlign: TextAlign.left, style: Constants.headerfontStyle),
const SizedBox(
width: 0,
height: 3,
),
Container(
height: 2,
width: 40,
color: const Color.fromARGB(255, 170, 57, 230),
),
const SizedBox(
height: 15,
width: 1,
),
const Text('Summary',
textAlign: TextAlign.left, style: Constants.headerfontStyle),
const SizedBox(
width: 0,
height: 3,
),
Container(
height: 2,
width: 40,
color: const Color.fromARGB(255, 170, 57, 230),
),
const SizedBox(
height: 15,
width: 1,
),
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(5.0),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 2,
blurRadius: 5,
offset: const Offset(0, 2),
),
],
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(5.0),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 2,
blurRadius: 5,
offset: const Offset(0, 2),
),
],
),
child: Column(
children: [
Container(
margin: const EdgeInsets.fromLTRB(5.0, 5.0, 5.0, 5.0),
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
const Text(
' Registered :',
style: Constants.headerlistitems,
),
Text(' $registered',
style: Constants.headerlistitems1),
],
),
const SizedBox(width: 1, height: 10),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
const Text(' UnRegistered :',
style: Constants.headerlistitems),
Text(' $unregistered',
style: Constants.headerlistitems1),
],
),
const SizedBox(width: 1, height: 10),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
const Text(' Total :',
style: Constants.headerlistitems),
Text(' $total', style: Constants.headerlistitems1),
],
),
const SizedBox(width: 1, height: 10),
],
),
),
child: Column(
children: [
Container(
margin: const EdgeInsets.fromLTRB(5.0, 5.0, 5.0, 5.0),
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
const Text(
' Registered :',
style: Constants.headerlistitems,
),
Text(' $registered', style: Constants.headerlistitems1),
],
),
const SizedBox(width: 1, height: 10),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
const Text(' UnRegistered :',
style: Constants.headerlistitems),
Text(' $unregistered',
style: Constants.headerlistitems1),
],
),
const SizedBox(width: 1, height: 10),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
const Text(' Total :',
style: Constants.headerlistitems),
Text(' $total', style: Constants.headerlistitems1),
],
),
const SizedBox(width: 1, height: 10),
],
const SizedBox(
height: 15,
width: 1,
),
const Text('Details',
textAlign: TextAlign.left, style: Constants.headerfontStyle),
const SizedBox(
width: 0,
height: 3,
),
),
const SizedBox(
height: 15,
width: 1,
),
const Text('Details',
textAlign: TextAlign.left, style: Constants.headerfontStyle),
const SizedBox(
width: 0,
height: 3,
),
Container(
height: 2,
width: 30,
color: const Color.fromARGB(255, 170, 57, 230),
),
const SizedBox(
height: 15,
width: 1,
),
Container(
decoration: BoxDecoration(
// border: Border.all(
// color: const Color.fromARGB(255, 123, 50, 254),
// style: BorderStyle.solid,
// width: 1.0,
// ),
color: const Color.fromARGB(255, 35, 22, 66),
borderRadius: BorderRadius.circular(5.0),
Container(
height: 2,
width: 30,
color: const Color.fromARGB(255, 170, 57, 230),
),
//color: Color.fromARGB(255, 123, 50, 254),
height: 40,
child: const Row(
children: [
Expanded(
child: Text(
'EMP ID',
textAlign: TextAlign.center,
style: Constants.whitefontStyle,
const SizedBox(
height: 15,
width: 1,
),
Container(
decoration: BoxDecoration(
// border: Border.all(
// color: const Color.fromARGB(255, 123, 50, 254),
// style: BorderStyle.solid,
// width: 1.0,
// ),
color: const Color.fromARGB(255, 35, 22, 66),
borderRadius: BorderRadius.circular(5.0),
),
//color: Color.fromARGB(255, 123, 50, 254),
height: 40,
child: const Row(
children: [
Expanded(
child: Text(
'EMP ID',
textAlign: TextAlign.center,
style: Constants.whitefontStyle,
),
),
),
VerticalDivider(
width: 1.0,
color: Colors.white,
),
Expanded(
child: Text(
'EMP STATUS',
textAlign: TextAlign.center,
style: Constants.whitefontStyle,
VerticalDivider(
width: 1.0,
color: Colors.white,
),
),
],
Expanded(
child: Text(
'EMP STATUS',
textAlign: TextAlign.center,
style: Constants.whitefontStyle,
),
),
],
),
),
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.42,
child: ListView.builder(
itemCount: empreportlist?.length,
itemBuilder: (context, index) {
return Padding(
padding: const EdgeInsets.all(0.0),
child: Container(
height: 40,
color: index % 2 == 0
? const Color.fromARGB(255, 245, 242, 251)
: Colors.white,
child: Row(
children: [
if (empreportlist![index].rEGSTATUS ==
'NOT REGISTERED' ||
empreportlist![index].rEGSTATUS ==
'Not Registered') ...[
SizedBox(
width: MediaQuery.of(context).size.width / 2.2,
// height: 40,
child: Text(
empreportlist![index].eMPId.toString(),
style: Constants.reviewbuttonsfontStyle,
maxLines: 5,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
SizedBox(
height: MediaQuery.of(context).size.height * 0.48,
child: ListView.builder(
itemCount: empreportlist?.length,
itemBuilder: (context, index) {
return Padding(
padding: const EdgeInsets.all(0.0),
child: Container(
height: 40,
color: index % 2 == 0
? const Color.fromARGB(255, 245, 242, 251)
: Colors.white,
child: Row(
children: [
if (empreportlist![index].rEGSTATUS ==
'NOT REGISTERED' ||
empreportlist![index].rEGSTATUS ==
'Not Registered') ...[
SizedBox(
width: MediaQuery.of(context).size.width / 2.2,
// height: 40,
child: Text(
empreportlist![index].eMPId.toString(),
style: Constants.reviewbuttonsfontStyle,
maxLines: 5,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
),
),
),
const VerticalDivider(
width: 1.0,
color: Colors.white,
),
SizedBox(
width: MediaQuery.of(context).size.width / 2.2,
child: Text(
empreportlist![index]
.rEGSTATUS
.toString()
.toUpperCase(),
style: Constants.unregisterfontStyle,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
const VerticalDivider(
width: 1.0,
color: Colors.white,
),
),
// Expanded(
// child: Text(
// empreportlist![index].eMPId.toString(),
// textAlign: TextAlign.center,
// style: Constants.unregisterfontStyle),
// ),
// VerticalDivider(
// width: 20.0,
SizedBox(
width: MediaQuery.of(context).size.width / 2.2,
child: Text(
empreportlist![index]
.rEGSTATUS
.toString()
.toUpperCase(),
style: Constants.unregisterfontStyle,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
),
),
// Expanded(
// child: Text(
// empreportlist![index].eMPId.toString(),
// textAlign: TextAlign.center,
// style: Constants.unregisterfontStyle),
// ),
// VerticalDivider(
// width: 20.0,
// color: Colors.white,
// ),
// Expanded(
// child: Text(
// empreportlist![index].rEGSTATUS.toString(),
// textAlign: TextAlign.center,
// style: Constants.unregisterfontStyle,
// ),
// ),
],
if (empreportlist![index].rEGSTATUS ==
'Registered') ...[
SizedBox(
width: MediaQuery.of(context).size.width / 2.2,
// height: 40,
child: Text(
empreportlist![index].eMPId.toString(),
style: Constants.reviewbuttonsfontStyle,
maxLines: 5,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
// color: Colors.white,
// ),
// Expanded(
// child: Text(
// empreportlist![index].rEGSTATUS.toString(),
// textAlign: TextAlign.center,
// style: Constants.unregisterfontStyle,
// ),
// ),
],
if (empreportlist![index].rEGSTATUS ==
'Registered') ...[
SizedBox(
width: MediaQuery.of(context).size.width / 2.2,
// height: 40,
child: Text(
empreportlist![index].eMPId.toString(),
style: Constants.reviewbuttonsfontStyle,
maxLines: 5,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
),
),
const VerticalDivider(
width: 1.0,
color: Colors.white,
),
),
const VerticalDivider(
width: 1.0,
color: Colors.white,
),
SizedBox(
width: MediaQuery.of(context).size.width / 2.2,
child: Text(
empreportlist![index]
.rEGSTATUS
.toString()
.toUpperCase(),
style: Constants.registerfontStyle,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
SizedBox(
width: MediaQuery.of(context).size.width / 2.2,
child: Text(
empreportlist![index]
.rEGSTATUS
.toString()
.toUpperCase(),
style: Constants.registerfontStyle,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
),
),
),
// Expanded(
// child: Text(
// empreportlist![index].eMPId.toString(),
// textAlign: TextAlign.center,
// style: Constants.registerfontStyle,
// ),
// ),
// Expanded(
// child: Text(
// empreportlist![index].rEGSTATUS.toString(),
// textAlign: TextAlign.center,
// style: Constants.registerfontStyle,
// ),
// ),
]
],
// Expanded(
// child: Text(
// empreportlist![index].eMPId.toString(),
// textAlign: TextAlign.center,
// style: Constants.registerfontStyle,
// ),
// ),
// Expanded(
// child: Text(
// empreportlist![index].rEGSTATUS.toString(),
// textAlign: TextAlign.center,
// style: Constants.registerfontStyle,
// ),
// ),
]
],
),
),
),
);
},
);
},
),
),
),
],
],
),
),
),
);
}
void showProgressDialog(BuildContext context) {
// Capture the context in a local variable
BuildContext dialogContext = context;
showDialog(
context: dialogContext,
builder: (BuildContext context) {
return const Center(
child: CircularProgressIndicator(
color: Color.fromARGB(255, 173, 57, 230),
),
);
},
);
}
// Capture the context in a local variable
BuildContext dialogContext = context;
showDialog(
context: dialogContext,
builder: (BuildContext context) {
return const Center(
child: CircularProgressIndicator(
color: Color.fromARGB(255, 173, 57, 230),
),
);
},
);
}
Future<void> getupdateData(String? selectedDropdownItem) async {
if (await Constants.checkInternetConnectivity()) {
......@@ -429,7 +432,8 @@ class _EmployeeReport extends State<EmployeeReport> {
});
} else {
Navigator.of(context).pop();
Constants('Employee Report', 'Please check your internet connection').showAlertDialog(context, false);
Constants('Employee Report', 'Please check your internet connection')
.showAlertDialog(context, false);
}
}
}
......@@ -148,17 +148,7 @@ class _FootFall extends State<FootFall> {
onHorizontalDragStart: (details) {
print('force press start');
},
onHorizontalDragDown: (details) {
print('force press down');
//if (details.globalPosition.direction > 0) {
// print('force press down1$details');
//}
//if (details.globalPosition.direction < 0) {
// print('force press down$details');
//}
//Navigator.of(context).pop();
},
onHorizontalDragDown: (details) {},
child: FutureBuilder<Foot?>(
future: _futureFoot,
builder: (context, snapshot) {
......@@ -403,6 +393,13 @@ class _FootFall extends State<FootFall> {
style: Constants.listitems,
),
),
Expanded(
child: Text(
'MTeens',
textAlign: TextAlign.center,
style: Constants.listitems,
),
),
],
),
const SizedBox(
......@@ -454,17 +451,17 @@ class _FootFall extends State<FootFall> {
),
),
),
// Expanded(
// child: Text(
// foot.mteens.toString(),
// textAlign: TextAlign.center,
// style: const TextStyle(
// color:
// Color.fromARGB(255, 63, 123, 173),
// fontWeight: FontWeight.bold,
// ),
// ),
// ),
Expanded(
child: Text(
foot.mteens.toString(),
textAlign: TextAlign.center,
style: const TextStyle(
color: Color.fromARGB(
255, 63, 123, 173),
fontWeight: FontWeight.bold,
),
),
),
],
),
const SizedBox(
......@@ -517,16 +514,17 @@ class _FootFall extends State<FootFall> {
),
),
),
// Expanded(
// child: Text(
// foot.fteens.toString(),
// textAlign: TextAlign.center,
// style: const TextStyle(
// color: Color.fromARGB(255, 235, 25, 42),
// fontWeight: FontWeight.bold,
// ),
// ),
// ),
Expanded(
child: Text(
foot.fteens.toString(),
textAlign: TextAlign.center,
style: const TextStyle(
color: Color.fromARGB(
255, 235, 25, 42),
fontWeight: FontWeight.bold,
),
),
),
],
),
const SizedBox(
......
......@@ -6,9 +6,9 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'package:storemonitor/Models/chartdata.dart';
import 'package:storemonitor/Screens/EmployeeStatus.dart';
import 'package:storemonitor/Screens/IssueVideos.dart';
import 'package:storemonitor/Screens/MyHomePage.dart';
import 'package:storemonitor/Screens/NavBar.dart';
import 'package:intl/intl.dart';
import 'package:storemonitor/Screens/WeeklyAudit.dart';
import 'package:storemonitor/Services/RemoteData.dart';
import 'package:syncfusion_flutter_charts/charts.dart';
import 'Constants.dart';
......@@ -27,6 +27,7 @@ class Home extends StatefulWidget {
class _Home extends State<Home> {
String? selectedDropdownItem;
String? empId;
List<String>? namesList;
late List<GDPData> _chartData;
DateTime _selectedDate = DateTime.now();
......@@ -46,6 +47,8 @@ class _Home extends State<Home> {
loadData() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
String? userId = prefs.getString("stores_list");
empId = prefs.getString('empId');
print(empId);
namesList = (json.decode(userId!) as List<dynamic>)
.map((map) => map['name'] as String)
.toList();
......@@ -647,9 +650,10 @@ class _Home extends State<Home> {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => WeeklyAudit(
message:
selectedDropdownItem.toString())));
builder: (context) => MyHomePage(
message:
'https://vaman.plutokm.com/sa_mob_report/$empId',
)));
},
child: Container(
width: MediaQuery.of(context).size.width * 0.44,
......
......@@ -2,7 +2,6 @@ import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
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/SurvellianceView.dart';
......@@ -36,10 +35,14 @@ class _IssueVideos extends State<IssueVideos> {
Future<void> requestStoragePermission() async {
final status = await Permission.storage.request();
if (status.isGranted) {
print('Granted');
if (kDebugMode) {
print('Granted');
}
// You have the permission, you can now access storage.
} else if (status.isDenied) {
print('Not Granted');
if (kDebugMode) {
print('Not Granted');
}
// The user denied the permission. You can explain why you need it and request again.
} else if (status.isPermanentlyDenied) {
// The user permanently denied the permission. You can open the app settings to let the user manually enable it.
......@@ -65,9 +68,12 @@ class _IssueVideos extends State<IssueVideos> {
}
void getData(String name) async {
if (kDebugMode) {
print("Second Class Hitting");
}
bool isInternetConnected = await Constants.checkInternetConnectivity();
if (isInternetConnected) {
showDialog(
showDialog(
context: context,
builder: (context) {
return const Center(
......@@ -119,354 +125,354 @@ class _IssueVideos extends State<IssueVideos> {
),
),
),
body: Container(
margin: const EdgeInsets.all(15.0),
child: Column(
//crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
// SizedBox(
// width: double.infinity,
// //height: double.infinity,
// child: DropdownButton(
// isExpanded: true,
// value: selectedDropdownItem,
// onChanged: (value) {
// setState(() {
// selectedDropdownItem = value;
// //getupdateData(selectedDropdownItem);
// });
// },
// items: storesList?.map((value) {
// return DropdownMenuItem(
// value: value,
// child: Text(value),
// );
// }).toList(),
// ),
// ),
Container(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(5.0),
),
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
menuMaxHeight: Constants.getDropdownItemHeight(context),
value: selectedDropdownItem,
onChanged: (newValue) {
setState(() {
selectedDropdownItem = newValue;
getData(selectedDropdownItem!);
});
},
items: storesList?.map((item) {
return DropdownMenuItem<String>(
value: item,
child: Text(item),
);
}).toList(),
icon: const Icon(Icons.arrow_drop_down),
isExpanded: true,
body: SingleChildScrollView(
child: Container(
margin: const EdgeInsets.all(15.0),
child: Column(
//crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
// SizedBox(
// width: double.infinity,
// //height: double.infinity,
// child: DropdownButton(
// isExpanded: true,
// value: selectedDropdownItem,
// onChanged: (value) {
// setState(() {
// selectedDropdownItem = value;
// //getupdateData(selectedDropdownItem);
// });
// },
// items: storesList?.map((value) {
// return DropdownMenuItem(
// value: value,
// child: Text(value),
// );
// }).toList(),
// ),
// ),
Container(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(5.0),
),
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
menuMaxHeight: Constants.getDropdownItemHeight(context),
value: selectedDropdownItem,
onChanged: (newValue) {
setState(() {
selectedDropdownItem = newValue;
getData(selectedDropdownItem!);
});
},
items: storesList?.map((item) {
return DropdownMenuItem<String>(
value: item,
child: Text(item),
);
}).toList(),
icon: const Icon(Icons.arrow_drop_down),
isExpanded: true,
),
),
),
),
const SizedBox(
width: 0,
height: 15,
),
const Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text('Details',
textAlign: TextAlign.left,
style: Constants.headerfontStyle),
],
),
Container(
decoration: BoxDecoration(
// border: Border.all(
// color: const Color.fromARGB(255, 123, 50, 254),
// style: BorderStyle.solid,
// width: 1.0,
// ),
color: const Color.fromARGB(255, 35, 22, 66),
borderRadius: BorderRadius.circular(5.0),
const SizedBox(
width: 0,
height: 15,
),
//color: Color.fromARGB(255, 123, 50, 254),
height: 40,
child: const Row(
const Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
child: Text(
'VIDNOTID',
textAlign: TextAlign.center,
style: Constants.whitefontStyle,
Text('Details',
textAlign: TextAlign.left,
style: Constants.headerfontStyle),
],
),
Container(
decoration: BoxDecoration(
// border: Border.all(
// color: const Color.fromARGB(255, 123, 50, 254),
// style: BorderStyle.solid,
// width: 1.0,
// ),
color: const Color.fromARGB(255, 35, 22, 66),
borderRadius: BorderRadius.circular(5.0),
),
//color: Color.fromARGB(255, 123, 50, 254),
height: 40,
child: const Row(
children: [
Expanded(
child: Text(
'VIDNOTID',
textAlign: TextAlign.center,
style: Constants.whitefontStyle,
),
),
),
SizedBox(width: 10),
VerticalDivider(
width: 1.0,
color: Colors.white,
),
Expanded(
child: Text(
'Time',
textAlign: TextAlign.center,
style: Constants.whitefontStyle,
SizedBox(width: 10),
VerticalDivider(
width: 1.0,
color: Colors.white,
),
),
VerticalDivider(
width: 1.0,
color: Colors.white,
),
Expanded(
child: Text(
'STATUS',
textAlign: TextAlign.center,
style: Constants.whitefontStyle,
Expanded(
child: Text(
'Time',
textAlign: TextAlign.center,
style: Constants.whitefontStyle,
),
),
),
// VerticalDivider(
// width: 1.0,
// color: Colors.white,
// ),
// Expanded(
// child: Text(
// 'LINK',
// textAlign: TextAlign.center,
// style: Constants.whitefontStyle,
// ),
// ),
],
VerticalDivider(
width: 1.0,
color: Colors.white,
),
Expanded(
child: Text(
'STATUS',
textAlign: TextAlign.center,
style: Constants.whitefontStyle,
),
),
// VerticalDivider(
// width: 1.0,
// color: Colors.white,
// ),
// Expanded(
// child: Text(
// 'LINK',
// textAlign: TextAlign.center,
// style: Constants.whitefontStyle,
// ),
// ),
],
),
),
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.65,
child: ListView.builder(
itemCount: notificationslist?.length,
itemBuilder: (context, index) {
return Padding(
padding: const EdgeInsets.all(2.0),
child: Container(
height: 60,
color: index % 2 == 0
? const Color.fromARGB(255, 245, 242, 251)
: Colors.white,
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);
SizedBox(
height: MediaQuery.of(context).size.height * 0.65,
child: ListView.builder(
itemCount: notificationslist?.length,
itemBuilder: (context, index) {
return Padding(
padding: const EdgeInsets.all(2.0),
child: Container(
height: 60,
color: index % 2 == 0
? const Color.fromARGB(255, 245, 242, 251)
: Colors.white,
child: GestureDetector(
onTap: () {
requestStoragePermission();
// Navigator.of(context).push(MaterialPageRoute(
// builder: (_) => MyHomePage()));
},
child: Row(
children: [
Expanded(
child: Text(
notificationslist![index]
.VIDNOTID
.toString()
.toLowerCase(),
style: Constants.headerlistitems,
textAlign: TextAlign.center,
overflow: TextOverflow.ellipsis,
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => 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((value) => setState(() {
getData(selectedDropdownItem!);
}));
print("refresh done ");
},
child: Row(
children: [
Expanded(
child: Text(
notificationslist![index]
.VIDNOTID
.toString()
.toLowerCase(),
style: Constants.headerlistitems,
textAlign: TextAlign.center,
overflow: TextOverflow.ellipsis,
),
),
const SizedBox(width: 10),
const VerticalDivider(
width: 1.0,
color: Colors.white,
),
Expanded(
child: Text(
notificationslist![index]
.TIMESTAMP
.toString(),
textAlign: TextAlign.center,
style: Constants.headerlistitems1,
),
),
),
const SizedBox(width: 10),
const VerticalDivider(
width: 1.0,
color: Colors.white,
),
Expanded(
child: Text(
notificationslist![index].TIMESTAMP.toString(),
textAlign: TextAlign.center,
style: Constants.headerlistitems1,
const VerticalDivider(
width: 1.0,
color: Colors.white,
),
),
const VerticalDivider(
width: 1.0,
color: Colors.white,
),
Expanded(
child:
notificationslist![index].STATUS.toString() ==
'CLOSED'
? const Text(
'VIEWED',
style: Constants.close,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
)
: Text(
notificationslist![index]
.STATUS
.toString(),
style: Constants.open,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
),
),
// VerticalDivider(
// width: 1.0,
// color: Colors.white,
// ),
// Expanded(
// child: Text(
// 'LINK',
// textAlign: TextAlign.center,
// style: Constants.whitefontStyle,
// ),
Expanded(
child: notificationslist![index]
.STATUS
.toString() ==
'CLOSED'
? const Text(
'VIEWED',
style: Constants.close,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
)
: Text(
notificationslist![index]
.STATUS
.toString(),
style: Constants.open,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
),
),
// VerticalDivider(
// width: 1.0,
// color: Colors.white,
// ),
// Expanded(
// child: Text(
// 'LINK',
// textAlign: TextAlign.center,
// style: Constants.whitefontStyle,
// ),
// ),
],
// ),
],
),
),
),
// child: Row(
// children: [
// const SizedBox(
// width: 5,
// height: 2,
// ),
// SizedBox(
// width: MediaQuery.of(context).size.width / 3.3,
// // height: 40,
// child: Text(
// notificationslist![index]
// .DESCRIPTION
// .toString()
// .toLowerCase(),
// style: Constants.headerlistitems,
// maxLines: 5,
// overflow: TextOverflow.ellipsis,
// textAlign: TextAlign.left,
// ),
// ),
// const VerticalDivider(
// width: 1.0,
// color: Colors.white,
// ),
// // SizedBox(
// // width: MediaQuery.of(context).size.width / 4.6,
// // child: Text(
// // notificationslist![index].STATUS.toString(),
// // style: Constants.headerlistitems1,
// // overflow: TextOverflow.ellipsis,
// // textAlign: TextAlign.center,
// // ),
// // ),
// // const VerticalDivider(
// // width: 1.0,
// // color: Colors.white,
// // ),
// SizedBox(
// width: MediaQuery.of(context).size.width / 3.4,
// child:
// notificationslist![index].STATUS.toString() ==
// 'CLOSED'
// ? const Text(
// 'VIEWED',
// style: Constants.headerlistitems1,
// overflow: TextOverflow.ellipsis,
// textAlign: TextAlign.center,
// )
// : Text(
// notificationslist![index]
// .STATUS
// .toString(),
// style: Constants.headerlistitems1,
// overflow: TextOverflow.ellipsis,
// textAlign: TextAlign.center,
// ),
// ),
// const VerticalDivider(
// width: 1.0,
// color: Colors.white,
// ),
// SizedBox(
// width: MediaQuery.of(context).size.width / 3.6,
// child: Align(
// alignment: Alignment.center,
// child: IconButton(
// icon: const Icon(Icons.play_arrow,
// size: 32.0), // Play arrow icon
// onPressed: () {
// // Add your play button action here
// // For example, start playing a video or audio
// // Navigator.push(
// // context,
// // MaterialPageRoute(
// // builder: (context) => SurvellianceView(
// // message: notificationslist![index]
// // .VIDEOURL,
// // id: notificationslist![index]
// // .VIDNOTID
// // .toString(),
// // ),
// // ),
// // );
// child: Row(
// children: [
// const SizedBox(
// width: 5,
// height: 2,
// ),
// SizedBox(
// width: MediaQuery.of(context).size.width / 3.3,
// // height: 40,
// child: Text(
// notificationslist![index]
// .DESCRIPTION
// .toString()
// .toLowerCase(),
// style: Constants.headerlistitems,
// maxLines: 5,
// overflow: TextOverflow.ellipsis,
// textAlign: TextAlign.left,
// ),
// ),
// const VerticalDivider(
// width: 1.0,
// color: Colors.white,
// ),
// // SizedBox(
// // width: MediaQuery.of(context).size.width / 4.6,
// // child: Text(
// // notificationslist![index].STATUS.toString(),
// // style: Constants.headerlistitems1,
// // overflow: TextOverflow.ellipsis,
// // textAlign: TextAlign.center,
// // ),
// // ),
// // const VerticalDivider(
// // width: 1.0,
// // color: Colors.white,
// // ),
// SizedBox(
// width: MediaQuery.of(context).size.width / 3.4,
// child:
// notificationslist![index].STATUS.toString() ==
// 'CLOSED'
// ? const Text(
// 'VIEWED',
// style: Constants.headerlistitems1,
// overflow: TextOverflow.ellipsis,
// textAlign: TextAlign.center,
// )
// : Text(
// notificationslist![index]
// .STATUS
// .toString(),
// style: Constants.headerlistitems1,
// overflow: TextOverflow.ellipsis,
// textAlign: TextAlign.center,
// ),
// ),
// const VerticalDivider(
// width: 1.0,
// color: Colors.white,
// ),
// SizedBox(
// width: MediaQuery.of(context).size.width / 3.6,
// child: Align(
// alignment: Alignment.center,
// child: IconButton(
// icon: const Icon(Icons.play_arrow,
// size: 32.0), // Play arrow icon
// onPressed: () {
// // Add your play button action here
// // For example, start playing a video or audio
// // Navigator.push(
// // context,
// // MaterialPageRoute(
// // builder: (context) => SurvellianceView(
// // message: notificationslist![index]
// // .VIDEOURL,
// // id: notificationslist![index]
// // .VIDNOTID
// // .toString(),
// // ),
// // ),
// // );
// Navigator.of(context)
// .push(
// MaterialPageRoute(
// builder: (_) => SurvellianceView(
// message: notificationslist![
// index]
// .VIDEOURL,
// id: notificationslist![
// index]
// .VIDNOTID
// .toString(),
// )),
// )
// .then((val) => val
// ? getData(selectedDropdownItem!)
// : null);
// Navigator.of(context)
// .push(
// MaterialPageRoute(
// builder: (_) => SurvellianceView(
// message: notificationslist![
// index]
// .VIDEOURL,
// id: notificationslist![
// index]
// .VIDNOTID
// .toString(),
// )),
// )
// .then((val) => val
// ? getData(selectedDropdownItem!)
// : null);
// //.then((value) => setState(() {}));
// },
// ),
// ),
// ),
// ],
// ),
),
);
},
// //.then((value) => setState(() {}));
// },
// ),
// ),
// ),
// ],
// ),
),
);
},
),
),
),
],
],
),
),
),
);
......
import 'package:chewie/chewie.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:storemonitor/Screens/Constants.dart';
import 'package:video_player/video_player.dart';
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
final String message;
const MyHomePage({super.key, required this.message});
@override
_VideoPlayerScreenState createState() => _VideoPlayerScreenState();
}
class _VideoPlayerScreenState extends State<MyHomePage> {
late VideoPlayerController _videoPlayerController;
late ChewieController _chewieController;
var isMeeters = '';
InAppWebViewController? webViewController;
String? userId = '';
//double _scale = 1.0;
String? url = 'http://192.168.65.111:8100/restream';
String? urlData =
'https://www.flutterdecode.com/play-video-from-url-in-flutter';
//String? url = 'http://192.168.65.111:8100/restream';
String urlData = '';
@override
void initState() {
super.initState();
isMeeters = widget.message;
//getLoadData();
}
Future<void> getLoadData() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
userId = prefs.getString('empId');
urlData = 'https://vaman.plutokm.com/sa_mob_report/$userId';
//await Future.delayed(Duration(seconds: 1));
if (kDebugMode) {
print(urlData);
}
}
@override
void dispose() {
super.dispose();
_videoPlayerController.dispose();
_chewieController.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
// leading: IconButton(
// icon: const Icon(Icons.arrow_back),
// onPressed: () async {
// Navigator.pop(context, true);
// },
// ),
title: const Text(
'Video Playing',
'Weekly Report',
style: Constants.fontStyle,
),
flexibleSpace: Container(
......@@ -52,11 +57,12 @@ class _VideoPlayerScreenState extends State<MyHomePage> {
),
),
),
body: SizedBox(
height: MediaQuery.of(context).size.height,
child: InAppWebView(
initialUrlRequest: URLRequest(
url: Uri.parse("http://192.168.65.111:8100"),
url: Uri.parse(isMeeters),
),
onWebViewCreated: (controller) {
webViewController = controller;
......@@ -77,29 +83,23 @@ class _VideoPlayerScreenState extends State<MyHomePage> {
}
// class VideoStream extends StatefulWidget {
// const VideoStream({Key? key}) : super(key: key);
// @override
// State<VideoStream> createState() => _VideoStreamState();
// }
// class _VideoStreamState extends State<VideoStream> {
// }// class _VideoStreamState extends State<VideoStream> {
// final WebSocket _socket = WebSocket('http://192.168.65.111:8100/restream');
// bool _isConnected = false;
// void connect(BuildContext context) async {
// _socket.connect();
// setState(() {
// _isConnected = true;
// });
// }
// void disconnect() {
// _socket.disconnect();
// setState(() {
// _isConnected = false;
// });
// }
// @override
// Widget build(BuildContext context) {
// return Scaffold(
......@@ -136,7 +136,6 @@ class _VideoPlayerScreenState extends State<MyHomePage> {
// if (!snapshot.hasData) {
// return const CircularProgressIndicator();
// }
// if (snapshot.connectionState == ConnectionState.done) {
// return const Center(
// child: Text("Connection Closed !"),
......
......@@ -170,6 +170,14 @@ class _Review extends State<Review> {
Navigator.of(context).pop();
Constants('Review', data.statusCode.toString())
.showAlertDialog(context, false);
setState(() {
filteredAlerts?.clear();
if (filteredAlerts!.isNotEmpty) {
_controller.text = '${1}/${filteredAlerts?.length ?? 0}';
} else {
_controller.text = '${0}/${filteredAlerts?.length ?? 0}';
}
});
}
} else {}
}
......
......@@ -25,7 +25,7 @@ class SurvellianceView extends StatefulWidget {
required this.location,
required this.time})
: super(key: key);
@override
_SurvellianceViewState createState() => _SurvellianceViewState();
}
......@@ -39,7 +39,6 @@ class _SurvellianceViewState extends State<SurvellianceView> {
var location = '';
var des = '';
var time = '';
//late VlcPlayerController? controller;
final TextEditingController _textFieldController3 = TextEditingController();
final _focusNode = FocusNode();
......@@ -53,17 +52,13 @@ class _SurvellianceViewState extends State<SurvellianceView> {
}
void initilize(String url) {
_videoPlayerController = VideoPlayerController.networkUrl(
Uri.parse(url),
);
_videoPlayerController = VideoPlayerController.networkUrl(Uri.parse(url));
_chewieController = ChewieController(
videoPlayerController: _videoPlayerController,
aspectRatio: 16 / 9, // Set your desired aspect ratio
autoPlay: true,
looping: false, // Set to true if you want the video to loop
// Other customization options can be set here
showControls: true, // Show video controls
// Other customization options can be set here
materialProgressColors: ChewieProgressColors(
playedColor:
const Color.fromARGB(255, 205, 96, 196), // Change played color
......@@ -105,7 +100,7 @@ class _SurvellianceViewState extends State<SurvellianceView> {
final respon = await RemoteData().getUpdateIssueVideos1(Id, comment);
Map<String, dynamic> responseMap = jsonDecode(respon);
Navigator.of(context).pop();
hideKeyboard(context);
if (responseMap['status'] == 'Updated') {
Constants.dialogMessage(context, 'Video Playing', responseMap['status']);
//Navigator.of(context).pop();
......@@ -120,7 +115,6 @@ class _SurvellianceViewState extends State<SurvellianceView> {
void hideKeyboard(BuildContext context) {
// Use FocusScope to find the current FocusNode
final currentFocus = FocusScope.of(context);
// Unfocus the current FocusNode to hide the keyboard
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
......@@ -169,35 +163,6 @@ class _SurvellianceViewState extends State<SurvellianceView> {
width: 1,
height: 15,
),
// SizedBox(
// width: 90,
// height: 40,
// child: ElevatedButton(
// onPressed: () {
// setState(() {
// _isPlaying = !_isPlaying;
// if (_isPlaying) {
// controller!.play();
// } else {
// controller!.pause();
// }
// });
// },
// style: ButtonStyle(
// backgroundColor: MaterialStateProperty.all<Color>(
// const Color.fromARGB(255, 35, 22, 66)),
// ),
// child: Text(_isPlaying ? 'Pause' : 'Play'),
// ),
// ),
// Center(
// child: isLoading
// ? const CircularProgressIndicator(
// color: Color.fromARGB(255, 173, 57, 230),
// )
// : const Text(''),
// ),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
......@@ -208,12 +173,9 @@ class _SurvellianceViewState extends State<SurvellianceView> {
width: 10,
height: 1,
),
Text(id,
style: Constants.listHeaderoppfontStyle,
overflow: TextOverflow.ellipsis),
//isvisible =false;
],
),
const SizedBox(height: 10.0),
......@@ -227,12 +189,9 @@ class _SurvellianceViewState extends State<SurvellianceView> {
width: 10,
height: 1,
),
Text(store,
style: Constants.listHeaderoppfontStyle,
overflow: TextOverflow.ellipsis),
//isvisible =false;
],
),
const SizedBox(height: 10.0),
......@@ -254,10 +213,6 @@ class _SurvellianceViewState extends State<SurvellianceView> {
style: Constants.listHeaderoppfontStyle,
),
),
// Text(location,
// textAlign: TextAlign.right,
// style: Constants.listHeaderoppfontStyle,
// overflow: TextOverflow.ellipsis),
],
),
const SizedBox(height: 10.0),
......@@ -358,7 +313,6 @@ class _SurvellianceViewState extends State<SurvellianceView> {
color:
Color.fromARGB(255, 173, 57, 230)));
});
//getUpdate(id, _textFieldController3.text);
getUpdate1(id, _textFieldController3.text);
} else {
......
......@@ -88,9 +88,9 @@ class _CheckBoxListState extends State<WeeklyAudit> {
),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 20),
padding: EdgeInsets.symmetric(horizontal: 10),
child: Text(
' Audited?',
'Audited?',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
......@@ -102,7 +102,7 @@ class _CheckBoxListState extends State<WeeklyAudit> {
),
),
body: ListView(
padding: const EdgeInsets.fromLTRB(4, 2, 20, 4),
padding: const EdgeInsets.fromLTRB(4, 2, 10, 4),
children: List<Widget>.generate(_items.length, (index) {
final SimpleModel item = _items[index];
final Color backgroundColor = index % 2 == 0
......
......@@ -5,14 +5,14 @@ import 'package:storemonitor/FirebaseApi.dart';
import 'Screens/SplashScreen.dart';
Future<void> main() async {
if (Platform.isAndroid) {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
await FirebaseApi().initNotifications();
}
runApp(const MaterialApp(
if (Platform.isAndroid) {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
await FirebaseApi().initNotifications();
}
runApp(const MaterialApp(
debugShowCheckedModeBanner: false,
home: SplashScreen(),
)
);
home: SplashScreen(),)
);
}
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