feat:offline sync , other changes and extension fixes

This commit is contained in:
snehalathad 2024-04-08 17:30:54 +05:30
parent 7981a02996
commit b7d08e858c
42 changed files with 644 additions and 442 deletions

View File

@ -359,7 +359,7 @@
"id": "otherpostal_14", "id": "otherpostal_14",
"depid": "", "depid": "",
"widget": "text", "widget": "text",
"input": "Hubli", "input": "number",
"validation": "validation":
{ {
"isRequired": true "isRequired": true

View File

@ -120,13 +120,13 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
asset_webview: 6ea3e602c34e111b4d808f8c09b8d31fbe5c27e4 asset_webview: 6ea3e602c34e111b4d808f8c09b8d31fbe5c27e4
connectivity_plus: 413a8857dd5d9f1c399a39130850d02fe0feaf7e connectivity_plus: bf0076dd84a130856aa636df1c71ccaff908fa1d
device_info_plus: 7545d84d8d1b896cb16a4ff98c19f07ec4b298ea device_info_plus: 7545d84d8d1b896cb16a4ff98c19f07ec4b298ea
DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179 DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
file_picker: 15fd9539e4eb735dc54bae8c0534a7a9511a03de file_picker: 15fd9539e4eb735dc54bae8c0534a7a9511a03de
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_inappwebview: 50b55a88f5dddadc9e741a7caf72f378116e2156 flutter_inappwebview: 0fd654db805825eae42bd8ee7c428890cdaf7ff1
image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5 image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c
package_info_plus: fd030dabf36271f146f1f3beacd48f564b0f17f7 package_info_plus: fd030dabf36271f146f1f3beacd48f564b0f17f7
@ -140,4 +140,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: 108feb553cebadca4bc232556afce4dd4c21da4c PODFILE CHECKSUM: 108feb553cebadca4bc232556afce4dd4c21da4c
COCOAPODS: 1.12.1 COCOAPODS: 1.14.3

View File

@ -1,8 +1,10 @@
<?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="22505" 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="22504"/>
<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 @@
<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="-26" y="-76"/>
</scene> </scene>
</scenes> </scenes>
</document> </document>

View File

@ -64,5 +64,8 @@
<true/> <true/>
<key>UIFileSharingEnabled</key> <key>UIFileSharingEnabled</key>
<true/> <true/>
<key>FLTEnableImpeller</key>
<false />
</dict> </dict>
</plist> </plist>

View File

@ -1,14 +1,10 @@
import 'dart:async'; import 'dart:async';
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:flutter/services.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:hive_flutter/hive_flutter.dart'; import 'package:hive_flutter/hive_flutter.dart';
import 'package:path_provider/path_provider.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:pwa_ios/model/interaction_config_data.dart'; import 'package:pwa_ios/model/interaction_config_data.dart';
import 'package:pwa_ios/model/interaction_data.dart'; import 'package:pwa_ios/model/interaction_data.dart';
@ -29,7 +25,6 @@ import 'package:pwa_ios/views/home_screen.dart';
import 'package:pwa_ios/views/konectarpage.dart'; import 'package:pwa_ios/views/konectarpage.dart';
import 'package:pwa_ios/views/login.dart'; import 'package:pwa_ios/views/login.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:openid_client/openid_client.dart'; import 'package:openid_client/openid_client.dart';
import 'package:flutter_web_plugins/url_strategy.dart'; import 'package:flutter_web_plugins/url_strategy.dart';
import 'package:internet_connection_checker/internet_connection_checker.dart'; import 'package:internet_connection_checker/internet_connection_checker.dart';
@ -92,9 +87,8 @@ Future main() async {
Hive.registerAdapter(MultipleSectionListAdapter()); Hive.registerAdapter(MultipleSectionListAdapter());
Hive.registerAdapter(SaveAdapter()); Hive.registerAdapter(SaveAdapter());
Hive.registerAdapter(SaveInteractionFormJsonAdapter()); Hive.registerAdapter(SaveInteractionFormJsonAdapter());
// await Hive.openBox('InteractionDataBox'); await Hive.openBox<SaveInteraction>('InteractionDataBox');
// await Hive.openBox<UserData>("UserDataBox"); await Hive.openBox<UserData>("UserDataBox");
//await Hive.openBox('InteractionConfigDataBox');
await Hive.openBox<InteractionConfigData>('InteractionConfigDataBox'); await Hive.openBox<InteractionConfigData>('InteractionConfigDataBox');
// final ConfigDataProvider configDataProvider = ConfigDataProvider(); // final ConfigDataProvider configDataProvider = ConfigDataProvider();
@ -109,11 +103,10 @@ Future main() async {
// print(json.toString()); // print(json.toString());
// await MockApiCall().postFormData(json).then((value) async { // await MockApiCall().postFormData(json).then((value) async {
// await configDataProvider.initConfigUIData().then((value) { // await configDataProvider.initConfigUIData().then((value) {
// // activateTimer(); activateTimer();
// }); // });
// }); // });
await configDataProvider.initConfigUIData(); // await configDataProvider.initConfigUIData();
// activateTimer();
// await provider.initConfigUIData(); // await provider.initConfigUIData();
if (!kIsWeb && if (!kIsWeb &&
@ -141,10 +134,13 @@ Future main() async {
// credential = await authenticate(client, scopes: scopes); // credential = await authenticate(client, scopes: scopes);
// userInfo = await credential!.getUserInfo(); // userInfo = await credential!.getUserInfo();
//runApp(const MyApp()); //runApp(const MyApp());
SharedPreferences.getInstance().then((instance) { // activateTimer();
SharedPreferences.getInstance().then((instance) async {
//StorageService().sharedPreferencesInstance = instance; //StorageService().sharedPreferencesInstance = instance;
bool isloggedIn = instance.getBool('isloggedin') ?? false; bool isloggedIn = instance.getBool('isloggedin') ?? false;
if (!isloggedIn) {
await configDataProvider.initConfigUIData();
}
runApp( runApp(
MultiProvider( MultiProvider(
providers: [ providers: [
@ -166,14 +162,14 @@ Future main() async {
builder: (context, snapshot) { builder: (context, snapshot) {
print("Data_is : $snapshot"); print("Data_is : $snapshot");
if (snapshot.connectionState == ConnectionState.waiting) { if (snapshot.connectionState == ConnectionState.waiting) {
return CircularProgressIndicator(); return const CircularProgressIndicator();
} else if (snapshot.hasError) { } else if (snapshot.hasError) {
return Text('Error: ${snapshot.error}'); return Text('Error: ${snapshot.error}');
} else { } else {
final isLoggedIn = snapshot.data ?? false; final isLoggedIn = snapshot.data ?? false;
print("isLoggedIn_is : $isLoggedIn"); print("isLoggedIn_is : $isLoggedIn");
return isLoggedIn ? HomeScreen() : LoginScreen(); return isLoggedIn ? const HomeScreen() : const LoginScreen();
} }
}, },
), //userInfo != null ? const Home() : OpenidScreen(credential: credential,), ), //userInfo != null ? const Home() : OpenidScreen(credential: credential,),
@ -191,22 +187,37 @@ cancelTimer() {
activateTimer() { activateTimer() {
mytimer = Timer.periodic(const Duration(minutes: 5), (timer) async { mytimer = Timer.periodic(const Duration(minutes: 5), (timer) async {
//code to run on every 2 minutes 5 seconds if (await InternetConnectionChecker().hasConnection) {
final ConfigDataProvider configDataProvider = ConfigDataProvider(); //code to run on every 2 minutes 5 seconds
final ViewInteractionProvider viewInteractionProvider = print("timer started ");
ViewInteractionProvider(); final ConfigDataProvider configDataProvider = ConfigDataProvider();
List<SaveInteraction> savedList = final InteractionProvider viewInteractionProvider = InteractionProvider();
await viewInteractionProvider.getAllRecords(); if (await checkRecordsAvailable()) {
String jsonstr = await formJsonForSync();
SendSavedDataJson json = SendSavedDataJson(data: savedList); await MockApiCall().postSavedData(jsonstr).then((value) async {
print(json.toString()); await deleteRecords();
await MockApiCall().postFormData(json).then((value) async { await configDataProvider.initConfigUIData().then((value) async {
await configDataProvider.initConfigUIData().then((value) { await viewInteractionProvider.initConfigData().then((value) {
// activateTimer(); activateTimer();
}); });
});
print("ended");
});
});
} else {
await configDataProvider.initConfigUIData().then((value) async {
await viewInteractionProvider.initConfigData().then((value) {
activateTimer();
});
print("ended");
});
}
}
print("Interval called 2 mins"); print("Interval called 2 mins");
}); });
print("timer"); print("timer");
print(mytimer?.isActive); print(mytimer?.isActive);
} }
@ -272,10 +283,10 @@ class _HomeState extends State<Home> with WidgetsBindingObserver {
// Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context) => MyApp())); // Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context) => MyApp()));
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => const MyApp()), MaterialPageRoute(builder: (context) => const MyApp())
); );
}, },
child: Text('click'), child: const Text('click'),
), ),
), ),
), ),
@ -284,7 +295,7 @@ class _HomeState extends State<Home> with WidgetsBindingObserver {
@override @override
void dispose() { void dispose() {
Hive.close(); // Hive.close();
super.dispose(); super.dispose();
} }
} }

View File

@ -19,7 +19,7 @@ class UIDataResponse {
success: json["success"], success: json["success"],
message: json["message"], message: json["message"],
formFields: List<FormFieldData>.from( formFields: List<FormFieldData>.from(
json["form-fields"].map((x) => FormFieldData.fromJson(x))), json["data"].map((x) => FormFieldData.fromJson(x))),
); );
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() => {

View File

@ -6,7 +6,6 @@ import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hive_flutter/hive_flutter.dart'; import 'package:hive_flutter/hive_flutter.dart';
import 'package:pwa_ios/model/json_form_data.dart';
part 'interaction_data.g.dart'; part 'interaction_data.g.dart';
// InteractionResultData welcomeFromJson(String str) => // InteractionResultData welcomeFromJson(String str) =>

View File

@ -6,7 +6,6 @@ import 'dart:convert';
import 'package:hive_flutter/hive_flutter.dart'; import 'package:hive_flutter/hive_flutter.dart';
import 'package:pwa_ios/model/interaction_data.dart'; import 'package:pwa_ios/model/interaction_data.dart';
import 'package:pwa_ios/model/json_form_data.dart';
part 'save_interaction.g.dart'; part 'save_interaction.g.dart';
SaveInteraction welcomeFromJson(String str) => SaveInteraction welcomeFromJson(String str) =>

View File

@ -44,8 +44,9 @@ class _LoginPageState extends State<LoginPage> {
Future<Client> getClient() async { Future<Client> getClient() async {
var uri = Uri.parse(keycloakUri); var uri = Uri.parse(keycloakUri);
if (!kIsWeb && Platform.isAndroid) if (!kIsWeb && Platform.isAndroid) {
uri = uri.replace(host: 'sso.konectar.io'); uri = uri.replace(host: 'sso.konectar.io');
}
var clientId = 'appwildcard'; var clientId = 'appwildcard';
var issuer = await Issuer.discover(uri); var issuer = await Issuer.discover(uri);

View File

@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import 'package:hive/hive.dart'; import 'package:hive/hive.dart';
import 'package:pwa_ios/model/interaction_config_data.dart'; import 'package:pwa_ios/model/interaction_config_data.dart';
import 'package:pwa_ios/model/save_interaction.dart';
class HiveDataRepository extends ChangeNotifier { class HiveDataRepository extends ChangeNotifier {
Box<InteractionConfigData> _hiveBox; // Use the correct type for your Hive box Box<InteractionConfigData> _hiveBox; // Use the correct type for your Hive box

View File

@ -15,7 +15,7 @@ final kPwaHost = kPwaUri.host;
final notificationUri = final notificationUri =
WebUri('https://cardio-staging.konectar.io/notifications/'); WebUri('https://cardio-staging.konectar.io/notifications/');
final String publicKey = const String publicKey =
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyZWYiOiIxZTIxMTkyZS1jYTkyLTRlNDktYjY5Zi0yM2YzZTdiOWY1ODAiLCJhbm9uX2tleSI6ImVkZTgzYjg3LTljNGUtNDcyYS04MGEzLTQxNGU1NjE1YWExMSIsImlhdCI6MTY5NTk5MDY2NiwiZXhwIjoxNzI3NTQ4MjY2LCJpc3MiOiJodHRwczovL2J1aWxkd2l0aHRoZXRhLmNvbSJ9.nFjrMCr2swrkN9-JTqZOqsSOdUgJpH0LiRBFBpe2ceA"; "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyZWYiOiIxZTIxMTkyZS1jYTkyLTRlNDktYjY5Zi0yM2YzZTdiOWY1ODAiLCJhbm9uX2tleSI6ImVkZTgzYjg3LTljNGUtNDcyYS04MGEzLTQxNGU1NjE1YWExMSIsImlhdCI6MTY5NTk5MDY2NiwiZXhwIjoxNzI3NTQ4MjY2LCJpc3MiOiJodHRwczovL2J1aWxkd2l0aHRoZXRhLmNvbSJ9.nFjrMCr2swrkN9-JTqZOqsSOdUgJpH0LiRBFBpe2ceA";
// Custom HTML Error Page. // Custom HTML Error Page.

View File

@ -6,7 +6,7 @@ import 'package:dio/dio.dart';
class FileUpload { class FileUpload {
Future<bool> uploadFileAndJsonData( Future<bool> uploadFileAndJsonData(
{required File empFace, required String empCode}) async { {required File empFace, required String empCode}) async {
final url = 'My API URL'; const url = 'My API URL';
try { try {
var formData = FormData.fromMap({ var formData = FormData.fromMap({
"files": [ "files": [

View File

@ -6,7 +6,6 @@ import 'package:dio/dio.dart';
import 'package:dio/io.dart'; import 'package:dio/io.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:http_mock_adapter/http_mock_adapter.dart'; import 'package:http_mock_adapter/http_mock_adapter.dart';
import 'package:path_provider/path_provider.dart';
import 'package:pwa_ios/model/interaction_config_data.dart'; import 'package:pwa_ios/model/interaction_config_data.dart';
class MockApiCall { class MockApiCall {
@ -32,14 +31,13 @@ class MockApiCall {
// ), // ),
// ); // );
// Send a GET request to "https://example.com" using Dio // Send a GET request to "https://example.com" using Dio
final response = final response = await dio.get('https://passvault.konectar.io/forms');
await dio.get('http://192.168.2.64/konectar-app/public/forms');
UIDataResponse dataResponse = UIDataResponse.fromJson(response.data); //UIDataResponse dataResponse = UIDataResponse.fromJson(response.data);
// The response should contain the mock data we registered // The response should contain the mock data we registered
print("response"); print("response");
print(response.data); print(response.data);
return dataResponse; return response.data;
} }
Future<dynamic> postConfigData(var jsonObj) async { Future<dynamic> postConfigData(var jsonObj) async {
@ -119,9 +117,10 @@ class MockApiCall {
print(response.data); // {messa print(response.data); // {messa
} }
Future<dynamic> postSavedData(var jsonObj, String filepath) async { Future<dynamic> postSavedData(var jsonObj) async {
// final dio = Dio(BaseOptions()); // final dio = Dio(BaseOptions());
final dio = Dio(); final dio = Dio();
// ignore: deprecated_member_use
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate = (dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
(HttpClient client) { (HttpClient client) {
client.badCertificateCallback = client.badCertificateCallback =
@ -153,9 +152,15 @@ class MockApiCall {
// }); // });
// Send a GET request to "https://example.com" using Dio // Send a GET request to "https://example.com" using Dio
final response = await dio.get(
'http://192.168.2.64/konectar-app/public/push_data', // Or create `Dio` with a `BaseOptions` instance.
data: jsonObj); final options = Options(
sendTimeout: const Duration(seconds: 15),
receiveTimeout: const Duration(seconds: 15),
);
final response = await dio.get('https://passvault.konectar.io/push_data',
options: options, data: jsonObj);
//UIDataResponse dataResponse = UIDataResponse.fromJson(response.data); //UIDataResponse dataResponse = UIDataResponse.fromJson(response.data);
// The response should contain the mock data we registered // The response should contain the mock data we registered
@ -166,7 +171,7 @@ class MockApiCall {
Future<bool> uploadFileAndJsonData(var jsonObj) async { Future<bool> uploadFileAndJsonData(var jsonObj) async {
// {required File empFace, required String empCode} // {required File empFace, required String empCode}
final url = 'http://192.168.2.64/konectar-app/public/push_data'; const url = 'http://192.168.2.64/konectar-app/public/push_data';
try { try {
var formData = FormData.fromMap({ var formData = FormData.fromMap({
"files": [ "files": [

13
lib/utils/repository.dart Normal file
View File

@ -0,0 +1,13 @@
import 'package:flutter/foundation.dart';
import 'package:hive_flutter/hive_flutter.dart';
class HiveRepository extends ChangeNotifier {
static Future<Box<dynamic>> openHive(String boxname) async {
var connectionBox = Hive.box<dynamic>(boxname);
if (!connectionBox.isOpen) {
connectionBox = await Hive.openBox<dynamic>(boxname);
}
return connectionBox;
}
}

View File

@ -3,6 +3,10 @@ import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:hive_flutter/hive_flutter.dart'; import 'package:hive_flutter/hive_flutter.dart';
import 'package:pwa_ios/model/json_form_data.dart';
import 'package:pwa_ios/model/save_interaction.dart';
import 'package:pwa_ios/viewmodel/interactionprovider.dart';
import 'package:pwa_ios/viewmodel/viewinteractionprovider.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
Future<bool> isNetworkAvailable() async { Future<bool> isNetworkAvailable() async {
@ -44,6 +48,36 @@ bool get isTablet {
return logicalShortestSide > 600; return logicalShortestSide > 600;
} }
Future<String> formJsonForSync() async {
final provider = ViewInteractionProvider();
final prov = InteractionProvider();
List<SaveInteractionFormJson> senSavedList = [];
List<SaveInteraction> savedList = await provider.getAllRecords();
for (var obj in savedList) {
senSavedList.add(prov.formJson(obj));
}
SendSaveJson jsonData = SendSaveJson(savedList: senSavedList);
DataJson dataJson = DataJson(sendSaveJson: jsonData);
String jsonstr = saveFormJsonToJson(jsonData);
print(jsonstr);
return jsonstr;
}
Future<bool> checkRecordsAvailable() async {
final provider = ViewInteractionProvider();
List<SaveInteraction> savedList = await provider.getAllRecords();
return savedList.isNotEmpty;
}
deleteRecords() async {
final provider = ViewInteractionProvider();
List<SaveInteraction> savedList = await provider.getAllRecords();
for (var obj in savedList) {
provider.deleteRecord(obj);
}
}
Future<int> getNextAutoIncrementValue() async { Future<int> getNextAutoIncrementValue() async {
var counterBox = await Hive.openBox<int>('counterBox'); var counterBox = await Hive.openBox<int>('counterBox');
if (!counterBox.containsKey('counter')) { if (!counterBox.containsKey('counter')) {

View File

@ -1,46 +1,46 @@
import 'dart:convert';
import 'dart:ffi';
import 'dart:io';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'package:hive_flutter/hive_flutter.dart'; import 'package:hive_flutter/hive_flutter.dart';
import 'package:path_provider/path_provider.dart';
import 'package:pwa_ios/model/interaction_config_data.dart'; import 'package:pwa_ios/model/interaction_config_data.dart';
import 'package:pwa_ios/model/interaction_data.dart'; import 'package:pwa_ios/model/interaction_data.dart';
import 'package:pwa_ios/utils/mockapi.dart'; import 'package:pwa_ios/utils/mockapi.dart';
import 'package:pwa_ios/utils/util.dart'; import 'package:pwa_ios/utils/util.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:internet_connection_checker/internet_connection_checker.dart';
import 'package:file_picker/file_picker.dart';
class ConfigDataProvider extends ChangeNotifier { class ConfigDataProvider extends ChangeNotifier {
Future<void> initConfigUIData() async { Future<void> initConfigUIData() async {
// dynamic jsonResult = await MockApiCall().getConfigData();
List<InteractionConfigData> interactionConfigData = []; List<InteractionConfigData> interactionConfigData = [];
// interactionConfigData = await fetchInteactionConfigData(); // interactionConfigData = await fetchInteactionConfigData();
//interactionConfigData = fetchInteactionUIConfigData(jsonResult); //interactionConfigData = fetchInteactionUIConfigData(jsonResult);
interactionConfigData = await fetchLocalInteactionConfigData(); if (await InternetConnectionChecker().hasConnection) {
var box = interactionConfigData = await fetchLocalInteactionConfigData();
await Hive.openBox<InteractionConfigData>('InteractionConfigDataBox'); var box = Hive.box<InteractionConfigData>('InteractionConfigDataBox');
if (box.isEmpty) {
for (InteractionConfigData data in interactionConfigData) {
box.put(await getNextAutoIncrementValue(), data);
}
} else {
box.clear();
for (InteractionConfigData data in interactionConfigData) { if (!box.isOpen) {
box.put(await getNextAutoIncrementValue(), data); box = await Hive.openBox<InteractionConfigData>(
'InteractionConfigDataBox');
}
if (box.isEmpty) {
for (InteractionConfigData data in interactionConfigData) {
box.put(await getNextAutoIncrementValue(), data);
}
} else {
box.clear();
for (InteractionConfigData data in interactionConfigData) {
box.put(await getNextAutoIncrementValue(), data);
}
} }
} }
notifyListeners(); notifyListeners();
} }
Future<List<InteractionConfigData>> fetchLocalInteactionConfigData() async { Future<List<InteractionConfigData>> fetchLocalInteactionConfigData() async {
dynamic jsonResult = jsonDecode( // dynamic jsonResult = jsonDecode(
await rootBundle.loadString("assets/images/interactiondata.json")); // await rootBundle.loadString("assets/images/interactiondata.json"));
dynamic jsonResult = await MockApiCall().getConfigData();
// dynamic jsonResultc2 = jsonDecode( // dynamic jsonResultc2 = jsonDecode(
// await rootBundle.loadString("assets/images/interactiondatac2.json")); // await rootBundle.loadString("assets/images/interactiondatac2.json"));
// // for (var value in jsonResult) { // // for (var value in jsonResult) {
@ -50,14 +50,15 @@ class ConfigDataProvider extends ChangeNotifier {
// dynamic jsonResult2 = jsonDecode( // dynamic jsonResult2 = jsonDecode(
// await rootBundle.loadString("assets/images/interactionform.json")); // await rootBundle.loadString("assets/images/interactionform.json"));
dynamic jsonResult2c2 = jsonDecode( // dynamic jsonResult2c2 = jsonDecode(
await rootBundle.loadString("assets/images/newconfigdata.json")); // await rootBundle.loadString("assets/images/newconfigdata.json"));
List<InteractionConfigData> interactionConfigData = []; List<InteractionConfigData> interactionConfigData = [];
// for (var value in jsonResult) { // for (var value in jsonResult) {
// InteractionResultData interactionConfig = // InteractionResultData interactionConfig =
// InteractionResultData.fromJson(jsonResult2); // InteractionResultData.fromJson(jsonResult2);
ResponseData responseData = ResponseDataFromJson(jsonResult2c2); ResponseData responseData = ResponseDataFromJson(jsonResult);
for (InteractionResultData obj in responseData.data) { for (InteractionResultData obj in responseData.data) {
// InteractionResultData interactionConfigc2 = // InteractionResultData interactionConfigc2 =
// InteractionResultData.fromJson(obj); // InteractionResultData.fromJson(obj);
@ -68,7 +69,7 @@ class ConfigDataProvider extends ChangeNotifier {
// widgets: interactionConfig, // widgets: interactionConfig,
// id: "IN01", // id: "IN01",
// name: "InteractionForm1")); // name: "InteractionForm1"));
// interactionConfigData.add( // inte ractionConfigData.add(
InteractionConfigData(widgets: obj, id: obj.id, name: obj.name)); InteractionConfigData(widgets: obj, id: obj.id, name: obj.name));
} }
return interactionConfigData; return interactionConfigData;

View File

@ -1,12 +1,8 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:io';
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:hive_flutter/hive_flutter.dart'; import 'package:hive_flutter/hive_flutter.dart';
import 'package:provider/provider.dart';
import 'package:pwa_ios/model/interaction_config_data.dart'; import 'package:pwa_ios/model/interaction_config_data.dart';
import 'package:pwa_ios/model/interaction_data.dart'; import 'package:pwa_ios/model/interaction_data.dart';
@ -15,7 +11,6 @@ import 'package:pwa_ios/model/json_form_data.dart';
import 'package:pwa_ios/model/location_model.dart'; import 'package:pwa_ios/model/location_model.dart';
import 'package:pwa_ios/model/save_interaction.dart'; import 'package:pwa_ios/model/save_interaction.dart';
import 'package:pwa_ios/repository/hive_repository.dart'; import 'package:pwa_ios/repository/hive_repository.dart';
import 'package:pwa_ios/utils/mockapi.dart';
import '../utils/util.dart'; import '../utils/util.dart';
@ -50,10 +45,16 @@ class InteractionProvider extends ChangeNotifier {
initConfigData() async { initConfigData() async {
_hiveprovider.openHiveBox(); _hiveprovider.openHiveBox();
intConfigDataList = _hiveprovider.getAllDataFromHive(); intConfigDataList = _hiveprovider.getAllDataFromHive();
notifyListeners();
} }
Future<void> getRecords() async { Future<void> getRecords() async {
var box = await Hive.openBox<SaveInteraction>('InteractionDataBox'); var box = Hive.box<SaveInteraction>('InteractionDataBox');
if (!box.isOpen) {
box = await Hive.openBox<SaveInteraction>('InteractionDataBox');
}
savedList = box.values.toList(); savedList = box.values.toList();
notifyListeners(); notifyListeners();
} }
@ -64,7 +65,7 @@ class InteractionProvider extends ChangeNotifier {
// intConfigDataList = _hiveprovider.getAllDataFromHive(); // intConfigDataList = _hiveprovider.getAllDataFromHive();
dynamic jsonResult = jsonDecode( dynamic jsonResult = jsonDecode(
await rootBundle.loadString("assets/images/interactiondata.json")); await rootBundle.loadString("assets/images/interactiondata.json"));
await initConfigData();
InteractionConfigData interactionConfigData = intConfigDataList[index]; InteractionConfigData interactionConfigData = intConfigDataList[index];
intId = intConfigDataList[index].id; intId = intConfigDataList[index].id;
intName = intConfigDataList[index].name; intName = intConfigDataList[index].name;
@ -165,6 +166,7 @@ class InteractionProvider extends ChangeNotifier {
// } // }
String getDataValue(String widgetId, String id) { String getDataValue(String widgetId, String id) {
print("issue *************");
if (id != "") { if (id != "") {
List<InputClass> list = []; List<InputClass> list = [];
String value = ' '; String value = ' ';
@ -345,9 +347,9 @@ class InteractionProvider extends ChangeNotifier {
} else if (sectionItem.widget == InteractionWidget.CHECKBOX) { } else if (sectionItem.widget == InteractionWidget.CHECKBOX) {
List<InputClass> list = sectionItem.inputList!; List<InputClass> list = sectionItem.inputList!;
if (list.isNotEmpty) { if (list.isNotEmpty) {
sectionItem.inputList!.forEach((element) { for (var element in sectionItem.inputList!) {
element.ischecked = false; element.ischecked = false;
}); }
} }
// sectionItem.value = list[0].id; // sectionItem.value = list[0].id;
// sectionItem.selectedValue!.add(list[0].id); // sectionItem.selectedValue!.add(list[0].id);
@ -602,11 +604,15 @@ class InteractionProvider extends ChangeNotifier {
form: form, form: form,
intId: intId ?? "id", intId: intId ?? "id",
intName: intName ?? "name"); intName: intName ?? "name");
var box = Hive.box<SaveInteraction>('InteractionDataBox');
final box = await Hive.openBox<SaveInteraction>('InteractionDataBox'); if (!box.isOpen) {
box = await Hive.openBox<SaveInteraction>('InteractionDataBox');
}
await box.put(await getNextAutoIncrementValue(), data); await box.put(await getNextAutoIncrementValue(), data);
box.close(); // box.close();
await getRecords();
return generateId; return generateId;
// await MockApiCall().postFormData(data); // await MockApiCall().postFormData(data);
// await prov.addOfflineData(data); // await prov.addOfflineData(data);
@ -641,10 +647,10 @@ class InteractionProvider extends ChangeNotifier {
List<SectionList> sectionList, List<SectionList> multipleList) { List<SectionList> sectionList, List<SectionList> multipleList) {
List<List<MultipleSectionList>> list = []; List<List<MultipleSectionList>> list = [];
List<List<MultipleSectionList>> listing = []; List<List<MultipleSectionList>> listing = [];
List<MultipleSectionList> _secList = getModifiedList(sectionList); List<MultipleSectionList> secList = getModifiedList(sectionList);
List<MultipleSectionList> _multipleList = getModifiedList(multipleList); List<MultipleSectionList> multipleList0 = getModifiedList(multipleList);
list.add(_secList); list.add(secList);
listing.add(_secList); listing.add(secList);
// List<SectionList> listing = []; // List<SectionList> listing = [];
if (multipleList.isNotEmpty) { if (multipleList.isNotEmpty) {
final releaseDateMap = multipleList.groupBy((m) => m.gid); final releaseDateMap = multipleList.groupBy((m) => m.gid);
@ -657,7 +663,7 @@ class InteractionProvider extends ChangeNotifier {
for (var item in mulList) { for (var item in mulList) {
listing.add(getModifiedList(item)); listing.add(getModifiedList(item));
} }
listing.add(_secList); listing.add(secList);
list = [...listing]; list = [...listing];
//}); //});

View File

@ -1,6 +1,5 @@
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:hive_flutter/hive_flutter.dart'; import 'package:hive_flutter/hive_flutter.dart';
import 'package:pwa_ios/model/save_interaction.dart';
import 'package:pwa_ios/model/userdata_model.dart'; import 'package:pwa_ios/model/userdata_model.dart';
class LoginProvider extends ChangeNotifier { class LoginProvider extends ChangeNotifier {

View File

@ -1,12 +1,9 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:io';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:hive_flutter/hive_flutter.dart'; import 'package:hive_flutter/hive_flutter.dart';
import 'package:provider/provider.dart';
import 'package:pwa_ios/model/interaction_config_data.dart'; import 'package:pwa_ios/model/interaction_config_data.dart';
import 'package:pwa_ios/model/interaction_data.dart'; import 'package:pwa_ios/model/interaction_data.dart';
@ -15,10 +12,8 @@ import 'package:pwa_ios/model/json_form_data.dart';
import 'package:pwa_ios/model/location_model.dart'; import 'package:pwa_ios/model/location_model.dart';
import 'package:pwa_ios/model/save_interaction.dart'; import 'package:pwa_ios/model/save_interaction.dart';
import 'package:pwa_ios/repository/hive_repository.dart'; import 'package:pwa_ios/repository/hive_repository.dart';
import 'package:pwa_ios/utils/mockapi.dart';
import 'package:pwa_ios/viewmodel/interactionprovider.dart'; import 'package:pwa_ios/viewmodel/interactionprovider.dart';
import '../utils/util.dart';
class ViewInteractionProvider extends ChangeNotifier { class ViewInteractionProvider extends ChangeNotifier {
List<FormFieldData> interactionReponseList = []; List<FormFieldData> interactionReponseList = [];
@ -366,8 +361,8 @@ class ViewInteractionProvider extends ChangeNotifier {
int i = 0; int i = 0;
for (var obj in interactionReponseList) { for (var obj in interactionReponseList) {
if (multiple && obj.multipleList != null) { if (multiple && obj.multipleList != null) {
i = obj.multipleList! i = obj.multipleList!.indexWhere((element) =>
.indexWhere((element) => element.id == sectionItem.id); element.id == sectionItem.id && element.gid == sectionItem.gid);
if (i != -1) { if (i != -1) {
obj.multipleList![i].value = value; obj.multipleList![i].value = value;
obj.multipleList![i].tempselectedValue = []; obj.multipleList![i].tempselectedValue = [];
@ -390,7 +385,7 @@ class ViewInteractionProvider extends ChangeNotifier {
Future<void> disposeValues() async { Future<void> disposeValues() async {
print("dispose called"); print("dispose called");
await _hiveprovider.closeHiveBox(); // await _hiveprovider.closeHiveBox();
for (var obj in interactionReponseList) { for (var obj in interactionReponseList) {
obj.multipleList!.clear(); obj.multipleList!.clear();
// for (var obj2 in obj.sectionList) { // for (var obj2 in obj.sectionList) {
@ -406,8 +401,8 @@ class ViewInteractionProvider extends ChangeNotifier {
int i = 0; int i = 0;
for (var obj in interactionReponseList) { for (var obj in interactionReponseList) {
if (multiple && obj.multipleList != null) { if (multiple && obj.multipleList != null) {
i = obj.multipleList! i = obj.multipleList!.indexWhere((element) =>
.indexWhere((element) => element.id == sectionItem.id); element.id == sectionItem.id && element.gid == sectionItem.gid);
if (i != -1) { if (i != -1) {
obj.multipleList![i].value = value; obj.multipleList![i].value = value;
obj.multipleList![i].selectedValue!.add(value); obj.multipleList![i].selectedValue!.add(value);
@ -428,8 +423,8 @@ class ViewInteractionProvider extends ChangeNotifier {
int i = 0; int i = 0;
for (var obj in interactionReponseList) { for (var obj in interactionReponseList) {
if (multiple && obj.multipleList != null) { if (multiple && obj.multipleList != null) {
i = obj.multipleList! i = obj.multipleList!.indexWhere((element) =>
.indexWhere((element) => element.id == sectionItem.id); element.id == sectionItem.id && element.gid == sectionItem.gid);
if (i != -1) { if (i != -1) {
obj.multipleList![i].value = value; obj.multipleList![i].value = value;
obj.multipleList![i].tempselectedValue = []; obj.multipleList![i].tempselectedValue = [];
@ -571,8 +566,8 @@ class ViewInteractionProvider extends ChangeNotifier {
int index2 = 0; int index2 = 0;
for (var obj in interactionReponseList) { for (var obj in interactionReponseList) {
if (multiple && obj.multipleList != null) { if (multiple && obj.multipleList != null) {
index2 = obj.multipleList! index2 = obj.multipleList!.indexWhere((element) =>
.indexWhere((element) => element.id == sectionItem.id); element.id == sectionItem.id && element.gid == sectionItem.gid);
if (index2 != -1) { if (index2 != -1) {
obj.multipleList![index2].value = sectionItem.inputList![index].id; obj.multipleList![index2].value = sectionItem.inputList![index].id;
obj.multipleList![index2].selectedValue! obj.multipleList![index2].selectedValue!
@ -727,16 +722,18 @@ class ViewInteractionProvider extends ChangeNotifier {
intId: saveInteraction.intId, intId: saveInteraction.intId,
intName: saveInteraction.intName, intName: saveInteraction.intName,
); );
var box = Hive.box<SaveInteraction>('InteractionDataBox');
var box = await Hive.openBox<SaveInteraction>('InteractionDataBox'); if (!box.isOpen) {
// box.put(await getNextAutoIncrementValue(), data); box = await Hive.openBox<SaveInteraction>('InteractionDataBox');
}
int index = int index =
box.values.toList().indexWhere((element) => element.id == data.id); box.values.toList().indexWhere((element) => element.id == data.id);
box.putAt(index, data); box.putAt(index, data);
await getRecords(saveInteraction.form!); await getRecords(saveInteraction.form!);
box.close(); // box.close();
// await MockApiCall().postFormData(data); // await MockApiCall().postFormData(data);
} }
@ -752,7 +749,7 @@ class ViewInteractionProvider extends ChangeNotifier {
}); });
box.delete(deleteKey); box.delete(deleteKey);
await getRecords(saveInteraction.form!); await getRecords(saveInteraction.form!);
box.close(); //box.close();
} }
List<MultipleSectionList> getModifiedList(List<SectionList> sectionList) { List<MultipleSectionList> getModifiedList(List<SectionList> sectionList) {

View File

@ -1,15 +1,9 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:pwa_ios/utils/apicall.dart'; import 'package:pwa_ios/utils/apicall.dart';
import 'package:pwa_ios/main.dart';
import 'package:pwa_ios/views/interaction_module/interaction_screen.dart';
import 'package:pwa_ios/views/interaction_module/interactionlistscreen.dart'; import 'package:pwa_ios/views/interaction_module/interactionlistscreen.dart';
import 'package:pwa_ios/views/konectarpage.dart'; import 'package:pwa_ios/views/konectarpage.dart';
import 'package:pwa_ios/views/notification_screen.dart';
import 'package:pwa_ios/views/notifications.dart'; import 'package:pwa_ios/views/notifications.dart';
import 'package:pwa_ios/views/profile.dart'; import 'package:pwa_ios/views/profile.dart';
import 'package:pwa_ios/views/webview_example.dart';
class HomeScreen extends StatefulWidget { class HomeScreen extends StatefulWidget {
const HomeScreen({super.key}); const HomeScreen({super.key});
@ -47,14 +41,14 @@ class _HomeScreenState extends State<HomeScreen> {
type: BottomNavigationBarType.fixed, type: BottomNavigationBarType.fixed,
currentIndex: _selectedIndex, currentIndex: _selectedIndex,
//backgroundColor: Color.fromARGB(255, 35, 79, 150), //backgroundColor: Color.fromARGB(255, 35, 79, 150),
selectedItemColor: Color.fromARGB(255, 35, 79, 150), selectedItemColor: const Color.fromARGB(255, 35, 79, 150),
unselectedItemColor: Color.fromARGB(255, 153, 153, 163), unselectedItemColor: const Color.fromARGB(255, 153, 153, 163),
iconSize: 40, iconSize: 40,
onTap: _onItemTapped, onTap: _onItemTapped,
elevation: 1, elevation: 1,
items: <BottomNavigationBarItem>[ items: <BottomNavigationBarItem>[
BottomNavigationBarItem( BottomNavigationBarItem(
icon: Container( icon: SizedBox(
width: 30, width: 30,
height: 30, height: 30,
child: Image.asset( child: Image.asset(
@ -62,15 +56,15 @@ class _HomeScreenState extends State<HomeScreen> {
), ),
), ),
label: 'Konectar', label: 'Konectar',
backgroundColor: Color.fromARGB(255, 168, 170, 173)), backgroundColor: const Color.fromARGB(255, 168, 170, 173)),
// const BottomNavigationBarItem( const BottomNavigationBarItem(
// icon: Icon( icon: Icon(
// Icons.notifications, Icons.notifications,
// size: 30, size: 30,
// ), ),
// label: 'Notifications', label: 'frappe',
// backgroundColor: Colors.blue, backgroundColor: Colors.blue,
// ), ),
const BottomNavigationBarItem( const BottomNavigationBarItem(
icon: Icon( icon: Icon(
Icons.edit_document, Icons.edit_document,
@ -91,8 +85,10 @@ class _HomeScreenState extends State<HomeScreen> {
body: _selectedIndex == 0 body: _selectedIndex == 0
? const MyApp() ? const MyApp()
: _selectedIndex == 1 : _selectedIndex == 1
? const InteractionListScreen() ? const NotificationsScreen()
: const ProfileScreen(), : _selectedIndex == 2
? const InteractionListScreen()
: const ProfileScreen(),
); );
} }
} }

View File

@ -1,13 +1,13 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:pwa_ios/main.dart';
import 'package:pwa_ios/model/interaction_data.dart'; import 'package:pwa_ios/model/interaction_data.dart';
import 'package:pwa_ios/model/save_interaction.dart'; import 'package:pwa_ios/model/save_interaction.dart';
import 'package:pwa_ios/utils/util.dart'; import 'package:pwa_ios/utils/util.dart';
@ -56,6 +56,9 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
void initState() { void initState() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
// initConfig(); // initConfig();
if (mytimer!.isActive) {
cancelTimer();
}
init(); init();
}); });
@ -95,7 +98,7 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
//resizeToAvoidBottomInset: false, //resizeToAvoidBottomInset: false,
appBar: AppBar( appBar: AppBar(
title: Text( title: Text(
'${widget.saveInteraction.id}', widget.saveInteraction.id,
style: TextStyle( style: TextStyle(
fontSize: isTablet ? 22 : 14, color: Colors.white), fontSize: isTablet ? 22 : 14, color: Colors.white),
), ),
@ -335,7 +338,10 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
}) { }) {
switch (widgetData) { switch (widgetData) {
case InteractionWidget.CHECKBOX: case InteractionWidget.CHECKBOX:
return buildCheckbox(sectionItem, item.sectionName, provider, multiple); return (sectionItem.inputList!.length >= 5)
? customMultiselectDropdown(
sectionItem, provider, sectionItem.inputList!, multiple)
: buildCheckbox(sectionItem, item.sectionName, provider, multiple);
case InteractionWidget.AUTOCOMPLETE: case InteractionWidget.AUTOCOMPLETE:
return customAutoCompletedropdown( return customAutoCompletedropdown(
@ -345,7 +351,10 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
return customMultiselectDropdown(sectionItem, provider, list, multiple); return customMultiselectDropdown(sectionItem, provider, list, multiple);
case InteractionWidget.RADIO: case InteractionWidget.RADIO:
return buildRadio(sectionItem, provider); return (sectionItem.inputList!.length >= 5)
? customdropdown(
sectionItem, provider, sectionItem.inputList!, multiple)
: buildRadio(sectionItem, provider);
case InteractionWidget.LABEL: case InteractionWidget.LABEL:
return Text(sectionItem.input!); return Text(sectionItem.input!);
@ -416,8 +425,8 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
maxchars: int.parse(sectionItem.chars ?? "0"), maxchars: int.parse(sectionItem.chars ?? "0"),
controller: sectionItem.controller!, controller: sectionItem.controller!,
labelText: sectionItem.name, labelText: sectionItem.name,
maxlines: 4, // maxlines: 4,
minlines: 3, // minlines: 3,
onChanged: (val) { onChanged: (val) {
sectionItem.selectedValue = []; sectionItem.selectedValue = [];
setState(() {}); setState(() {});
@ -434,7 +443,7 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
controller: sectionItem.controller!, controller: sectionItem.controller!,
inputType: sectionItem.input == "number" inputType: sectionItem.input == "number"
? TextInputType.number ? TextInputType.number
: TextInputType.none, : TextInputType.name,
labelText: sectionItem.name, labelText: sectionItem.name,
onChanged: (val) { onChanged: (val) {
sectionItem.selectedValue = []; sectionItem.selectedValue = [];
@ -459,8 +468,8 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
), ),
labelStyle: TextStyle(fontSize: 16), labelStyle: const TextStyle(fontSize: 16),
suffixIcon: Icon(Icons.calendar_today), //icon of text field suffixIcon: const Icon(Icons.calendar_today), //icon of text field
labelText: "Enter Date" //label text of field labelText: "Enter Date" //label text of field
), ),
readOnly: true, //set it true, so that user will not able to edit text readOnly: true, //set it true, so that user will not able to edit text
@ -503,13 +512,13 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
CustomButton( CustomButton(
backgroundColor: Colors.green.shade900, backgroundColor: Colors.green.shade900,
onPressed: () async { onPressed: () async {
if (textFieldsValidation(provider).isEmpty) { // if (textFieldsValidation(provider).isEmpty) {
await provider.saveJsonObject(context, await provider.saveJsonObject(context,
widget.saveInteraction.intId, widget.saveInteraction); widget.saveInteraction.intId, widget.saveInteraction);
showAlertDialog(context, widget.saveInteraction.id!); showAlertDialog(context, widget.saveInteraction.id);
} else { // } else {
_displaySnackBar(textFieldsValidation(provider)); // _displaySnackBar(textFieldsValidation(provider));
} // }
}, },
textColor: Colors.white, textColor: Colors.white,
title: "Update", title: "Update",
@ -550,7 +559,7 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
}); });
}, },
), ),
Text('${value.name}'), Text(value.name),
], ],
), ),
], ],
@ -578,7 +587,7 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
//setState(() {}); //setState(() {});
}, },
), ),
Text('${value.name}'), Text(value.name),
], ],
), ),
], ],
@ -614,7 +623,7 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
), ),
hint: Text( hint: Text(
'Select ${sectionItem.name}', 'Select ${sectionItem.name}',
style: TextStyle(fontSize: 14), style: const TextStyle(fontSize: 14),
), ),
items: list items: list
.map((item) => DropdownMenuItem<InputClass>( .map((item) => DropdownMenuItem<InputClass>(
@ -910,8 +919,8 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
int listIndex) { int listIndex) {
return Padding( return Padding(
padding: isTablet padding: isTablet
? EdgeInsets.only(left: 8.0) ? const EdgeInsets.only(left: 8.0)
: EdgeInsets.only(left: 12.0, right: 12.0), : const EdgeInsets.only(left: 12.0, right: 12.0),
child: GridView.count( child: GridView.count(
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
crossAxisCount: context.responsive<int>( crossAxisCount: context.responsive<int>(
@ -1029,7 +1038,7 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
const EdgeInsets.only(left: 3.0, top: 5), const EdgeInsets.only(left: 3.0, top: 5),
child: CustomButton( child: CustomButton(
backgroundColor: backgroundColor:
Color.fromARGB(255, 233, 75, 75), const Color.fromARGB(255, 233, 75, 75),
onPressed: () { onPressed: () {
provider.deleteMultipleRows( provider.deleteMultipleRows(
sectionItem.gid!, sectionItem.gid!,
@ -1085,7 +1094,7 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
final snackBar = SnackBar( final snackBar = SnackBar(
content: Text( content: Text(
msg, msg,
style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold), style: const TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold),
)); ));
ScaffoldMessenger.of(context).showSnackBar(snackBar); ScaffoldMessenger.of(context).showSnackBar(snackBar);
//scaffoldKeyLogin.currentState!.showSnackBar(snackBar); //scaffoldKeyLogin.currentState!.showSnackBar(snackBar);
@ -1116,7 +1125,7 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
print("see the converted directory path $convertedDirectoryPath"); print("see the converted directory path $convertedDirectoryPath");
newPath = convertedDirectoryPath + "/konectar/files"; newPath = "$convertedDirectoryPath/konectar/files";
print("new path :$newPath"); print("new path :$newPath");
directory = Directory(newPath); directory = Directory(newPath);
if (!await directory.exists()) { if (!await directory.exists()) {
@ -1154,7 +1163,7 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
// ViewInteractionProvider provider = // ViewInteractionProvider provider =
// Provider.of<ViewInteractionProvider>(context, listen: false); // Provider.of<ViewInteractionProvider>(context, listen: false);
Widget cancelButton = TextButton( Widget cancelButton = TextButton(
child: Text("Ok"), child: const Text("Ok"),
onPressed: () async { onPressed: () async {
Navigator.of(context).pop(); Navigator.of(context).pop();
Navigator.of(context).pop(); Navigator.of(context).pop();
@ -1185,7 +1194,7 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
// ViewInteractionProvider provider = // ViewInteractionProvider provider =
// Provider.of<ViewInteractionProvider>(context, listen: false); // Provider.of<ViewInteractionProvider>(context, listen: false);
Widget cancelButton = TextButton( Widget cancelButton = TextButton(
child: Text("Upload"), child: const Text("Upload"),
onPressed: () async { onPressed: () async {
Navigator.of(context).pop(); Navigator.of(context).pop();
sectionItem.selectedValue = []; sectionItem.selectedValue = [];
@ -1195,7 +1204,7 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
}, },
); );
Widget okButton = TextButton( Widget okButton = TextButton(
child: Text("Cancel"), child: const Text("Cancel"),
onPressed: () async { onPressed: () async {
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
@ -1205,7 +1214,7 @@ class _EditInteractionScreenState extends State<EditInteractionScreen> {
title: const Text(""), title: const Text(""),
content: Text( content: Text(
"Following File(s) $files uploaded .Do you still want to upload files ?", "Following File(s) $files uploaded .Do you still want to upload files ?",
style: TextStyle(fontSize: 15), style: const TextStyle(fontSize: 15),
), ),
actions: [cancelButton, okButton], actions: [cancelButton, okButton],
); );

View File

@ -1,17 +1,15 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:pwa_ios/main.dart';
import 'package:pwa_ios/model/interaction_data.dart'; import 'package:pwa_ios/model/interaction_data.dart';
import 'package:pwa_ios/utils/mockapi.dart';
import 'package:pwa_ios/utils/util.dart'; import 'package:pwa_ios/utils/util.dart';
import 'package:pwa_ios/viewmodel/configprovider.dart';
import 'package:pwa_ios/viewmodel/interactionprovider.dart'; import 'package:pwa_ios/viewmodel/interactionprovider.dart';
import 'package:pwa_ios/widgets/custombutton.dart'; import 'package:pwa_ios/widgets/custombutton.dart';
import 'package:pwa_ios/widgets/customrangeslider.dart'; import 'package:pwa_ios/widgets/customrangeslider.dart';
@ -41,6 +39,9 @@ class _InteractionScreenState extends State<InteractionScreen> {
@override @override
void initState() { void initState() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
if (mytimer!.isActive) {
cancelTimer();
}
init(); init();
}); });
@ -216,7 +217,10 @@ class _InteractionScreenState extends State<InteractionScreen> {
'add' 'add'
? const SizedBox.shrink() ? const SizedBox.shrink()
: Text( : Text(
'${sectionItem.name}:*', sectionItem.validation!
.isRequired
? '${sectionItem.name}:*'
: '${sectionItem.name}:',
style: TextStyle( style: TextStyle(
color: Colors color: Colors
.orange.shade800, .orange.shade800,
@ -292,7 +296,10 @@ class _InteractionScreenState extends State<InteractionScreen> {
}) { }) {
switch (widgetData) { switch (widgetData) {
case InteractionWidget.CHECKBOX: case InteractionWidget.CHECKBOX:
return buildCheckbox(sectionItem, item.sectionName, provider, multiple); return (sectionItem.inputList!.length >= 5)
? customMultiselectDropdown(
sectionItem, provider, sectionItem.inputList!, multiple)
: buildCheckbox(sectionItem, item.sectionName, provider, multiple);
case InteractionWidget.AUTOCOMPLETE: case InteractionWidget.AUTOCOMPLETE:
return customAutoCompletedropdown( return customAutoCompletedropdown(
@ -302,7 +309,10 @@ class _InteractionScreenState extends State<InteractionScreen> {
return customMultiselectDropdown(sectionItem, provider, list, multiple); return customMultiselectDropdown(sectionItem, provider, list, multiple);
case InteractionWidget.RADIO: case InteractionWidget.RADIO:
return buildRadio(sectionItem, provider); return (sectionItem.inputList!.length >= 5)
? customdropdown(
sectionItem, provider, sectionItem.inputList!, multiple)
: buildRadio(sectionItem, provider);
case InteractionWidget.LABEL: case InteractionWidget.LABEL:
return Text(sectionItem.input!); return Text(sectionItem.input!);
@ -372,8 +382,8 @@ class _InteractionScreenState extends State<InteractionScreen> {
maxchars: int.parse(sectionItem.validation!.chars ?? "0"), maxchars: int.parse(sectionItem.validation!.chars ?? "0"),
controller: sectionItem.controller!, controller: sectionItem.controller!,
labelText: sectionItem.name, labelText: sectionItem.name,
maxlines: 4, // maxlines: 8,
minlines: 3, //minlines: 4,
onChanged: (val) { onChanged: (val) {
sectionItem.selectedValue = []; sectionItem.selectedValue = [];
setState(() {}); setState(() {});
@ -388,7 +398,7 @@ class _InteractionScreenState extends State<InteractionScreen> {
child: InteractionTextField( child: InteractionTextField(
inputType: sectionItem.input == "number" inputType: sectionItem.input == "number"
? TextInputType.number ? TextInputType.number
: TextInputType.none, : TextInputType.name,
maxchars: int.parse(sectionItem.chars ?? "0"), maxchars: int.parse(sectionItem.chars ?? "0"),
controller: sectionItem.controller!, controller: sectionItem.controller!,
labelText: sectionItem.name, labelText: sectionItem.name,
@ -537,7 +547,7 @@ class _InteractionScreenState extends State<InteractionScreen> {
}); });
}, },
), ),
Text('${value.name}'), Text(value.name),
], ],
), ),
], ],
@ -565,7 +575,7 @@ class _InteractionScreenState extends State<InteractionScreen> {
//setState(() {}); //setState(() {});
}, },
), ),
Text('${value.name}'), Text(value.name),
], ],
), ),
], ],
@ -601,7 +611,7 @@ class _InteractionScreenState extends State<InteractionScreen> {
), ),
hint: Text( hint: Text(
'Select ${sectionItem.name}', 'Select ${sectionItem.name}',
style: TextStyle(fontSize: 14), style: const TextStyle(fontSize: 14),
), ),
items: list items: list
.map((item) => DropdownMenuItem<InputClass>( .map((item) => DropdownMenuItem<InputClass>(
@ -666,6 +676,7 @@ class _InteractionScreenState extends State<InteractionScreen> {
// if (list.isEmpty) { // if (list.isEmpty) {
// print("list is empty"); // print("list is empty");
list = sectionItem.inputList!; list = sectionItem.inputList!;
print("***Autocomplete list ${list[0].name}");
//} //}
//InputClass selectedObj = list[0]; //InputClass selectedObj = list[0];
return SizedBox( return SizedBox(
@ -899,8 +910,8 @@ class _InteractionScreenState extends State<InteractionScreen> {
int listIndex) { int listIndex) {
return Padding( return Padding(
padding: isTablet padding: isTablet
? EdgeInsets.only(left: 8.0) ? const EdgeInsets.only(left: 8.0)
: EdgeInsets.only(left: 12.0, right: 12.0), : const EdgeInsets.only(left: 12.0, right: 12.0),
child: GridView.count( child: GridView.count(
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
crossAxisCount: context.responsive<int>( crossAxisCount: context.responsive<int>(
@ -980,7 +991,7 @@ class _InteractionScreenState extends State<InteractionScreen> {
), ),
Text( Text(
sectionItem.selectedValue!.isNotEmpty sectionItem.selectedValue!.isNotEmpty
? sectionItem.selectedValue!.length > 0 ? sectionItem.selectedValue!.isNotEmpty
? 'File uploaded' ? 'File uploaded'
: "Files Uploaded" : "Files Uploaded"
: 'No file uploaded', : 'No file uploaded',
@ -1013,7 +1024,7 @@ class _InteractionScreenState extends State<InteractionScreen> {
const EdgeInsets.only(left: 3.0, top: 5), const EdgeInsets.only(left: 3.0, top: 5),
child: CustomButton( child: CustomButton(
backgroundColor: backgroundColor:
Color.fromARGB(255, 233, 75, 75), const Color.fromARGB(255, 233, 75, 75),
onPressed: () { onPressed: () {
provider.deleteMultipleRows( provider.deleteMultipleRows(
sectionItem.gid!, sectionItem.gid!,
@ -1046,22 +1057,35 @@ class _InteractionScreenState extends State<InteractionScreen> {
); );
} }
String textFieldsValidation(InteractionProvider provider) { String fieldsValidation(InteractionProvider provider) {
if (provider.sectionList List<SectionList> secList = provider.sectionList
.any((element) => element.controller!.text.isEmpty)) { .where((element) => element.validation!.isRequired = true)
.toList();
if (secList.any((element) => element.selectedValue!.isEmpty)) {
return 'Fields cannot be empty'; return 'Fields cannot be empty';
} }
if (provider.textEditingControllerList.isNotEmpty) { return '';
if (provider.validateTextFields()) { }
return 'Fields cannot be empty';
}
}
if (provider.multipletextEditingControllerList.isNotEmpty) { String textFieldsValidation(InteractionProvider provider) {
if (provider.validateMultipleRows()) { // if (provider.sectionList
return 'Fields cannot be empty'; // .any((element) => element.widget == InteractionWidget.TEXT)) {
} // if (provider.sectionList
} // .any((element) => element.controller!.text.isEmpty)) {
// return 'Fields cannot be empty';
// }
// if (provider.textEditingControllerList.isNotEmpty) {
// if (provider.validateTextFields()) {
// return 'Fields cannot be empty';
// }
// }
// if (provider.multipletextEditingControllerList.isNotEmpty) {
// if (provider.validateMultipleRows()) {
// return 'Fields cannot be empty';
// }
// }
// }
return ''; return '';
} }
@ -1070,7 +1094,7 @@ class _InteractionScreenState extends State<InteractionScreen> {
final snackBar = SnackBar( final snackBar = SnackBar(
content: Text( content: Text(
msg, msg,
style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold), style: const TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold),
)); ));
ScaffoldMessenger.of(context).showSnackBar(snackBar); ScaffoldMessenger.of(context).showSnackBar(snackBar);
//scaffoldKeyLogin.currentState!.showSnackBar(snackBar); //scaffoldKeyLogin.currentState!.showSnackBar(snackBar);
@ -1101,7 +1125,7 @@ class _InteractionScreenState extends State<InteractionScreen> {
print("see the converted directory path $convertedDirectoryPath"); print("see the converted directory path $convertedDirectoryPath");
newPath = convertedDirectoryPath + "/konectar/files"; newPath = "$convertedDirectoryPath/konectar/files";
print("new path :$newPath"); print("new path :$newPath");
directory = Directory(newPath); directory = Directory(newPath);
if (!await directory.exists()) { if (!await directory.exists()) {
@ -1131,7 +1155,7 @@ class _InteractionScreenState extends State<InteractionScreen> {
// ViewInteractionProvider provider = // ViewInteractionProvider provider =
// Provider.of<ViewInteractionProvider>(context, listen: false); // Provider.of<ViewInteractionProvider>(context, listen: false);
Widget cancelButton = TextButton( Widget cancelButton = TextButton(
child: Text("Ok"), child: const Text("Ok"),
onPressed: () async { onPressed: () async {
Navigator.of(context).pop(); Navigator.of(context).pop();
Navigator.of(context).pop(); Navigator.of(context).pop();

View File

@ -1,9 +1,9 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:pwa_ios/main.dart';
import 'package:pwa_ios/model/save_interaction.dart'; import 'package:pwa_ios/model/save_interaction.dart';
import 'package:pwa_ios/utils/util.dart'; import 'package:pwa_ios/utils/util.dart';
import 'package:pwa_ios/viewmodel/interactionprovider.dart'; import 'package:pwa_ios/viewmodel/interactionprovider.dart';
import 'package:pwa_ios/viewmodel/viewinteractionprovider.dart';
import 'package:pwa_ios/views/interaction_module/interaction_screen.dart'; import 'package:pwa_ios/views/interaction_module/interaction_screen.dart';
import 'package:pwa_ios/views/interaction_module/view_forms_list.dart'; import 'package:pwa_ios/views/interaction_module/view_forms_list.dart';
@ -19,6 +19,9 @@ class _InteractionListScreenState extends State<InteractionListScreen> {
@override @override
void initState() { void initState() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
if (!mytimer!.isActive) {
activateTimer();
}
init(); init();
}); });
@ -32,8 +35,9 @@ class _InteractionListScreenState extends State<InteractionListScreen> {
setState(() {}); setState(() {});
} }
int getCount(String form, InteractionProvider provider) { Future<int> getCount(String form, InteractionProvider provider) async {
provider.getRecords(); await provider.getRecords();
return provider.savedList.where((element) => element.form == form).length; return provider.savedList.where((element) => element.form == form).length;
} }
@ -63,7 +67,7 @@ class _InteractionListScreenState extends State<InteractionListScreen> {
title: Row( title: Row(
children: [ children: [
Text( Text(
'Interaction-form${(index + 1).toString()}', provider.intConfigDataList[index].name,
), ),
const SizedBox( const SizedBox(
width: 20, width: 20,
@ -76,8 +80,9 @@ class _InteractionListScreenState extends State<InteractionListScreen> {
builder: (BuildContext context) => builder: (BuildContext context) =>
InteractionScreen( InteractionScreen(
index: index, index: index,
form: form: provider
'Interaction-form${(index + 1).toString()}', .intConfigDataList[index]
.name,
))); )));
}, },
icon: const Icon( icon: const Icon(
@ -90,32 +95,38 @@ class _InteractionListScreenState extends State<InteractionListScreen> {
), ),
trailing: provider.savedList.indexWhere((element) => trailing: provider.savedList.indexWhere((element) =>
element.form == element.form ==
'Interaction-form${(index + 1).toString()}') != provider.intConfigDataList[index].name) !=
-1 -1
? InkWell( ? InkWell(
onTap: () { onTap: () {
if (getCount( if (getCount(
'Interaction-form${(index + 1).toString()}', provider
.intConfigDataList[index].name,
provider) != provider) !=
0) { 0) {
List<SaveInteraction> sendsavedList = provider List<SaveInteraction> sendsavedList =
.savedList provider
.where((element) => .savedList
element.form == .where((element) =>
'Interaction-form${(index + 1).toString()}') element.form ==
.toList(); provider
.intConfigDataList[index]
.name)
.toList();
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (BuildContext context) => builder: (BuildContext context) =>
SavedFormListScreen( SavedFormListScreen(
formname: formname: provider
'Interaction-form${(index + 1).toString()}', .intConfigDataList[
index]
.name,
))); )));
} }
}, },
child: Text( child: Text(
"${getCount('Interaction-form${(index + 1).toString()}', provider).toString()} record(s) saved", "${provider.savedList.where((element) => element.form == provider.intConfigDataList[index].name).length} record(s) saved",
style: TextStyle( style: TextStyle(
fontSize: isTablet ? 18.0 : 14, fontSize: isTablet ? 18.0 : 14,
color: Colors.blue.shade900), color: Colors.blue.shade900),
@ -129,8 +140,8 @@ class _InteractionListScreenState extends State<InteractionListScreen> {
builder: (BuildContext context) => builder: (BuildContext context) =>
InteractionScreen( InteractionScreen(
index: index, index: index,
form: form: provider
'Interaction-form${(index + 1).toString()}', .intConfigDataList[index].name,
))); )));
}, },
), ),

View File

@ -2,10 +2,8 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:pwa_ios/model/save_interaction.dart'; import 'package:pwa_ios/model/save_interaction.dart';
import 'package:pwa_ios/utils/util.dart'; import 'package:pwa_ios/utils/util.dart';
import 'package:pwa_ios/viewmodel/interactionprovider.dart';
import 'package:pwa_ios/viewmodel/viewinteractionprovider.dart'; import 'package:pwa_ios/viewmodel/viewinteractionprovider.dart';
import 'package:pwa_ios/views/interaction_module/edit_interaction_screen.dart'; import 'package:pwa_ios/views/interaction_module/edit_interaction_screen.dart';
import 'package:pwa_ios/views/interaction_module/interaction_screen.dart';
import 'package:pwa_ios/views/interaction_module/view_interaction_screen.dart'; import 'package:pwa_ios/views/interaction_module/view_interaction_screen.dart';
class SavedFormListScreen extends StatefulWidget { class SavedFormListScreen extends StatefulWidget {
@ -73,7 +71,7 @@ class _SavedFormListScreenState extends State<SavedFormListScreen> {
//style: TextStyle(fontStyle: FontStyle.italic), //style: TextStyle(fontStyle: FontStyle.italic),
), ),
title: Text( title: Text(
'${provider.savedList[index].id}', provider.savedList[index].id,
), ),
trailing: SizedBox( trailing: SizedBox(
width: 150, width: 150,
@ -155,7 +153,7 @@ class _SavedFormListScreenState extends State<SavedFormListScreen> {
ViewInteractionProvider provider = ViewInteractionProvider provider =
Provider.of<ViewInteractionProvider>(context, listen: false); Provider.of<ViewInteractionProvider>(context, listen: false);
Widget cancelButton = TextButton( Widget cancelButton = TextButton(
child: Text("YES"), child: const Text("YES"),
onPressed: () async { onPressed: () async {
await provider.deleteRecord(saveInteraction).then((value) { await provider.deleteRecord(saveInteraction).then((value) {
_displaySnackBar("Deleted sucessfully!"); _displaySnackBar("Deleted sucessfully!");
@ -164,7 +162,7 @@ class _SavedFormListScreenState extends State<SavedFormListScreen> {
}, },
); );
Widget continueButton = TextButton( Widget continueButton = TextButton(
child: Text("NO"), child: const Text("NO"),
onPressed: () { onPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
@ -193,7 +191,7 @@ class _SavedFormListScreenState extends State<SavedFormListScreen> {
final snackBar = SnackBar( final snackBar = SnackBar(
content: Text( content: Text(
msg, msg,
style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold), style: const TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold),
)); ));
ScaffoldMessenger.of(context).showSnackBar(snackBar); ScaffoldMessenger.of(context).showSnackBar(snackBar);
//scaffoldKeyLogin.currentState!.showSnackBar(snackBar); //scaffoldKeyLogin.currentState!.showSnackBar(snackBar);

View File

@ -1,19 +1,11 @@
import 'dart:convert';
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:pwa_ios/model/interaction_data.dart'; import 'package:pwa_ios/model/interaction_data.dart';
import 'package:pwa_ios/model/save_interaction.dart'; import 'package:pwa_ios/model/save_interaction.dart';
import 'package:pwa_ios/utils/util.dart'; import 'package:pwa_ios/utils/util.dart';
import 'package:pwa_ios/viewmodel/interactionprovider.dart'; import 'package:pwa_ios/viewmodel/interactionprovider.dart';
import 'package:pwa_ios/widgets/custombutton.dart'; import 'package:pwa_ios/widgets/custombutton.dart';
import 'package:pwa_ios/widgets/customrangeslider.dart';
import 'package:pwa_ios/widgets/interatciontextfield.dart';
import 'package:file_picker/file_picker.dart';
import 'package:pwa_ios/widgets/responsive_ext.dart'; import 'package:pwa_ios/widgets/responsive_ext.dart';
class ViewInteractionScreen extends StatefulWidget { class ViewInteractionScreen extends StatefulWidget {
@ -62,7 +54,7 @@ class _ViewInteractionScreenState extends State<ViewInteractionScreen> {
//resizeToAvoidBottomInset: false, //resizeToAvoidBottomInset: false,
appBar: AppBar( appBar: AppBar(
title: Text( title: Text(
'${widget.saveInteraction.id}', widget.saveInteraction.id,
style: TextStyle( style: TextStyle(
fontSize: isTablet ? 22 : 14, color: Colors.white), fontSize: isTablet ? 22 : 14, color: Colors.white),
), ),
@ -262,19 +254,24 @@ class _ViewInteractionScreenState extends State<ViewInteractionScreen> {
}) { }) {
switch (widgetData) { switch (widgetData) {
case InteractionWidget.CHECKBOX: case InteractionWidget.CHECKBOX:
return Text( return (sectionItem.inputList!.length >= 5)
"${provider.getDataValue(sectionItem.id, sectionItem.selectedValue!.last)}"); ? Text(sectionItem.selectedValue.toString())
: Text(
provider.getDataValue(sectionItem.id, sectionItem.selectedValue!.last));
case InteractionWidget.AUTOCOMPLETE: case InteractionWidget.AUTOCOMPLETE:
return Text( return Text(
"${provider.getDataValue(sectionItem.id, sectionItem.selectedValue!.last)}"); provider.getDataValue(sectionItem.id, sectionItem.selectedValue!.last));
case InteractionWidget.MULTISELECT: case InteractionWidget.MULTISELECT:
return Text("${sectionItem.selectedValue.toString()}"); return Text(sectionItem.selectedValue.toString());
case InteractionWidget.RADIO: case InteractionWidget.RADIO:
return Text( return (sectionItem.inputList!.length >= 5)
"${provider.getDataValue(sectionItem.id, sectionItem.selectedValue!.last)}"); ? Text(
sectionItem.selectedValue!.isNotEmpty ? provider.getDataValue(sectionItem.id, sectionItem.selectedValue!.last) : " ")
: Text(
provider.getDataValue(sectionItem.id, sectionItem.selectedValue!.last));
case InteractionWidget.LABEL: case InteractionWidget.LABEL:
return Text(sectionItem.input!); return Text(sectionItem.input!);
@ -285,17 +282,19 @@ class _ViewInteractionScreenState extends State<ViewInteractionScreen> {
: " "); : " ");
case InteractionWidget.TEXT: case InteractionWidget.TEXT:
return Text(sectionItem.selectedValue!.last); return Text(sectionItem.selectedValue!.isNotEmpty
? sectionItem.selectedValue!.last.toString()
: " ");
case InteractionWidget.BUTTON: case InteractionWidget.BUTTON:
return sectionItem.input == "chooseFile" return sectionItem.input == "chooseFile"
? sectionItem.selectedValue!.isNotEmpty ? sectionItem.selectedValue!.isNotEmpty
? Text("File Uploaded") ? const Text("File Uploaded")
: Text(" ") : const Text(" ")
: Text(" "); : const Text(" ");
default: default:
return Text( return Text(
"${sectionItem.selectedValue!.isNotEmpty ? provider.getDataValue(sectionItem.id, sectionItem.selectedValue!.last) : " "}"); sectionItem.selectedValue!.isNotEmpty ? provider.getDataValue(sectionItem.id, sectionItem.selectedValue!.last) : " ");
} }
} }
@ -355,8 +354,8 @@ class _ViewInteractionScreenState extends State<ViewInteractionScreen> {
int listIndex) { int listIndex) {
return Padding( return Padding(
padding: isTablet padding: isTablet
? EdgeInsets.only(left: 22.0) ? const EdgeInsets.only(left: 22.0)
: EdgeInsets.only(left: 12.0, right: 12.0), : const EdgeInsets.only(left: 12.0, right: 12.0),
child: GridView.count( child: GridView.count(
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
crossAxisCount: context.responsive<int>( crossAxisCount: context.responsive<int>(
@ -441,7 +440,7 @@ class _ViewInteractionScreenState extends State<ViewInteractionScreen> {
final snackBar = SnackBar( final snackBar = SnackBar(
content: Text( content: Text(
msg, msg,
style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold), style: const TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold),
)); ));
ScaffoldMessenger.of(context).showSnackBar(snackBar); ScaffoldMessenger.of(context).showSnackBar(snackBar);
//scaffoldKeyLogin.currentState!.showSnackBar(snackBar); //scaffoldKeyLogin.currentState!.showSnackBar(snackBar);

View File

@ -1,24 +1,16 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'dart:async'; import 'dart:async';
import 'dart:collection'; import 'dart:collection';
import 'dart:io';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:pwa_ios/utils/apicall.dart';
import 'package:pwa_ios/utils/constants.dart'; import 'package:pwa_ios/utils/constants.dart';
import 'package:pwa_ios/views/home_screen.dart';
import 'package:pwa_ios/views/login.dart'; import 'package:pwa_ios/views/login.dart';
import 'package:pwa_ios/utils/util.dart'; import 'package:pwa_ios/utils/util.dart';
import 'package:pwa_ios/views/webview_example.dart';
import 'package:pwa_ios/widgets/webview_popup.dart'; import 'package:pwa_ios/widgets/webview_popup.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import 'dart:ui' as ui;
import 'package:internet_connection_checker/internet_connection_checker.dart'; import 'package:internet_connection_checker/internet_connection_checker.dart';
import 'package:openid_client/openid_client.dart';
import 'package:flutter_web_plugins/url_strategy.dart';
class MyApp extends StatefulWidget { class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key); const MyApp({Key? key}) : super(key: key);
@ -148,11 +140,11 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: FutureBuilder<bool>( child: FutureBuilder<bool>(
future: isNetworkAvailable(), future: InternetConnectionChecker().hasConnection,
builder: (context, snapshot) { builder: (context, snapshot) {
if (!snapshot.hasData) { if (!snapshot.hasData) {
print("no data******"); print("no data******");
return Text("No internet connectivity!"); return const Text("No internet connectivity!");
} }
final bool networkAvailable = snapshot.data ?? false; final bool networkAvailable = snapshot.data ?? false;
@ -182,10 +174,10 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
valueListenable: isLoading, valueListenable: isLoading,
builder: (context, value, child) { builder: (context, value, child) {
return isLoading.value return isLoading.value
? CircularProgressIndicator() ? const CircularProgressIndicator()
: Center( : Center(
child: Container( child: Container(
child: Text( child: const Text(
"No internet connectivity!"), "No internet connectivity!"),
), ),
); );
@ -341,7 +333,8 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
)); ));
} }
if (await isNetworkAvailable() && if (await InternetConnectionChecker()
.hasConnection &&
!(await isPWAInstalled())) { !(await isPWAInstalled())) {
// if network is available and this is the first timeß // if network is available and this is the first timeß
setPWAInstalled(); setPWAInstalled();
@ -352,7 +345,8 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
final isForMainFrame = final isForMainFrame =
request.isForMainFrame ?? true; request.isForMainFrame ?? true;
if (isForMainFrame && if (isForMainFrame &&
!(await isNetworkAvailable())) { !(await InternetConnectionChecker()
.hasConnection)) {
if (!(await isPWAInstalled())) { if (!(await isPWAInstalled())) {
await controller.loadData( await controller.loadData(
data: kHTMLErrorPageNotInstalled); data: kHTMLErrorPageNotInstalled);
@ -411,7 +405,7 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
], ],
) )
: Container( : Container(
child: Text("No internet"), child: const Text("No internet"),
); );
}, },
), ),

View File

@ -1,4 +1,3 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:pwa_ios/model/userdata_model.dart'; import 'package:pwa_ios/model/userdata_model.dart';
@ -102,7 +101,7 @@ class _LoginScreenState extends State<LoginScreen> {
width: isTablet ? 160 : 80, width: isTablet ? 160 : 80,
height: isTablet ? 160 : 80, height: isTablet ? 160 : 80,
child: CircleAvatar( child: CircleAvatar(
backgroundColor: Color.fromARGB(255, 126, 134, 147), backgroundColor: const Color.fromARGB(255, 126, 134, 147),
child: Icon( child: Icon(
Icons.person, Icons.person,
size: isTablet ? 120 : 60, size: isTablet ? 120 : 60,
@ -134,10 +133,20 @@ class _LoginScreenState extends State<LoginScreen> {
// Color.fromARGB(255, 214, 217, 223), // Color.fromARGB(255, 214, 217, 223),
// ], // ],
// )), // )),
child: _buildform(),
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 30, horizontal: 30,
vertical: orientation == Orientation.portrait ? 20 : 0), vertical: orientation == Orientation.portrait ? 20 : 0),
// decoration: const BoxDecoration(
// gradient: LinearGradient(
// begin: Alignment.topRight,
// end: Alignment.bottomLeft,
// colors: [
// Color.fromARGB(255, 126, 134, 147),
// Color.fromARGB(255, 193, 198, 209),
// Color.fromARGB(255, 214, 217, 223),
// ],
// )),
child: _buildform(),
), ),
) )
]; ];
@ -171,7 +180,7 @@ class _LoginScreenState extends State<LoginScreen> {
), ),
CustomTextField( CustomTextField(
labelText: "Secret key", controller: secretKeyTextConrtroller), labelText: "Secret key", controller: secretKeyTextConrtroller),
SizedBox( SizedBox(
height: isTablet ? 40 : 20, height: isTablet ? 40 : 20,
), ),
CustomButton( CustomButton(

View File

@ -1,4 +1,3 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class NotificationCustomScreen extends StatefulWidget { class NotificationCustomScreen extends StatefulWidget {
@ -88,8 +87,8 @@ class _NotificationCustomScreenState extends State<NotificationCustomScreen> {
return MaterialApp( return MaterialApp(
home: Scaffold( home: Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text('Notifications'), title: const Text('Notifications'),
backgroundColor: Color.fromARGB(255, 11, 60, 144), backgroundColor: const Color.fromARGB(255, 11, 60, 144),
), ),
body: Padding( body: Padding(
padding: const EdgeInsets.all(20.0), padding: const EdgeInsets.all(20.0),
@ -170,28 +169,28 @@ class _NotificationCustomScreenState extends State<NotificationCustomScreen> {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Text( child: Text(
item['Start date']!, item['Start date']!,
style: TextStyle(fontSize: 18.0), style: const TextStyle(fontSize: 18.0),
), ),
), ),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Text( child: Text(
item['End date']!, item['End date']!,
style: TextStyle(fontSize: 18.0), style: const TextStyle(fontSize: 18.0),
), ),
), ),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Text( child: Text(
item['notification']!, item['notification']!,
style: TextStyle(fontSize: 18.0), style: const TextStyle(fontSize: 18.0),
), ),
), ),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Text( child: Text(
item['createdby']!, item['createdby']!,
style: TextStyle(fontSize: 18.0), style: const TextStyle(fontSize: 18.0),
), ),
), ),
]) ])
@ -201,7 +200,7 @@ class _NotificationCustomScreenState extends State<NotificationCustomScreen> {
), ),
), ),
floatingActionButton: FloatingActionButton( floatingActionButton: FloatingActionButton(
backgroundColor: Color.fromARGB(255, 11, 60, 144), backgroundColor: const Color.fromARGB(255, 11, 60, 144),
onPressed: () { onPressed: () {
setState(() { setState(() {
// Update the list of table data rows // Update the list of table data rows
@ -229,7 +228,7 @@ class _NotificationCustomScreenState extends State<NotificationCustomScreen> {
]; ];
}); });
}, },
child: Icon(Icons.refresh), child: const Icon(Icons.refresh),
), ),
), ),
); );

View File

@ -3,7 +3,6 @@ import 'dart:convert';
import 'package:pwa_ios/utils/apicall.dart'; import 'package:pwa_ios/utils/apicall.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:theta/theta.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -210,29 +209,33 @@ class _NotificationsScreenState extends State<NotificationsScreen>
return null; return null;
}, },
initialUrlRequest: token.isNotEmpty initialUrlRequest: URLRequest(
? URLRequest( url: WebUri("http://192.168.2.109:8001/forms/new"),
url: WebUri( ),
"https://cardio-staging.konectar.io/notifications/"),
headers: { // token.isNotEmpty
"rows": "10", // ? URLRequest(
"page": "1", // url: WebUri(
"sidx": "name", // "https://cardio-staging.konectar.io/notifications/"),
"sord": "desc" // headers: {
}, // "rows": "10",
method: "POST") // "page": "1",
: URLRequest( // "sidx": "name",
url: kPwaUri, // "sord": "desc"
headers: { // },
"key": key, // method: "POST")
"email": email, // : URLRequest(
"name": name, // url: kPwaUri,
"key": // headers: {
"\$2a\$08\$XeBs/kLqAESRk/jWyNVsyeCjoOvxEmDT7/TK5xkLn23FJ/.5B5beK", // "key": key,
// // "email": "scheepu@tikamobile.com", // "email": email,
// // "name": "scheepu", // "name": name,
}, // "key":
method: "GET"), // "\$2a\$08\$XeBs/kLqAESRk/jWyNVsyeCjoOvxEmDT7/TK5xkLn23FJ/.5B5beK",
// // // "email": "scheepu@tikamobile.com",
// // // "name": "scheepu",
// },
// method: "GET"),
//cachePolicy: cachePolicy), //cachePolicy: cachePolicy),
onReceivedServerTrustAuthRequest: onReceivedServerTrustAuthRequest:

View File

@ -1,5 +1,4 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:developer';
import 'dart:io'; import 'dart:io';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
@ -8,19 +7,12 @@ import 'package:flutter/services.dart';
import 'package:image_picker/image_picker.dart'; import 'package:image_picker/image_picker.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:pwa_ios/main.dart'; import 'package:pwa_ios/main.dart';
import 'package:pwa_ios/model/interaction_data.dart';
import 'package:pwa_ios/model/json_form_data.dart';
import 'package:pwa_ios/model/save_interaction.dart';
import 'package:pwa_ios/model/userdata_model.dart'; import 'package:pwa_ios/model/userdata_model.dart';
import 'package:pwa_ios/utils/apicall.dart';
import 'package:pwa_ios/utils/mockapi.dart'; import 'package:pwa_ios/utils/mockapi.dart';
import 'package:pwa_ios/utils/sessionmanager.dart'; import 'package:pwa_ios/utils/sessionmanager.dart';
import 'package:pwa_ios/utils/util.dart'; import 'package:pwa_ios/utils/util.dart';
import 'package:pwa_ios/viewmodel/configprovider.dart'; import 'package:pwa_ios/viewmodel/configprovider.dart';
import 'package:pwa_ios/viewmodel/interactionprovider.dart';
import 'package:pwa_ios/viewmodel/loginprovider.dart'; import 'package:pwa_ios/viewmodel/loginprovider.dart';
import 'package:pwa_ios/viewmodel/viewinteractionprovider.dart';
import 'package:pwa_ios/views/login.dart';
import 'package:pwa_ios/utils/validations.dart'; import 'package:pwa_ios/utils/validations.dart';
import 'package:pwa_ios/widgets/custombutton.dart'; import 'package:pwa_ios/widgets/custombutton.dart';
import 'package:pwa_ios/widgets/customtextfield.dart'; import 'package:pwa_ios/widgets/customtextfield.dart';
@ -202,44 +194,56 @@ class _ProfileScreenState extends State<ProfileScreen> {
CustomButton( CustomButton(
backgroundColor: Colors.grey.shade300, backgroundColor: Colors.grey.shade300,
onPressed: () async { onPressed: () async {
//cancelTimer(); cancelTimer();
bool result =
await InternetConnectionChecker().hasConnection; if (await InternetConnectionChecker().hasConnection) {
if (result == true) {
showLoaderDialog(context); showLoaderDialog(context);
final ConfigDataProvider configDataProvider =
ConfigDataProvider();
// ignore: use_build_context_synchronously // ignore: use_build_context_synchronously
final provider = Provider.of<ViewInteractionProvider>( // final provider = Provider.of<ViewInteractionProvider>(
context, // context,
listen: false); // listen: false);
final prov = Provider.of<InteractionProvider>(context, // final prov = Provider.of<InteractionProvider>(context,
listen: false); // listen: false);
List<SaveInteractionFormJson> senSavedList = []; // List<SaveInteractionFormJson> senSavedList = [];
List<SaveInteraction> savedList = // List<SaveInteraction> savedList =
await provider.getAllRecords(); // await provider.getAllRecords();
for (var obj in savedList) { // for (var obj in savedList) {
senSavedList.add(prov.formJson(obj)); // senSavedList.add(prov.formJson(obj));
} // }
SendSaveJson jsonData = // SendSaveJson jsonData =
SendSaveJson(savedList: senSavedList); // SendSaveJson(savedList: senSavedList);
DataJson dataJson = DataJson(sendSaveJson: jsonData); // DataJson dataJson = DataJson(sendSaveJson: jsonData);
String jsonstr = saveFormJsonToJson(jsonData); // String jsonstr = saveFormJsonToJson(jsonData);
print(jsonstr); // print(jsonstr);
String jsonDataEncoded = if (await checkRecordsAvailable()) {
saveInteractionFormJsonToJson(dataJson); String jsonstr = await formJsonForSync();
print(jsonDataEncoded);
var result = await MockApiCall().postSavedData( var result =
jsonstr, await MockApiCall().postSavedData(jsonstr);
"/Users/aissel/Library/Developer/CoreSimulator/Devices/1E435121-7E65-45C6-9E0B-411C8B9915F5/data/Containers/Data/Application/4B7EDC75-F376-4A21-A1E4-2A621BCCBD13/Documents/konectar/files/Flutter Questionaire.pdf");
if (result != null) { if (result != null) {
Navigator.pop(context); Navigator.pop(context);
_displaySnackBar('Data synced sucessfully!');
await deleteRecords();
await configDataProvider
.initConfigUIData()
.then((value) {});
_displaySnackBar('Data synced sucessfully!');
} else {
Navigator.pop(context);
_displaySnackBar('Something went wrong!');
}
} else { } else {
Navigator.pop(context); Navigator.pop(context);
_displaySnackBar('Something went wrong!'); _displaySnackBar('No records to sync!');
} }
} else {
_displaySnackBar('No Internet Connectivity!');
} }
}, },
textColor: Colors.black, textColor: Colors.black,
@ -273,7 +277,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
const CircularProgressIndicator(), const CircularProgressIndicator(),
Container( Container(
margin: const EdgeInsets.only(left: 7), margin: const EdgeInsets.only(left: 7),
child: Text("Syncing...")), child: const Text("Syncing...")),
], ],
), ),
); );
@ -476,7 +480,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
showAlertDialog(BuildContext context) { showAlertDialog(BuildContext context) {
// set up the buttons // set up the buttons
Widget cancelButton = TextButton( Widget cancelButton = TextButton(
child: Text("Gallery"), child: const Text("Gallery"),
onPressed: () async { onPressed: () async {
await _getFromGallery(); await _getFromGallery();
setState(() {}); setState(() {});
@ -484,7 +488,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
}, },
); );
Widget continueButton = TextButton( Widget continueButton = TextButton(
child: Text("Camera"), child: const Text("Camera"),
onPressed: () async { onPressed: () async {
await _getFromCamera(); await _getFromCamera();
setState(() {}); setState(() {});
@ -494,8 +498,8 @@ class _ProfileScreenState extends State<ProfileScreen> {
// set up the AlertDialog // set up the AlertDialog
AlertDialog alert = AlertDialog( AlertDialog alert = AlertDialog(
title: Text(""), title: const Text(""),
content: Text("Profile photo"), content: const Text("Profile photo"),
actions: [ actions: [
cancelButton, cancelButton,
continueButton, continueButton,
@ -514,7 +518,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
showDeleteProfileAlertDialog(BuildContext context) { showDeleteProfileAlertDialog(BuildContext context) {
// set up the buttons // set up the buttons
Widget cancelButton = TextButton( Widget cancelButton = TextButton(
child: Text("YES"), child: const Text("YES"),
onPressed: () async { onPressed: () async {
await provider.deleteUserData().then((value) async { await provider.deleteUserData().then((value) async {
await SessionManager().clearSession().then((value) { await SessionManager().clearSession().then((value) {
@ -526,7 +530,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
}, },
); );
Widget continueButton = TextButton( Widget continueButton = TextButton(
child: Text("NO"), child: const Text("NO"),
onPressed: () { onPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },

View File

@ -1,6 +1,5 @@
import 'dart:collection'; import 'dart:collection';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart'; 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';

View File

@ -1,4 +1,3 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class CustomButton extends StatelessWidget { class CustomButton extends StatelessWidget {

View File

@ -1,4 +1,3 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:pwa_ios/utils/util.dart'; import 'package:pwa_ios/utils/util.dart';
@ -19,17 +18,20 @@ class CustomRangeSlider extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return Column(
children: [ children: [
Slider( SizedBox(
activeColor: const Color(0xFF2b9af3), height: isTablet ? 40 : 40,
onChanged: onChanged, child: Slider(
min: min ?? 10.0, activeColor: const Color(0xFF2b9af3),
max: max ?? 80.0, onChanged: onChanged,
label: sliderPos.toInt().toString(), min: min ?? 10.0,
divisions: 48, max: max ?? 80.0,
value: sliderPos, label: sliderPos.toInt().toString(),
divisions: 48,
value: sliderPos,
),
), ),
SizedBox( SizedBox(
height: isTablet ? 2 : 1, height: isTablet ? 1 : 1,
), ),
Text( Text(
"Range: ${sliderPos.toInt()}", "Range: ${sliderPos.toInt()}",

View File

@ -0,0 +1,15 @@
import 'package:flutter/material.dart';
class customWidgets extends StatefulWidget {
const customWidgets({super.key});
@override
State<customWidgets> createState() => _customWidgetsState();
}
class _customWidgetsState extends State<customWidgets> {
@override
Widget build(BuildContext context) {
return Container();
}
}

View File

@ -37,7 +37,7 @@ class InteractionTextField extends StatelessWidget {
onTap: () {}, onTap: () {},
maxLines: maxlines ?? 1, maxLines: maxlines ?? 1,
minLines: minlines, minLines: minlines,
keyboardType: inputType ?? TextInputType.none, keyboardType: inputType ?? TextInputType.name,
onChanged: (value) { onChanged: (value) {
onChanged(value); onChanged(value);
}, },

View File

@ -8,7 +8,7 @@ import Foundation
import connectivity_plus import connectivity_plus
import device_info_plus import device_info_plus
import file_selector_macos import file_selector_macos
import flutter_inappwebview import flutter_inappwebview_macos
import package_info_plus import package_info_plus
import path_provider_foundation import path_provider_foundation
import shared_preferences_foundation import shared_preferences_foundation

View File

@ -74,4 +74,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367 PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367
COCOAPODS: 1.12.1 COCOAPODS: 1.14.3

View File

@ -259,7 +259,7 @@
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastSwiftUpdateCheck = 0920; LastSwiftUpdateCheck = 0920;
LastUpgradeCheck = 1300; LastUpgradeCheck = 1430;
ORGANIZATIONNAME = ""; ORGANIZATIONNAME = "";
TargetAttributes = { TargetAttributes = {
331C80D4294CF70F00263BE5 = { 331C80D4294CF70F00263BE5 = {

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "1300" LastUpgradeVersion = "1430"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"

View File

@ -117,10 +117,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: build_runner name: build_runner
sha256: "10c6bcdbf9d049a0b666702cf1cee4ddfdc38f02a19d35ae392863b47519848b" sha256: "3ac61a79bfb6f6cc11f693591063a7f19a7af628dc52f141743edac5c16e8c22"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.4.6" version: "2.4.9"
build_runner_core: build_runner_core:
dependency: transitive dependency: transitive
description: description:
@ -237,10 +237,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: cupertino_icons name: cupertino_icons
sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.0.5" version: "1.0.6"
dart_style: dart_style:
dependency: transitive dependency: transitive
description: description:
@ -293,10 +293,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: dio name: dio
sha256: ce75a1b40947fea0a0e16ce73337122a86762e38b982e1ccb909daa3b9bc4197 sha256: "0978e9a3e45305a80a7210dbeaf79d6ee8bee33f70c8e542dc654c952070217f"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "5.3.2" version: "5.4.2+1"
dropdown_button2: dropdown_button2:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -373,10 +373,10 @@ packages:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: file_picker name: file_picker
sha256: "4e42aacde3b993c5947467ab640882c56947d9d27342a5b6f2895b23956954a6" sha256: "1bbf65dd997458a08b531042ec3794112a6c39c07c37ff22113d2e7e4f81d4e4"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "6.1.1" version: "6.2.1"
file_selector_linux: file_selector_linux:
dependency: transitive dependency: transitive
description: description:
@ -434,26 +434,66 @@ packages:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: flutter_inappwebview name: flutter_inappwebview
sha256: fad1f2740ff4b5b7da378a639f54beeb9d787b6339c89a9de00494d92372c0bb sha256: "3e9a443a18ecef966fb930c3a76ca5ab6a7aafc0c7b5e14a4a850cf107b09959"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "6.0.0-beta.24+1" version: "6.0.0"
flutter_inappwebview_android:
dependency: transitive
description:
name: flutter_inappwebview_android
sha256: d247f6ed417f1f8c364612fa05a2ecba7f775c8d0c044c1d3b9ee33a6515c421
url: "https://pub.dev"
source: hosted
version: "1.0.13"
flutter_inappwebview_internal_annotations: flutter_inappwebview_internal_annotations:
dependency: transitive dependency: transitive
description: description:
name: flutter_inappwebview_internal_annotations name: flutter_inappwebview_internal_annotations
sha256: "064a8ccbc76217dcd3b0fd6c6ea6f549e69b2849a0233b5bb46af9632c3ce2ff" sha256: "5f80fd30e208ddded7dbbcd0d569e7995f9f63d45ea3f548d8dd4c0b473fb4c8"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.0" version: "1.1.1"
flutter_inappwebview_ios:
dependency: transitive
description:
name: flutter_inappwebview_ios
sha256: f363577208b97b10b319cd0c428555cd8493e88b468019a8c5635a0e4312bd0f
url: "https://pub.dev"
source: hosted
version: "1.0.13"
flutter_inappwebview_macos:
dependency: transitive
description:
name: flutter_inappwebview_macos
sha256: b55b9e506c549ce88e26580351d2c71d54f4825901666bd6cfa4be9415bb2636
url: "https://pub.dev"
source: hosted
version: "1.0.11"
flutter_inappwebview_platform_interface:
dependency: transitive
description:
name: flutter_inappwebview_platform_interface
sha256: "545fd4c25a07d2775f7d5af05a979b2cac4fbf79393b0a7f5d33ba39ba4f6187"
url: "https://pub.dev"
source: hosted
version: "1.0.10"
flutter_inappwebview_web:
dependency: transitive
description:
name: flutter_inappwebview_web
sha256: d8c680abfb6fec71609a700199635d38a744df0febd5544c5a020bd73de8ee07
url: "https://pub.dev"
source: hosted
version: "1.0.8"
flutter_lints: flutter_lints:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: flutter_lints name: flutter_lints
sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.0.2" version: "2.0.3"
flutter_plugin_android_lifecycle: flutter_plugin_android_lifecycle:
dependency: transitive dependency: transitive
description: description:
@ -474,10 +514,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: flutter_svg name: flutter_svg
sha256: "8c5d68a82add3ca76d792f058b186a0599414f279f00ece4830b9b231b570338" sha256: d39e7f95621fc84376bc0f7d504f05c3a41488c562f4a8ad410569127507402c
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.0.7" version: "2.0.9"
flutter_test: flutter_test:
dependency: "direct dev" dependency: "direct dev"
description: flutter description: flutter
@ -548,10 +588,10 @@ packages:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: go_router name: go_router
sha256: b3cadd2cd59a4103fd5f6bc572ca75111264698784e927aa471921c3477d5475 sha256: e1a30a66d734f9e498b1b6522d6a75ded28242bad2359a9158df38a1c30bcf1f
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "10.0.0" version: "10.2.0"
google_fonts: google_fonts:
dependency: transitive dependency: transitive
description: description:
@ -604,10 +644,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: http_mock_adapter name: http_mock_adapter
sha256: "07e78a5b64410ff8404aee2f8889ebff08def0c752b85a3945dec2029a6e1110" sha256: "46399c78bd4a0af071978edd8c502d7aeeed73b5fb9860bca86b5ed647a63c1b"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.6.0" version: "0.6.1"
http_multi_server: http_multi_server:
dependency: transitive dependency: transitive
description: description:
@ -628,10 +668,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: image_picker name: image_picker
sha256: "7d7f2768df2a8b0a3cefa5ef4f84636121987d403130e70b17ef7e2cf650ba84" sha256: "26222b01a0c9a2c8fe02fc90b8208bd3325da5ed1f4a2acabf75939031ac0bdd"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.0.4" version: "1.0.7"
image_picker_android: image_picker_android:
dependency: transitive dependency: transitive
description: description:
@ -736,6 +776,30 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "4.8.1" version: "4.8.1"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
url: "https://pub.dev"
source: hosted
version: "10.0.0"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
url: "https://pub.dev"
source: hosted
version: "2.0.1"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
url: "https://pub.dev"
source: hosted
version: "2.0.1"
light_logger: light_logger:
dependency: transitive dependency: transitive
description: description:
@ -788,18 +852,18 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: matcher name: matcher
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.12.16" version: "0.12.16+1"
material_color_utilities: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
name: material_color_utilities name: material_color_utilities
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.5.0" version: "0.8.0"
material_design_icons_flutter: material_design_icons_flutter:
dependency: transitive dependency: transitive
description: description:
@ -812,10 +876,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.10.0" version: "1.11.0"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -844,10 +908,10 @@ packages:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: openid_client name: openid_client
sha256: "514c0ba645b81029c28999831a70cb055dda1a3bc60be759a04d2556f60ec960" sha256: "043878e907b7a1b460b54fb7b3b27b101cf70d4ac28b32a2db87ae67dbaed611"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.4.7" version: "0.4.8"
package_config: package_config:
dependency: transitive dependency: transitive
description: description:
@ -876,10 +940,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: path name: path
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.8.3" version: "1.9.0"
path_parsing: path_parsing:
dependency: transitive dependency: transitive
description: description:
@ -892,10 +956,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: path_provider name: path_provider
sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa sha256: b27217933eeeba8ff24845c34003b003b2b22151de3c908d0e679e8fe1aa078b
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.1" version: "2.1.2"
path_provider_android: path_provider_android:
dependency: transitive dependency: transitive
description: description:
@ -940,50 +1004,50 @@ packages:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: permission_handler name: permission_handler
sha256: "860c6b871c94c78e202dc69546d4d8fd84bd59faeb36f8fb9888668a53ff4f78" sha256: "18bf33f7fefbd812f37e72091a15575e72d5318854877e0e4035a24ac1113ecb"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "11.1.0" version: "11.3.1"
permission_handler_android: permission_handler_android:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_android name: permission_handler_android
sha256: "2f1bec180ee2f5665c22faada971a8f024761f632e93ddc23310487df52dcfa6" sha256: "1acac6bae58144b442f11e66621c062aead9c99841093c38f5bcdcc24c1c3474"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "12.0.1" version: "12.0.5"
permission_handler_apple: permission_handler_apple:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_apple name: permission_handler_apple
sha256: "1a816084338ada8d574b1cb48390e6e8b19305d5120fe3a37c98825bacc78306" sha256: e9ad66020b89ff1b63908f247c2c6f931c6e62699b756ef8b3c4569350cd8662
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "9.2.0" version: "9.4.4"
permission_handler_html: permission_handler_html:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_html name: permission_handler_html
sha256: "11b762a8c123dced6461933a88ea1edbbe036078c3f9f41b08886e678e7864df" sha256: "54bf176b90f6eddd4ece307e2c06cf977fb3973719c35a93b85cc7093eb6070d"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.1.0+2" version: "0.1.1"
permission_handler_platform_interface: permission_handler_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_platform_interface name: permission_handler_platform_interface
sha256: d87349312f7eaf6ce0adaf668daf700ac5b06af84338bd8b8574dfbd93ffe1a1 sha256: "48d4fcf201a1dad93ee869ab0d4101d084f49136ec82a8a06ed9cfeacab9fd20"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "4.0.2" version: "4.2.1"
permission_handler_windows: permission_handler_windows:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_windows name: permission_handler_windows
sha256: "1e8640c1e39121128da6b816d236e714d2cf17fac5a105dd6acdd3403a628004" sha256: "1a790728016f79a41216d88672dbc5df30e686e811ad4e698bfc51f76ad91f1e"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.2.0" version: "0.2.1"
petitparser: petitparser:
dependency: transitive dependency: transitive
description: description:
@ -1004,10 +1068,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: plugin_platform_interface name: plugin_platform_interface
sha256: "43798d895c929056255600343db8f049921cbec94d31ec87f1dc5c16c01935dd" sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.5" version: "2.1.8"
pointycastle: pointycastle:
dependency: transitive dependency: transitive
description: description:
@ -1028,10 +1092,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: provider name: provider
sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f sha256: c8a055ee5ce3fd98d6fc872478b03823ffdb448699c6ebdbbc71d59b596fd48c
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "6.0.5" version: "6.1.2"
pub_semver: pub_semver:
dependency: transitive dependency: transitive
description: description:
@ -1068,18 +1132,18 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: riverpod name: riverpod
sha256: a600120d6f213a9922860eea1abc32597436edd5b2c4e73b91410f8c2af67d22 sha256: f21b32ffd26a36555e501b04f4a5dca43ed59e16343f1a30c13632b2351dfa4d
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.4.0" version: "2.5.1"
shared_preferences: shared_preferences:
dependency: "direct main" dependency: "direct main"
description: description:
name: shared_preferences name: shared_preferences
sha256: "0344316c947ffeb3a529eac929e1978fcd37c26be4e8468628bac399365a3ca1" sha256: "81429e4481e1ccfb51ede496e916348668fd0921627779233bd24cc3ff6abd02"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.2.0" version: "2.2.2"
shared_preferences_android: shared_preferences_android:
dependency: transitive dependency: transitive
description: description:
@ -1297,66 +1361,66 @@ packages:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: url_launcher name: url_launcher
sha256: "781bd58a1eb16069412365c98597726cd8810ae27435f04b3b4d3a470bacd61e" sha256: "0ecc004c62fd3ed36a2ffcbe0dd9700aee63bd7532d0b642a488b1ec310f492e"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "6.1.12" version: "6.2.5"
url_launcher_android: url_launcher_android:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_android name: url_launcher_android
sha256: "78cb6dea3e93148615109e58e42c35d1ffbf5ef66c44add673d0ab75f12ff3af" sha256: d4ed0711849dd8e33eb2dd69c25db0d0d3fdc37e0a62e629fe32f57a22db2745
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "6.0.37" version: "6.3.0"
url_launcher_ios: url_launcher_ios:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_ios name: url_launcher_ios
sha256: "9af7ea73259886b92199f9e42c116072f05ff9bea2dcb339ab935dfc957392c2" sha256: "9149d493b075ed740901f3ee844a38a00b33116c7c5c10d7fb27df8987fb51d5"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "6.1.4" version: "6.2.5"
url_launcher_linux: url_launcher_linux:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_linux name: url_launcher_linux
sha256: "207f4ddda99b95b4d4868320a352d374b0b7e05eefad95a4a26f57da413443f5" sha256: ab360eb661f8879369acac07b6bb3ff09d9471155357da8443fd5d3cf7363811
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.5" version: "3.1.1"
url_launcher_macos: url_launcher_macos:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_macos name: url_launcher_macos
sha256: "1c4fdc0bfea61a70792ce97157e5cc17260f61abbe4f39354513f39ec6fd73b1" sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.6" version: "3.1.0"
url_launcher_platform_interface: url_launcher_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_platform_interface name: url_launcher_platform_interface
sha256: bfdfa402f1f3298637d71ca8ecfe840b4696698213d5346e9d12d4ab647ee2ea sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.3" version: "2.3.2"
url_launcher_web: url_launcher_web:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_web name: url_launcher_web
sha256: cc26720eefe98c1b71d85f9dc7ef0cada5132617046369d9dc296b3ecaa5cbb4 sha256: "3692a459204a33e04bc94f5fb91158faf4f2c8903281ddd82915adecdb1a901d"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.0.18" version: "2.3.0"
url_launcher_windows: url_launcher_windows:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_windows name: url_launcher_windows
sha256: "7967065dd2b5fccc18c653b97958fdf839c5478c28e767c61ee879f4e7882422" sha256: ecf9725510600aa2bb6d7ddabe16357691b6d2805f66216a97d1b881e21beff7
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.7" version: "3.1.1"
uuid: uuid:
dependency: transitive dependency: transitive
description: description:
@ -1369,26 +1433,26 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: vector_graphics name: vector_graphics
sha256: "670f6e07aca990b4a2bcdc08a784193c4ccdd1932620244c3a86bb72a0eac67f" sha256: "4ac59808bbfca6da38c99f415ff2d3a5d7ca0a6b4809c71d9cf30fba5daf9752"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.7" version: "1.1.10+1"
vector_graphics_codec: vector_graphics_codec:
dependency: transitive dependency: transitive
description: description:
name: vector_graphics_codec name: vector_graphics_codec
sha256: "7451721781d967db9933b63f5733b1c4533022c0ba373a01bdd79d1a5457f69f" sha256: f3247e7ab0ec77dc759263e68394990edc608fb2b480b80db8aa86ed09279e33
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.7" version: "1.1.10+1"
vector_graphics_compiler: vector_graphics_compiler:
dependency: transitive dependency: transitive
description: description:
name: vector_graphics_compiler name: vector_graphics_compiler
sha256: "80a13c613c8bde758b1464a1755a7b3a8f2b6cec61fbf0f5a53c94c30f03ba2e" sha256: "18489bdd8850de3dd7ca8a34e0c446f719ec63e2bab2e7a8cc66a9028dd76c5a"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.7" version: "1.1.10+1"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
@ -1397,6 +1461,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.4" version: "2.1.4"
vm_service:
dependency: transitive
description:
name: vm_service
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
url: "https://pub.dev"
source: hosted
version: "13.0.0"
watcher: watcher:
dependency: transitive dependency: transitive
description: description:
@ -1409,10 +1481,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: web name: web
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.3.0" version: "0.5.1"
web_socket_channel: web_socket_channel:
dependency: transitive dependency: transitive
description: description:
@ -1470,5 +1542,5 @@ packages:
source: hosted source: hosted
version: "3.1.2" version: "3.1.2"
sdks: sdks:
dart: ">=3.2.0-194.0.dev <4.0.0" dart: ">=3.3.0 <4.0.0"
flutter: ">=3.16.0" flutter: ">=3.19.0"

View File

@ -67,7 +67,7 @@ dev_dependencies:
# activated in the `analysis_options.yaml` file located at the root of your # activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint # package. See that file for information about deactivating specific lint
# rules and activating additional ones. # rules and activating additional ones.
flutter_lints: ^2.0.0 flutter_lints: ^2.0.3
# For information on the generic Dart part of this file, see the # For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec # following page: https://dart.dev/tools/pub/pubspec

View File

@ -8,7 +8,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:pwa_ios/main.dart';
import 'package:pwa_ios/views/konectarpage.dart'; import 'package:pwa_ios/views/konectarpage.dart';
void main() { void main() {