Commit 5d111162 by Ramesh Babu Puvvadi

add

parent 64f962fe
...@@ -48,7 +48,7 @@ android { ...@@ -48,7 +48,7 @@ android {
applicationId "com.sopt.storemonitor" applicationId "com.sopt.storemonitor"
// You can update the following values to match your application needs. // You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion 20 minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
......
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sopt.storemonitor"> package="com.sopt.storemonitor">
<!-- The INTERNET permission is required for development. Specifically, <!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc. to allow setting breakpoints, to provide hot reload, etc. -->
-->
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<!-- <uses-permission android:name="android.permission.CALL_PHONE" /> --> <!-- <uses-permission android:name="android.permission.CALL_PHONE" /> -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
......
...@@ -44,6 +44,8 @@ PODS: ...@@ -44,6 +44,8 @@ PODS:
- OrderedSet (~> 5.0) - OrderedSet (~> 5.0)
- flutter_sms (1.1.0): - flutter_sms (1.1.0):
- Flutter - Flutter
- flutter_tts (0.0.1):
- Flutter
- GoogleDataTransport (9.2.5): - GoogleDataTransport (9.2.5):
- GoogleUtilities/Environment (~> 7.7) - GoogleUtilities/Environment (~> 7.7)
- nanopb (< 2.30910.0, >= 2.30908.0) - nanopb (< 2.30910.0, >= 2.30908.0)
...@@ -85,6 +87,10 @@ PODS: ...@@ -85,6 +87,10 @@ PODS:
- shared_preferences_foundation (0.0.1): - shared_preferences_foundation (0.0.1):
- Flutter - Flutter
- FlutterMacOS - FlutterMacOS
- speech_to_text (0.0.1):
- Flutter
- Try
- Try (2.1.1)
- url_launcher_ios (0.0.1): - url_launcher_ios (0.0.1):
- Flutter - Flutter
- video_player_avfoundation (0.0.1): - video_player_avfoundation (0.0.1):
...@@ -101,11 +107,13 @@ DEPENDENCIES: ...@@ -101,11 +107,13 @@ DEPENDENCIES:
- Flutter (from `Flutter`) - Flutter (from `Flutter`)
- flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`) - flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`)
- flutter_sms (from `.symlinks/plugins/flutter_sms/ios`) - flutter_sms (from `.symlinks/plugins/flutter_sms/ios`)
- flutter_tts (from `.symlinks/plugins/flutter_tts/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`) - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- share_plus (from `.symlinks/plugins/share_plus/ios`) - share_plus (from `.symlinks/plugins/share_plus/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- speech_to_text (from `.symlinks/plugins/speech_to_text/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/ios`) - video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/ios`)
- wakelock (from `.symlinks/plugins/wakelock/ios`) - wakelock (from `.symlinks/plugins/wakelock/ios`)
...@@ -124,6 +132,7 @@ SPEC REPOS: ...@@ -124,6 +132,7 @@ SPEC REPOS:
- OrderedSet - OrderedSet
- PromisesObjC - PromisesObjC
- Reachability - Reachability
- Try
EXTERNAL SOURCES: EXTERNAL SOURCES:
connectivity: connectivity:
...@@ -138,6 +147,8 @@ EXTERNAL SOURCES: ...@@ -138,6 +147,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_inappwebview/ios" :path: ".symlinks/plugins/flutter_inappwebview/ios"
flutter_sms: flutter_sms:
:path: ".symlinks/plugins/flutter_sms/ios" :path: ".symlinks/plugins/flutter_sms/ios"
flutter_tts:
:path: ".symlinks/plugins/flutter_tts/ios"
image_picker_ios: image_picker_ios:
:path: ".symlinks/plugins/image_picker_ios/ios" :path: ".symlinks/plugins/image_picker_ios/ios"
path_provider_foundation: path_provider_foundation:
...@@ -148,6 +159,8 @@ EXTERNAL SOURCES: ...@@ -148,6 +159,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/share_plus/ios" :path: ".symlinks/plugins/share_plus/ios"
shared_preferences_foundation: shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin" :path: ".symlinks/plugins/shared_preferences_foundation/darwin"
speech_to_text:
:path: ".symlinks/plugins/speech_to_text/ios"
url_launcher_ios: url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios" :path: ".symlinks/plugins/url_launcher_ios/ios"
video_player_avfoundation: video_player_avfoundation:
...@@ -169,6 +182,7 @@ SPEC CHECKSUMS: ...@@ -169,6 +182,7 @@ SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_inappwebview: 3d32228f1304635e7c028b0d4252937730bbc6cf flutter_inappwebview: 3d32228f1304635e7c028b0d4252937730bbc6cf
flutter_sms: 91ce41530f55c85d6524d82307a5d555844c086a flutter_sms: 91ce41530f55c85d6524d82307a5d555844c086a
flutter_tts: 0f492aab6accf87059b72354fcb4ba934304771d
GoogleDataTransport: 54dee9d48d14580407f8f5fbf2f496e92437a2f2 GoogleDataTransport: 54dee9d48d14580407f8f5fbf2f496e92437a2f2
GoogleUtilities: 13e2c67ede716b8741c7989e26893d151b2b2084 GoogleUtilities: 13e2c67ede716b8741c7989e26893d151b2b2084
image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5 image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
...@@ -180,6 +194,8 @@ SPEC CHECKSUMS: ...@@ -180,6 +194,8 @@ SPEC CHECKSUMS:
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68 share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126 shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
speech_to_text: b43a7d99aef037bd758ed8e45d79bbac035d2dfe
Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4 url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
video_player_avfoundation: 81e49bb3d9fb63dccf9fa0f6d877dc3ddbeac126 video_player_avfoundation: 81e49bb3d9fb63dccf9fa0f6d877dc3ddbeac126
wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f
......
...@@ -355,6 +355,7 @@ ...@@ -355,6 +355,7 @@
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
...@@ -368,6 +369,7 @@ ...@@ -368,6 +369,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 5;
PRODUCT_BUNDLE_IDENTIFIER = com.sopt.storemonito; PRODUCT_BUNDLE_IDENTIFIER = com.sopt.storemonito;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
...@@ -489,6 +491,7 @@ ...@@ -489,6 +491,7 @@
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
...@@ -502,6 +505,7 @@ ...@@ -502,6 +505,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 5;
PRODUCT_BUNDLE_IDENTIFIER = com.sopt.storemonito; PRODUCT_BUNDLE_IDENTIFIER = com.sopt.storemonito;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
...@@ -517,6 +521,7 @@ ...@@ -517,6 +521,7 @@
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
...@@ -530,6 +535,7 @@ ...@@ -530,6 +535,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 5;
PRODUCT_BUNDLE_IDENTIFIER = com.sopt.storemonito; PRODUCT_BUNDLE_IDENTIFIER = com.sopt.storemonito;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
......
...@@ -39,6 +39,9 @@ ...@@ -39,6 +39,9 @@
<string>Microphone access is required to dial a call</string> <string>Microphone access is required to dial a call</string>
<key>NSPhotoLibraryUsageDescription</key> <key>NSPhotoLibraryUsageDescription</key>
<string>This app requires access to the photo library</string> <string>This app requires access to the photo library</string>
<key>NSSpeechRecognitionUsageDescription</key>
<string>Speech recognition allows you to use text-to-speech and speech</string>
<key>REVERSED_CLIENT_ID</key> <key>REVERSED_CLIENT_ID</key>
<string>d6689d068c6b4290aba903</string> <string>d6689d068c6b4290aba903</string>
<key>UIApplicationSupportsIndirectInputEvents</key> <key>UIApplicationSupportsIndirectInputEvents</key>
......
...@@ -32,6 +32,16 @@ class _CheckRegistration extends State<CheckRegistration> { ...@@ -32,6 +32,16 @@ class _CheckRegistration extends State<CheckRegistration> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
leading: IconButton(
icon: Image.asset(
"assets/images/back_arrow.png",
width: 24,
height: 24,
color: Colors.white,
),
//color: Colors.white,
onPressed: () => Navigator.pop(context),
),
title: const Text( title: const Text(
'CHECK REGISTRATION', 'CHECK REGISTRATION',
style: Constants.fontStyle, style: Constants.fontStyle,
...@@ -135,8 +145,7 @@ class _CheckRegistration extends State<CheckRegistration> { ...@@ -135,8 +145,7 @@ class _CheckRegistration extends State<CheckRegistration> {
}); });
if (Platform.isAndroid) { if (Platform.isAndroid) {
image = await _picker.pickVideo( image = await _picker.pickVideo(
source: ImageSource.camera, source: ImageSource.camera, preferredCameraDevice: CameraDevice.rear);
preferredCameraDevice: CameraDevice.rear);
} else { } else {
image = await _picker.pickVideo( image = await _picker.pickVideo(
source: ImageSource.camera, source: ImageSource.camera,
......
...@@ -23,7 +23,7 @@ class Constants { ...@@ -23,7 +23,7 @@ class Constants {
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
); color: Colors.white);
static const TextStyle headerfontStyle = TextStyle( static const TextStyle headerfontStyle = TextStyle(
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 16, fontSize: 16,
...@@ -132,12 +132,7 @@ class Constants { ...@@ -132,12 +132,7 @@ class Constants {
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
color: Color.fromARGB( color: Color.fromARGB(255, 12, 18, 22),
255,
12,
18,
22
),
); );
static const TextStyle LoginuseridStyle = TextStyle( static const TextStyle LoginuseridStyle = TextStyle(
fontFamily: 'Poppins', fontFamily: 'Poppins',
......
...@@ -63,6 +63,16 @@ class _EmployeeReport extends State<EmployeeReport> { ...@@ -63,6 +63,16 @@ class _EmployeeReport extends State<EmployeeReport> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
leading: IconButton(
icon: Image.asset(
"assets/images/back_arrow.png",
width: 24,
height: 24,
color: Colors.white,
),
//color: Colors.white,
onPressed: () => Navigator.pop(context),
),
title: const Text( title: const Text(
'EMPLOYEE REPORT', 'EMPLOYEE REPORT',
style: Constants.fontStyle, style: Constants.fontStyle,
......
...@@ -89,6 +89,16 @@ class employeeStatus extends State<EmployeeStatus> { ...@@ -89,6 +89,16 @@ class employeeStatus extends State<EmployeeStatus> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
leading: IconButton(
icon: Image.asset(
"assets/images/back_arrow.png",
width: 24,
height: 24,
color: Colors.white,
),
//color: Colors.white,
onPressed: () => Navigator.pop(context),
),
title: const Text( title: const Text(
"EmployeesStatus", "EmployeesStatus",
style: Constants.fontStyle, style: Constants.fontStyle,
......
...@@ -11,6 +11,7 @@ import 'Constants.dart'; ...@@ -11,6 +11,7 @@ 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( const FootFall(
{super.key, required this.message, required this.selecteddate}); {super.key, required this.message, required this.selecteddate});
...@@ -110,6 +111,16 @@ class _FootFall extends State<FootFall> { ...@@ -110,6 +111,16 @@ class _FootFall extends State<FootFall> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
leading: IconButton(
icon: Image.asset(
"assets/images/back_arrow.png",
width: 24,
height: 24,
color: Colors.white,
),
//color: Colors.white,
onPressed: () => Navigator.pop(context),
),
title: const Text( title: const Text(
"FOOT FALL", "FOOT FALL",
style: Constants.fontStyle, style: Constants.fontStyle,
...@@ -395,7 +406,7 @@ class _FootFall extends State<FootFall> { ...@@ -395,7 +406,7 @@ class _FootFall extends State<FootFall> {
), ),
Expanded( Expanded(
child: Text( child: Text(
'MTeens', 'MTens',
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: Constants.listitems, style: Constants.listitems,
), ),
......
...@@ -20,7 +20,7 @@ import 'UserRegistration.dart'; ...@@ -20,7 +20,7 @@ import 'UserRegistration.dart';
class Home extends StatefulWidget { class Home extends StatefulWidget {
final String message; final String message;
const Home({super.key, required this.message}); const Home({super.key, required this.message});
//const Home({super.key});
@override @override
_Home createState() => _Home(); _Home createState() => _Home();
} }
...@@ -34,6 +34,7 @@ class _Home extends State<Home> { ...@@ -34,6 +34,7 @@ class _Home extends State<Home> {
final TextEditingController _dateTime = TextEditingController(); final TextEditingController _dateTime = TextEditingController();
bool isAuthenticated = false; bool isAuthenticated = false;
bool iswarehouserelated = false; bool iswarehouserelated = false;
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
@override @override
void initState() { void initState() {
...@@ -48,7 +49,9 @@ class _Home extends State<Home> { ...@@ -48,7 +49,9 @@ class _Home extends State<Home> {
SharedPreferences prefs = await SharedPreferences.getInstance(); SharedPreferences prefs = await SharedPreferences.getInstance();
String? userId = prefs.getString("stores_list"); String? userId = prefs.getString("stores_list");
empId = prefs.getString('empId'); empId = prefs.getString('empId');
if (kDebugMode) {
print(empId); print(empId);
}
namesList = (json.decode(userId!) as List<dynamic>) namesList = (json.decode(userId!) as List<dynamic>)
.map((map) => map['name'] as String) .map((map) => map['name'] as String)
.toList(); .toList();
...@@ -64,7 +67,6 @@ class _Home extends State<Home> { ...@@ -64,7 +67,6 @@ class _Home extends State<Home> {
isAuthenticated = false; isAuthenticated = false;
}); });
} }
if (selectedDropdownItem == 'WH KISMATPUR' || if (selectedDropdownItem == 'WH KISMATPUR' ||
selectedDropdownItem == 'WH BANGALORE' || selectedDropdownItem == 'WH BANGALORE' ||
selectedDropdownItem == 'WH VIJAYAWADA' || selectedDropdownItem == 'WH VIJAYAWADA' ||
...@@ -73,16 +75,6 @@ class _Home extends State<Home> { ...@@ -73,16 +75,6 @@ class _Home extends State<Home> {
} else { } else {
iswarehouserelated = false; iswarehouserelated = false;
} }
// if(prefs.getBool('warehouse') == true) {
// setState(() {
// iswarehouserelated = true;
// });
// } else {
// setState(() {
// iswarehouserelated = false;
// });
// }
} }
Future<void> _selectDate(BuildContext context) async { Future<void> _selectDate(BuildContext context) async {
...@@ -116,15 +108,23 @@ class _Home extends State<Home> { ...@@ -116,15 +108,23 @@ class _Home extends State<Home> {
}); });
} }
//9866438056
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
key: _scaffoldKey,
drawer: NavBar( drawer: NavBar(
message: selectedDropdownItem.toString(), message: selectedDropdownItem.toString(),
), ),
appBar: AppBar( appBar: AppBar(
leading: IconButton(
icon: Image.asset(
"assets/images/menu.png",
width: 24,
height: 24,
color: Colors.white,
),
onPressed: () => _scaffoldKey.currentState?.openDrawer(),
),
title: const Text( title: const Text(
'STORE MONITOR', 'STORE MONITOR',
style: Constants.fontStyle, style: Constants.fontStyle,
...@@ -147,15 +147,6 @@ class _Home extends State<Home> { ...@@ -147,15 +147,6 @@ class _Home extends State<Home> {
print('force press down'); print('force press down');
//Navigator.pop(context); //Navigator.pop(context);
}, },
// onHorizontalDragUpdate: (dragDetail) {
// print('Testing');
// if (dragDetail.delta.direction > 0) {
// Navigator.pop(context);
// print('Hitted =====>');
// }
// },
child: Container( child: Container(
margin: const EdgeInsets.all(12.0), margin: const EdgeInsets.all(12.0),
child: Column( child: Column(
...@@ -441,18 +432,6 @@ class _Home extends State<Home> { ...@@ -441,18 +432,6 @@ class _Home extends State<Home> {
// 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,
// ),
// ),
], ],
), ),
), ),
...@@ -504,18 +483,6 @@ class _Home extends State<Home> { ...@@ -504,18 +483,6 @@ class _Home extends State<Home> {
// 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(
// 'Foot Fall',
// overflow: TextOverflow.ellipsis,
// style: Constants.buttonsfontStyle,
// textAlign: TextAlign.center,
// ),
// ),
], ],
), ),
), ),
...@@ -704,18 +671,6 @@ class _Home extends State<Home> { ...@@ -704,18 +671,6 @@ class _Home extends State<Home> {
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(
// gradient: const LinearGradient(
// begin: Alignment.bottomLeft,
// end: Alignment.bottomRight,
// colors: [
// // Color(0xFF6a706f),
// // //Color(0xFFC2185B),
// // Color(0xFF91b3b1),
// ],
// ),
// borderRadius: BorderRadius.circular(7),
// ),
), ),
), ),
), ),
......
import 'dart:convert'; import 'dart:convert';
import 'dart:io';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:share_plus/share_plus.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/SurvellianceView.dart'; import 'package:storemonitor/Screens/SurvellianceView.dart';
...@@ -108,13 +110,23 @@ class _IssueVideos extends State<IssueVideos> { ...@@ -108,13 +110,23 @@ class _IssueVideos extends State<IssueVideos> {
} else {} } else {}
// } catch (e) { // } catch (e) {
// Constants('Review', e.).showAlertDialog(context); // Constants('Review', e.).showAlertDialog(context);
// } // }shareImageWithText(String Text, 'Reason: ${filteredAlerts![itemIndex].alertReason}\nCamera:${filteredAlerts![itemIndex].cameraName}\nTime:${filteredAlerts![itemIndex].alertTime}\nID:${filteredAlerts![itemIndex].notificationID}');
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
leading: IconButton(
icon: Image.asset(
"assets/images/back_arrow.png",
width: 24,
height: 24,
color: Colors.white,
),
//color: Colors.white,
onPressed: () => Navigator.pop(context),
),
title: const Text( title: const Text(
'Issue Videos List', 'Issue Videos List',
style: Constants.fontStyle, style: Constants.fontStyle,
...@@ -124,6 +136,22 @@ class _IssueVideos extends State<IssueVideos> { ...@@ -124,6 +136,22 @@ class _IssueVideos extends State<IssueVideos> {
gradient: Constants.getReturn(), gradient: Constants.getReturn(),
), ),
), ),
// actions: [
// IconButton(
// icon: const Icon(
// Icons.logout,
// color: Colors.white,
// ),
// onPressed: () async {
// bool valid = await Constants.checkInternetConnectivity();
// if (valid) {
// //signOut();
// } else {
// Constants('Upload Images', 'Check your internet connection');
// }
// },
// ),
// ],
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
......
...@@ -47,6 +47,16 @@ class _VideoPlayerScreenState extends State<MyHomePage> { ...@@ -47,6 +47,16 @@ class _VideoPlayerScreenState extends State<MyHomePage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
leading: IconButton(
icon: Image.asset(
"assets/images/back_arrow.png",
width: 24,
height: 24,
color: Colors.white,
),
//color: Colors.white,
onPressed: () => Navigator.pop(context),
),
title: const Text( title: const Text(
'Weekly Report', 'Weekly Report',
style: Constants.fontStyle, style: Constants.fontStyle,
...@@ -57,7 +67,6 @@ class _VideoPlayerScreenState extends State<MyHomePage> { ...@@ -57,7 +67,6 @@ class _VideoPlayerScreenState extends State<MyHomePage> {
), ),
), ),
), ),
body: SizedBox( body: SizedBox(
height: MediaQuery.of(context).size.height, height: MediaQuery.of(context).size.height,
child: InAppWebView( child: InAppWebView(
......
...@@ -115,7 +115,8 @@ class _NotificationReport extends State<NotificationReport> { ...@@ -115,7 +115,8 @@ 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()).showAlertDialog(context, false); Constants('NotificationReport', data.statusCode.toString())
.showAlertDialog(context, false);
return; return;
} }
Navigator.of(context).pop(); Navigator.of(context).pop();
...@@ -169,6 +170,16 @@ class _NotificationReport extends State<NotificationReport> { ...@@ -169,6 +170,16 @@ class _NotificationReport extends State<NotificationReport> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
leading: IconButton(
icon: Image.asset(
"assets/images/back_arrow.png",
width: 24,
height: 24,
color: Colors.white,
),
//color: Colors.white,
onPressed: () => Navigator.pop(context),
),
title: const Text( title: const Text(
'NOTIFICATION REPORT', 'NOTIFICATION REPORT',
style: Constants.fontStyle, style: Constants.fontStyle,
......
...@@ -50,7 +50,7 @@ class _Review extends State<Review> { ...@@ -50,7 +50,7 @@ class _Review extends State<Review> {
late String imp; late String imp;
Key carouselKey = UniqueKey(); Key carouselKey = UniqueKey();
bool pressed = false; bool pressed = false;
bool pressed1= false; bool pressed1 = false;
Color black = Colors.black; Color black = Colors.black;
Color black1 = Colors.black; Color black1 = Colors.black;
Color black2 = Colors.black; Color black2 = Colors.black;
...@@ -411,6 +411,16 @@ class _Review extends State<Review> { ...@@ -411,6 +411,16 @@ class _Review extends State<Review> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
leading: IconButton(
icon: Image.asset(
"assets/images/back_arrow.png",
width: 24,
height: 24,
color: Colors.white,
),
//color: Colors.white,
onPressed: () => Navigator.pop(context),
),
title: const Text( title: const Text(
'REVIEW', 'REVIEW',
style: Constants.fontStyle, style: Constants.fontStyle,
...@@ -670,6 +680,8 @@ class _Review extends State<Review> { ...@@ -670,6 +680,8 @@ class _Review extends State<Review> {
), ),
child: TextFormField( child: TextFormField(
controller: _controller, controller: _controller,
readOnly: true,
enabled: false,
decoration: const InputDecoration(border: InputBorder.none), decoration: const InputDecoration(border: InputBorder.none),
style: const TextStyle(fontSize: 20, color: Colors.white), style: const TextStyle(fontSize: 20, color: Colors.white),
textAlign: TextAlign.center, textAlign: TextAlign.center,
...@@ -1078,7 +1090,7 @@ class _Review extends State<Review> { ...@@ -1078,7 +1090,7 @@ class _Review extends State<Review> {
context) context)
.size .size
.width / .width /
3, 3.2,
child: child:
const Center( const Center(
child: child:
...@@ -1090,7 +1102,7 @@ class _Review extends State<Review> { ...@@ -1090,7 +1102,7 @@ class _Review extends State<Review> {
), ),
), ),
const SizedBox( const SizedBox(
width: 5, width: 3,
height: 0, height: 0,
), ),
Container( Container(
...@@ -1138,7 +1150,7 @@ class _Review extends State<Review> { ...@@ -1138,7 +1150,7 @@ class _Review extends State<Review> {
context) context)
.size .size
.width / .width /
3, 3.2,
child: child:
const Center( const Center(
child: child:
...@@ -1297,6 +1309,7 @@ class _Review extends State<Review> { ...@@ -1297,6 +1309,7 @@ class _Review extends State<Review> {
final File imageFile = File('${temp.path}/ShareImage.jpg'); final File imageFile = File('${temp.path}/ShareImage.jpg');
imageFile.writeAsBytesSync(response.bodyBytes); imageFile.writeAsBytesSync(response.bodyBytes);
if (Platform.isAndroid) { if (Platform.isAndroid) {
await Share.shareXFiles([XFile('${temp.path}/ShareImage.jpg')], await Share.shareXFiles([XFile('${temp.path}/ShareImage.jpg')],
text: textToShare, text: textToShare,
//subject: 'Reason', //subject: 'Reason',
...@@ -1349,7 +1362,7 @@ class _Review extends State<Review> { ...@@ -1349,7 +1362,7 @@ class _Review extends State<Review> {
Navigator.of(context).pop(); // Close the dialog Navigator.of(context).pop(); // Close the dialog
}, },
child: const Padding( child: const Padding(
padding: EdgeInsets.only(right: 130), padding: EdgeInsets.only(left: 10),
child: Text('Submit'), child: Text('Submit'),
), ),
//child: const Text('Submit'), //child: const Text('Submit'),
......
import 'dart:convert'; import 'dart:convert';
import 'dart:io';
import 'package:chewie/chewie.dart'; import 'package:chewie/chewie.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:share_plus/share_plus.dart';
import 'package:storemonitor/Screens/Constants.dart'; import 'package:storemonitor/Screens/Constants.dart';
import 'package:storemonitor/Services/RemoteData.dart'; import 'package:storemonitor/Services/RemoteData.dart';
import 'package:video_player/video_player.dart'; import 'package:video_player/video_player.dart';
...@@ -133,10 +135,51 @@ class _SurvellianceViewState extends State<SurvellianceView> { ...@@ -133,10 +135,51 @@ class _SurvellianceViewState extends State<SurvellianceView> {
} }
} }
Future<void> shareImageWithText(String textToShare, String desc) async {
List<String> paths = [
textToShare
]; // If you're sharing text, you might not need this list
final box = context.findRenderObject() as RenderBox?;
if (Platform.isAndroid) {
print('Android Share +++++++++++++++++++$desc');
// await Share.shareFiles(
// paths,
// text: '$textToShare\n\n$desc', // Combine text and description
// subject: 'Your Subject Here',
// sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
// );
await Share.share(
'$textToShare \n\n$desc',
subject: desc,
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
);
} else if (Platform.isIOS) {
print('iOS Share +++++++++++++++++++$textToShare');
await Share.share(
'$textToShare \n\n$desc',
// subject: 'Reason',
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
);
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
leading: IconButton(
icon: Image.asset(
"assets/images/back_arrow.png",
width: 24,
height: 24,
color: Colors.white,
),
//color: Colors.white,
onPressed: () => Navigator.pop(context),
),
title: const Text( title: const Text(
'Video Playing', 'Video Playing',
style: Constants.fontStyle, style: Constants.fontStyle,
...@@ -146,6 +189,25 @@ class _SurvellianceViewState extends State<SurvellianceView> { ...@@ -146,6 +189,25 @@ class _SurvellianceViewState extends State<SurvellianceView> {
gradient: Constants.getReturn(), gradient: Constants.getReturn(),
), ),
), ),
actions: [
IconButton(
icon: const Icon(
Icons.share,
color: Colors.white,
),
onPressed: () async {
bool valid = await Constants.checkInternetConnectivity();
if (valid) {
shareImageWithText(
videoUrl,
' Vidnotid: ${id}\nStore:${store}\nLocation:${location}\nDescription:${des}',
);
} else {
Constants('Upload Images', 'Check your internet connection');
}
},
),
],
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
......
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'dart:math';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_tts/flutter_tts.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_recognition_result.dart';
import 'package:speech_to_text/speech_to_text.dart';
import '../Services/RemoteData.dart';
class SpeechSampleApp extends StatefulWidget {
const SpeechSampleApp({Key? key}) : super(key: key);
@override
State<SpeechSampleApp> createState() => _SpeechSampleAppState();
}
/// An example that demonstrates the basic functionality of the
/// SpeechToText plugin for using the speech recognition capability
/// of the underlying platform.
class _SpeechSampleAppState extends State<SpeechSampleApp> {
bool _hasSpeech = false;
final bool _logEvents = false;
final bool _onDevice = false;
final FlutterTts ftts = FlutterTts();
final TextEditingController _pauseForController =
TextEditingController(text: '5');
final TextEditingController _listenForController =
TextEditingController(text: '30');
double level = 0.0;
double minSoundLevel = 50000;
double maxSoundLevel = -50000;
String lastWords = '';
String lastError = '';
String lastStatus = '';
String _currentLocaleId = '';
SpeechToText speech = SpeechToText();
List<Data>? data = [];
@override
void initState() {
initSpeechState();
if (Platform.isAndroid) {
checkAndRequestMicrophonePermission();
}
if (Platform.isIOS) {}
super.initState();
}
Future<void> checkAndRequestMicrophonePermission() async {
PermissionStatus status = await Permission.microphone.status;
if (status.isGranted) {
if (kDebugMode) {
print('Microphone permission is granted.');
}
} else {
status = await Permission.microphone.request();
if (status.isGranted) {
if (kDebugMode) {
print('Microphone permission is granted.');
}
} else {
if (kDebugMode) {
print('Microphone permission is denied.');
}
}
}
}
/// This initializes SpeechToText.That only has to be done
/// once per application,though calling it again is harmless
/// it also does nothing.The UX of the sample app ensures that
/// it can only be called once.
Future<void> initSpeechState() async {
_logEvent('Initialize');
try {
var hasSpeech = await speech.initialize(
onError: errorListener,
onStatus: statusListener,
debugLogging: _logEvents,
);
if (hasSpeech) {
var systemLocale = await speech.systemLocale();
_currentLocaleId = systemLocale?.localeId ?? '';
}
if (!mounted) return;
setState(() {
_hasSpeech = hasSpeech;
});
} catch (e) {
setState(() {
lastError = 'Speech recognition failed: ${e.toString()}';
_hasSpeech = false;
});
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Speech to Text Example'),
),
body: Column(children: [
//const HeaderWidget(),
Column(
children: <Widget>[
// InitSpeechWidget(_hasSpeech, initSpeechState),
SpeechControlWidget(
lastWords,
level,
_hasSpeech,
speech.isListening,
startListening,
stopListening,
cancelListening),
// SessionOptionsWidget(
// _currentLocaleId,
// _switchLang,
// _localeNames,
// _logEvents,
// _switchLogging,
// _pauseForController,
// _listenForController,
// _onDevice,
// _switchOnDevice,
// ),
],
),
// Expanded(
// flex: 4,
// child: RecognitionResultsWidget(lastWords: lastWords, level: level),
// ),
// Expanded(
// flex: 1,
// child: ErrorWidget(lastError: lastError),
// ),
//SpeechStatusWidget(speech: speech),
]),
);
}
// This is called each time the users wants to start a new speech
// recognition session
void startListening() {
_logEvent('start listening');
lastWords = '';
lastError = '';
final pauseFor = int.tryParse(_pauseForController.text);
final listenFor = int.tryParse(_listenForController.text);
final options = SpeechListenOptions(
onDevice: _onDevice,
listenMode: ListenMode.confirmation,
cancelOnError: true,
partialResults: true,
autoPunctuation: true,
enableHapticFeedback: true);
// Note that `listenFor` is the maximum, not the minimum, on some
// systems recognition will be stopped before this value is reached.
// Similarly `pauseFor` is a maximum not a minimum and may be ignored
// on some devices.
speech.listen(
onResult: resultListener,
listenFor: Duration(seconds: listenFor ?? 30),
pauseFor: Duration(seconds: pauseFor ?? 3),
localeId: _currentLocaleId,
onSoundLevelChange: soundLevelListener,
listenOptions: options,
);
setState(() {});
}
void stopListening() {
_logEvent('stop');
speech.stop();
setState(() {
level = 0.0;
});
}
void cancelListening() {
_logEvent('cancel');
speech.cancel();
setState(() {
level = 0.0;
});
}
// This callback is invoked each time new recognition results are
// available after `listen` is called.
void resultListener(SpeechRecognitionResult result) {
_logEvent(
'Result listener final: ${result.finalResult}, words: ${result.recognizedWords}');
setState(() async {
//lastWords = '${result.recognizedWords} - ${result.finalResult}';
lastWords = result.recognizedWords;
if (result.finalResult) {
if (kDebugMode) {
print('Final Result: $lastWords');
}
String res = await RemoteData().getSpeechResponse(lastWords);
//var response = jsonDecode(res);
Map<String, dynamic> jsonResponse = jsonDecode(res);
List<dynamic> output1 = jsonResponse['output1'];
if (output1.isNotEmpty) {
Map<String, dynamic> firstItem = output1[0];
String zoneValue = firstItem['ZONE'];
Data dataInstance = Data(question: lastWords, answer: zoneValue);
await ftts.setLanguage("en-US");
await ftts.setSpeechRate(0.5); //speed of speech
await ftts.setVolume(1.0); //volume of speech
await ftts.setPitch(2.0); //pitc of sound
//await ftts.setVoice('en-us-x-sfg#male_1-local');
//play text to sp
var result = await ftts.speak(zoneValue);
if (kDebugMode) {
print(result);
}
if (result == 1) {
if (kDebugMode) {
print("Flutter Campus speaking...");
}
} else {
if (kDebugMode) {
print("Flutter Campus not speaking...");
}
}
if (kDebugMode) {
print("ZONE value: $zoneValue");
}
data!.add(dataInstance);
} else {
if (kDebugMode) {
print("No items in 'output1'");
}
}
if (kDebugMode) {
print('Speech Text Resposne =====>$res');
}
// Create a list to hold instances of Data
//List<Data> dataList = [];
// Add the instance to the list
SpeechControlWidget.UpdateList(data!);
setState(() {
data = data;
});
}
});
}
void soundLevelListener(double level) {
minSoundLevel = min(minSoundLevel, level);
maxSoundLevel = max(maxSoundLevel, level);
// _logEvent('sound level $level: $minSoundLevel - $maxSoundLevel ');
setState(() {
this.level = level;
});
}
void errorListener(SpeechRecognitionError error) {
_logEvent(
'Received error status: $error, listening: ${speech.isListening}');
setState(() {
lastError = '${error.errorMsg} - ${error.permanent}';
});
}
void statusListener(String status) {
_logEvent(
'Received listener status: $status, listening: ${speech.isListening}');
setState(() {
lastStatus = status;
});
}
//void _switchLang(selectedVal){
// setState((){
// _currentLocaleId = selectedVal;
// });
// debugPrint(selectedVal);
//}
void _logEvent(String eventDescription) {
if (_logEvents) {
var eventTime = DateTime.now().toIso8601String();
debugPrint('$eventTime $eventDescription');
}
}
//void _switchLogging(bool? val){
// setState(() {
// _logEvents = val ?? false;
// });
//}
// void _switchOnDevice(bool? val) {
// setState(() {
// _onDevice = val ?? false;
// });
// }'
}
/// Displays the most recently recognized words and the sound level.
class RecognitionResultsWidget extends StatelessWidget {
const RecognitionResultsWidget({
Key? key,
required this.lastWords,
required this.level,
}) : super(key: key);
final String lastWords;
final double level;
@override
Widget build(BuildContext context) {
return Column(
children: <Widget>[
const Center(
child: Text(
'Recognized Words',
style: TextStyle(fontSize: 22.0),
),
),
Expanded(
child: Stack(
children: <Widget>[
Container(
color: Theme.of(context).secondaryHeaderColor,
child: Center(
child: Text(
lastWords,
textAlign: TextAlign.start,
),
),
),
Positioned.fill(
bottom: 10,
child: Align(
alignment: Alignment.bottomCenter,
child: Container(
width: 40,
height: 40,
alignment: Alignment.center,
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
blurRadius: .26,
spreadRadius: level * 1.5,
color: Colors.black.withOpacity(.05))
],
color: Colors.white,
borderRadius: const BorderRadius.all(Radius.circular(50)),
),
child: IconButton(
icon: const Icon(Icons.mic),
onPressed: () {},
),
),
),
),
],
),
),
],
);
}
}
class HeaderWidget extends StatelessWidget {
const HeaderWidget({
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return const Center(
child: Text(
'Speech recognition available',
style: TextStyle(fontSize: 22.0),
),
);
}
}
/// Display the current error status from the speech
/// recognizer
class ErrorWidget extends StatelessWidget {
const ErrorWidget({
Key? key,
required this.lastError,
}) : super(key: key);
final String lastError;
@override
Widget build(BuildContext context) {
return Column(
children: <Widget>[
const Center(
child: Text(
'Error Status',
style: TextStyle(fontSize: 22.0),
),
),
Center(
child: Text(lastError),
),
],
);
}
}
/// Controls to start and stop speech recognition
class SpeechControlWidget extends StatelessWidget {
// final List<Data>? datalist;
// SpeechControlWidget.withListeners({Key? key, this.datalist}) : super(key: key);
SpeechControlWidget(this.total, this.level, this.hasSpeech, this.isListening,
this.startListening, this.stopListening, this.cancelListening,
{Key? key})
: super(key: key);
final double level;
final String total;
final bool hasSpeech;
final bool isListening;
final void Function() startListening;
final void Function() stopListening;
final void Function() cancelListening;
static List<Data>? data1 = [];
//final TextEditingController _dateTime = TextEditingController();
@override
Widget build(BuildContext context) {
return Column(
children: <Widget>[
Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
SizedBox(
height: MediaQuery.of(context).size.height * 0.80,
child: Container(
decoration: BoxDecoration(
color: const Color.fromARGB(255, 249, 248, 248),
border: Border.all(
style: BorderStyle.solid,
color: const Color.fromARGB(255, 164, 149, 120),
),
borderRadius: BorderRadius.circular(7),
),
child: Column(
children: [
Expanded(
child: ListView.builder(
itemCount: data1?.length,
itemBuilder: (context, index) {
return Padding(
padding: const EdgeInsets.fromLTRB(5, 5, 1, 5),
//height: 60,
//color: const Color.fromARGB(255, 16, 16, 16),
child: SizedBox(
width: MediaQuery.of(context).size.width / 1,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
child: Text(
data1![index].question,
textAlign: TextAlign.left,
softWrap: true,
maxLines: 4,
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Expanded(
child: Text(
data1![index].answer,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.right,
maxLines: 4,
),
),
],
),
],
),
),
);
},
),
),
],
),
),
),
TextFormField(
// style: Constants.Titletextstyle,
// enabled: false,
readOnly: true,
controller: TextEditingController(text: total),
onTap: () {},
decoration: InputDecoration(
// border: Border.all(color: Colors.grey),
filled: true,
fillColor: const Color.fromARGB(255, 250, 248, 248),
contentPadding:
const EdgeInsets.symmetric(vertical: 15, horizontal: 10),
isDense: true,
hintText: '',
border: OutlineInputBorder(
borderSide: const BorderSide(color: Colors.grey, width: 0.0),
borderRadius: BorderRadius.circular(2.0),
),
suffixIcon: IconButton(
icon: const Icon(Icons.mic),
onPressed: () {
startListening();
},
),
),
),
],
),
],
);
}
static UpdateList(List<Data> dataList) {
// setState(() {
// data = dataList;
// });
data1 = dataList;
print(dataList);
//data = dataList;
}
}
class Data {
String question = ''; // Use camelCase for variable names
String answer = ''; // Use camelCase for variable names
// Constructor
Data({required this.question, required this.answer});
// Named constructor for creating an instance from a Map
Data.fromMap(Map<String, dynamic> map)
: question = map['Question'] ?? '',
answer = map['Answer'] ?? '';
// Convert the object to a Map
Map<String, dynamic> toMap() {
return {
'Question': question,
'Answer': answer,
};
}
}
class InitSpeechWidget extends StatelessWidget {
const InitSpeechWidget(this.hasSpeech, this.initSpeechState, {Key? key})
: super(key: key);
final bool hasSpeech;
final Future<void> Function() initSpeechState;
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
TextButton(
onPressed: hasSpeech ? null : initSpeechState,
child: const Text('Initialize'),
),
],
);
}
}
class SpeechStatusWidget extends StatelessWidget {
const SpeechStatusWidget({
Key? key,
required this.speech,
}) : super(key: key);
final SpeechToText speech;
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.symmetric(vertical: 20),
color: Theme.of(context).colorScheme.background,
child: Center(
child: speech.isListening
? const Text(
"I'm listening...",
style: TextStyle(fontWeight: FontWeight.bold),
)
: const Text(
'Not listening',
style: TextStyle(fontWeight: FontWeight.bold),
),
),
);
}
}
...@@ -22,6 +22,16 @@ class _MyWidgetState extends State<UserRegistration> { ...@@ -22,6 +22,16 @@ class _MyWidgetState extends State<UserRegistration> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
leading: IconButton(
icon: Image.asset(
"assets/images/back_arrow.png",
width: 24,
height: 24,
color: Colors.white,
),
//color: Colors.white,
onPressed: () => Navigator.pop(context),
),
title: const Text( title: const Text(
'USER REGISTRATION', 'USER REGISTRATION',
style: Constants.fontStyle, style: Constants.fontStyle,
......
...@@ -21,12 +21,14 @@ class RemoteData { ...@@ -21,12 +21,14 @@ class RemoteData {
String ChangePassword = 'http://vaman.plutokm.com/changePassword'; String ChangePassword = 'http://vaman.plutokm.com/changePassword';
String FootFallVerify = 'http://vaman.plutokm.com/footfall_verify_flutter'; String FootFallVerify = 'http://vaman.plutokm.com/footfall_verify_flutter';
String EmployeeStatus = 'http://vaman.plutokm.com/employees_status'; String EmployeeStatus = 'http://vaman.plutokm.com/employees_status';
String DepartmentSearch = 'http://vaman.plutokm.com/employees_status_department_instore'; String DepartmentSearch =
'http://vaman.plutokm.com/employees_status_department_instore';
String IssueVideos = 'http://vaman.plutokm.com/video_alert_page'; String IssueVideos = 'http://vaman.plutokm.com/video_alert_page';
String UpdateIssueVideos = 'http://vaman.plutokm.com/update_video_alert'; String UpdateIssueVideos = 'http://vaman.plutokm.com/update_video_alert';
String UpdateIssueVideos1 = 'http://vaman.plutokm.com/L2_update_video_alert'; String UpdateIssueVideos1 = 'http://vaman.plutokm.com/L2_update_video_alert';
String Type = "Content-Type"; String Type = "Content-Type";
String App_json = "application/json"; String App_json = "application/json";
String speechtotext = 'http://192.168.65.148:5113/mobile_response/';
// Stores List Request GET Method // Stores List Request GET Method
// Login Request POST Method // Login Request POST Method
...@@ -57,6 +59,25 @@ class RemoteData { ...@@ -57,6 +59,25 @@ class RemoteData {
} }
} }
Future<String> getSpeechResponse(String? text) async {
var header = {Type: App_json};
var res = '';
var response = await http.post(
Uri.parse('$speechtotext$text'),
headers: header,
);
if (kDebugMode) {
print(response.statusCode);
}
if (response.statusCode == 200) {
res = response.body;
if (kDebugMode) {
print('Logout : $res');
}
}
return res;
}
Future<int> getFeedbackStatus(String notificationId, String userId, Future<int> getFeedbackStatus(String notificationId, String userId,
String feed, String comments) async { String feed, String comments) async {
Map<String, dynamic> body = { Map<String, dynamic> body = {
......
...@@ -13,6 +13,7 @@ Future<void> main() async { ...@@ -13,6 +13,7 @@ Future<void> main() async {
} }
runApp(const MaterialApp( runApp(const MaterialApp(
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
home: SplashScreen(),) home: SplashScreen(),
)
); );
} }
...@@ -9,9 +9,11 @@ import connectivity_macos ...@@ -9,9 +9,11 @@ import connectivity_macos
import file_selector_macos import file_selector_macos
import firebase_core import firebase_core
import firebase_messaging import firebase_messaging
import flutter_tts
import path_provider_foundation import path_provider_foundation
import share_plus import share_plus
import shared_preferences_foundation import shared_preferences_foundation
import speech_to_text_macos
import url_launcher_macos import url_launcher_macos
import wakelock_macos import wakelock_macos
...@@ -20,9 +22,11 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { ...@@ -20,9 +22,11 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin")) FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin"))
FlutterTtsPlugin.register(with: registry.registrar(forPlugin: "FlutterTtsPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
SpeechToTextMacosPlugin.register(with: registry.registrar(forPlugin: "SpeechToTextMacosPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
WakelockMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockMacosPlugin")) WakelockMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockMacosPlugin"))
} }
...@@ -93,10 +93,10 @@ packages: ...@@ -93,10 +93,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.17.2" version: "1.18.0"
connectivity: connectivity:
dependency: "direct main" dependency: "direct main"
description: description:
...@@ -323,6 +323,14 @@ packages: ...@@ -323,6 +323,14 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
flutter_tts:
dependency: "direct main"
description:
name: flutter_tts
sha256: cbb3fd43b946e62398560235469e6113e4fe26c40eab1b7cb5e7c417503fb3a8
url: "https://pub.dev"
source: hosted
version: "3.8.5"
flutter_web_plugins: flutter_web_plugins:
dependency: transitive dependency: transitive
description: flutter description: flutter
...@@ -492,10 +500,10 @@ packages: ...@@ -492,10 +500,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.9.1" version: "1.10.0"
mime: mime:
dependency: transitive dependency: transitive
description: description:
...@@ -568,6 +576,14 @@ packages: ...@@ -568,6 +576,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
pedantic:
dependency: transitive
description:
name: pedantic
sha256: "67fc27ed9639506c856c840ccce7594d0bdcd91bc8d53d6e52359449a1d50602"
url: "https://pub.dev"
source: hosted
version: "1.11.1"
permission_handler: permission_handler:
dependency: "direct main" dependency: "direct main"
description: description:
...@@ -741,22 +757,46 @@ packages: ...@@ -741,22 +757,46 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.10.0" version: "1.10.0"
speech_to_text:
dependency: "direct main"
description:
name: speech_to_text
sha256: "57fef1d41bdebe298e84842c89bb4ac91f31cdbec7830c8cb1fc6b91d03abd42"
url: "https://pub.dev"
source: hosted
version: "6.6.0"
speech_to_text_macos:
dependency: transitive
description:
name: speech_to_text_macos
sha256: e685750f7542fcaa087a5396ee471e727ec648bf681f4da83c84d086322173f6
url: "https://pub.dev"
source: hosted
version: "1.1.0"
speech_to_text_platform_interface:
dependency: transitive
description:
name: speech_to_text_platform_interface
sha256: a0df1a907091ea09880077dc25aae02af9f79811264e6e97ddb08639b7f771c2
url: "https://pub.dev"
source: hosted
version: "2.2.0"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.11.0" version: "1.11.1"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.1" version: "2.1.2"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
...@@ -793,10 +833,10 @@ packages: ...@@ -793,10 +833,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.6.0" version: "0.6.1"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
...@@ -969,10 +1009,10 @@ packages: ...@@ -969,10 +1009,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: web name: web
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.1.4-beta" version: "0.3.0"
webview_flutter: webview_flutter:
dependency: "direct main" dependency: "direct main"
description: description:
...@@ -1038,5 +1078,5 @@ packages: ...@@ -1038,5 +1078,5 @@ packages:
source: hosted source: hosted
version: "3.1.2" version: "3.1.2"
sdks: sdks:
dart: ">=3.1.0 <4.0.0" dart: ">=3.2.0-194.0.dev <4.0.0"
flutter: ">=3.13.0" flutter: ">=3.13.0"
...@@ -39,6 +39,8 @@ dependencies: ...@@ -39,6 +39,8 @@ dependencies:
video_player: ^2.7.0 video_player: ^2.7.0
firebase_messaging: ^14.6.8 firebase_messaging: ^14.6.8
firebase_core : ^2.16.0 firebase_core : ^2.16.0
speech_to_text: ^6.6.0
flutter_tts: ^3.5.1
#media_kit: ^0.0.8 #media_kit: ^0.0.8
#media_kit_video: ^0.0.1 #media_kit_video: ^0.0.1
#flutter_vlc_player: ^7.3.1 #flutter_vlc_player: ^7.3.1
...@@ -99,10 +101,11 @@ flutter: ...@@ -99,10 +101,11 @@ flutter:
- assets/images/audit.png - assets/images/audit.png
- assets/images/info.png - assets/images/info.png
- assets/images/emp.png - assets/images/emp.png
#- assets/images/green.png - assets/images/back_arrow.png
- assets/images/red.png - assets/images/red.png
- assets/images/videos.png - assets/images/videos.png
- assets/images/weekly_report.png - assets/images/weekly_report.png
- assets/images/menu.png
fonts: fonts:
- family: Poppins - family: Poppins
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <file_selector_windows/file_selector_windows.h> #include <file_selector_windows/file_selector_windows.h>
#include <firebase_core/firebase_core_plugin_c_api.h> #include <firebase_core/firebase_core_plugin_c_api.h>
#include <flutter_tts/flutter_tts_plugin.h>
#include <permission_handler_windows/permission_handler_windows_plugin.h> #include <permission_handler_windows/permission_handler_windows_plugin.h>
#include <share_plus/share_plus_windows_plugin_c_api.h> #include <share_plus/share_plus_windows_plugin_c_api.h>
#include <url_launcher_windows/url_launcher_windows.h> #include <url_launcher_windows/url_launcher_windows.h>
...@@ -17,6 +18,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { ...@@ -17,6 +18,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
registry->GetRegistrarForPlugin("FileSelectorWindows")); registry->GetRegistrarForPlugin("FileSelectorWindows"));
FirebaseCorePluginCApiRegisterWithRegistrar( FirebaseCorePluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); registry->GetRegistrarForPlugin("FirebaseCorePluginCApi"));
FlutterTtsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FlutterTtsPlugin"));
PermissionHandlerWindowsPluginRegisterWithRegistrar( PermissionHandlerWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin")); registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin"));
SharePlusWindowsPluginCApiRegisterWithRegistrar( SharePlusWindowsPluginCApiRegisterWithRegistrar(
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
file_selector_windows file_selector_windows
firebase_core firebase_core
flutter_tts
permission_handler_windows permission_handler_windows
share_plus share_plus
url_launcher_windows url_launcher_windows
......
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