Commit 03cd7684 by Ramesh Babu Puvvadi

added voice record

parent 5d111162
......@@ -27,7 +27,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 33
compileSdkVersion 34
ndkVersion flutter.ndkVersion
compileOptions {
......@@ -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 21
minSdkVersion 23
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
......
......@@ -9,10 +9,16 @@
<!-- <uses-permission android:name="android.permission.CALL_PHONE" /> -->
<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.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<application
android:usesCleartextTraffic="true"
android:requestLegacyExternalStorage="true"/>
......
......@@ -6,6 +6,9 @@
<uses-permission android:name="android.permission.SEND_SMS"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<queries>
<intent>
......
......@@ -10,6 +10,10 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_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.SEND_SMS"/> -->
<!-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
......
buildscript {
ext.kotlin_version = '1.7.10'
ext.kotlin_version = '1.8.21'
repositories {
google()
mavenCentral()
......
......@@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>11.0</string>
<string>12.0</string>
</dict>
</plist>
......@@ -2,7 +2,7 @@
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
platform :ios, '11.0'
platform :ios, '12.0'
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
......@@ -39,8 +39,25 @@ target 'Runner' do
# 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|
installer.pods_project.targets.each do |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
\ No newline at end of file
......@@ -155,7 +155,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
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 Flutter
@UIApplicationMain
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> 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)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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">
<?xml version="1.0" encoding="UTF-8"?>
<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>
<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>
<scenes>
<!--Flutter View Controller-->
......@@ -14,13 +16,14 @@
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<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"/>
<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>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="121" y="-2"/>
</scene>
</scenes>
</document>
......@@ -33,14 +33,26 @@
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>tel</string>
</array>
<key>NSCameraUsageDescription</key>
<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>
<string>Microphone access is required to dial a call</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app requires access to the photo library</string>
<key>NSSpeechRecognitionUsageDescription</key>
<string>Speech recognition allows you to use text-to-speech and speech</string>
<key>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>
<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 {
class Store {
Store({
required this.region,
required this.storename,
});
String storename;
String region;
factory Store.fromJson(Map<String, dynamic> json) => Store(
storename: json["storename"],
region: json["region"],
);
Map<String, dynamic> toJson() => {
"storename": storename,
"region": region,
};
}
......@@ -74,6 +74,16 @@ class _CheckList extends State<CheckList> {
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(
'FootFall Verification',
style: Constants.fontStyle,
......
......@@ -88,13 +88,11 @@ class _CheckRegistration extends State<CheckRegistration> {
//getVideo(_empId.text);
getValidReg(_empId.text);
} else {
Constants('Check Registration', 'Enter emp id')
.showAlertDialog(context, false);
Constants('Check Registration', 'Enter emp id').showAlertDialog(context, false);
}
},
style: ElevatedButton.styleFrom(
backgroundColor:
Colors.transparent, // make the button transparent
backgroundColor: Colors.transparent, // make the button transparent
elevation: 0, // remove the button's shadow
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
......@@ -156,7 +154,6 @@ class _CheckRegistration extends State<CheckRegistration> {
File file = File(image!.path);
//String filecontents = await fileToString(file);
String fileName = file.path.split(Platform.pathSeparator).last;
final response =
await RemoteData().UploadEmpVideo(file, fileName, empid, store);
Map<String, dynamic> responseMap = jsonDecode(response);
......@@ -165,7 +162,9 @@ class _CheckRegistration extends State<CheckRegistration> {
String message = "$responseMap";
// Extract the status value from the message
String status = message.split('status:').last.split('}').first.trim();
print(status);
if (kDebugMode) {
print(status);
}
if (status == 'Success') {
Navigator.pop(context);
file.delete();
......
......@@ -19,11 +19,37 @@ class Constants {
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(
fontFamily: 'Poppins',
fontSize: 18,
fontWeight: FontWeight.normal,
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(
fontFamily: 'Poppins',
fontSize: 16,
......@@ -123,17 +149,11 @@ class Constants {
);
static const TextStyle unregisterfontStyle = TextStyle(
fontFamily: 'Poppins',
fontSize: 14,
fontSize: 16,
fontWeight: FontWeight.normal,
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(
fontFamily: 'Poppins',
fontSize: 16,
......@@ -208,8 +228,8 @@ class Constants {
prefs.setString('userId', username);
prefs.setString('empId', empid);
prefs.setString('stores_list', storeslist);
prefs.setString('storeName', storeName);
prefs.setString('access', accessLevel);
//prefs.setString('storeName', storeName);
prefs.setBool('islogged', validate);
}
......
......@@ -60,7 +60,7 @@ class _DepartmentSearch extends State<DepartmentSearch> {
Future<void> loadData() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
String? userId = prefs.getString("stores_list");
String? userId = prefs.getString("storeName");
empid = prefs.getString('empId')!;
storesList = (json.decode(userId!) as List<dynamic>)
.map((map) => map['name'] as String)
......
......@@ -41,7 +41,7 @@ class _EmployeeReport extends State<EmployeeReport> {
// Constants.showLoader(context);
//});
SharedPreferences prefs = await SharedPreferences.getInstance();
String? userId = prefs.getString("stores_list");
String? userId = prefs.getString("storeName");
if (kDebugMode) {
print(userId);
}
......@@ -414,36 +414,34 @@ class _EmployeeReport extends State<EmployeeReport> {
// color: Color.fromARGB(255, 173, 57, 230),
// ));
// });
//8919290229
Map<String, dynamic> body = {
'STORE': selectedDropdownItem!,
};
dynamic response = await _apiServices.getPostApiResponse(
'http://vaman.plutokm.com/regstatusreport', body);
dynamic response = await _apiServices.getPostApiResponse('http://vaman.plutokm.com/regstatusreport', body);
print("response is ----------->$response");
final respon = await RemoteData().getUserReport(selectedDropdownItem);
Map<String, dynamic> responseMap = jsonDecode(respon);
empReport = EmpReport.fromJson(responseMap);
final res = await RemoteData().getUserReport(selectedDropdownItem);
Map<String, dynamic> responseMap = jsonDecode(res);
empReport = EmpReport.fromJson(responseMap);
empreportlist = empReport!.data;
//Constants.dismissAlertDialog1(context);
setState(() {
total = empreportlist!.length;
total = empreportlist!.length;
filteredreortlist = empReport!.data
?.where((alert) =>
alert.rEGSTATUS == 'Not Registered' ||
alert.rEGSTATUS == 'NOT REGISTERED')
.toList();
unregistered = filteredreortlist!.length;
unregistered= filteredreortlist!.length;
filteredreortlist = empReport!.data
?.where((alert) => alert.rEGSTATUS == 'Registered')
.toList();
registered = filteredreortlist!.length;
registered = filteredreortlist!.length;
Navigator.of(context).pop();
});
} else {
Navigator.of(context).pop();
Constants('Employee Report', 'Please check your internet connection')
.showAlertDialog(context, false);
Constants('Employee Report', 'Please check your internet connection').showAlertDialog(context, false);
}
}
}
......@@ -62,7 +62,7 @@ class employeeStatus extends State<EmployeeStatus> {
Future<void> loadData() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
String? userId = prefs.getString("stores_list");
String? userId = prefs.getString("storeName");
storesList = (json.decode(userId!) as List<dynamic>)
.map((map) => map['name'] as String)
.toList();
......
import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:intl/intl.dart';
......@@ -85,7 +86,7 @@ class _FootFall extends State<FootFall> {
Future<void> loadData() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
String? userId = prefs.getString("stores_list");
String? userId = prefs.getString("storeName");
storesList = (json.decode(userId!) as List<dynamic>)
.map((map) => map['name'] as String)
.toList();
......@@ -154,10 +155,14 @@ class _FootFall extends State<FootFall> {
),
body: GestureDetector(
onForcePressUpdate: (details) {
print('force press update');
if (kDebugMode) {
print('force press update');
}
},
onHorizontalDragStart: (details) {
print('force press start');
if (kDebugMode) {
print('force press start');
}
},
onHorizontalDragDown: (details) {},
child: FutureBuilder<Foot?>(
......@@ -216,6 +221,7 @@ class _FootFall extends State<FootFall> {
),
TextFormField(
controller: _dateTime,
readOnly: true,
onTap: () => '',
decoration: InputDecoration(
contentPadding: const EdgeInsets.symmetric(
......
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';
......@@ -40,21 +38,18 @@ class _IssueVideos extends State<IssueVideos> {
if (kDebugMode) {
print('Granted');
}
// You have the permission, you can now access storage.
} else if (status.isDenied) {
if (kDebugMode) {
print('Not Granted');
}
// The user denied the permission. You can explain why you need it and request again.
} else if (status.isPermanentlyDenied) {
// The user permanently denied the permission. You can open the app settings to let the user manually enable it.
openAppSettings();
}
}
Future<void> loadData() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
String? userId = prefs.getString("stores_list");
String? userId = prefs.getString("storeName");
//print(userId);
storesList = (json.decode(userId!) as List<dynamic>)
.map((map) => map['name'] as String)
......@@ -82,14 +77,12 @@ class _IssueVideos extends State<IssueVideos> {
child: CircularProgressIndicator(
color: Color.fromARGB(255, 29, 20, 34)));
});
//Response data;
final respon = await RemoteData().getIssueVideos(name);
Map<String, dynamic> responseMap = jsonDecode(respon);
if (kDebugMode) {
print(responseMap['data']);
}
if (responseMap['data'] == null ||
!(responseMap['data'] as List).isNotEmpty) {
if (responseMap['data'] == null || !(responseMap['data'] as List).isNotEmpty) {
notificationslist = [];
setState(() {
notificationslist;
......@@ -107,7 +100,9 @@ class _IssueVideos extends State<IssueVideos> {
}
}
Navigator.of(context).pop();
} else {}
} 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}');
......@@ -160,6 +155,7 @@ class _IssueVideos extends State<IssueVideos> {
//crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
// SizedBox(
// width: double.infinity,
// //height: double.infinity,
......@@ -180,6 +176,7 @@ class _IssueVideos extends State<IssueVideos> {
// }).toList(),
// ),
// ),
Container(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
decoration: BoxDecoration(
......
......@@ -17,7 +17,6 @@ class LoginPage extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: true,
//resizeToAvoidBottomPadding: false,
body: SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height,
......@@ -28,7 +27,6 @@ class LoginPage extends StatelessWidget {
colors: [
Color.fromARGB(255, 125, 50, 253),
Color.fromARGB(255, 125, 50, 253),
// Color.fromARGB(255, 157, 55, 237)
],
),
),
......@@ -36,19 +34,19 @@ class LoginPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
const SizedBox(height: 30),
// GifImage(
// image: AssetImage('assets/sample.gif'), // Replace with your actual GIF image path
// ),
//GifImage(
// image: AssetImage('assets/sample.gif'), // Replace with your actual GIF image path
//),
GifView.asset(
'assets/images/login.gif',
height: 350,
width: 350,
frameRate: 30, // default is 15 FPS
frameRate: 30, //default is 15 FPS
),
// Image.asset(
// 'assets/images/login_header_image.png',
// height: 350,
// width: 350,
//Image.asset(
// 'assets/images/login_header_image.png',
// height: 350,
// width: 350,
//),
const SizedBox(height: 30),
const LoginForm(),
......@@ -91,7 +89,6 @@ class LoginFormState extends State<LoginForm> {
Future<void> login(String email, String pass) async {
//Constants.showAlertDialog1(context);
//final DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
// String? deviceId;
// if (Platform.isAndroid) {
// const androidId = AndroidId();
......@@ -111,6 +108,9 @@ class LoginFormState extends State<LoginForm> {
// Handle success status
final userResponse = userResponseFromJson(response);
if (userResponse.status.contains('Success')) {
if (kDebugMode) {
print('Login Response $responseMap');
}
List<Map<String, dynamic>>? normalArray;
if (userResponse.stores.isNotEmpty) {
normalArray = userResponse.stores.map((item) {
......@@ -119,11 +119,18 @@ class LoginFormState extends State<LoginForm> {
};
}).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);
//print(userResponse.level);
Constants.saveLoginCredentials(userResponse.empName, _email.text,
jsonStr, '', userResponse.level, true);
jsonStr, str, userResponse.level, true);
Navigator.pushReplacement(
context,
MaterialPageRoute(
......@@ -174,7 +181,7 @@ class LoginFormState extends State<LoginForm> {
height: 50,
child: TextFormField(
cursorColor: const Color.fromARGB(255, 125, 50, 253),
style: Constants.fontStyle,
style: Constants.LoginfontStyle,
controller: _email,
//obscureText: true,
decoration: InputDecoration(
......@@ -188,7 +195,6 @@ class LoginFormState extends State<LoginForm> {
// Align the label text to the left by specifying the padding
//contentPadding: const EdgeInsets.all(15.0),
// Align the suffix icon to the right by wrapping it in a Row
suffix: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.end,
......@@ -202,7 +208,6 @@ class LoginFormState extends State<LoginForm> {
)
],
),
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(
color: Colors.grey, // Set the desired color here
......@@ -216,6 +221,7 @@ class LoginFormState extends State<LoginForm> {
borderRadius: BorderRadius.circular(5.0),
),
),
//style: const TextStyle(color: Colors.black),
),
),
const SizedBox(height: 15),
......@@ -223,7 +229,7 @@ class LoginFormState extends State<LoginForm> {
height: 50,
child: TextFormField(
cursorColor: const Color.fromARGB(255, 125, 50, 253),
style: Constants.fontStyle,
style: Constants.LoginfontStyle,
controller: _pass,
obscureText: true,
decoration: InputDecoration(
......@@ -297,7 +303,8 @@ class LoginFormState extends State<LoginForm> {
});
login(_email.text, _pass.text);
} else {
Constants.dialogMessage(context, 'Login', 'Check your internetconnection');
Constants.dialogMessage(
context, 'Login', 'Check your internetconnection');
}
}
},
......@@ -305,10 +312,12 @@ class LoginFormState extends State<LoginForm> {
backgroundColor: MaterialStateProperty.all<Color>(
const Color.fromARGB(255, 62, 43, 75)),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0),
//side: BorderSide(color: Colors.red)
))),
)
)
),
child: const Text(
'LOGIN',
style: Constants.fontStyle,
......
......@@ -79,7 +79,7 @@ class _VideoPlayerScreenState extends State<MyHomePage> {
initialOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(),
android: AndroidInAppWebViewOptions(
supportMultipleWindows: true,
supportMultipleWindows: true,
),
ios: IOSInAppWebViewOptions(
allowsInlineMediaPlayback: true,
......
......@@ -44,7 +44,7 @@ class _NotificationReport extends State<NotificationReport> {
Future<void> loadData() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
String? userId = prefs.getString("stores_list");
String? userId = prefs.getString("storeName");
//print(userId);
storesList = (json.decode(userId!) as List<dynamic>)
.map((map) => map['name'] as String)
......@@ -249,6 +249,7 @@ class _NotificationReport extends State<NotificationReport> {
),
TextFormField(
controller: _dateTime1,
readOnly: true,
//onTap: () => print('Date Picker'),
decoration: InputDecoration(
contentPadding:
......
......@@ -20,6 +20,7 @@ class Review extends StatefulWidget {
//const Review({super.key});
final String message;
final String selecteddate;
const Review({super.key, required this.message, required this.selecteddate});
@override
......@@ -91,7 +92,7 @@ class _Review extends State<Review> {
Future<void> loadData() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
String? userId = prefs.getString("stores_list");
String? userId = prefs.getString("storeName");
//print(userId);
storesList = (json.decode(userId!) as List<dynamic>)
.map((map) => map['name'] as String)
......@@ -217,10 +218,6 @@ class _Review extends State<Review> {
}
}
//ebe5f6
//f772d1
//c972f2
Color _buttonColor1 = 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);
......@@ -236,7 +233,6 @@ class _Review extends State<Review> {
carouselKey = UniqueKey();
});
getData(imp);
//Constants.showAlertDialog1(context);
setState(() {
black = Colors.white;
black1 = Colors.black;
......@@ -262,8 +258,6 @@ class _Review extends State<Review> {
carouselKey = UniqueKey();
});
getData(imp);
//carouselKey = UniqueKey();
//Constants.showAlertDialog1(context);
setState(() {
black = Colors.black;
black1 = Colors.white;
......@@ -471,6 +465,7 @@ class _Review extends State<Review> {
),
TextFormField(
controller: _dateTime,
readOnly: true,
//onTap: () => print('Date Picker'),
decoration: InputDecoration(
contentPadding:
......@@ -760,7 +755,6 @@ class _Review extends State<Review> {
} else {
isvisible = true;
}
return Padding(
padding: const EdgeInsets.all(15.0),
child: Card(
......@@ -1150,7 +1144,7 @@ class _Review extends State<Review> {
context)
.size
.width /
3.2,
3.5,
child:
const Center(
child:
......@@ -1221,7 +1215,7 @@ class _Review extends State<Review> {
context)
.size
.width /
1.3,
1.4,
child:
const Center(
child:
......@@ -1287,7 +1281,6 @@ class _Review extends State<Review> {
userId!,
feed,
comments);
// print('GetAction: $res');
if (res == 200) {
setState(() {
if (feed == 'yes' || feed == 'no' || feed == 'audit') {
......@@ -1296,20 +1289,18 @@ class _Review extends State<Review> {
}
Constants('Review', 'Sucess').showAlertDialog(context, false);
});
} else {
Constants('Review', res.toString()).showAlertDialog(context, false);
}
}
Future<void> shareImageWithText(String url, String textToShare) async {
final box = context.findRenderObject() as RenderBox?;
//print('inside share function');
final response = await get(Uri.parse(url));
//print('got response:$response');
//final bytes = response.bodyBytes;
final Directory temp = await getTemporaryDirectory();
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',
......@@ -1365,7 +1356,6 @@ class _Review extends State<Review> {
padding: EdgeInsets.only(left: 10),
child: Text('Submit'),
),
//child: const Text('Submit'),
),
],
);
......
......@@ -117,14 +117,15 @@ class _SignUpState extends State<SignUp> {
// width: 300,
// height: 400,
// ),
TextField(
TextFormField(
keyboardType: TextInputType.number,
controller: _email,
scrollPadding: const EdgeInsets.all(100.0),
//scrollPadding: const EdgeInsets.all(100.0),
decoration: const InputDecoration(
hintText: 'UserId',
border: OutlineInputBorder(),
),
style: const TextStyle(color: Colors.black),
),
const SizedBox(
height: 20,
......@@ -138,6 +139,7 @@ class _SignUpState extends State<SignUp> {
hintText: 'Password',
border: OutlineInputBorder(),
),
style: const TextStyle(color: Colors.black),
),
const SizedBox(
height: 30,
......
......@@ -44,7 +44,9 @@ class _SplashScreenState extends State<SplashScreen> {
message: 'success',
)));
} else {
//print('else condition :${isLoggedIn}');
if (kDebugMode) {
print('else condition : $isLoggedIn');
}
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(builder: (context) => const LoginPage()),
......@@ -91,5 +93,5 @@ class _SplashScreenState extends State<SplashScreen> {
print(info.utsname.machine); // "iPhone15,2"
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> {
initilize(videoUrl);
}
void getUpdate1(String Id, String comment) async {
final respon = await RemoteData().getUpdateIssueVideos1(Id, comment);
void getUpdate1(String id, String comment) async {
final respon = await RemoteData().getUpdateIssueVideos1(id, comment);
Map<String, dynamic> responseMap = jsonDecode(respon);
Navigator.of(context).pop();
hideKeyboard(context);
......@@ -136,28 +136,29 @@ 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
// 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(
if (kDebugMode) {
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');
if (kDebugMode) {
print('iOS Share +++++++++++++++++++$textToShare');
}
await Share.share(
'$textToShare \n\n$desc',
// subject: 'Reason',
......
......@@ -5,15 +5,14 @@ import 'package:storemonitor/FirebaseApi.dart';
import 'Screens/SplashScreen.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
if (Platform.isAndroid) {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
await FirebaseApi().initNotifications();
} else {
}
runApp(const MaterialApp(
debugShowCheckedModeBanner: false,
home: SplashScreen(),
)
);
));
}
......@@ -7,12 +7,16 @@
#include "generated_plugin_registrant.h"
#include <file_selector_linux/file_selector_plugin.h>
#include <record_linux/record_linux_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>
void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
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 =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
......
......@@ -4,6 +4,7 @@
list(APPEND FLUTTER_PLUGIN_LIST
file_selector_linux
record_linux
url_launcher_linux
)
......
......@@ -5,28 +5,38 @@
import FlutterMacOS
import Foundation
import audio_session
import connectivity_macos
import file_selector_macos
import firebase_core
import firebase_messaging
import flutter_tts
import just_audio
import path_provider_foundation
import record_macos
import share_plus
import shared_preferences_foundation
import speech_to_text_macos
import sqflite
import text_to_speech_macos
import url_launcher_macos
import wakelock_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AudioSessionPlugin.register(with: registry.registrar(forPlugin: "AudioSessionPlugin"))
ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
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"))
JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
RecordMacosPlugin.register(with: registry.registrar(forPlugin: "RecordMacosPlugin"))
SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
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"))
WakelockMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockMacosPlugin"))
}
......@@ -35,12 +35,22 @@ dependencies:
syncfusion_flutter_charts: ^21.1.41
permission_handler: ^10.4.3
chewie: ^1.5.0
fluttertoast: ^8.0.8
typewritertext: ^3.0.2
flutter_widget_from_html: ^0.14.11
#webfeed: ^0.7.0
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
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_video: ^0.0.1
#flutter_vlc_player: ^7.3.1
......@@ -106,6 +116,11 @@ flutter:
- assets/images/videos.png
- assets/images/weekly_report.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:
- family: Poppins
......
......@@ -10,6 +10,7 @@
#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 <record_windows/record_windows_plugin_c_api.h>
#include <share_plus/share_plus_windows_plugin_c_api.h>
#include <url_launcher_windows/url_launcher_windows.h>
......@@ -22,6 +23,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
registry->GetRegistrarForPlugin("FlutterTtsPlugin"));
PermissionHandlerWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin"));
RecordWindowsPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("RecordWindowsPluginCApi"));
SharePlusWindowsPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi"));
UrlLauncherWindowsRegisterWithRegistrar(
......
......@@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
firebase_core
flutter_tts
permission_handler_windows
record_windows
share_plus
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