Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
StoreMonitor
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ramesh Babu Puvvadi
StoreMonitor
Commits
5d111162
Commit
5d111162
authored
Feb 09, 2024
by
Ramesh Babu Puvvadi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
64f962fe
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
976 additions
and
136 deletions
+976
-136
build.gradle
android/app/build.gradle
+1
-1
AndroidManifest.xml
android/app/src/debug/AndroidManifest.xml
+3
-2
back_arrow.png
assets/images/back_arrow.png
+0
-0
menu.png
assets/images/menu.png
+0
-0
Podfile.lock
ios/Podfile.lock
+16
-0
project.pbxproj
ios/Runner.xcodeproj/project.pbxproj
+6
-0
Info.plist
ios/Runner/Info.plist
+3
-0
CheckRegistration.dart
lib/Screens/CheckRegistration.dart
+11
-2
Constants.dart
lib/Screens/Constants.dart
+6
-11
EmployeeReport.dart
lib/Screens/EmployeeReport.dart
+10
-0
EmployeeStatus.dart
lib/Screens/EmployeeStatus.dart
+12
-2
FootFall.dart
lib/Screens/FootFall.dart
+13
-2
Home.dart
lib/Screens/Home.dart
+19
-64
IssueVideos.dart
lib/Screens/IssueVideos.dart
+29
-1
MyHomePage.dart
lib/Screens/MyHomePage.dart
+10
-1
NotificationReport.dart
lib/Screens/NotificationReport.dart
+12
-1
Review.dart
lib/Screens/Review.dart
+21
-8
SurvellianceView.dart
lib/Screens/SurvellianceView.dart
+62
-0
TexttoSpeach.dart
lib/Screens/TexttoSpeach.dart
+618
-0
UserRegistration.dart
lib/Screens/UserRegistration.dart
+10
-0
RemoteData.dart
lib/Services/RemoteData.dart
+39
-18
main.dart
lib/main.dart
+10
-9
GeneratedPluginRegistrant.swift
macos/Flutter/GeneratedPluginRegistrant.swift
+4
-0
pubspec.lock
pubspec.lock
+53
-13
pubspec.yaml
pubspec.yaml
+4
-1
generated_plugin_registrant.cc
windows/flutter/generated_plugin_registrant.cc
+3
-0
generated_plugins.cmake
windows/flutter/generated_plugins.cmake
+1
-0
No files found.
android/app/build.gradle
View file @
5d111162
...
...
@@ -48,7 +48,7 @@ android {
applicationId
"com.sopt.storemonitor"
// 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.
minSdkVersion
2
0
minSdkVersion
2
1
targetSdkVersion
flutter
.
targetSdkVersion
versionCode
flutterVersionCode
.
toInteger
()
versionName
flutterVersionName
...
...
android/app/src/debug/AndroidManifest.xml
View file @
5d111162
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.sopt.storemonitor"
>
<!-- The INTERNET permission is required for development. Specifically,
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.CALL_PHONE" /> -->
<uses-permission
android:name=
"android.permission.ACCESS_NETWORK_STATE"
/>
...
...
assets/images/back_arrow.png
0 → 100644
View file @
5d111162
1.71 KB
assets/images/menu.png
0 → 100644
View file @
5d111162
1.15 KB
ios/Podfile.lock
View file @
5d111162
...
...
@@ -44,6 +44,8 @@ PODS:
- OrderedSet (~> 5.0)
- flutter_sms (1.1.0):
- Flutter
- flutter_tts (0.0.1):
- Flutter
- GoogleDataTransport (9.2.5):
- GoogleUtilities/Environment (~> 7.7)
- nanopb (< 2.30910.0, >= 2.30908.0)
...
...
@@ -85,6 +87,10 @@ PODS:
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- speech_to_text (0.0.1):
- Flutter
- Try
- Try (2.1.1)
- url_launcher_ios (0.0.1):
- Flutter
- video_player_avfoundation (0.0.1):
...
...
@@ -101,11 +107,13 @@ DEPENDENCIES:
- Flutter (from `Flutter`)
- flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/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`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- share_plus (from `.symlinks/plugins/share_plus/ios`)
- 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`)
- video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/ios`)
- wakelock (from `.symlinks/plugins/wakelock/ios`)
...
...
@@ -124,6 +132,7 @@ SPEC REPOS:
- OrderedSet
- PromisesObjC
- Reachability
- Try
EXTERNAL SOURCES:
connectivity:
...
...
@@ -138,6 +147,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_inappwebview/ios"
flutter_sms:
:path: ".symlinks/plugins/flutter_sms/ios"
flutter_tts:
:path: ".symlinks/plugins/flutter_tts/ios"
image_picker_ios:
:path: ".symlinks/plugins/image_picker_ios/ios"
path_provider_foundation:
...
...
@@ -148,6 +159,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/share_plus/ios"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
speech_to_text:
:path: ".symlinks/plugins/speech_to_text/ios"
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"
video_player_avfoundation:
...
...
@@ -169,6 +182,7 @@ SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_inappwebview: 3d32228f1304635e7c028b0d4252937730bbc6cf
flutter_sms: 91ce41530f55c85d6524d82307a5d555844c086a
flutter_tts: 0f492aab6accf87059b72354fcb4ba934304771d
GoogleDataTransport: 54dee9d48d14580407f8f5fbf2f496e92437a2f2
GoogleUtilities: 13e2c67ede716b8741c7989e26893d151b2b2084
image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
...
...
@@ -180,6 +194,8 @@ SPEC CHECKSUMS:
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
speech_to_text: b43a7d99aef037bd758ed8e45d79bbac035d2dfe
Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
video_player_avfoundation: 81e49bb3d9fb63dccf9fa0f6d877dc3ddbeac126
wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f
...
...
ios/Runner.xcodeproj/project.pbxproj
View file @
5d111162
...
...
@@ -355,6 +355,7 @@
baseConfigurationReference
=
7AFA3C8E1D35360C0083082E
/* Release.xcconfig */
;
buildSettings
=
{
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS
=
YES
;
CLANG_ENABLE_MODULES
=
YES
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_STYLE
=
Automatic
;
...
...
@@ -368,6 +369,7 @@
"$(inherited)"
,
"@executable_path/Frameworks"
,
);
MARKETING_VERSION
=
5
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.sopt.storemonito
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PROVISIONING_PROFILE_SPECIFIER
=
""
;
...
...
@@ -489,6 +491,7 @@
baseConfigurationReference
=
9740EEB21CF90195004384FC
/* Debug.xcconfig */
;
buildSettings
=
{
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS
=
YES
;
CLANG_ENABLE_MODULES
=
YES
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_STYLE
=
Automatic
;
...
...
@@ -502,6 +505,7 @@
"$(inherited)"
,
"@executable_path/Frameworks"
,
);
MARKETING_VERSION
=
5
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.sopt.storemonito
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PROVISIONING_PROFILE_SPECIFIER
=
""
;
...
...
@@ -517,6 +521,7 @@
baseConfigurationReference
=
7AFA3C8E1D35360C0083082E
/* Release.xcconfig */
;
buildSettings
=
{
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS
=
YES
;
CLANG_ENABLE_MODULES
=
YES
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_STYLE
=
Automatic
;
...
...
@@ -530,6 +535,7 @@
"$(inherited)"
,
"@executable_path/Frameworks"
,
);
MARKETING_VERSION
=
5
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.sopt.storemonito
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PROVISIONING_PROFILE_SPECIFIER
=
""
;
...
...
ios/Runner/Info.plist
View file @
5d111162
...
...
@@ -39,6 +39,9 @@
<
string
>
Microphone
access
is
required
to
dial
a
call
<
/string
>
<
k
e
y
>
NSPhotoLibraryUsageDescription
<
/k
e
y
>
<
string
>
This
app
requires
access
to
the
photo
library
<
/string
>
<
k
e
y
>
NSSpeechRecognitionUsageDescription
<
/k
e
y
>
<
string
>
Speech
recognition
allows
you
to
use
text-to-speech
and
speech
<
/string
>
<
k
e
y
>
REVERSED_CLIENT_ID
<
/k
e
y
>
<
string
>
d6689d068c6b4290aba903
<
/string
>
<
k
e
y
>
UIApplicationSupportsIndirectInputEvents
<
/k
e
y
>
...
...
lib/Screens/CheckRegistration.dart
View file @
5d111162
...
...
@@ -32,6 +32,16 @@ class _CheckRegistration extends State<CheckRegistration> {
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
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
(
'CHECK REGISTRATION'
,
style:
Constants
.
fontStyle
,
...
...
@@ -135,8 +145,7 @@ class _CheckRegistration extends State<CheckRegistration> {
});
if
(
Platform
.
isAndroid
)
{
image
=
await
_picker
.
pickVideo
(
source
:
ImageSource
.
camera
,
preferredCameraDevice:
CameraDevice
.
rear
);
source
:
ImageSource
.
camera
,
preferredCameraDevice:
CameraDevice
.
rear
);
}
else
{
image
=
await
_picker
.
pickVideo
(
source
:
ImageSource
.
camera
,
...
...
lib/Screens/Constants.dart
View file @
5d111162
...
...
@@ -20,10 +20,10 @@ class Constants {
}
static
const
TextStyle
fontStyle
=
TextStyle
(
fontFamily:
'Poppins'
,
fontSize:
18
,
fontWeight:
FontWeight
.
normal
,
);
fontFamily:
'Poppins'
,
fontSize:
18
,
fontWeight:
FontWeight
.
normal
,
color:
Colors
.
white
);
static
const
TextStyle
headerfontStyle
=
TextStyle
(
fontFamily:
'Poppins'
,
fontSize:
16
,
...
...
@@ -128,16 +128,11 @@ class Constants {
color:
Colors
.
red
,
);
static
const
TextStyle
LoginbuttonsfontStyle
=
TextStyle
(
static
const
TextStyle
LoginbuttonsfontStyle
=
TextStyle
(
fontFamily:
'Poppins'
,
fontSize:
16
,
fontWeight:
FontWeight
.
normal
,
color:
Color
.
fromARGB
(
255
,
12
,
18
,
22
),
color:
Color
.
fromARGB
(
255
,
12
,
18
,
22
),
);
static
const
TextStyle
LoginuseridStyle
=
TextStyle
(
fontFamily:
'Poppins'
,
...
...
lib/Screens/EmployeeReport.dart
View file @
5d111162
...
...
@@ -63,6 +63,16 @@ class _EmployeeReport extends State<EmployeeReport> {
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
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
(
'EMPLOYEE REPORT'
,
style:
Constants
.
fontStyle
,
...
...
lib/Screens/EmployeeStatus.dart
View file @
5d111162
...
...
@@ -25,8 +25,8 @@ class employeeStatus extends State<EmployeeStatus> {
List
<
String
>?
storesList
;
//final Color _buttonColor1 = const Color.fromARGB(255, 235, 229, 246);
//final Color _buttonColor = const Color.fromARGB(255, 235, 229, 246);
Color
color
=
Colors
.
black
;
Color
color1
=
Colors
.
black
;
Color
color
=
Colors
.
black
;
Color
color1
=
Colors
.
black
;
@override
void
initState
()
{
...
...
@@ -89,6 +89,16 @@ class employeeStatus extends State<EmployeeStatus> {
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
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
(
"EmployeesStatus"
,
style:
Constants
.
fontStyle
,
...
...
lib/Screens/FootFall.dart
View file @
5d111162
...
...
@@ -11,6 +11,7 @@ import 'Constants.dart';
class
FootFall
extends
StatefulWidget
{
final
String
message
;
final
String
selecteddate
;
const
FootFall
(
{
super
.
key
,
required
this
.
message
,
required
this
.
selecteddate
});
...
...
@@ -33,7 +34,7 @@ class _FootFall extends State<FootFall> {
super
.
initState
();
isMeeters
=
widget
.
message
;
loadData
();
//_selectedDate = DateTime.now();
//_selectedDate
= DateTime.now();
String
dateString
=
widget
.
selecteddate
;
DateFormat
format
=
DateFormat
(
"yyyy/MM/dd"
);
_selectedDate
=
format
.
parse
(
dateString
);
...
...
@@ -110,6 +111,16 @@ class _FootFall extends State<FootFall> {
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
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
(
"FOOT FALL"
,
style:
Constants
.
fontStyle
,
...
...
@@ -395,7 +406,7 @@ class _FootFall extends State<FootFall> {
),
Expanded
(
child:
Text
(
'MTe
e
ns'
,
'MTens'
,
textAlign:
TextAlign
.
center
,
style:
Constants
.
listitems
,
),
...
...
lib/Screens/Home.dart
View file @
5d111162
...
...
@@ -20,7 +20,7 @@ import 'UserRegistration.dart';
class
Home
extends
StatefulWidget
{
final
String
message
;
const
Home
({
super
.
key
,
required
this
.
message
});
//const Home({super.key});
@override
_Home
createState
()
=>
_Home
();
}
...
...
@@ -34,21 +34,24 @@ class _Home extends State<Home> {
final
TextEditingController
_dateTime
=
TextEditingController
();
bool
isAuthenticated
=
false
;
bool
iswarehouserelated
=
false
;
final
GlobalKey
<
ScaffoldState
>
_scaffoldKey
=
GlobalKey
<
ScaffoldState
>();
@override
void
initState
()
{
super
.
initState
();
loadData
();
_chartData
=
getChartData
(
0
,
0
);
_selectedDate
=
DateTime
.
now
();
_chartData
=
getChartData
(
0
,
0
);
_selectedDate
=
DateTime
.
now
();
_dateTime
.
text
=
DateFormat
(
'yyyy/MM/dd'
).
format
(
_selectedDate
);
}
loadData
()
async
{
SharedPreferences
prefs
=
await
SharedPreferences
.
getInstance
();
String
?
userId
=
prefs
.
getString
(
"stores_list"
);
empId
=
prefs
.
getString
(
'empId'
);
print
(
empId
);
String
?
userId
=
prefs
.
getString
(
"stores_list"
);
empId
=
prefs
.
getString
(
'empId'
);
if
(
kDebugMode
)
{
print
(
empId
);
}
namesList
=
(
json
.
decode
(
userId
!)
as
List
<
dynamic
>)
.
map
((
map
)
=>
map
[
'name'
]
as
String
)
.
toList
();
...
...
@@ -64,7 +67,6 @@ class _Home extends State<Home> {
isAuthenticated
=
false
;
});
}
if
(
selectedDropdownItem
==
'WH KISMATPUR'
||
selectedDropdownItem
==
'WH BANGALORE'
||
selectedDropdownItem
==
'WH VIJAYAWADA'
||
...
...
@@ -73,16 +75,6 @@ class _Home extends State<Home> {
}
else
{
iswarehouserelated
=
false
;
}
// if(prefs.getBool('warehouse') == true) {
// setState(() {
// iswarehouserelated = true;
// });
// } else {
// setState(() {
// iswarehouserelated = false;
// });
// }
}
Future
<
void
>
_selectDate
(
BuildContext
context
)
async
{
...
...
@@ -116,15 +108,23 @@ class _Home extends State<Home> {
});
}
//9866438056
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
key:
_scaffoldKey
,
drawer:
NavBar
(
message:
selectedDropdownItem
.
toString
(),
),
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
(
'STORE MONITOR'
,
style:
Constants
.
fontStyle
,
...
...
@@ -147,15 +147,6 @@ class _Home extends State<Home> {
print
(
'force press down'
);
//Navigator.pop(context);
},
// onHorizontalDragUpdate: (dragDetail) {
// print('Testing');
// if (dragDetail.delta.direction > 0) {
// Navigator.pop(context);
// print('Hitted =====>');
// }
// },
child:
Container
(
margin:
const
EdgeInsets
.
all
(
12.0
),
child:
Column
(
...
...
@@ -441,18 +432,6 @@ class _Home extends State<Home> {
// width: 145,
// height: 160,
),
// replace with your image
// const SizedBox(
// width:
// 10), // add some space between the image and the text
// const Expanded(
// child: Text(
// 'Accuracy',
// overflow: TextOverflow.ellipsis,
// style: Constants.buttonsfontStyle,
// textAlign: TextAlign.center,
// ),
// ),
],
),
),
...
...
@@ -504,18 +483,6 @@ class _Home extends State<Home> {
// width: 145,
// height: 160,
),
// replace with your image
// const SizedBox(
// width:
// 10), // add some space between the image and the text
// const Expanded(
// child: Text(
// 'Foot Fall',
// overflow: TextOverflow.ellipsis,
// style: Constants.buttonsfontStyle,
// textAlign: TextAlign.center,
// ),
// ),
],
),
),
...
...
@@ -704,18 +671,6 @@ class _Home extends State<Home> {
width:
MediaQuery
.
of
(
context
).
size
.
width
*
0.44
,
height:
MediaQuery
.
of
(
context
).
size
.
width
*
0.22
,
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),
// ),
),
),
),
...
...
lib/Screens/IssueVideos.dart
View file @
5d111162
import
'dart:convert'
;
import
'dart:io'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/material.dart'
;
import
'package:permission_handler/permission_handler.dart'
;
import
'package:share_plus/share_plus.dart'
;
import
'package:shared_preferences/shared_preferences.dart'
;
import
'package:storemonitor/Screens/Issue.dart'
;
import
'package:storemonitor/Screens/SurvellianceView.dart'
;
...
...
@@ -108,13 +110,23 @@ class _IssueVideos extends State<IssueVideos> {
}
else
{}
// } catch (e) {
// 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
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
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
(
'Issue Videos List'
,
style:
Constants
.
fontStyle
,
...
...
@@ -124,6 +136,22 @@ class _IssueVideos extends State<IssueVideos> {
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
(
child:
Container
(
...
...
lib/Screens/MyHomePage.dart
View file @
5d111162
...
...
@@ -47,6 +47,16 @@ class _VideoPlayerScreenState extends State<MyHomePage> {
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
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
(
'Weekly Report'
,
style:
Constants
.
fontStyle
,
...
...
@@ -57,7 +67,6 @@ class _VideoPlayerScreenState extends State<MyHomePage> {
),
),
),
body:
SizedBox
(
height:
MediaQuery
.
of
(
context
).
size
.
height
,
child:
InAppWebView
(
...
...
lib/Screens/NotificationReport.dart
View file @
5d111162
...
...
@@ -115,7 +115,8 @@ class _NotificationReport extends State<NotificationReport> {
data
=
await
RemoteData
().
getNotificationReport
(
selectedDropdownItem
!,
'
${_selectedDate1.year}
-
$selectedmonth
-
$selectedday
'
);
if
(
data
.
statusCode
!=
200
)
{
Constants
(
'NotificationReport'
,
data
.
statusCode
.
toString
()).
showAlertDialog
(
context
,
false
);
Constants
(
'NotificationReport'
,
data
.
statusCode
.
toString
())
.
showAlertDialog
(
context
,
false
);
return
;
}
Navigator
.
of
(
context
).
pop
();
...
...
@@ -169,6 +170,16 @@ class _NotificationReport extends State<NotificationReport> {
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
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
(
'NOTIFICATION REPORT'
,
style:
Constants
.
fontStyle
,
...
...
lib/Screens/Review.dart
View file @
5d111162
...
...
@@ -45,13 +45,13 @@ class _Review extends State<Review> {
'assets/images/review.png'
];
List
<
String
>?
storesList
;
ReviewList
?
reviewList
;
ReviewList
?
reviewList
;
List
<
Alerts
>?
filteredAlerts
=
[];
late
String
imp
;
late
String
imp
;
Key
carouselKey
=
UniqueKey
();
bool
pressed
=
false
;
bool
pressed1
=
false
;
Color
black
=
Colors
.
black
;
bool
pressed1
=
false
;
Color
black
=
Colors
.
black
;
Color
black1
=
Colors
.
black
;
Color
black2
=
Colors
.
black
;
Color
black3
=
Colors
.
black
;
...
...
@@ -411,6 +411,16 @@ class _Review extends State<Review> {
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
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
(
'REVIEW'
,
style:
Constants
.
fontStyle
,
...
...
@@ -670,6 +680,8 @@ class _Review extends State<Review> {
),
child:
TextFormField
(
controller:
_controller
,
readOnly:
true
,
enabled:
false
,
decoration:
const
InputDecoration
(
border:
InputBorder
.
none
),
style:
const
TextStyle
(
fontSize:
20
,
color:
Colors
.
white
),
textAlign:
TextAlign
.
center
,
...
...
@@ -1078,7 +1090,7 @@ class _Review extends State<Review> {
context
)
.
size
.
width
/
3
,
3
.2
,
child:
const
Center
(
child:
...
...
@@ -1090,7 +1102,7 @@ class _Review extends State<Review> {
),
),
const
SizedBox
(
width:
5
,
width:
3
,
height:
0
,
),
Container
(
...
...
@@ -1138,7 +1150,7 @@ class _Review extends State<Review> {
context
)
.
size
.
width
/
3
,
3
.2
,
child:
const
Center
(
child:
...
...
@@ -1297,6 +1309,7 @@ class _Review extends State<Review> {
final
File
imageFile
=
File
(
'
${temp.path}
/ShareImage.jpg'
);
imageFile
.
writeAsBytesSync
(
response
.
bodyBytes
);
if
(
Platform
.
isAndroid
)
{
await
Share
.
shareXFiles
([
XFile
(
'
${temp.path}
/ShareImage.jpg'
)],
text:
textToShare
,
//subject: 'Reason',
...
...
@@ -1349,7 +1362,7 @@ class _Review extends State<Review> {
Navigator
.
of
(
context
).
pop
();
// Close the dialog
},
child:
const
Padding
(
padding:
EdgeInsets
.
only
(
right:
13
0
),
padding:
EdgeInsets
.
only
(
left:
1
0
),
child:
Text
(
'Submit'
),
),
//child: const Text('Submit'),
...
...
lib/Screens/SurvellianceView.dart
View file @
5d111162
import
'dart:convert'
;
import
'dart:io'
;
import
'package:chewie/chewie.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/material.dart'
;
import
'package:share_plus/share_plus.dart'
;
import
'package:storemonitor/Screens/Constants.dart'
;
import
'package:storemonitor/Services/RemoteData.dart'
;
import
'package:video_player/video_player.dart'
;
...
...
@@ -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
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
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
(
'Video Playing'
,
style:
Constants
.
fontStyle
,
...
...
@@ -146,6 +189,25 @@ class _SurvellianceViewState extends State<SurvellianceView> {
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}
\n
Store:
${store}
\n
Location:
${location}
\n
Description:
${des}
'
,
);
}
else
{
Constants
(
'Upload Images'
,
'Check your internet connection'
);
}
},
),
],
),
body:
SingleChildScrollView
(
child:
Container
(
...
...
lib/Screens/TexttoSpeach.dart
0 → 100644
View file @
5d111162
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
),
),
),
);
}
}
lib/Screens/UserRegistration.dart
View file @
5d111162
...
...
@@ -22,6 +22,16 @@ class _MyWidgetState extends State<UserRegistration> {
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
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
(
'USER REGISTRATION'
,
style:
Constants
.
fontStyle
,
...
...
lib/Services/RemoteData.dart
View file @
5d111162
...
...
@@ -5,28 +5,30 @@ import 'dart:io';
import
'package:http/http.dart'
as
http
;
class
RemoteData
{
String
BaseUrl
=
'http://vaman.plutokm.com/'
;
String
LoginUrl
=
'http://vaman.plutokm.com/login'
;
String
BaseUrl
=
'http://vaman.plutokm.com/'
;
String
LoginUrl
=
'http://vaman.plutokm.com/login'
;
//String AlertSummary = 'http://vaman.plutokm.com/alert_summary_flutter';
String
AlertSummary
=
'http://vaman.plutokm.com/alert_summary_flutter'
;
String
Review
=
'http://vaman.plutokm.com/alerts_new'
;
String
EmpReport
=
'http://vaman.plutokm.com/regstatusreport'
;
String
ImageUrl
=
'http://vaman.plutokm.com/flutter'
;
String
UploadVideo
=
'http://vaman.plutokm.com/registeration_video'
;
String
feedback
=
'http://vaman.plutokm.com/api/mx_feedback_new'
;
String
AuditData
=
'http://vaman.plutokm.com/audit_page'
;
String
AlertSummary
=
'http://vaman.plutokm.com/alert_summary_flutter'
;
String
Review
=
'http://vaman.plutokm.com/alerts_new'
;
String
EmpReport
=
'http://vaman.plutokm.com/regstatusreport'
;
String
ImageUrl
=
'http://vaman.plutokm.com/flutter'
;
String
UploadVideo
=
'http://vaman.plutokm.com/registeration_video'
;
String
feedback
=
'http://vaman.plutokm.com/api/mx_feedback_new'
;
String
AuditData
=
'http://vaman.plutokm.com/audit_page'
;
//String AuditData = 'http://192.168.65.111:8088/audit_page';
//String AuditupdateData = 'http://192.168.65.111:8088/audit_update';
String
AuditupdateData
=
'http://vaman.plutokm.com/audit_update'
;
String
ChangePassword
=
'http://vaman.plutokm.com/changePassword'
;
String
FootFallVerify
=
'http://vaman.plutokm.com/footfall_verify_flutter'
;
String
EmployeeStatus
=
'http://vaman.plutokm.com/employees_status'
;
String
DepartmentSearch
=
'http://vaman.plutokm.com/employees_status_department_instore'
;
String
IssueVideos
=
'http://vaman.plutokm.com/video_alert_page'
;
String
UpdateIssueVideos
=
'http://vaman.plutokm.com/update_video_alert'
;
String
AuditupdateData
=
'http://vaman.plutokm.com/audit_update'
;
String
ChangePassword
=
'http://vaman.plutokm.com/changePassword'
;
String
FootFallVerify
=
'http://vaman.plutokm.com/footfall_verify_flutter'
;
String
EmployeeStatus
=
'http://vaman.plutokm.com/employees_status'
;
String
DepartmentSearch
=
'http://vaman.plutokm.com/employees_status_department_instore'
;
String
IssueVideos
=
'http://vaman.plutokm.com/video_alert_page'
;
String
UpdateIssueVideos
=
'http://vaman.plutokm.com/update_video_alert'
;
String
UpdateIssueVideos1
=
'http://vaman.plutokm.com/L2_update_video_alert'
;
String
Type
=
"Content-Type"
;
String
App_json
=
"application/json"
;
String
Type
=
"Content-Type"
;
String
App_json
=
"application/json"
;
String
speechtotext
=
'http://192.168.65.148:5113/mobile_response/'
;
// Stores List Request GET Method
// Login Request POST Method
...
...
@@ -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
,
String
feed
,
String
comments
)
async
{
Map
<
String
,
dynamic
>
body
=
{
...
...
lib/main.dart
View file @
5d111162
...
...
@@ -5,14 +5,15 @@ import 'package:storemonitor/FirebaseApi.dart';
import
'Screens/SplashScreen.dart'
;
Future
<
void
>
main
()
async
{
WidgetsFlutterBinding
.
ensureInitialized
();
if
(
Platform
.
isAndroid
)
{
WidgetsFlutterBinding
.
ensureInitialized
();
if
(
Platform
.
isAndroid
)
{
WidgetsFlutterBinding
.
ensureInitialized
();
await
Firebase
.
initializeApp
();
await
FirebaseApi
().
initNotifications
();
}
runApp
(
const
MaterialApp
(
debugShowCheckedModeBanner:
false
,
home:
SplashScreen
(),)
);
await
Firebase
.
initializeApp
();
await
FirebaseApi
().
initNotifications
();
}
runApp
(
const
MaterialApp
(
debugShowCheckedModeBanner:
false
,
home:
SplashScreen
(),
)
);
}
macos/Flutter/GeneratedPluginRegistrant.swift
View file @
5d111162
...
...
@@ -9,9 +9,11 @@ import connectivity_macos
import
file_selector_macos
import
firebase_core
import
firebase_messaging
import
flutter_tts
import
path_provider_foundation
import
share_plus
import
shared_preferences_foundation
import
speech_to_text_macos
import
url_launcher_macos
import
wakelock_macos
...
...
@@ -20,9 +22,11 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FileSelectorPlugin
.
register
(
with
:
registry
.
registrar
(
forPlugin
:
"FileSelectorPlugin"
))
FLTFirebaseCorePlugin
.
register
(
with
:
registry
.
registrar
(
forPlugin
:
"FLTFirebaseCorePlugin"
))
FLTFirebaseMessagingPlugin
.
register
(
with
:
registry
.
registrar
(
forPlugin
:
"FLTFirebaseMessagingPlugin"
))
FlutterTtsPlugin
.
register
(
with
:
registry
.
registrar
(
forPlugin
:
"FlutterTtsPlugin"
))
PathProviderPlugin
.
register
(
with
:
registry
.
registrar
(
forPlugin
:
"PathProviderPlugin"
))
SharePlusMacosPlugin
.
register
(
with
:
registry
.
registrar
(
forPlugin
:
"SharePlusMacosPlugin"
))
SharedPreferencesPlugin
.
register
(
with
:
registry
.
registrar
(
forPlugin
:
"SharedPreferencesPlugin"
))
SpeechToTextMacosPlugin
.
register
(
with
:
registry
.
registrar
(
forPlugin
:
"SpeechToTextMacosPlugin"
))
UrlLauncherPlugin
.
register
(
with
:
registry
.
registrar
(
forPlugin
:
"UrlLauncherPlugin"
))
WakelockMacosPlugin
.
register
(
with
:
registry
.
registrar
(
forPlugin
:
"WakelockMacosPlugin"
))
}
pubspec.lock
View file @
5d111162
...
...
@@ -93,10 +93,10 @@ packages:
dependency: transitive
description:
name: collection
sha256:
f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
sha256:
ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
url: "https://pub.dev"
source: hosted
version: "1.1
7.2
"
version: "1.1
8.0
"
connectivity:
dependency: "direct main"
description:
...
...
@@ -323,6 +323,14 @@ packages:
description: flutter
source: sdk
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:
dependency: transitive
description: flutter
...
...
@@ -492,10 +500,10 @@ packages:
dependency: transitive
description:
name: meta
sha256:
"3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
sha256:
a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
url: "https://pub.dev"
source: hosted
version: "1.
9.1
"
version: "1.
10.0
"
mime:
dependency: transitive
description:
...
...
@@ -568,6 +576,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.2.1"
pedantic:
dependency: transitive
description:
name: pedantic
sha256: "67fc27ed9639506c856c840ccce7594d0bdcd91bc8d53d6e52359449a1d50602"
url: "https://pub.dev"
source: hosted
version: "1.11.1"
permission_handler:
dependency: "direct main"
description:
...
...
@@ -741,22 +757,46 @@ packages:
url: "https://pub.dev"
source: hosted
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:
dependency: transitive
description:
name: stack_trace
sha256:
c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
sha256:
"73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
url: "https://pub.dev"
source: hosted
version: "1.11.
0
"
version: "1.11.
1
"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256:
"83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
sha256:
ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
url: "https://pub.dev"
source: hosted
version: "2.1.
1
"
version: "2.1.
2
"
string_scanner:
dependency: transitive
description:
...
...
@@ -793,10 +833,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "
75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8
"
sha256: "
5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b
"
url: "https://pub.dev"
source: hosted
version: "0.6.
0
"
version: "0.6.
1
"
typed_data:
dependency: transitive
description:
...
...
@@ -969,10 +1009,10 @@ packages:
dependency: transitive
description:
name: web
sha256:
dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
sha256:
afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
url: "https://pub.dev"
source: hosted
version: "0.
1.4-beta
"
version: "0.
3.0
"
webview_flutter:
dependency: "direct main"
description:
...
...
@@ -1038,5 +1078,5 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.
1.0
<4.0.0"
dart: ">=3.
2.0-194.0.dev
<4.0.0"
flutter: ">=3.13.0"
pubspec.yaml
View file @
5d111162
...
...
@@ -39,6 +39,8 @@ dependencies:
video_player
:
^2.7.0
firebase_messaging
:
^14.6.8
firebase_core
:
^2.16.0
speech_to_text
:
^6.6.0
flutter_tts
:
^3.5.1
#media_kit: ^0.0.8
#media_kit_video: ^0.0.1
#flutter_vlc_player: ^7.3.1
...
...
@@ -99,10 +101,11 @@ flutter:
-
assets/images/audit.png
-
assets/images/info.png
-
assets/images/emp.png
#- assets/images/green
.png
-
assets/images/back_arrow
.png
-
assets/images/red.png
-
assets/images/videos.png
-
assets/images/weekly_report.png
-
assets/images/menu.png
fonts
:
-
family
:
Poppins
...
...
windows/flutter/generated_plugin_registrant.cc
View file @
5d111162
...
...
@@ -8,6 +8,7 @@
#include <file_selector_windows/file_selector_windows.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 <share_plus/share_plus_windows_plugin_c_api.h>
#include <url_launcher_windows/url_launcher_windows.h>
...
...
@@ -17,6 +18,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
registry
->
GetRegistrarForPlugin
(
"FileSelectorWindows"
));
FirebaseCorePluginCApiRegisterWithRegistrar
(
registry
->
GetRegistrarForPlugin
(
"FirebaseCorePluginCApi"
));
FlutterTtsPluginRegisterWithRegistrar
(
registry
->
GetRegistrarForPlugin
(
"FlutterTtsPlugin"
));
PermissionHandlerWindowsPluginRegisterWithRegistrar
(
registry
->
GetRegistrarForPlugin
(
"PermissionHandlerWindowsPlugin"
));
SharePlusWindowsPluginCApiRegisterWithRegistrar
(
...
...
windows/flutter/generated_plugins.cmake
View file @
5d111162
...
...
@@ -5,6 +5,7 @@
list
(
APPEND FLUTTER_PLUGIN_LIST
file_selector_windows
firebase_core
flutter_tts
permission_handler_windows
share_plus
url_launcher_windows
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment