Commit 03cd7684 by Ramesh Babu Puvvadi

added voice record

parent 5d111162
...@@ -27,7 +27,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" ...@@ -27,7 +27,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.gms.google-services'
android { android {
compileSdkVersion 33 compileSdkVersion 34
ndkVersion flutter.ndkVersion ndkVersion flutter.ndkVersion
compileOptions { compileOptions {
...@@ -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 21 minSdkVersion 23
targetSdkVersion flutter.targetSdkVersion targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
......
...@@ -9,10 +9,16 @@ ...@@ -9,10 +9,16 @@
<!-- <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"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<!-- <uses-permission android:name="android.permission.SEND_SMS"/> --> <!-- <uses-permission android:name="android.permission.SEND_SMS"/> -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<application <application
android:usesCleartextTraffic="true" android:usesCleartextTraffic="true"
android:requestLegacyExternalStorage="true"/> android:requestLegacyExternalStorage="true"/>
......
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
<uses-permission android:name="android.permission.SEND_SMS"/> <uses-permission android:name="android.permission.SEND_SMS"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<queries> <queries>
<intent> <intent>
......
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<!-- <uses-permission android:name="android.permission.CALL_PHONE" /> --> <!-- <uses-permission android:name="android.permission.CALL_PHONE" /> -->
<!-- <uses-permission android:name="android.permission.SEND_SMS"/> --> <!-- <uses-permission android:name="android.permission.SEND_SMS"/> -->
<!-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <!-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
......
buildscript { buildscript {
ext.kotlin_version = '1.7.10' ext.kotlin_version = '1.8.21'
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
......
...@@ -21,6 +21,6 @@ ...@@ -21,6 +21,6 @@
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.0</string> <string>1.0</string>
<key>MinimumOSVersion</key> <key>MinimumOSVersion</key>
<string>11.0</string> <string>12.0</string>
</dict> </dict>
</plist> </plist>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# CocoaPods analytics sends network stats synchronously affecting flutter build latency. # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
platform :ios, '11.0' platform :ios, '12.0'
ENV['COCOAPODS_DISABLE_STATS'] = 'true' ENV['COCOAPODS_DISABLE_STATS'] = 'true'
...@@ -39,8 +39,25 @@ target 'Runner' do ...@@ -39,8 +39,25 @@ target 'Runner' do
# end # end
end end
# post_install do |installer|
# installer.pods_project.targets.each do |target|
# flutter_additional_ios_build_settings(target)
# end
# end
post_install do |installer| post_install do |installer|
installer.pods_project.targets.each do |target| installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target) flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)',
'PERMISSION_CAMERA=1',
'PERMISSION_MICROPHONE=1',
'PERMISSION_PHOTOS=1',
'PERMISSION_MEDIA_LIBRARY=1',
'PERMISSION_STORAGE=1',
]
end
end end
end end
\ No newline at end of file
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
97C146E61CF9000F007C117D /* Project object */ = { 97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 1430; LastUpgradeCheck = 1510;
ORGANIZATIONNAME = ""; ORGANIZATIONNAME = "";
TargetAttributes = { TargetAttributes = {
97C146ED1CF9000F007C117D = { 97C146ED1CF9000F007C117D = {
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "1430" LastUpgradeVersion = "1510"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"
......
// import UIKit
// import Flutter
// @main
// @objc class AppDelegate: FlutterAppDelegate {
// override func application(
// _ application: UIApplication,
// didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
// ) -> Bool {
// GeneratedPluginRegistrant.register(with: self)
// return super.application(application, didFinishLaunchingWithOptions: launchOptions)
// }
// }
import AVFoundation
import UIKit import UIKit
import Flutter import Flutter
@UIApplicationMain @main
@objc class AppDelegate: FlutterAppDelegate { @objc class AppDelegate: FlutterAppDelegate {
override func application( override func application(
_ application: UIApplication, _ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool { ) -> Bool {
// Set up the audio session
let audioSession = AVAudioSession.sharedInstance()
do {
try audioSession.setCategory(.playAndRecord, mode: .default, options: [.defaultToSpeaker, .allowBluetooth])
try audioSession.setActive(true)
} catch {
print("Failed to set up audio session: \(error.localizedDescription)")
}
GeneratedPluginRegistrant.register(with: self) GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions) return super.application(application, didFinishLaunchingWithOptions: launchOptions)
} }
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22154" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22130"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
<scenes> <scenes>
<!--Flutter View Controller--> <!--Flutter View Controller-->
...@@ -14,13 +16,14 @@ ...@@ -14,13 +16,14 @@
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/> <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides> </layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC"> <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/> <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view> </view>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects> </objects>
<point key="canvasLocation" x="121" y="-2"/>
</scene> </scene>
</scenes> </scenes>
</document> </document>
...@@ -33,14 +33,26 @@ ...@@ -33,14 +33,26 @@
<key>NSAllowsArbitraryLoads</key> <key>NSAllowsArbitraryLoads</key>
<true/> <true/>
</dict> </dict>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>tel</string>
</array>
<key>NSCameraUsageDescription</key> <key>NSCameraUsageDescription</key>
<string>Camera access is required to capture</string> <string>Camera access is required to capture</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>We need access to add photos to your library.</string>
<key>NSMicrophoneUsageDescription</key> <key>NSMicrophoneUsageDescription</key>
<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> <key>NSSpeechRecognitionUsageDescription</key>
<string>Speech recognition allows you to use text-to-speech and speech</string> <string>Speech recognition allows you to use text-to-speech and speech</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>We need access to your location to provide better services.</string>
<key>NSContactsUsageDescription</key>
<string>This app requires access to phone calls to function properly.</string>
<key>REVERSED_CLIENT_ID</key> <key>REVERSED_CLIENT_ID</key>
<string>d6689d068c6b4290aba903</string> <string>d6689d068c6b4290aba903</string>
......
class Store {
final String region;
final String storename;
Store({required this.region, required this.storename});
factory Store.fromJson(Map<String, dynamic> json) {
return Store(
region: json['region'] ?? 'Unknown Region',
storename: json['storename'] ?? 'Unknown Store',
);
}
}
...@@ -43,16 +43,20 @@ class UserResponse { ...@@ -43,16 +43,20 @@ class UserResponse {
class Store { class Store {
Store({ Store({
required this.region,
required this.storename, required this.storename,
}); });
String storename; String storename;
String region;
factory Store.fromJson(Map<String, dynamic> json) => Store( factory Store.fromJson(Map<String, dynamic> json) => Store(
storename: json["storename"], storename: json["storename"],
region: json["region"],
); );
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() => {
"storename": storename, "storename": storename,
"region": region,
}; };
} }
...@@ -74,6 +74,16 @@ class _CheckList extends State<CheckList> { ...@@ -74,6 +74,16 @@ class _CheckList extends State<CheckList> {
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(
'FootFall Verification', 'FootFall Verification',
style: Constants.fontStyle, style: Constants.fontStyle,
......
...@@ -88,13 +88,11 @@ class _CheckRegistration extends State<CheckRegistration> { ...@@ -88,13 +88,11 @@ class _CheckRegistration extends State<CheckRegistration> {
//getVideo(_empId.text); //getVideo(_empId.text);
getValidReg(_empId.text); getValidReg(_empId.text);
} else { } else {
Constants('Check Registration', 'Enter emp id') Constants('Check Registration', 'Enter emp id').showAlertDialog(context, false);
.showAlertDialog(context, false);
} }
}, },
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: backgroundColor: Colors.transparent, // make the button transparent
Colors.transparent, // make the button transparent
elevation: 0, // remove the button's shadow elevation: 0, // remove the button's shadow
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
...@@ -156,7 +154,6 @@ class _CheckRegistration extends State<CheckRegistration> { ...@@ -156,7 +154,6 @@ class _CheckRegistration extends State<CheckRegistration> {
File file = File(image!.path); File file = File(image!.path);
//String filecontents = await fileToString(file); //String filecontents = await fileToString(file);
String fileName = file.path.split(Platform.pathSeparator).last; String fileName = file.path.split(Platform.pathSeparator).last;
final response = final response =
await RemoteData().UploadEmpVideo(file, fileName, empid, store); await RemoteData().UploadEmpVideo(file, fileName, empid, store);
Map<String, dynamic> responseMap = jsonDecode(response); Map<String, dynamic> responseMap = jsonDecode(response);
...@@ -165,7 +162,9 @@ class _CheckRegistration extends State<CheckRegistration> { ...@@ -165,7 +162,9 @@ class _CheckRegistration extends State<CheckRegistration> {
String message = "$responseMap"; String message = "$responseMap";
// Extract the status value from the message // Extract the status value from the message
String status = message.split('status:').last.split('}').first.trim(); String status = message.split('status:').last.split('}').first.trim();
if (kDebugMode) {
print(status); print(status);
}
if (status == 'Success') { if (status == 'Success') {
Navigator.pop(context); Navigator.pop(context);
file.delete(); file.delete();
......
...@@ -19,11 +19,37 @@ class Constants { ...@@ -19,11 +19,37 @@ class Constants {
this.color = color; this.color = color;
} }
static const TextStyle LoginfontStyle = TextStyle(
fontFamily: 'Poppins',
fontSize: 18,
fontWeight: FontWeight.normal,
color: Colors.grey);
static const TextStyle HeaderStyle = TextStyle(
fontFamily: 'Poppins',
fontSize: 18,
fontWeight: FontWeight.w400,
color: Colors.black);
static const TextStyle fontStyle = TextStyle( static const TextStyle fontStyle = TextStyle(
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
color: Colors.white); color: Colors.white);
static const TextStyle speeachfontStyle = TextStyle(
fontFamily: 'Poppins',
fontSize: 16,
fontWeight: FontWeight.normal,
color: Colors.white);
static const TextStyle LoginbuttonsfontStyle = TextStyle(
fontFamily: 'Poppins',
fontSize: 16,
fontWeight: FontWeight.normal,
color: Color.fromARGB(255, 12, 18, 22),
);
static const TextStyle headerfontStyle = TextStyle( static const TextStyle headerfontStyle = TextStyle(
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 16, fontSize: 16,
...@@ -123,17 +149,11 @@ class Constants { ...@@ -123,17 +149,11 @@ class Constants {
); );
static const TextStyle unregisterfontStyle = TextStyle( static const TextStyle unregisterfontStyle = TextStyle(
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 14, fontSize: 16,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
color: Colors.red, color: Colors.red,
); );
static const TextStyle LoginbuttonsfontStyle = TextStyle(
fontFamily: 'Poppins',
fontSize: 16,
fontWeight: FontWeight.normal,
color: Color.fromARGB(255, 12, 18, 22),
);
static const TextStyle LoginuseridStyle = TextStyle( static const TextStyle LoginuseridStyle = TextStyle(
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 16, fontSize: 16,
...@@ -208,8 +228,8 @@ class Constants { ...@@ -208,8 +228,8 @@ class Constants {
prefs.setString('userId', username); prefs.setString('userId', username);
prefs.setString('empId', empid); prefs.setString('empId', empid);
prefs.setString('stores_list', storeslist); prefs.setString('stores_list', storeslist);
prefs.setString('storeName', storeName);
prefs.setString('access', accessLevel); prefs.setString('access', accessLevel);
//prefs.setString('storeName', storeName);
prefs.setBool('islogged', validate); prefs.setBool('islogged', validate);
} }
......
...@@ -60,7 +60,7 @@ class _DepartmentSearch extends State<DepartmentSearch> { ...@@ -60,7 +60,7 @@ class _DepartmentSearch extends State<DepartmentSearch> {
Future<void> loadData() async { Future<void> loadData() async {
SharedPreferences prefs = await SharedPreferences.getInstance(); SharedPreferences prefs = await SharedPreferences.getInstance();
String? userId = prefs.getString("stores_list"); String? userId = prefs.getString("storeName");
empid = prefs.getString('empId')!; empid = prefs.getString('empId')!;
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)
......
...@@ -41,7 +41,7 @@ class _EmployeeReport extends State<EmployeeReport> { ...@@ -41,7 +41,7 @@ class _EmployeeReport extends State<EmployeeReport> {
// Constants.showLoader(context); // Constants.showLoader(context);
//}); //});
SharedPreferences prefs = await SharedPreferences.getInstance(); SharedPreferences prefs = await SharedPreferences.getInstance();
String? userId = prefs.getString("stores_list"); String? userId = prefs.getString("storeName");
if (kDebugMode) { if (kDebugMode) {
print(userId); print(userId);
} }
...@@ -414,15 +414,14 @@ class _EmployeeReport extends State<EmployeeReport> { ...@@ -414,15 +414,14 @@ class _EmployeeReport extends State<EmployeeReport> {
// color: Color.fromARGB(255, 173, 57, 230), // color: Color.fromARGB(255, 173, 57, 230),
// )); // ));
// }); // });
//8919290229
Map<String, dynamic> body = { Map<String, dynamic> body = {
'STORE': selectedDropdownItem!, 'STORE': selectedDropdownItem!,
}; };
dynamic response = await _apiServices.getPostApiResponse( dynamic response = await _apiServices.getPostApiResponse('http://vaman.plutokm.com/regstatusreport', body);
'http://vaman.plutokm.com/regstatusreport', body);
print("response is ----------->$response"); print("response is ----------->$response");
final respon = await RemoteData().getUserReport(selectedDropdownItem); final res = await RemoteData().getUserReport(selectedDropdownItem);
Map<String, dynamic> responseMap = jsonDecode(respon); Map<String, dynamic> responseMap = jsonDecode(res);
empReport = EmpReport.fromJson(responseMap); empReport = EmpReport.fromJson(responseMap);
empreportlist = empReport!.data; empreportlist = empReport!.data;
//Constants.dismissAlertDialog1(context); //Constants.dismissAlertDialog1(context);
...@@ -433,7 +432,7 @@ class _EmployeeReport extends State<EmployeeReport> { ...@@ -433,7 +432,7 @@ class _EmployeeReport extends State<EmployeeReport> {
alert.rEGSTATUS == 'Not Registered' || alert.rEGSTATUS == 'Not Registered' ||
alert.rEGSTATUS == 'NOT REGISTERED') alert.rEGSTATUS == 'NOT REGISTERED')
.toList(); .toList();
unregistered = filteredreortlist!.length; unregistered= filteredreortlist!.length;
filteredreortlist = empReport!.data filteredreortlist = empReport!.data
?.where((alert) => alert.rEGSTATUS == 'Registered') ?.where((alert) => alert.rEGSTATUS == 'Registered')
.toList(); .toList();
...@@ -442,8 +441,7 @@ class _EmployeeReport extends State<EmployeeReport> { ...@@ -442,8 +441,7 @@ class _EmployeeReport extends State<EmployeeReport> {
}); });
} else { } else {
Navigator.of(context).pop(); Navigator.of(context).pop();
Constants('Employee Report', 'Please check your internet connection') Constants('Employee Report', 'Please check your internet connection').showAlertDialog(context, false);
.showAlertDialog(context, false);
} }
} }
} }
...@@ -62,7 +62,7 @@ class employeeStatus extends State<EmployeeStatus> { ...@@ -62,7 +62,7 @@ class employeeStatus extends State<EmployeeStatus> {
Future<void> loadData() async { Future<void> loadData() async {
SharedPreferences prefs = await SharedPreferences.getInstance(); SharedPreferences prefs = await SharedPreferences.getInstance();
String? userId = prefs.getString("stores_list"); String? userId = prefs.getString("storeName");
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();
......
import 'dart:convert'; import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
...@@ -85,7 +86,7 @@ class _FootFall extends State<FootFall> { ...@@ -85,7 +86,7 @@ class _FootFall extends State<FootFall> {
Future<void> loadData() async { Future<void> loadData() async {
SharedPreferences prefs = await SharedPreferences.getInstance(); SharedPreferences prefs = await SharedPreferences.getInstance();
String? userId = prefs.getString("stores_list"); String? userId = prefs.getString("storeName");
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();
...@@ -154,10 +155,14 @@ class _FootFall extends State<FootFall> { ...@@ -154,10 +155,14 @@ class _FootFall extends State<FootFall> {
), ),
body: GestureDetector( body: GestureDetector(
onForcePressUpdate: (details) { onForcePressUpdate: (details) {
if (kDebugMode) {
print('force press update'); print('force press update');
}
}, },
onHorizontalDragStart: (details) { onHorizontalDragStart: (details) {
if (kDebugMode) {
print('force press start'); print('force press start');
}
}, },
onHorizontalDragDown: (details) {}, onHorizontalDragDown: (details) {},
child: FutureBuilder<Foot?>( child: FutureBuilder<Foot?>(
...@@ -216,6 +221,7 @@ class _FootFall extends State<FootFall> { ...@@ -216,6 +221,7 @@ class _FootFall extends State<FootFall> {
), ),
TextFormField( TextFormField(
controller: _dateTime, controller: _dateTime,
readOnly: true,
onTap: () => '', onTap: () => '',
decoration: InputDecoration( decoration: InputDecoration(
contentPadding: const EdgeInsets.symmetric( contentPadding: const EdgeInsets.symmetric(
......
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';
...@@ -40,21 +38,18 @@ class _IssueVideos extends State<IssueVideos> { ...@@ -40,21 +38,18 @@ class _IssueVideos extends State<IssueVideos> {
if (kDebugMode) { if (kDebugMode) {
print('Granted'); print('Granted');
} }
// You have the permission, you can now access storage.
} else if (status.isDenied) { } else if (status.isDenied) {
if (kDebugMode) { if (kDebugMode) {
print('Not Granted'); print('Not Granted');
} }
// The user denied the permission. You can explain why you need it and request again.
} else if (status.isPermanentlyDenied) { } else if (status.isPermanentlyDenied) {
// The user permanently denied the permission. You can open the app settings to let the user manually enable it.
openAppSettings(); openAppSettings();
} }
} }
Future<void> loadData() async { Future<void> loadData() async {
SharedPreferences prefs = await SharedPreferences.getInstance(); SharedPreferences prefs = await SharedPreferences.getInstance();
String? userId = prefs.getString("stores_list"); String? userId = prefs.getString("storeName");
//print(userId); //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)
...@@ -82,14 +77,12 @@ class _IssueVideos extends State<IssueVideos> { ...@@ -82,14 +77,12 @@ class _IssueVideos extends State<IssueVideos> {
child: CircularProgressIndicator( child: CircularProgressIndicator(
color: Color.fromARGB(255, 29, 20, 34))); color: Color.fromARGB(255, 29, 20, 34)));
}); });
//Response data;
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) {
print(responseMap['data']); print(responseMap['data']);
} }
if (responseMap['data'] == null || if (responseMap['data'] == null || !(responseMap['data'] as List).isNotEmpty) {
!(responseMap['data'] as List).isNotEmpty) {
notificationslist = []; notificationslist = [];
setState(() { setState(() {
notificationslist; notificationslist;
...@@ -107,7 +100,9 @@ class _IssueVideos extends State<IssueVideos> { ...@@ -107,7 +100,9 @@ class _IssueVideos extends State<IssueVideos> {
} }
} }
Navigator.of(context).pop(); Navigator.of(context).pop();
} 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}'); // }shareImageWithText(String Text, 'Reason: ${filteredAlerts![itemIndex].alertReason}\nCamera:${filteredAlerts![itemIndex].cameraName}\nTime:${filteredAlerts![itemIndex].alertTime}\nID:${filteredAlerts![itemIndex].notificationID}');
...@@ -160,6 +155,7 @@ class _IssueVideos extends State<IssueVideos> { ...@@ -160,6 +155,7 @@ class _IssueVideos extends State<IssueVideos> {
//crossAxisAlignment: CrossAxisAlignment.center, //crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
// SizedBox( // SizedBox(
// width: double.infinity, // width: double.infinity,
// //height: double.infinity, // //height: double.infinity,
...@@ -180,6 +176,7 @@ class _IssueVideos extends State<IssueVideos> { ...@@ -180,6 +176,7 @@ class _IssueVideos extends State<IssueVideos> {
// }).toList(), // }).toList(),
// ), // ),
// ), // ),
Container( Container(
padding: const EdgeInsets.symmetric(horizontal: 10.0), padding: const EdgeInsets.symmetric(horizontal: 10.0),
decoration: BoxDecoration( decoration: BoxDecoration(
......
...@@ -17,7 +17,6 @@ class LoginPage extends StatelessWidget { ...@@ -17,7 +17,6 @@ class LoginPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
//resizeToAvoidBottomPadding: false,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
height: MediaQuery.of(context).size.height, height: MediaQuery.of(context).size.height,
...@@ -28,7 +27,6 @@ class LoginPage extends StatelessWidget { ...@@ -28,7 +27,6 @@ class LoginPage extends StatelessWidget {
colors: [ colors: [
Color.fromARGB(255, 125, 50, 253), Color.fromARGB(255, 125, 50, 253),
Color.fromARGB(255, 125, 50, 253), Color.fromARGB(255, 125, 50, 253),
// Color.fromARGB(255, 157, 55, 237)
], ],
), ),
), ),
...@@ -36,16 +34,16 @@ class LoginPage extends StatelessWidget { ...@@ -36,16 +34,16 @@ class LoginPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
const SizedBox(height: 30), const SizedBox(height: 30),
// GifImage( //GifImage(
// image: AssetImage('assets/sample.gif'), // Replace with your actual GIF image path // image: AssetImage('assets/sample.gif'), // Replace with your actual GIF image path
// ), //),
GifView.asset( GifView.asset(
'assets/images/login.gif', 'assets/images/login.gif',
height: 350, height: 350,
width: 350, width: 350,
frameRate: 30, // default is 15 FPS frameRate: 30, //default is 15 FPS
), ),
// Image.asset( //Image.asset(
// 'assets/images/login_header_image.png', // 'assets/images/login_header_image.png',
// height: 350, // height: 350,
// width: 350, // width: 350,
...@@ -91,7 +89,6 @@ class LoginFormState extends State<LoginForm> { ...@@ -91,7 +89,6 @@ class LoginFormState extends State<LoginForm> {
Future<void> login(String email, String pass) async { Future<void> login(String email, String pass) async {
//Constants.showAlertDialog1(context); //Constants.showAlertDialog1(context);
//final DeviceInfoPlugin deviceInfo = DeviceInfoPlugin(); //final DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
// String? deviceId; // String? deviceId;
// if (Platform.isAndroid) { // if (Platform.isAndroid) {
// const androidId = AndroidId(); // const androidId = AndroidId();
...@@ -111,6 +108,9 @@ class LoginFormState extends State<LoginForm> { ...@@ -111,6 +108,9 @@ class LoginFormState extends State<LoginForm> {
// Handle success status // Handle success status
final userResponse = userResponseFromJson(response); final userResponse = userResponseFromJson(response);
if (userResponse.status.contains('Success')) { if (userResponse.status.contains('Success')) {
if (kDebugMode) {
print('Login Response $responseMap');
}
List<Map<String, dynamic>>? normalArray; List<Map<String, dynamic>>? normalArray;
if (userResponse.stores.isNotEmpty) { if (userResponse.stores.isNotEmpty) {
normalArray = userResponse.stores.map((item) { normalArray = userResponse.stores.map((item) {
...@@ -119,11 +119,18 @@ class LoginFormState extends State<LoginForm> { ...@@ -119,11 +119,18 @@ class LoginFormState extends State<LoginForm> {
}; };
}).toList(); }).toList();
} }
String jsonStr = json.encode(normalArray); String str = json.encode(normalArray);
if (kDebugMode) {
print('Testing Stores List : str');
}
String jsonStr = json.encode(userResponse.stores);
if (kDebugMode) {
print('Final Data $jsonStr');
}
Navigator.pop(context); Navigator.pop(context);
//print(userResponse.level); //print(userResponse.level);
Constants.saveLoginCredentials(userResponse.empName, _email.text, Constants.saveLoginCredentials(userResponse.empName, _email.text,
jsonStr, '', userResponse.level, true); jsonStr, str, userResponse.level, true);
Navigator.pushReplacement( Navigator.pushReplacement(
context, context,
MaterialPageRoute( MaterialPageRoute(
...@@ -174,7 +181,7 @@ class LoginFormState extends State<LoginForm> { ...@@ -174,7 +181,7 @@ class LoginFormState extends State<LoginForm> {
height: 50, height: 50,
child: TextFormField( child: TextFormField(
cursorColor: const Color.fromARGB(255, 125, 50, 253), cursorColor: const Color.fromARGB(255, 125, 50, 253),
style: Constants.fontStyle, style: Constants.LoginfontStyle,
controller: _email, controller: _email,
//obscureText: true, //obscureText: true,
decoration: InputDecoration( decoration: InputDecoration(
...@@ -188,7 +195,6 @@ class LoginFormState extends State<LoginForm> { ...@@ -188,7 +195,6 @@ class LoginFormState extends State<LoginForm> {
// Align the label text to the left by specifying the padding // Align the label text to the left by specifying the padding
//contentPadding: const EdgeInsets.all(15.0), //contentPadding: const EdgeInsets.all(15.0),
// Align the suffix icon to the right by wrapping it in a Row // Align the suffix icon to the right by wrapping it in a Row
suffix: Row( suffix: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
...@@ -202,7 +208,6 @@ class LoginFormState extends State<LoginForm> { ...@@ -202,7 +208,6 @@ class LoginFormState extends State<LoginForm> {
) )
], ],
), ),
enabledBorder: const OutlineInputBorder( enabledBorder: const OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: Colors.grey, // Set the desired color here color: Colors.grey, // Set the desired color here
...@@ -216,6 +221,7 @@ class LoginFormState extends State<LoginForm> { ...@@ -216,6 +221,7 @@ class LoginFormState extends State<LoginForm> {
borderRadius: BorderRadius.circular(5.0), borderRadius: BorderRadius.circular(5.0),
), ),
), ),
//style: const TextStyle(color: Colors.black),
), ),
), ),
const SizedBox(height: 15), const SizedBox(height: 15),
...@@ -223,7 +229,7 @@ class LoginFormState extends State<LoginForm> { ...@@ -223,7 +229,7 @@ class LoginFormState extends State<LoginForm> {
height: 50, height: 50,
child: TextFormField( child: TextFormField(
cursorColor: const Color.fromARGB(255, 125, 50, 253), cursorColor: const Color.fromARGB(255, 125, 50, 253),
style: Constants.fontStyle, style: Constants.LoginfontStyle,
controller: _pass, controller: _pass,
obscureText: true, obscureText: true,
decoration: InputDecoration( decoration: InputDecoration(
...@@ -297,7 +303,8 @@ class LoginFormState extends State<LoginForm> { ...@@ -297,7 +303,8 @@ class LoginFormState extends State<LoginForm> {
}); });
login(_email.text, _pass.text); login(_email.text, _pass.text);
} else { } else {
Constants.dialogMessage(context, 'Login', 'Check your internetconnection'); Constants.dialogMessage(
context, 'Login', 'Check your internetconnection');
} }
} }
}, },
...@@ -308,7 +315,9 @@ class LoginFormState extends State<LoginForm> { ...@@ -308,7 +315,9 @@ class LoginFormState extends State<LoginForm> {
RoundedRectangleBorder( RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0), borderRadius: BorderRadius.circular(5.0),
//side: BorderSide(color: Colors.red) //side: BorderSide(color: Colors.red)
))), )
)
),
child: const Text( child: const Text(
'LOGIN', 'LOGIN',
style: Constants.fontStyle, style: Constants.fontStyle,
......
...@@ -44,7 +44,7 @@ class _NotificationReport extends State<NotificationReport> { ...@@ -44,7 +44,7 @@ class _NotificationReport extends State<NotificationReport> {
Future<void> loadData() async { Future<void> loadData() async {
SharedPreferences prefs = await SharedPreferences.getInstance(); SharedPreferences prefs = await SharedPreferences.getInstance();
String? userId = prefs.getString("stores_list"); String? userId = prefs.getString("storeName");
//print(userId); //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)
...@@ -249,6 +249,7 @@ class _NotificationReport extends State<NotificationReport> { ...@@ -249,6 +249,7 @@ class _NotificationReport extends State<NotificationReport> {
), ),
TextFormField( TextFormField(
controller: _dateTime1, controller: _dateTime1,
readOnly: true,
//onTap: () => print('Date Picker'), //onTap: () => print('Date Picker'),
decoration: InputDecoration( decoration: InputDecoration(
contentPadding: contentPadding:
......
...@@ -20,6 +20,7 @@ class Review extends StatefulWidget { ...@@ -20,6 +20,7 @@ class Review extends StatefulWidget {
//const Review({super.key}); //const Review({super.key});
final String message; final String message;
final String selecteddate; final String selecteddate;
const Review({super.key, required this.message, required this.selecteddate}); const Review({super.key, required this.message, required this.selecteddate});
@override @override
...@@ -91,7 +92,7 @@ class _Review extends State<Review> { ...@@ -91,7 +92,7 @@ class _Review extends State<Review> {
Future<void> loadData() async { Future<void> loadData() async {
SharedPreferences prefs = await SharedPreferences.getInstance(); SharedPreferences prefs = await SharedPreferences.getInstance();
String? userId = prefs.getString("stores_list"); String? userId = prefs.getString("storeName");
//print(userId); //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)
...@@ -217,10 +218,6 @@ class _Review extends State<Review> { ...@@ -217,10 +218,6 @@ class _Review extends State<Review> {
} }
} }
//ebe5f6
//f772d1
//c972f2
Color _buttonColor1 = const Color.fromARGB(255, 235, 229, 246); Color _buttonColor1 = const Color.fromARGB(255, 235, 229, 246);
Color _buttonColor2 = const Color.fromARGB(255, 235, 229, 246); Color _buttonColor2 = const Color.fromARGB(255, 235, 229, 246);
Color _buttonColor3 = const Color.fromARGB(255, 235, 229, 246); Color _buttonColor3 = const Color.fromARGB(255, 235, 229, 246);
...@@ -236,7 +233,6 @@ class _Review extends State<Review> { ...@@ -236,7 +233,6 @@ class _Review extends State<Review> {
carouselKey = UniqueKey(); carouselKey = UniqueKey();
}); });
getData(imp); getData(imp);
//Constants.showAlertDialog1(context);
setState(() { setState(() {
black = Colors.white; black = Colors.white;
black1 = Colors.black; black1 = Colors.black;
...@@ -262,8 +258,6 @@ class _Review extends State<Review> { ...@@ -262,8 +258,6 @@ class _Review extends State<Review> {
carouselKey = UniqueKey(); carouselKey = UniqueKey();
}); });
getData(imp); getData(imp);
//carouselKey = UniqueKey();
//Constants.showAlertDialog1(context);
setState(() { setState(() {
black = Colors.black; black = Colors.black;
black1 = Colors.white; black1 = Colors.white;
...@@ -471,6 +465,7 @@ class _Review extends State<Review> { ...@@ -471,6 +465,7 @@ class _Review extends State<Review> {
), ),
TextFormField( TextFormField(
controller: _dateTime, controller: _dateTime,
readOnly: true,
//onTap: () => print('Date Picker'), //onTap: () => print('Date Picker'),
decoration: InputDecoration( decoration: InputDecoration(
contentPadding: contentPadding:
...@@ -760,7 +755,6 @@ class _Review extends State<Review> { ...@@ -760,7 +755,6 @@ class _Review extends State<Review> {
} else { } else {
isvisible = true; isvisible = true;
} }
return Padding( return Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
child: Card( child: Card(
...@@ -1150,7 +1144,7 @@ class _Review extends State<Review> { ...@@ -1150,7 +1144,7 @@ class _Review extends State<Review> {
context) context)
.size .size
.width / .width /
3.2, 3.5,
child: child:
const Center( const Center(
child: child:
...@@ -1221,7 +1215,7 @@ class _Review extends State<Review> { ...@@ -1221,7 +1215,7 @@ class _Review extends State<Review> {
context) context)
.size .size
.width / .width /
1.3, 1.4,
child: child:
const Center( const Center(
child: child:
...@@ -1287,7 +1281,6 @@ class _Review extends State<Review> { ...@@ -1287,7 +1281,6 @@ class _Review extends State<Review> {
userId!, userId!,
feed, feed,
comments); comments);
// print('GetAction: $res');
if (res == 200) { if (res == 200) {
setState(() { setState(() {
if (feed == 'yes' || feed == 'no' || feed == 'audit') { if (feed == 'yes' || feed == 'no' || feed == 'audit') {
...@@ -1296,20 +1289,18 @@ class _Review extends State<Review> { ...@@ -1296,20 +1289,18 @@ class _Review extends State<Review> {
} }
Constants('Review', 'Sucess').showAlertDialog(context, false); Constants('Review', 'Sucess').showAlertDialog(context, false);
}); });
} else {
Constants('Review', res.toString()).showAlertDialog(context, false);
} }
} }
Future<void> shareImageWithText(String url, String textToShare) async { Future<void> shareImageWithText(String url, String textToShare) async {
final box = context.findRenderObject() as RenderBox?; final box = context.findRenderObject() as RenderBox?;
//print('inside share function');
final response = await get(Uri.parse(url)); final response = await get(Uri.parse(url));
//print('got response:$response');
//final bytes = response.bodyBytes;
final Directory temp = await getTemporaryDirectory(); final Directory temp = await getTemporaryDirectory();
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',
...@@ -1365,7 +1356,6 @@ class _Review extends State<Review> { ...@@ -1365,7 +1356,6 @@ class _Review extends State<Review> {
padding: EdgeInsets.only(left: 10), padding: EdgeInsets.only(left: 10),
child: Text('Submit'), child: Text('Submit'),
), ),
//child: const Text('Submit'),
), ),
], ],
); );
......
...@@ -117,14 +117,15 @@ class _SignUpState extends State<SignUp> { ...@@ -117,14 +117,15 @@ class _SignUpState extends State<SignUp> {
// width: 300, // width: 300,
// height: 400, // height: 400,
// ), // ),
TextField( TextFormField(
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
controller: _email, controller: _email,
scrollPadding: const EdgeInsets.all(100.0), //scrollPadding: const EdgeInsets.all(100.0),
decoration: const InputDecoration( decoration: const InputDecoration(
hintText: 'UserId', hintText: 'UserId',
border: OutlineInputBorder(), border: OutlineInputBorder(),
), ),
style: const TextStyle(color: Colors.black),
), ),
const SizedBox( const SizedBox(
height: 20, height: 20,
...@@ -138,6 +139,7 @@ class _SignUpState extends State<SignUp> { ...@@ -138,6 +139,7 @@ class _SignUpState extends State<SignUp> {
hintText: 'Password', hintText: 'Password',
border: OutlineInputBorder(), border: OutlineInputBorder(),
), ),
style: const TextStyle(color: Colors.black),
), ),
const SizedBox( const SizedBox(
height: 30, height: 30,
......
...@@ -44,7 +44,9 @@ class _SplashScreenState extends State<SplashScreen> { ...@@ -44,7 +44,9 @@ class _SplashScreenState extends State<SplashScreen> {
message: 'success', message: 'success',
))); )));
} else { } else {
//print('else condition :${isLoggedIn}'); if (kDebugMode) {
print('else condition : $isLoggedIn');
}
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
context, context,
MaterialPageRoute(builder: (context) => const LoginPage()), MaterialPageRoute(builder: (context) => const LoginPage()),
...@@ -91,5 +93,5 @@ class _SplashScreenState extends State<SplashScreen> { ...@@ -91,5 +93,5 @@ class _SplashScreenState extends State<SplashScreen> {
print(info.utsname.machine); // "iPhone15,2" print(info.utsname.machine); // "iPhone15,2"
print(info.utsname.version); // "iPhone 14 Pro" print(info.utsname.version); // "iPhone 14 Pro"
} }
} */ }*/
} }
import 'dart:convert';
import 'package:flutter/material.dart';
class StoreSelector extends StatefulWidget {
@override
_StoreSelectorState createState() => _StoreSelectorState();
}
class _StoreSelectorState extends State<StoreSelector> {
List<Store> stores = [];
List<String> regions = [];
List<String> storeNames = [];
String? selectedRegion;
String? selectedStore;
@override
void initState() {
super.initState();
fetchStores();
}
void fetchStores() {
const jsonData = '''
{
"STORES": [
{"region": "KARNATAKA", "storename": "KLM JAYANAGAR"},
{"region": "KARNATAKA", "storename": "KLM HSR"},
{"region": "ANDHRA PRADESH", "storename": "KLM GAJUWAKA"},
{"region": "TELANGANA", "storename": "KLM AMEERPET"},
{"region": "TELANGANA", "storename": "KLM DILSUKHNAGAR"},
{"region": "TELANGANA", "storename": "KLM KHAMMAM"},
{"region": "TELANGANA", "storename": "KLM AS RAO NAGAR"},
{"region": "TELANGANA", "storename": "KLM BODUPPAL"},
{"region": "ANDHRA PRADESH", "storename": "KLM BHIMAVARAM"},
{"region": "ANDHRA PRADESH", "storename": "KLM NELLORE"},
{"region": "ANDHRA PRADESH", "storename": "KLM VIZAG"},
{"region": "TELANGANA", "storename": "KLM VANASTHALIPURAM"},
{"region": "KARNATAKA", "storename": "KLM MARATHAHALLI"},
{"region": "TELANGANA", "storename": "KLM KUKATPALLY"},
{"region": "TELANGANA", "storename": "KLM PATNY"},
{"region": "TELANGANA", "storename": "KLM SUCHITRA"},
{"region": "TELANGANA", "storename": "MANDIR BANJARA HILLS"},
{"region": "TELANGANA", "storename": "KM-NEW-AMPT"},
{"region": "TELANGANA", "storename": "KM NEW PATNY"}
]
}
''';
final Map<String, dynamic> jsonResponse = json.decode(jsonData);
stores = (jsonResponse['STORES'] as List)
.map((data) => Store.fromJson(data))
.toList();
// Get unique regions
regions = stores.map((store) => store.region).toSet().toList();
setState(() {});
}
void updateStoreNames(String region) {
storeNames = stores
.where((store) => store.region == region)
.map((store) => store.storename)
.toList();
selectedStore = null; // Reset the selected store
setState(() {});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Store Selector'),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
DropdownButton<String>(
hint: Text('Select Region'),
value: selectedRegion,
isExpanded: true,
onChanged: (newValue) {
setState(() {
selectedRegion = newValue;
updateStoreNames(newValue!);
});
},
items: regions.map((region) {
return DropdownMenuItem<String>(
value: region,
child: Text(region),
);
}).toList(),
),
SizedBox(height: 20),
DropdownButton<String>(
hint: Text('Select Store'),
value: selectedStore,
isExpanded: true,
onChanged: (newValue) {
setState(() {
selectedStore = newValue;
});
},
items: storeNames.map((store) {
return DropdownMenuItem<String>(
value: store,
child: Text(store),
);
}).toList(),
),
],
),
),
);
}
}
class Store {
final String region;
final String storename;
Store({required this.region, required this.storename});
factory Store.fromJson(Map<String, dynamic> json) {
return Store(
region: json['region'],
storename: json['storename'],
);
}
}
\ No newline at end of file
...@@ -98,8 +98,8 @@ class _SurvellianceViewState extends State<SurvellianceView> { ...@@ -98,8 +98,8 @@ class _SurvellianceViewState extends State<SurvellianceView> {
initilize(videoUrl); initilize(videoUrl);
} }
void getUpdate1(String Id, String comment) async { void getUpdate1(String id, String comment) async {
final respon = await RemoteData().getUpdateIssueVideos1(Id, comment); final respon = await RemoteData().getUpdateIssueVideos1(id, comment);
Map<String, dynamic> responseMap = jsonDecode(respon); Map<String, dynamic> responseMap = jsonDecode(respon);
Navigator.of(context).pop(); Navigator.of(context).pop();
hideKeyboard(context); hideKeyboard(context);
...@@ -136,28 +136,29 @@ class _SurvellianceViewState extends State<SurvellianceView> { ...@@ -136,28 +136,29 @@ class _SurvellianceViewState extends State<SurvellianceView> {
} }
Future<void> shareImageWithText(String textToShare, String desc) async { Future<void> shareImageWithText(String textToShare, String desc) async {
List<String> paths = [ // List<String> paths = [
textToShare // textToShare
]; // If you're sharing text, you might not need this list // ]; // If you're sharing text, you might not need this list
final box = context.findRenderObject() as RenderBox?; final box = context.findRenderObject() as RenderBox?;
if (Platform.isAndroid) { if (Platform.isAndroid) {
if (kDebugMode) {
print('Android Share +++++++++++++++++++$desc'); print('Android Share +++++++++++++++++++$desc');
}
// await Share.shareFiles( //await Share.shareFiles(
// paths, // paths,
// text: '$textToShare\n\n$desc', // Combine text and description // text: '$textToShare\n\n$desc', // Combine text and description
// subject: 'Your Subject Here', // subject: 'Your Subject Here',
// sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size, // sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
// ); //);
await Share.share( await Share.share(
'$textToShare \n\n$desc', '$textToShare \n\n$desc',
subject: desc, subject: desc,
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size, sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
); );
} else if (Platform.isIOS) { } else if (Platform.isIOS) {
if (kDebugMode) {
print('iOS Share +++++++++++++++++++$textToShare'); print('iOS Share +++++++++++++++++++$textToShare');
}
await Share.share( await Share.share(
'$textToShare \n\n$desc', '$textToShare \n\n$desc',
// subject: 'Reason', // subject: 'Reason',
......
...@@ -5,15 +5,14 @@ import 'package:storemonitor/FirebaseApi.dart'; ...@@ -5,15 +5,14 @@ import 'package:storemonitor/FirebaseApi.dart';
import 'Screens/SplashScreen.dart'; import 'Screens/SplashScreen.dart';
Future<void> main() async { Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
if (Platform.isAndroid) { if (Platform.isAndroid) {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(); await Firebase.initializeApp();
await FirebaseApi().initNotifications(); await FirebaseApi().initNotifications();
} else {
} }
runApp(const MaterialApp( runApp(const MaterialApp(
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
home: SplashScreen(), home: SplashScreen(),
) ));
);
} }
...@@ -7,12 +7,16 @@ ...@@ -7,12 +7,16 @@
#include "generated_plugin_registrant.h" #include "generated_plugin_registrant.h"
#include <file_selector_linux/file_selector_plugin.h> #include <file_selector_linux/file_selector_plugin.h>
#include <record_linux/record_linux_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h> #include <url_launcher_linux/url_launcher_plugin.h>
void fl_register_plugins(FlPluginRegistry* registry) { void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar = g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin"); fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
file_selector_plugin_register_with_registrar(file_selector_linux_registrar); file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
g_autoptr(FlPluginRegistrar) record_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "RecordLinuxPlugin");
record_linux_plugin_register_with_registrar(record_linux_registrar);
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
file_selector_linux file_selector_linux
record_linux
url_launcher_linux url_launcher_linux
) )
......
...@@ -5,28 +5,38 @@ ...@@ -5,28 +5,38 @@
import FlutterMacOS import FlutterMacOS
import Foundation import Foundation
import audio_session
import connectivity_macos 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 flutter_tts
import just_audio
import path_provider_foundation import path_provider_foundation
import record_macos
import share_plus import share_plus
import shared_preferences_foundation import shared_preferences_foundation
import speech_to_text_macos import speech_to_text_macos
import sqflite
import text_to_speech_macos
import url_launcher_macos import url_launcher_macos
import wakelock_macos import wakelock_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AudioSessionPlugin.register(with: registry.registrar(forPlugin: "AudioSessionPlugin"))
ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin")) ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
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")) FlutterTtsPlugin.register(with: registry.registrar(forPlugin: "FlutterTtsPlugin"))
JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
RecordMacosPlugin.register(with: registry.registrar(forPlugin: "RecordMacosPlugin"))
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")) SpeechToTextMacosPlugin.register(with: registry.registrar(forPlugin: "SpeechToTextMacosPlugin"))
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
TextToSpeechMacOsPlugin.register(with: registry.registrar(forPlugin: "TextToSpeechMacOsPlugin"))
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"))
} }
...@@ -35,12 +35,22 @@ dependencies: ...@@ -35,12 +35,22 @@ dependencies:
syncfusion_flutter_charts: ^21.1.41 syncfusion_flutter_charts: ^21.1.41
permission_handler: ^10.4.3 permission_handler: ^10.4.3
chewie: ^1.5.0 chewie: ^1.5.0
fluttertoast: ^8.0.8
typewritertext: ^3.0.2
flutter_widget_from_html: ^0.14.11
#webfeed: ^0.7.0 #webfeed: ^0.7.0
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 speech_to_text: ^6.6.0
flutter_tts: ^3.5.1 substring_highlight: ^1.0.33
text_to_speech: ^0.2.3
flutter_tts : ^4.0.2
toggle_switch: ^2.3.0
record: ^4.4.1
path: ^1.8.0
#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
...@@ -106,6 +116,11 @@ flutter: ...@@ -106,6 +116,11 @@ flutter:
- assets/images/videos.png - assets/images/videos.png
- assets/images/weekly_report.png - assets/images/weekly_report.png
- assets/images/menu.png - assets/images/menu.png
- assets/images/micicon.png
- assets/images/bg.png
- assets/images/stop.png
- assets/images/chat.png
- assets/images/mic.gif
fonts: fonts:
- family: Poppins - family: Poppins
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#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 <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 <record_windows/record_windows_plugin_c_api.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>
...@@ -22,6 +23,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { ...@@ -22,6 +23,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
registry->GetRegistrarForPlugin("FlutterTtsPlugin")); registry->GetRegistrarForPlugin("FlutterTtsPlugin"));
PermissionHandlerWindowsPluginRegisterWithRegistrar( PermissionHandlerWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin")); registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin"));
RecordWindowsPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("RecordWindowsPluginCApi"));
SharePlusWindowsPluginCApiRegisterWithRegistrar( SharePlusWindowsPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi")); registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi"));
UrlLauncherWindowsRegisterWithRegistrar( UrlLauncherWindowsRegisterWithRegistrar(
......
...@@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST ...@@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
firebase_core firebase_core
flutter_tts flutter_tts
permission_handler_windows permission_handler_windows
record_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