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
b2fb65e0
Commit
b2fb65e0
authored
Aug 19, 2024
by
Ramesh Babu Puvvadi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added new changes
parent
f4cbf453
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
70 additions
and
165 deletions
+70
-165
Info.plist
ios/Runner/Info.plist
+2
-0
FirebaseApi.dart
lib/FirebaseApi.dart
+7
-4
Authentication.dart
lib/Screens/Authentication.dart
+7
-30
Chatboat.dart
lib/Screens/Chatboat.dart
+17
-38
CheckRegistration.dart
lib/Screens/CheckRegistration.dart
+3
-2
Home.dart
lib/Screens/Home.dart
+0
-0
IssueVideos.dart
lib/Screens/IssueVideos.dart
+3
-14
NavBar.dart
lib/Screens/NavBar.dart
+30
-77
SignUp.dart
lib/Screens/SignUp.dart
+1
-0
RemoteData.dart
lib/Services/RemoteData.dart
+0
-0
No files found.
ios/Runner/Info.plist
View file @
b2fb65e0
...
@@ -37,6 +37,8 @@
...
@@ -37,6 +37,8 @@
<
a
rr
a
y
>
<
a
rr
a
y
>
<
string
>
tel
<
/string
>
<
string
>
tel
<
/string
>
<
/
a
rr
a
y
>
<
/
a
rr
a
y
>
<
k
e
y
>
NSAppleMusicUsageDescription
<
/k
e
y
>
<
string
>
This
app
requires
access
to
your
music
usage
description
<
/string
>
<
k
e
y
>
NSCameraUsageDescription
<
/k
e
y
>
<
k
e
y
>
NSCameraUsageDescription
<
/k
e
y
>
<
string
>
Camera
access
is
required
to
capture
<
/string
>
<
string
>
Camera
access
is
required
to
capture
<
/string
>
<
k
e
y
>
NSPhotoLibraryAddUsageDescription
<
/k
e
y
>
<
k
e
y
>
NSPhotoLibraryAddUsageDescription
<
/k
e
y
>
...
...
lib/FirebaseApi.dart
View file @
b2fb65e0
...
@@ -3,8 +3,8 @@ import 'package:firebase_messaging/firebase_messaging.dart';
...
@@ -3,8 +3,8 @@ import 'package:firebase_messaging/firebase_messaging.dart';
import
'package:flutter/foundation.dart'
;
import
'package:flutter/foundation.dart'
;
class
FirebaseApi
{
class
FirebaseApi
{
final
_firebasemessaging
=
FirebaseMessaging
.
instance
;
final
_firebasemessaging
=
FirebaseMessaging
.
instance
;
Future
<
void
>
initNotifications
()
async
{
Future
<
void
>
initNotifications
()
async
{
await
_firebasemessaging
.
requestPermission
();
await
_firebasemessaging
.
requestPermission
();
final
fcmToken
=
await
_firebasemessaging
.
getToken
();
final
fcmToken
=
await
_firebasemessaging
.
getToken
();
...
@@ -15,8 +15,11 @@ class FirebaseApi {
...
@@ -15,8 +15,11 @@ class FirebaseApi {
Future
<
void
>
handleBackgroundMessage
(
RemoteMessage
message
)
async
{
Future
<
void
>
handleBackgroundMessage
(
RemoteMessage
message
)
async
{
await
Firebase
.
initializeApp
();
await
Firebase
.
initializeApp
();
//print('Title :${message.notification?.title}');
if
(
kDebugMode
)
{
//print('Title :${message.notification?.body}');
print
(
'Firebase title :
${message.notification?.title}
'
);
//print('Title :${message.data}');
print
(
'Firebase body :
${message.notification?.body}
'
);
print
(
'Firebase data :
${message.data}
'
);
}
}
}
}
}
lib/Screens/Authentication.dart
View file @
b2fb65e0
import
'package:flutter/foundation.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:storemonitor/Screens/Constants.dart'
;
import
'package:storemonitor/Screens/Constants.dart'
;
import
'package:video_player/video_player.dart'
;
import
'package:video_player/video_player.dart'
;
...
@@ -7,10 +8,7 @@ class VideoApp extends StatefulWidget {
...
@@ -7,10 +8,7 @@ class VideoApp extends StatefulWidget {
final
String
id
;
final
String
id
;
final
String
comment
;
final
String
comment
;
const
VideoApp
({
Key
?
key
,
const
VideoApp
({
Key
?
key
,
required
this
.
message
,
required
this
.
id
,
required
this
.
comment
}):
super
(
key:
key
);
required
this
.
message
,
required
this
.
id
,
required
this
.
comment
}):
super
(
key:
key
);
@override
@override
_VideoAppState
createState
()
=>
_VideoAppState
();
_VideoAppState
createState
()
=>
_VideoAppState
();
...
@@ -26,39 +24,17 @@ class _VideoAppState extends State<VideoApp> {
...
@@ -26,39 +24,17 @@ class _VideoAppState extends State<VideoApp> {
void
initState
()
{
void
initState
()
{
super
.
initState
();
super
.
initState
();
isdata
=
widget
.
message
;
isdata
=
widget
.
message
;
//List<String> parts = isdata.split('/');
// // Find the part that contains the file ID
// String? fileId;
// for (String part in parts) {
// if (part.startsWith('d/')) {
// fileId = part.substring(2);
// print('if Condition: $fileId');
// break;
// }
// }
// if (fileId != null) {
// print('File ID: $fileId');
// } else {
// print('File ID not found in the link');
// }
String
googleDriveFileUrl
=
isdata
;
String
googleDriveFileUrl
=
isdata
;
// Split the URL by '/'
List
<
String
>
urlParts
=
googleDriveFileUrl
.
split
(
'/'
);
List
<
String
>
urlParts
=
googleDriveFileUrl
.
split
(
'/'
);
int
indexOfD
=
urlParts
.
indexOf
(
'd'
);
int
indexOfD
=
urlParts
.
indexOf
(
'd'
);
// The file ID is the part after 'd'
String
fileId
=
urlParts
.
elementAt
(
indexOfD
+
1
);
String
fileId
=
urlParts
.
elementAt
(
indexOfD
+
1
);
//print('Testing : $urlParts[5]');
if
(
kDebugMode
)
{
// The fileId is the first part after the last '/'
//String fileId = urlParts.last;
print
(
'File ID:
$fileId
'
);
print
(
'File ID:
$fileId
'
);
}
videoUrl
=
'https://drive.google.com/uc?export=view&id=
$fileId
'
;
videoUrl
=
'https://drive.google.com/uc?export=view&id=
$fileId
'
;
if
(
kDebugMode
)
{
print
(
'VideoLink :
$videoUrl
'
);
print
(
'VideoLink :
$videoUrl
'
);
}
_controller
=
VideoPlayerController
.
networkUrl
(
Uri
.
parse
(
videoUrl
))
_controller
=
VideoPlayerController
.
networkUrl
(
Uri
.
parse
(
videoUrl
))
..
initialize
().
then
((
_
)
{
..
initialize
().
then
((
_
)
{
setState
(()
{
setState
(()
{
...
@@ -68,6 +44,7 @@ class _VideoAppState extends State<VideoApp> {
...
@@ -68,6 +44,7 @@ class _VideoAppState extends State<VideoApp> {
});
});
});
});
}
}
// void _initializeVideoPlayer() async {
// void _initializeVideoPlayer() async {
// videoUrl =
// videoUrl =
// 'https://drive.google.com/uc?export=view&id=1QVUJ34BKRilfchA_0ppmM3gFIPvYIl7i';
// 'https://drive.google.com/uc?export=view&id=1QVUJ34BKRilfchA_0ppmM3gFIPvYIl7i';
...
...
lib/Screens/Chatboat.dart
View file @
b2fb65e0
...
@@ -386,26 +386,18 @@ class _SpeechSampleAppState extends State<SpeechSampleApp1> {
...
@@ -386,26 +386,18 @@ class _SpeechSampleAppState extends State<SpeechSampleApp1> {
lastError
=
''
;
lastError
=
''
;
final
pauseFor
=
int
.
tryParse
(
_pauseForController
.
text
);
final
pauseFor
=
int
.
tryParse
(
_pauseForController
.
text
);
final
listenFor
=
int
.
tryParse
(
_listenForController
.
text
);
final
listenFor
=
int
.
tryParse
(
_listenForController
.
text
);
final
options
=
SpeechListenOptions
(
final
options
=
SpeechListenOptions
(
onDevice:
_onDevice
,
listenMode:
ListenMode
.
confirmation
,
cancelOnError:
true
,
partialResults:
true
,
autoPunctuation:
true
,
enableHapticFeedback:
true
);
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
(
speech
.
listen
(
onResult
:
resultListener
,
onResult
:
resultListener
,
listenFor:
Duration
(
seconds:
listenFor
??
30
),
listenFor:
Duration
(
seconds:
listenFor
??
30
),
pauseFor
:
Duration
(
seconds:
pauseFor
??
3
),
pauseFor
:
Duration
(
seconds:
pauseFor
??
3
),
localeId
:
_currentLocaleId
,
localeId
:
_currentLocaleId
,
onSoundLevelChange:
soundLevelListener
,
onSoundLevelChange:
soundLevelListener
,
listenOptions:
options
,
listenOptions:
options
,
);
);
setState
(()
{});
setState
(()
{});
}
}
void
stopListening
()
{
void
stopListening
()
{
...
@@ -426,21 +418,18 @@ class _SpeechSampleAppState extends State<SpeechSampleApp1> {
...
@@ -426,21 +418,18 @@ class _SpeechSampleAppState extends State<SpeechSampleApp1> {
// This callback is invoked each time new recognition results are
// This callback is invoked each time new recognition results are
// available after `listen` is called.
// available after `listen` is called.
void
resultListener
(
SpeechRecognitionResult
result
)
{
void
resultListener
(
SpeechRecognitionResult
result
)
{
_logEvent
(
_logEvent
(
'Result listener final:
${result.finalResult}
, words:
${result.recognizedWords}
'
);
'Result listener final:
${result.finalResult}
, words:
${result.recognizedWords}
'
);
if
(
kDebugMode
)
{
if
(
kDebugMode
)
{
print
(
print
(
'
\n
Testing listener final:
${result.finalResult}
, words:
${result.recognizedWords}
'
);
'
\n
Testing listener final:
${result.finalResult}
, words:
${result.recognizedWords}
'
);
}
}
setState
(()
async
{
setState
(()
async
{
//lastWords = '${result.recognizedWords} - ${result.finalResult}';
lastWords
=
result
.
recognizedWords
;
lastWords
=
result
.
recognizedWords
;
if
(
result
.
finalResult
)
{
if
(
result
.
finalResult
)
{
if
(
kDebugMode
)
{
if
(
kDebugMode
)
{
print
(
'Final Result:
$lastWords
'
);
print
(
'Final Result:
$lastWords
'
);
}
}
//await Future.delayed(Duration.zero);
remotevalidate
(
lastWords
);
remotevalidate
(
lastWords
);
}
}
});
});
...
@@ -449,23 +438,20 @@ class _SpeechSampleAppState extends State<SpeechSampleApp1> {
...
@@ -449,23 +438,20 @@ class _SpeechSampleAppState extends State<SpeechSampleApp1> {
void
soundLevelListener
(
double
level
)
{
void
soundLevelListener
(
double
level
)
{
minSoundLevel
=
min
(
minSoundLevel
,
level
);
minSoundLevel
=
min
(
minSoundLevel
,
level
);
maxSoundLevel
=
max
(
maxSoundLevel
,
level
);
maxSoundLevel
=
max
(
maxSoundLevel
,
level
);
// _logEvent('sound level $level: $minSoundLevel - $maxSoundLevel ');
setState
(()
{
setState
(()
{
this
.
level
=
level
;
this
.
level
=
level
;
});
});
}
}
void
errorListener
(
SpeechRecognitionError
error
)
{
void
errorListener
(
SpeechRecognitionError
error
)
{
_logEvent
(
_logEvent
(
'Received error status:
$error
, listening:
${speech.isListening}
'
);
'Received error status:
$error
, listening:
${speech.isListening}
'
);
setState
(()
{
setState
(()
{
lastError
=
'
${error.errorMsg}
-
${error.permanent}
'
;
lastError
=
'
${error.errorMsg}
-
${error.permanent}
'
;
});
});
}
}
void
statusListener
(
String
status
)
{
void
statusListener
(
String
status
)
{
_logEvent
(
_logEvent
(
'Received listener status:
$status
, listening:
${speech.isListening}
'
);
'Received listener status:
$status
, listening:
${speech.isListening}
'
);
setState
(()
{
setState
(()
{
lastStatus
=
status
;
lastStatus
=
status
;
});
});
...
@@ -478,6 +464,7 @@ class _SpeechSampleAppState extends State<SpeechSampleApp1> {
...
@@ -478,6 +464,7 @@ class _SpeechSampleAppState extends State<SpeechSampleApp1> {
// debugPrint(selectedVal);
// debugPrint(selectedVal);
//}
//}
void
_logEvent
(
String
eventDescription
)
{
void
_logEvent
(
String
eventDescription
)
{
if
(
_logEvents
)
{
if
(
_logEvents
)
{
var
eventTime
=
DateTime
.
now
().
toIso8601String
();
var
eventTime
=
DateTime
.
now
().
toIso8601String
();
...
@@ -511,8 +498,7 @@ class _SpeechSampleAppState extends State<SpeechSampleApp1> {
...
@@ -511,8 +498,7 @@ class _SpeechSampleAppState extends State<SpeechSampleApp1> {
if
(
kDebugMode
)
{
if
(
kDebugMode
)
{
print
(
'DataFetching1
$zoneValue
'
);
print
(
'DataFetching1
$zoneValue
'
);
}
}
Data
dataInstance
=
Data
dataInstance
=
Data
(
question:
lastWords
,
answer:
zoneValue
,
image:
'None'
);
Data
(
question:
lastWords
,
answer:
zoneValue
,
image:
'None'
);
await
ftts
.
setLanguage
(
'en-IN'
);
await
ftts
.
setLanguage
(
'en-IN'
);
//await ftts.setLanguage("en-IN");
//await ftts.setLanguage("en-IN");
await
ftts
.
setSpeechRate
(
0.5
);
//speed of speech
await
ftts
.
setSpeechRate
(
0.5
);
//speed of speech
...
@@ -525,20 +511,14 @@ class _SpeechSampleAppState extends State<SpeechSampleApp1> {
...
@@ -525,20 +511,14 @@ class _SpeechSampleAppState extends State<SpeechSampleApp1> {
print
(
await
ftts
.
getVoices
);
print
(
await
ftts
.
getVoices
);
}
}
await
ftts
.
setVoice
({
'name'
:
'Rishi'
,
'locale'
:
'en-IN'
});
await
ftts
.
setVoice
({
'name'
:
'Rishi'
,
'locale'
:
'en-IN'
});
//await ftts.setVoice(ftts.getDefaultVoice());
//await ftts.setIosAudioCategory(
//[IosTextToSpeechAudioCategory.playAndRecord,
//IosTextToSpeechAudioCategoryOptions.defaultToSpeaker],
//);
await
ftts
.
setIosAudioCategory
(
await
ftts
.
setIosAudioCategory
(
IosTextToSpeechAudioCategory
.
playback
,
IosTextToSpeechAudioCategory
.
playback
,
[
[
IosTextToSpeechAudioCategoryOptions
.
allowBluetooth
,
IosTextToSpeechAudioCategoryOptions
.
allowBluetooth
,
IosTextToSpeechAudioCategoryOptions
.
allowBluetoothA2DP
,
IosTextToSpeechAudioCategoryOptions
.
allowBluetoothA2DP
,
IosTextToSpeechAudioCategoryOptions
.
mixWithOthers
,
IosTextToSpeechAudioCategoryOptions
.
mixWithOthers
,
IosTextToSpeechAudioCategoryOptions
.
defaultToSpeaker
IosTextToSpeechAudioCategoryOptions
.
defaultToSpeaker
],
],
IosTextToSpeechAudioMode
.
defaultMode
IosTextToSpeechAudioMode
.
defaultMode
);
);
}
else
{
}
else
{
await
ftts
.
setVoice
({
'name'
:
' Rishi'
,
"locale"
:
"en-IN"
});
await
ftts
.
setVoice
({
'name'
:
' Rishi'
,
"locale"
:
"en-IN"
});
}
}
...
@@ -589,7 +569,6 @@ class _SpeechSampleAppState extends State<SpeechSampleApp1> {
...
@@ -589,7 +569,6 @@ class _SpeechSampleAppState extends State<SpeechSampleApp1> {
setState
(()
{
setState
(()
{
data
=
data
;
data
=
data
;
});
});
lastWords
=
''
;
lastWords
=
''
;
setState
(()
{});
setState
(()
{});
}
}
...
...
lib/Screens/CheckRegistration.dart
View file @
b2fb65e0
...
@@ -109,6 +109,7 @@ class _CheckRegistration extends State<CheckRegistration> {
...
@@ -109,6 +109,7 @@ class _CheckRegistration extends State<CheckRegistration> {
),
),
),
),
),
),
// ElevatedButton(
// ElevatedButton(
// onPressed: () {
// onPressed: () {
// if (_empId.text.isNotEmpty) {
// if (_empId.text.isNotEmpty) {
...
@@ -171,11 +172,11 @@ class _CheckRegistration extends State<CheckRegistration> {
...
@@ -171,11 +172,11 @@ class _CheckRegistration extends State<CheckRegistration> {
_empId
.
text
==
''
;
_empId
.
text
==
''
;
_empId
.
clear
();
_empId
.
clear
();
Constants
(
'Check Registration'
,
'Registered Sucessfully'
)
Constants
(
'Check Registration'
,
'Registered Sucessfully'
)
.
showAlertDialog
(
context
,
fals
e
);
.
showAlertDialog
(
context
,
tru
e
);
}
else
{
}
else
{
Navigator
.
pop
(
context
);
Navigator
.
pop
(
context
);
Constants
(
'Check Registration'
,
'Registation Failed'
)
Constants
(
'Check Registration'
,
'Registation Failed'
)
.
showAlertDialog
(
context
,
fals
e
);
.
showAlertDialog
(
context
,
tru
e
);
file
.
delete
();
file
.
delete
();
//Navigator.of(context).pop();
//Navigator.of(context).pop();
}
}
...
...
lib/Screens/Home.dart
View file @
b2fb65e0
This diff is collapsed.
Click to expand it.
lib/Screens/IssueVideos.dart
View file @
b2fb65e0
...
@@ -50,33 +50,25 @@ class _IssueVideos extends State<IssueVideos> {
...
@@ -50,33 +50,25 @@ class _IssueVideos extends State<IssueVideos> {
Future
<
void
>
loadData
()
async
{
Future
<
void
>
loadData
()
async
{
SharedPreferences
prefs
=
await
SharedPreferences
.
getInstance
();
SharedPreferences
prefs
=
await
SharedPreferences
.
getInstance
();
String
?
userId
=
prefs
.
getString
(
"storeName"
);
String
?
userId
=
prefs
.
getString
(
"storeName"
);
//print(userId);
storesList
=
(
json
.
decode
(
userId
!)
as
List
<
dynamic
>)
storesList
=
(
json
.
decode
(
userId
!)
as
List
<
dynamic
>)
.
map
((
map
)
=>
map
[
'name'
]
as
String
)
.
map
((
map
)
=>
map
[
'name'
]
as
String
)
.
toList
();
.
toList
();
//print(storesList);
int
index
=
storesList
!.
indexWhere
((
item
)
=>
item
.
contains
(
isMeeters
));
int
index
=
storesList
!.
indexWhere
((
item
)
=>
item
.
contains
(
isMeeters
));
setState
(()
{
setState
(()
{
selectedDropdownItem
=
storesList
![
index
];
selectedDropdownItem
=
storesList
![
index
];
//print(selectedDropdownItem);
getData
(
selectedDropdownItem
!);
getData
(
selectedDropdownItem
!);
});
});
}
}
void
getData
(
String
name
)
async
{
void
getData
(
String
name
)
async
{
if
(
kDebugMode
)
{
print
(
"Second Class Hitting"
);
}
bool
isInternetConnected
=
await
Constants
.
checkInternetConnectivity
();
bool
isInternetConnected
=
await
Constants
.
checkInternetConnectivity
();
if
(
isInternetConnected
)
{
if
(
isInternetConnected
)
{
showDialog
(
showDialog
(
context:
context
,
context:
context
,
builder:
(
context
)
{
builder:
(
context
)
{
return
const
Center
(
return
const
Center
(
child:
CircularProgressIndicator
(
color:
Color
.
fromARGB
(
255
,
29
,
20
,
34
)));
child:
CircularProgressIndicator
(
}
color:
Color
.
fromARGB
(
255
,
29
,
20
,
34
)));
);
});
final
respon
=
await
RemoteData
().
getIssueVideos
(
name
);
final
respon
=
await
RemoteData
().
getIssueVideos
(
name
);
Map
<
String
,
dynamic
>
responseMap
=
jsonDecode
(
respon
);
Map
<
String
,
dynamic
>
responseMap
=
jsonDecode
(
respon
);
if
(
kDebugMode
)
{
if
(
kDebugMode
)
{
...
@@ -87,13 +79,10 @@ class _IssueVideos extends State<IssueVideos> {
...
@@ -87,13 +79,10 @@ class _IssueVideos extends State<IssueVideos> {
setState
(()
{
setState
(()
{
notificationslist
;
notificationslist
;
});
});
//Navigator.of(context).pop();
}
else
{
}
else
{
//print('response $responseMap');
issue
=
Issue
.
fromJson
(
responseMap
);
issue
=
Issue
.
fromJson
(
responseMap
);
notificationslist
=
issue
!.
data
;
notificationslist
=
issue
!.
data
;
if
(
notificationslist
!.
isNotEmpty
)
{
if
(
notificationslist
!.
isNotEmpty
)
{
//Navigator.of(context).pop();
setState
(()
{
setState
(()
{
notificationslist
;
notificationslist
;
});
});
...
...
lib/Screens/NavBar.dart
View file @
b2fb65e0
This diff is collapsed.
Click to expand it.
lib/Screens/SignUp.dart
View file @
b2fb65e0
...
@@ -62,6 +62,7 @@ class _SignUpState extends State<SignUp> {
...
@@ -62,6 +62,7 @@ class _SignUpState extends State<SignUp> {
}
}
String
jsonStr
=
json
.
encode
(
normalArray
);
String
jsonStr
=
json
.
encode
(
normalArray
);
Navigator
.
pop
(
context
);
Navigator
.
pop
(
context
);
print
(
'User Level :
$userResponse
.level'
);
Constants
.
saveLoginCredentials
(
userResponse
.
empName
,
_email
.
text
,
Constants
.
saveLoginCredentials
(
userResponse
.
empName
,
_email
.
text
,
jsonStr
,
''
,
userResponse
.
level
,
true
);
jsonStr
,
''
,
userResponse
.
level
,
true
);
Navigator
.
pushReplacement
(
Navigator
.
pushReplacement
(
...
...
lib/Services/RemoteData.dart
View file @
b2fb65e0
This diff is collapsed.
Click to expand it.
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