Skip to content

Commit

Permalink
Merge pull request #219 from SayedZeeshanHyder/main
Browse files Browse the repository at this point in the history
Fixed The Add Subject Error
  • Loading branch information
SayedZeeshanHyder authored Jul 22, 2024
2 parents 002f110 + 09ffb50 commit d6736a3
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,16 @@ class AttendanceService{
}

static addSubject(Map<String,dynamic> updatedSubject)async{
List attendanceList;
final get = await firestore.doc(auth.currentUser!.uid).get();
final data = get.data() as Map<String,dynamic>;
List attendanceList = data['attendance'];
if(get.exists){
final data = get.data() as Map<String,dynamic>;
attendanceList = data['attendance'];
}else{
attendanceList = [];

}

attendanceList.add(updatedSubject);
await firestore.doc(auth.currentUser!.uid).set({"attendance":attendanceList});
}
Expand Down
92 changes: 42 additions & 50 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ packages:
dependency: transitive
description:
name: build_daemon
sha256: "79b2aef6ac2ed00046867ed354c88778c9c0f029df8a20fe10b5436826721ef9"
sha256: "0343061a33da9c5810b2d6cee51945127d8f4c060b7fbdd9d54917f0a3feaaa1"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
version: "4.0.1"
build_resolvers:
dependency: transitive
description:
Expand All @@ -117,18 +117,18 @@ packages:
dependency: "direct dev"
description:
name: build_runner
sha256: "644dc98a0f179b872f612d3eb627924b578897c629788e858157fa5e704ca0c7"
sha256: "3ac61a79bfb6f6cc11f693591063a7f19a7af628dc52f141743edac5c16e8c22"
url: "https://pub.dev"
source: hosted
version: "2.4.11"
version: "2.4.9"
build_runner_core:
dependency: transitive
description:
name: build_runner_core
sha256: e3c79f69a64bdfcd8a776a3c28db4eb6e3fb5356d013ae5eb2e52007706d5dbe
sha256: "4ae8ffe5ac758da294ecf1802f2aff01558d8b1b00616aa7538ea9a8a5d50799"
url: "https://pub.dev"
source: hosted
version: "7.3.1"
version: "7.3.0"
built_collection:
dependency: transitive
description:
Expand Down Expand Up @@ -594,10 +594,10 @@ packages:
dependency: transitive
description:
name: flutter_plugin_android_lifecycle
sha256: c6b0b4c05c458e1c01ad9bcc14041dd7b1f6783d487be4386f793f47a8a4d03e
sha256: "8cf40eebf5dec866a6d1956ad7b4f7016e6c0cc69847ab946833b7d43743809f"
url: "https://pub.dev"
source: hosted
version: "2.0.20"
version: "2.0.19"
flutter_riverpod:
dependency: "direct main"
description:
Expand Down Expand Up @@ -652,10 +652,10 @@ packages:
dependency: transitive
description:
name: graphs
sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0"
sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19
url: "https://pub.dev"
source: hosted
version: "2.3.2"
version: "2.3.1"
http:
dependency: transitive
description:
Expand Down Expand Up @@ -700,10 +700,10 @@ packages:
dependency: transitive
description:
name: image_picker_android
sha256: cea2bd5b9fcff039a4901d3b13c67fe747f940be9ba76bde1bcd218d168eeb7f
sha256: "0f57fee1e8bfadf8cc41818bbcd7f72e53bb768a54d9496355d5e8a5681a19f1"
url: "https://pub.dev"
source: hosted
version: "0.8.12+6"
version: "0.8.12+1"
image_picker_for_web:
dependency: transitive
description:
Expand Down Expand Up @@ -796,26 +796,26 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
url: "https://pub.dev"
source: hosted
version: "10.0.4"
version: "10.0.0"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
url: "https://pub.dev"
source: hosted
version: "3.0.3"
version: "2.0.1"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
url: "https://pub.dev"
source: hosted
version: "3.0.1"
version: "2.0.1"
linkify:
dependency: transitive
description:
Expand Down Expand Up @@ -868,10 +868,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
url: "https://pub.dev"
source: hosted
version: "1.12.0"
version: "1.11.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -924,10 +924,10 @@ packages:
dependency: transitive
description:
name: path_provider_android
sha256: "30c5aa827a6ae95ce2853cdc5fe3971daaac00f6f081c419c013f7f57bff2f5e"
sha256: a248d8146ee5983446bf03ed5ea8f6533129a12b11f12057ad1b4a67a2b3b41d
url: "https://pub.dev"
source: hosted
version: "2.2.7"
version: "2.2.4"
path_provider_foundation:
dependency: transitive
description:
Expand Down Expand Up @@ -1076,10 +1076,10 @@ packages:
dependency: transitive
description:
name: shared_preferences_android
sha256: "93d0ec9dd902d85f326068e6a899487d1f65ffcd5798721a95330b26c8131577"
sha256: "1ee8bf911094a1b592de7ab29add6f826a7331fb854273d55918693d5364a1f2"
url: "https://pub.dev"
source: hosted
version: "2.2.3"
version: "2.2.2"
shared_preferences_foundation:
dependency: transitive
description:
Expand Down Expand Up @@ -1132,10 +1132,10 @@ packages:
dependency: transitive
description:
name: shelf_web_socket
sha256: "073c147238594ecd0d193f3456a5fe91c4b0abbcc68bf5cd95b36c4e194ac611"
sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1"
url: "https://pub.dev"
source: hosted
version: "2.0.0"
version: "1.0.4"
sky_engine:
dependency: transitive
description: flutter
Expand Down Expand Up @@ -1257,10 +1257,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
url: "https://pub.dev"
source: hosted
version: "0.7.0"
version: "0.6.1"
textfield_search:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1313,10 +1313,10 @@ packages:
dependency: transitive
description:
name: url_launcher_android
sha256: "95d8027db36a0e52caf55680f91e33ea6aa12a3ce608c90b06f4e429a21067ac"
sha256: "17cd5e205ea615e2c6ea7a77323a11712dffa0720a8a90540db57a01347f9ad9"
url: "https://pub.dev"
source: hosted
version: "6.3.5"
version: "6.3.2"
url_launcher_ios:
dependency: transitive
description:
Expand Down Expand Up @@ -1385,10 +1385,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
url: "https://pub.dev"
source: hosted
version: "14.2.1"
version: "13.0.0"
watcher:
dependency: transitive
description:
Expand All @@ -1401,26 +1401,18 @@ packages:
dependency: transitive
description:
name: web
sha256: d43c1d6b787bf0afad444700ae7f4db8827f701bc61c255ac8d328c6f4d52062
sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27"
url: "https://pub.dev"
source: hosted
version: "1.0.0"
web_socket:
dependency: transitive
description:
name: web_socket
sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83"
url: "https://pub.dev"
source: hosted
version: "0.1.6"
version: "0.5.1"
web_socket_channel:
dependency: transitive
description:
name: web_socket_channel
sha256: "9f187088ed104edd8662ca07af4b124465893caf063ba29758f97af57e61da8f"
sha256: "58c6666b342a38816b2e7e50ed0f1e261959630becd4c879c4f26bfa14aa5a42"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
version: "2.4.5"
webview_flutter:
dependency: "direct main"
description:
Expand All @@ -1433,10 +1425,10 @@ packages:
dependency: "direct main"
description:
name: webview_flutter_android
sha256: f42447ca49523f11d8f70abea55ea211b3cafe172dd7a0e7ac007bb35dd356dc
sha256: "0d21cfc3bfdd2e30ab2ebeced66512b91134b39e72e97b43db2d47dda1c4e53a"
url: "https://pub.dev"
source: hosted
version: "3.16.4"
version: "3.16.3"
webview_flutter_platform_interface:
dependency: transitive
description:
Expand All @@ -1457,10 +1449,10 @@ packages:
dependency: transitive
description:
name: win32
sha256: a79dbe579cb51ecd6d30b17e0cae4e0ea15e2c0e66f69ad4198f22a6789e94f4
sha256: "0eaf06e3446824099858367950a813472af675116bf63f008a4c2a75ae13e9cb"
url: "https://pub.dev"
source: hosted
version: "5.5.1"
version: "5.5.0"
xdg_directories:
dependency: transitive
description:
Expand All @@ -1486,5 +1478,5 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.4.0 <4.0.0"
flutter: ">=3.22.0"
dart: ">=3.3.0 <4.0.0"
flutter: ">=3.19.0"

0 comments on commit d6736a3

Please sign in to comment.