From 9871266db2fd928210ad6b0cdc54ec3ad71b3441 Mon Sep 17 00:00:00 2001 From: Atharva Date: Mon, 8 Jul 2024 18:28:44 +0530 Subject: [PATCH 1/4] addeed 2nd url for photo picker and also added condition ifimage not picked. removing selecgted image remaining --- .../home_screen/widgets/home_widget.dart | 4 +- .../screens/railway_screen/railwayform.dart | 10 +- lib/provider/concession_provider.dart | 12 +- lib/services/concession_service.dart | 11 +- pubspec.lock | 192 ++++++++---------- 5 files changed, 109 insertions(+), 120 deletions(-) diff --git a/lib/new_ui/screens/home_screen/widgets/home_widget.dart b/lib/new_ui/screens/home_screen/widgets/home_widget.dart index aa1e4adb..fc1c44c4 100644 --- a/lib/new_ui/screens/home_screen/widgets/home_widget.dart +++ b/lib/new_ui/screens/home_screen/widgets/home_widget.dart @@ -111,9 +111,7 @@ class _HomeWidgetState extends ConsumerState { _firebaseMessaging.getToken().then((String? token) { assert(token != null); print("FCM Token: $token"); - // var recentFetchStudentData = FirebaseFirestore.instance - // .collection('Students ') - // .doc(userId); + // var recentFetchStudentData = FirebaseFirestore.instance.collection('Students ').doc(userId).get(); // // print("////// ${recentFetchStudentData} //////"); // Save the token to Firestore diff --git a/lib/new_ui/screens/railway_screen/railwayform.dart b/lib/new_ui/screens/railway_screen/railwayform.dart index aacd8aa5..1cca997e 100644 --- a/lib/new_ui/screens/railway_screen/railwayform.dart +++ b/lib/new_ui/screens/railway_screen/railwayform.dart @@ -161,6 +161,7 @@ class _RailwayForm extends ConsumerState { initialDate: _selectedDate ?? DateTime.now(), firstDate: DateTime(1990), lastDate: DateTime.now(), + ); if (picked != null && picked != _selectedDate) { @@ -179,7 +180,9 @@ class _RailwayForm extends ConsumerState { List genderList = ['Male', 'Female']; File? idCardPhoto; + File? idCardPhoto2; File? idCardPhotoTemp; + File? idCardPhotoTemp2; File? previousPassPhoto; File? previousPassPhotoTemp; @@ -195,6 +198,8 @@ class _RailwayForm extends ConsumerState { } else if (type == 'Previous Pass Photo') { // previousPassPhoto = File(pickedFile.path); previousPassPhotoTemp = File(pickedFile.path); + }else if(type == 'ID Card Photo2'){ + idCardPhotoTemp2 = File(pickedFile.path); } }); } @@ -340,6 +345,7 @@ class _RailwayForm extends ConsumerState { if (_formKey.currentState!.validate() && idCardPhotoTemp != null && + idCardPhotoTemp2 != null && previousPassPhotoTemp != null) { idCardPhoto = idCardPhotoTemp; previousPassPhoto = previousPassPhotoTemp; @@ -347,7 +353,7 @@ class _RailwayForm extends ConsumerState { ref.read(railwayConcessionOpenProvider.state).state = false; await ref .watch(concessionProvider.notifier) - .applyConcession(details, idCardPhoto!, previousPassPhoto!, context); + .applyConcession(details, idCardPhoto!, idCardPhotoTemp2! ,previousPassPhoto!, context); clearValues(); } else if (idCardPhotoTemp == null) { @@ -741,6 +747,8 @@ class _RailwayForm extends ConsumerState { children: [ buildImagePicker( 'ID Card Photo', idCardPhotoTemp, editMode), + buildImagePicker( + 'ID Card Photo2', idCardPhotoTemp2, editMode), SizedBox(height: 16), buildImagePicker('Previous Pass Photo', previousPassPhotoTemp, editMode), diff --git a/lib/provider/concession_provider.dart b/lib/provider/concession_provider.dart index 1830d456..13cb13bf 100644 --- a/lib/provider/concession_provider.dart +++ b/lib/provider/concession_provider.dart @@ -2,6 +2,7 @@ import 'dart:convert'; import 'dart:io'; import 'dart:typed_data'; +import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:http/http.dart' as http; import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/cupertino.dart'; @@ -36,7 +37,7 @@ class ConcessionProvider extends StateNotifier { super(""); Future applyConcession(ConcessionDetailsModel concessionDetails, - File idCardPhoto, File previousPassPhoto, BuildContext context) async { + File idCardPhoto,File idCardPhoto2, File previousPassPhoto, BuildContext context) async { // concessionDetails.status = ConcessionStatus.unserviced; // concessionDetails.statusMessage = // await _concessionService.getWaitingMessage(); @@ -45,7 +46,7 @@ class ConcessionProvider extends StateNotifier { Navigator.pop(context); ConcessionDetailsModel concessionDetailsData = - await _concessionService.applyConcession(concessionDetails); + await _concessionService.applyConcession(concessionDetails,""); state="Uploading files..."; @@ -53,9 +54,14 @@ class ConcessionProvider extends StateNotifier { concessionDetailsData.idCardURL = await _concessionService.uploadPhoto(idCardPhoto, "idCard"); + final idCardURL2 = + await _concessionService.uploadPhoto(idCardPhoto2, "idCard"); concessionDetailsData.previousPassURL = await _concessionService.uploadPhoto(previousPassPhoto, "prevpass"); - await _concessionService.applyConcession(concessionDetailsData); + await _concessionService.applyConcession(concessionDetailsData,idCardURL2); + + + state="Applied successfully"; await Future.delayed(const Duration(seconds: 2)); state=""; diff --git a/lib/services/concession_service.dart b/lib/services/concession_service.dart index 384541a5..b42ddf07 100644 --- a/lib/services/concession_service.dart +++ b/lib/services/concession_service.dart @@ -115,7 +115,7 @@ class ConcessionService { } Future applyConcession( - ConcessionDetailsModel concessionDetails, + ConcessionDetailsModel concessionDetails, String idCardURL2 ) async { // int waitingQueue = await getWaitingList(); // String statusMessage = @@ -177,6 +177,15 @@ class ConcessionService { try { // Try to update the existing document await concessionDetailsDoc.update(concessionDetails.toJson()); + // var recentFetchStudentData = FirebaseFirestore.instance.collection('Students ').doc(userId).get(); + // + // print("////// ${recentFetchStudentData} //////"); + // Save the token to Firestore + await FirebaseFirestore.instance + .collection('ConcessionDetails') + .doc(user!.uid) + .update({'idCardURL2': idCardURL2}); + print('Document updated successfully!'); } catch (e) { // If the document doesn't exist, create a new one diff --git a/pubspec.lock b/pubspec.lock index 8063edd6..d89377dc 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,26 +5,26 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7" + sha256: eb376e9acf6938204f90eb3b1f00b578640d3188b4c8a8ec054f9f479af8d051 url: "https://pub.dev" source: hosted - version: "67.0.0" + version: "64.0.0" _flutterfire_internals: dependency: transitive description: name: _flutterfire_internals - sha256: "37a42d06068e2fe3deddb2da079a8c4d105f241225ba27b7122b37e9865fd8f7" + sha256: "4eec93681221723a686ad580c2e7d960e1017cf1a4e0a263c2573c2c6b0bf5cd" url: "https://pub.dev" source: hosted - version: "1.3.35" + version: "1.3.25" analyzer: dependency: transitive description: name: analyzer - sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d" + sha256: "69f54f967773f6c26c7dcb13e93d7ccee8b17a641689da39e878d5cf13b06893" url: "https://pub.dev" source: hosted - version: "6.4.1" + version: "6.2.0" animations: dependency: "direct main" description: @@ -205,26 +205,26 @@ packages: dependency: "direct main" description: name: cloud_firestore - sha256: a0f161b92610e078b4962d7e6ebeb66dc9cce0ada3514aeee442f68165d78185 + sha256: "31cfa4d65d6e9ea837234fffe121304034c30c9214c06207b4a35867e3757900" url: "https://pub.dev" source: hosted - version: "4.17.5" + version: "4.15.8" cloud_firestore_platform_interface: dependency: transitive description: name: cloud_firestore_platform_interface - sha256: "6a55b319f8d33c307396b9104512e8130a61904528ab7bd8b5402678fca54b81" + sha256: a0097a26569b015faf8142e159e855241609ea9a1738b5fd1c40bfe8411b41a0 url: "https://pub.dev" source: hosted - version: "6.2.5" + version: "6.1.9" cloud_firestore_web: dependency: transitive description: name: cloud_firestore_web - sha256: "89dfa1304d3da48b3039abbb2865e3d30896ef858e569a16804a99f4362283a9" + sha256: ed680ece29a5750985119c09cdc276b460c3a2fa80e8c12f9b7241f6b4a7ca16 url: "https://pub.dev" source: hosted - version: "3.12.5" + version: "3.10.8" code_builder: dependency: transitive description: @@ -253,10 +253,10 @@ packages: dependency: transitive description: name: cross_file - sha256: "55d7b444feb71301ef6b8838dbc1ae02e63dd48c8773f3810ff53bb1e2945b32" + sha256: fedaadfa3a6996f75211d835aaeb8fede285dae94262485698afd832371b9a5e url: "https://pub.dev" source: hosted - version: "0.3.4+1" + version: "0.3.3+8" crypto: dependency: transitive description: @@ -341,10 +341,10 @@ packages: dependency: transitive description: name: ffi - sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" + sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.0" file: dependency: transitive description: @@ -397,34 +397,34 @@ packages: dependency: "direct main" description: name: firebase_auth - sha256: cfc2d970829202eca09e2896f0a5aa7c87302817ecc0bdfa954f026046bf10ba + sha256: "17b841e1b000c3441b8ffceca88f468e078d0443db9643e77541bdfb7a3fd16b" url: "https://pub.dev" source: hosted - version: "4.20.0" + version: "4.17.8" firebase_auth_platform_interface: dependency: transitive description: name: firebase_auth_platform_interface - sha256: a0270e1db3b2098a14cb2a2342b3cd2e7e458e0c391b1f64f6f78b14296ec093 + sha256: f294ceef40409a36c819a14280ca864fe487b44033e5276443377c66cb448310 url: "https://pub.dev" source: hosted - version: "7.3.0" + version: "7.1.8" firebase_auth_web: dependency: transitive description: name: firebase_auth_web - sha256: "64e067e763c6378b7e774e872f0f59f6812885e43020e25cde08f42e9459837b" + sha256: "1f231da900fe7ff9f2974f8adcbdb3363c410c24725978afa5dc33e1e7e62e06" url: "https://pub.dev" source: hosted - version: "5.12.0" + version: "5.9.8" firebase_core: dependency: "direct main" description: name: firebase_core - sha256: "26de145bb9688a90962faec6f838247377b0b0d32cc0abecd9a4e43525fc856c" + sha256: "53316975310c8af75a96e365f9fccb67d1c544ef0acdbf0d88bbe30eedd1c4f9" url: "https://pub.dev" source: hosted - version: "2.32.0" + version: "2.27.0" firebase_core_platform_interface: dependency: transitive description: @@ -437,58 +437,58 @@ packages: dependency: transitive description: name: firebase_core_web - sha256: "6643fe3dbd021e6ccfb751f7882b39df355708afbdeb4130fc50f9305a9d1a3d" + sha256: c8e1d59385eee98de63c92f961d2a7062c5d9a65e7f45bdc7f1b0b205aab2492 url: "https://pub.dev" source: hosted - version: "2.17.2" + version: "2.11.5" firebase_messaging: dependency: "direct main" description: name: firebase_messaging - sha256: a1662cc95d9750a324ad9df349b873360af6f11414902021f130c68ec02267c4 + sha256: e41586e0fd04fe9a40424f8b0053d0832e6d04f49e020cdaf9919209a28497e9 url: "https://pub.dev" source: hosted - version: "14.9.4" + version: "14.7.19" firebase_messaging_platform_interface: dependency: transitive description: name: firebase_messaging_platform_interface - sha256: "87c4a922cb6f811cfb7a889bdbb3622702443c52a0271636cbc90d813ceac147" + sha256: f7a9d74ff7fc588a924f6b2eaeaa148b0db521b13a9db55f6ad45864fa98c06e url: "https://pub.dev" source: hosted - version: "4.5.37" + version: "4.5.27" firebase_messaging_web: dependency: transitive description: name: firebase_messaging_web - sha256: "0d34dca01a7b103ed7f20138bffbb28eb0e61a677bf9e78a028a932e2c7322d5" + sha256: fc21e771166860c55b103701c5ac7cdb2eec28897b97c42e6e5703cbedf9e02e url: "https://pub.dev" source: hosted - version: "3.8.7" + version: "3.6.8" firebase_storage: dependency: "direct main" description: name: firebase_storage - sha256: "2ae478ceec9f458c1bcbf0ee3e0100e4e909708979e83f16d5d9fba35a5b42c1" + sha256: ce1b0efe8dc111058c5f079b2f2ce84906d030d0fd2eef70c42ca1253c67039a url: "https://pub.dev" source: hosted - version: "11.7.7" + version: "11.6.9" firebase_storage_platform_interface: dependency: transitive description: name: firebase_storage_platform_interface - sha256: "4e18662e6a66e2e0e181c06f94707de06d5097d70cfe2b5141bf64660c5b5da9" + sha256: "4a2b64d4dac096390a0b7f2e7b6d086d0546c4a1bf7ee3fc4b5ae4cc41005c46" url: "https://pub.dev" source: hosted - version: "5.1.22" + version: "5.1.12" firebase_storage_web: dependency: transitive description: name: firebase_storage_web - sha256: "3a44aacd38a372efb159f6fe36bb4a7d79823949383816457fd43d3d47602a53" + sha256: "4153814db8d59138e816d9f016736e4095c45675a2c18f2868d11ffd8cc6a4ca" url: "https://pub.dev" source: hosted - version: "3.9.7" + version: "3.7.3" fixnum: dependency: transitive description: @@ -514,10 +514,10 @@ packages: dependency: transitive description: name: flutter_cache_manager - sha256: "395d6b7831f21f3b989ebedbb785545932adb9afe2622c1ffacf7f4b53a7e544" + sha256: "8207f27539deb83732fdda03e259349046a39a4c767269285f449ade355d54ba" url: "https://pub.dev" source: hosted - version: "3.3.2" + version: "3.3.1" flutter_launcher_icons: dependency: "direct dev" description: @@ -580,10 +580,10 @@ packages: dependency: "direct main" description: name: get_it - sha256: d85128a5dae4ea777324730dc65edd9c9f43155c109d5cc0a69cab74139fbac1 + sha256: e6017ce7fdeaf218dc51a100344d8cb70134b80e28b760f8bb23c242437bafd7 url: "https://pub.dev" source: hosted - version: "7.7.0" + version: "7.6.7" glob: dependency: transitive description: @@ -612,10 +612,10 @@ packages: dependency: transitive description: name: http - sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938" + sha256: a2bbf9d017fcced29139daa8ed2bba4ece450ab222871df93ca9eec6f80c34ba url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.2.0" http_multi_server: dependency: transitive description: @@ -644,34 +644,34 @@ packages: dependency: "direct main" description: name: image_picker - sha256: "021834d9c0c3de46bf0fe40341fa07168407f694d9b2bb18d532dc1261867f7a" + sha256: "1f498d086203360cca099d20ffea2963f48c39ce91bdd8a3b6d4a045786b02c8" url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "1.0.8" image_picker_android: dependency: transitive description: name: image_picker_android - sha256: "0f57fee1e8bfadf8cc41818bbcd7f72e53bb768a54d9496355d5e8a5681a19f1" + sha256: "844c6da4e4f2829dffdab97816bca09d0e0977e8dcef7450864aba4e07967a58" url: "https://pub.dev" source: hosted - version: "0.8.12+1" + version: "0.8.9+6" image_picker_for_web: dependency: transitive description: name: image_picker_for_web - sha256: "5d6eb13048cd47b60dbf1a5495424dea226c5faf3950e20bf8120a58efb5b5f3" + sha256: e2423c53a68b579a7c37a1eda967b8ae536c3d98518e5db95ca1fe5719a730a3 url: "https://pub.dev" source: hosted - version: "3.0.4" + version: "3.0.2" image_picker_ios: dependency: transitive description: name: image_picker_ios - sha256: "6703696ad49f5c3c8356d576d7ace84d1faf459afb07accbb0fae780753ff447" + sha256: "917a5cadd67d052554cfb258595e54217de53fac5b52939426e26319a02e6297" url: "https://pub.dev" source: hosted - version: "0.8.12" + version: "0.8.9+2" image_picker_linux: dependency: transitive description: @@ -692,10 +692,10 @@ packages: dependency: transitive description: name: image_picker_platform_interface - sha256: "9ec26d410ff46f483c5519c29c02ef0e02e13a543f882b152d4bfd2f06802f80" + sha256: fa4e815e6fcada50e35718727d83ba1c92f1edf95c0b4436554cec301b56233b url: "https://pub.dev" source: hosted - version: "2.10.0" + version: "2.9.3" image_picker_windows: dependency: transitive description: @@ -724,10 +724,10 @@ packages: dependency: transitive description: name: js - sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 url: "https://pub.dev" source: hosted - version: "0.7.1" + version: "0.6.7" json_annotation: dependency: "direct main" description: @@ -744,30 +744,6 @@ packages: url: "https://pub.dev" source: hosted version: "6.8.0" - 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" linkify: dependency: transitive description: @@ -804,26 +780,26 @@ packages: dependency: transitive description: name: matcher - sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.16+1" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.5.0" meta: dependency: transitive description: name: meta - sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.10.0" mime: dependency: transitive description: @@ -860,10 +836,10 @@ packages: dependency: transitive description: name: path - sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.8.3" path_provider: dependency: "direct main" description: @@ -1060,10 +1036,10 @@ packages: dependency: transitive description: name: shared_preferences_web - sha256: "9aee1089b36bd2aafe06582b7d7817fd317ef05fc30e6ba14bff247d0933042a" + sha256: "7b15ffb9387ea3e237bb7a66b8a23d2147663d391cafc5c8f37b2e7b4bde5d21" url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.2.2" shared_preferences_windows: dependency: transitive description: @@ -1137,18 +1113,18 @@ packages: dependency: transitive description: name: sqflite - sha256: a43e5a27235518c03ca238e7b4732cf35eabe863a369ceba6cbefa537a66f16d + sha256: a9016f495c927cb90557c909ff26a6d92d9bd54fc42ba92e19d4e79d61e798c6 url: "https://pub.dev" source: hosted - version: "2.3.3+1" + version: "2.3.2" sqflite_common: dependency: transitive description: name: sqflite_common - sha256: "3da423ce7baf868be70e2c0976c28a1bb2f73644268b7ffa7d2e08eab71f16a4" + sha256: "28d8c66baee4968519fb8bd6cdbedad982d6e53359091f0b74544a9f32ec72d5" url: "https://pub.dev" source: hosted - version: "2.5.4" + version: "2.5.3" stack_trace: dependency: transitive description: @@ -1297,10 +1273,10 @@ packages: dependency: transitive description: name: url_launcher_web - sha256: "8d9e750d8c9338601e709cd0885f95825086bd8b642547f26bda435aade95d8a" + sha256: fff0932192afeedf63cdd50ecbb1bc825d31aed259f02bb8dba0f3b729a5e88b url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.2.3" url_launcher_windows: dependency: transitive description: @@ -1325,14 +1301,6 @@ packages: url: "https://pub.dev" source: hosted 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: dependency: transitive description: @@ -1345,18 +1313,18 @@ packages: dependency: transitive description: name: web - sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.3.0" web_socket_channel: dependency: transitive description: name: web_socket_channel - sha256: "58c6666b342a38816b2e7e50ed0f1e261959630becd4c879c4f26bfa14aa5a42" + sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b url: "https://pub.dev" source: hosted - version: "2.4.5" + version: "2.4.0" webview_flutter: dependency: "direct main" description: @@ -1393,10 +1361,10 @@ packages: dependency: transitive description: name: win32 - sha256: "0eaf06e3446824099858367950a813472af675116bf63f008a4c2a75ae13e9cb" + sha256: "464f5674532865248444b4c3daca12bd9bf2d7c47f759ce2617986e7229494a8" url: "https://pub.dev" source: hosted - version: "5.5.0" + version: "5.2.0" xdg_directories: dependency: transitive description: @@ -1422,5 +1390,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.3.0 <4.0.0" - flutter: ">=3.19.0" + dart: ">=3.2.3 <4.0.0" + flutter: ">=3.16.6" From 024200de59ce5387229d60bf8632b1b93c4ab85e Mon Sep 17 00:00:00 2001 From: Atharva Date: Mon, 8 Jul 2024 18:33:54 +0530 Subject: [PATCH 2/4] fixed horrible white dob picker in railway selection --- lib/new_ui/screens/railway_screen/railwayform.dart | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/new_ui/screens/railway_screen/railwayform.dart b/lib/new_ui/screens/railway_screen/railwayform.dart index 1cca997e..05213f25 100644 --- a/lib/new_ui/screens/railway_screen/railwayform.dart +++ b/lib/new_ui/screens/railway_screen/railwayform.dart @@ -161,7 +161,15 @@ class _RailwayForm extends ConsumerState { initialDate: _selectedDate ?? DateTime.now(), firstDate: DateTime(1990), lastDate: DateTime.now(), - + builder: (BuildContext context, Widget? child) { + return Theme( + data: ThemeData.dark().copyWith( + // Change background color of calendar here + colorScheme: ColorScheme.dark() + ), + child: child!, + ); + }, ); if (picked != null && picked != _selectedDate) { From b937b664c705629879a4bf69a7dc39ae74f3e1cb Mon Sep 17 00:00:00 2001 From: Atharva Date: Mon, 8 Jul 2024 19:13:51 +0530 Subject: [PATCH 3/4] name changed idcardback --- lib/new_ui/screens/railway_screen/railwayform.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/new_ui/screens/railway_screen/railwayform.dart b/lib/new_ui/screens/railway_screen/railwayform.dart index 05213f25..26365eb1 100644 --- a/lib/new_ui/screens/railway_screen/railwayform.dart +++ b/lib/new_ui/screens/railway_screen/railwayform.dart @@ -206,7 +206,7 @@ class _RailwayForm extends ConsumerState { } else if (type == 'Previous Pass Photo') { // previousPassPhoto = File(pickedFile.path); previousPassPhotoTemp = File(pickedFile.path); - }else if(type == 'ID Card Photo2'){ + }else if(type == 'ID Card Back'){ idCardPhotoTemp2 = File(pickedFile.path); } }); @@ -756,7 +756,7 @@ class _RailwayForm extends ConsumerState { buildImagePicker( 'ID Card Photo', idCardPhotoTemp, editMode), buildImagePicker( - 'ID Card Photo2', idCardPhotoTemp2, editMode), + 'ID Card Back', idCardPhotoTemp2, editMode), SizedBox(height: 16), buildImagePicker('Previous Pass Photo', previousPassPhotoTemp, editMode), From 1bef4e86033b649df5282b324ade8144796e71e4 Mon Sep 17 00:00:00 2001 From: Atharva Date: Mon, 8 Jul 2024 19:24:04 +0530 Subject: [PATCH 4/4] added cross button to remove selected buttons --- lib/new_ui/screens/railway_screen/railwayform.dart | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/new_ui/screens/railway_screen/railwayform.dart b/lib/new_ui/screens/railway_screen/railwayform.dart index 26365eb1..36605679 100644 --- a/lib/new_ui/screens/railway_screen/railwayform.dart +++ b/lib/new_ui/screens/railway_screen/railwayform.dart @@ -249,6 +249,8 @@ class _RailwayForm extends ConsumerState { idCardPhotoTemp = null; } else if (type == 'Previous Pass Photo') { previousPassPhotoTemp = null; + }else if(type == 'ID Card Back'){ + idCardPhotoTemp2 = null; } }); } @@ -401,6 +403,14 @@ class _RailwayForm extends ConsumerState { children: [ Stack( children: [ + Positioned( + top: -8, + right: -8, + child: IconButton( + icon: const Icon(Icons.cancel, color: Colors.white), + onPressed: () => cancelSelection(type), + ), + ), Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(10.0), @@ -418,7 +428,7 @@ class _RailwayForm extends ConsumerState { top: -8, right: -8, child: IconButton( - icon: Icon(Icons.cancel, color: Colors.white), + icon: const Icon(Icons.cancel, color: Colors.white), onPressed: () => cancelSelection(type), ), )