From d956efe95a2367b633e3072a33539659fa483e25 Mon Sep 17 00:00:00 2001 From: nkloos <2020633@stud.hs-mannheim.de> Date: Sun, 18 Jun 2023 13:41:52 +0200 Subject: [PATCH] fix web version --- assets/images/genericProfileWeb.jpg | Bin 0 -> 7990 bytes lib/Persistent/persistent.dart | 15 + lib/jobs/job_details.dart | 1 - lib/jobs/jobs_screen.dart | 321 +++++++++--------- lib/jobs/upload_job.dart | 19 +- lib/signup_page/signup_screen.dart | 6 +- linux/flutter/generated_plugin_registrant.cc | 4 + linux/flutter/generated_plugins.cmake | 1 + macos/Flutter/GeneratedPluginRegistrant.swift | 2 + pubspec.lock | 200 ++++++++--- pubspec.yaml | 2 + .../flutter/generated_plugin_registrant.cc | 3 + windows/flutter/generated_plugins.cmake | 1 + 13 files changed, 358 insertions(+), 217 deletions(-) create mode 100644 assets/images/genericProfileWeb.jpg diff --git a/assets/images/genericProfileWeb.jpg b/assets/images/genericProfileWeb.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f98b40153db4461de6ed9c2fad915d54f10bd86a GIT binary patch literal 7990 zcmbt$2UJtrw)Q4e0qG!8G(@CI54}cu3DS|KKnM^>LP_X?fCr@th!le$0z#+)(vc$7 z21-W)2&hO`4oyJi4|uNcoICFS#<=6HF?ROaYt8x1^363@4kr$00Tv@YLp^|kJT6dN z0D!|a;J%rs58emo>EjEQlavOOE*iqAsDPt!oeyLN@VWZ9f&*Q!U^gTd?27dF0Q(-v zd-%KfdWP_Uf&ocwv=0s$;0yL~2V;>zU{@c1EEw&AaRmpV@Sb1~e`E;Q)dk`0;qMcG zb(7=+;Q`Lh5*Qi{wm^A!;&EULBo65xh;-uvVF5;cBpx3EHpIAiAaTIq9N?=PjB*D6 zLqjouj_eW$V4?s4lH{2X`N@g~0UYGF75Ox>Eh<& zij+k7V5EXwe5GV0rKJEh&0t@0Fi1Q(7al0AI^;`BI|Ph!Q-|2f!=>TA+DK27L8w2{ zGSt)x5$cUlc7teY(5nTj1Y>+LNW2R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QRP>nuhbnaEawnb*%`LVL zf%k^hs8^jj7%~~J%Lw8!w$YzKvxP5p*e{f*>nSp(&VVC0ZWo(1z$R+PiuME{q*_F? zAx)WNm1KljA&#?w??9KSRpv^i&1&y3RNc# PcC!D{$e$x|hwuI$+J*Ad literal 0 HcmV?d00001 diff --git a/lib/Persistent/persistent.dart b/lib/Persistent/persistent.dart index e597a33..162fa02 100644 --- a/lib/Persistent/persistent.dart +++ b/lib/Persistent/persistent.dart @@ -1,3 +1,8 @@ +import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:firebase_auth/firebase_auth.dart'; + +import '../services/global_variables.dart'; + class Persistent{ static List jobCategoryList = [ "Architecture and Construction", @@ -10,4 +15,14 @@ class Persistent{ "Design", "Accounting" ]; + + + void getMyData() async{ + final DocumentSnapshot userDoc = await FirebaseFirestore.instance.collection("users").doc(FirebaseAuth.instance.currentUser!.uid) + .get(); + name = userDoc.get("name"); + userImage = userDoc.get("userImage"); + location = userDoc.get("location"); + + } } \ No newline at end of file diff --git a/lib/jobs/job_details.dart b/lib/jobs/job_details.dart index 3d4b7bd..1f3d660 100644 --- a/lib/jobs/job_details.dart +++ b/lib/jobs/job_details.dart @@ -561,7 +561,6 @@ class _JobDetailsScreenState extends State { toastLength: Toast.LENGTH_LONG, backgroundColor: Colors.grey, fontSize: 18.0, - ); _commentController.clear(); setState(() { diff --git a/lib/jobs/jobs_screen.dart b/lib/jobs/jobs_screen.dart index 231aba4..6241d05 100644 --- a/lib/jobs/jobs_screen.dart +++ b/lib/jobs/jobs_screen.dart @@ -21,78 +21,85 @@ class _JobScreenState extends State { _showTaskCategoriesDialog({required Size size}) { showDialog( - context: context, - builder: (ctx) { - return AlertDialog( - backgroundColor: Colors.black54, - title: const Text( - "Job Category", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 20, color: Colors.white), - ), - content: Container( - width: size.width * 0.9, - child: ListView.builder( - shrinkWrap: true, - itemCount: Persistent.jobCategoryList.length, - itemBuilder: (ctx, index) { - return InkWell( - onTap: () { - setState(() { - jobCategoryFilter = Persistent.jobCategoryList[index]; - }); - Navigator.canPop(context) ? Navigator.pop(context) : null; - print( - "jobCategoryList[index], ${Persistent.jobCategoryList[index]}"); - }, - child: Row( - children: [ - const Icon( - Icons.arrow_right_alt_outlined, - color: Colors.grey, - ), - Padding( - padding: const EdgeInsets.all(8.0), - child: Text( - Persistent.jobCategoryList[index], - style: const TextStyle( - color: Colors.grey, - fontSize: 16, - ), + context: context, + builder: (ctx) { + return AlertDialog( + backgroundColor: Colors.black54, + title: const Text( + "Job Category", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 20, color: Colors.white), + ), + content: Container( + width: size.width * 0.9, + child: ListView.builder( + shrinkWrap: true, + itemCount: Persistent.jobCategoryList.length, + itemBuilder: (ctx, index) { + return InkWell( + onTap: () { + setState(() { + jobCategoryFilter = Persistent.jobCategoryList[index]; + }); + Navigator.canPop(context) ? Navigator.pop(context) : null; + print("jobCategoryList[index], ${Persistent.jobCategoryList[index]}"); + }, + child: Row( + children: [ + const Icon( + Icons.arrow_right_alt_outlined, + color: Colors.grey, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + Persistent.jobCategoryList[index], + style: const TextStyle( + color: Colors.grey, + fontSize: 16, ), - ) - ], - ), - ); - }, - ), - ), - actions: [ - TextButton( - onPressed: () { - Navigator.canPop(context) ? Navigator.pop(context) : null; - }, - child: const Text( - "Close", - style: TextStyle( - color: Colors.white, - fontSize: 16, + ), + ) + ], ), + ); + }, + ), + ), + actions: [ + TextButton( + onPressed: () { + Navigator.canPop(context) ? Navigator.pop(context) : null; + }, + child: const Text( + "Close", + style: TextStyle( + color: Colors.white, + fontSize: 16, ), ), - TextButton( - onPressed: () { - setState(() { - jobCategoryFilter = null; - }); - Navigator.canPop(context) ? Navigator.pop(context) : null; - }, - child: const Text("Cancel Filter", - style: TextStyle(color: Colors.white)), - ), - ], - ); - }); + ), + TextButton( + onPressed: () { + setState(() { + jobCategoryFilter = null; + }); + Navigator.canPop(context) ? Navigator.pop(context) : null; + }, + child: const Text("Cancel Filter", + style: TextStyle(color: Colors.white)), + ), + ], + ); + }, + ); + } + + @override + void initState() { + super.initState(); + Persistent persistentObject = Persistent(); + persistentObject.getMyData(); } @override @@ -100,106 +107,106 @@ class _JobScreenState extends State { Size size = MediaQuery.of(context).size; return Scaffold( - bottomNavigationBar: BottomNavigationBarForApp(indexNum: 0), - body: Stack( - children: [ - Image.network( - signupUrlImage, - fit: BoxFit.cover, - width: double.infinity, - height: double.infinity, - ), - SingleChildScrollView( - child: SizedBox( - height: size.height - 18, // Adjust for bottom overflow - child: Column( - children: [ - AppBar( - backgroundColor: Colors.transparent, - actions: [ - IconButton( - icon: const Icon(Icons.search_outlined, - color: Colors.white), - onPressed: () { - Navigator.pushReplacement( - context, - MaterialPageRoute( - builder: (c) => SearchScreen())); - }, - ), - ], - automaticallyImplyLeading: false, - leading: IconButton( + bottomNavigationBar: BottomNavigationBarForApp(indexNum: 0), + body: Stack( + children: [ + Image.network( + signupUrlImage, + fit: BoxFit.cover, + width: double.infinity, + height: double.infinity, + ), + SingleChildScrollView( + child: SizedBox( + height: size.height - 18, // Adjust for bottom overflow + child: Column( + children: [ + AppBar( + backgroundColor: Colors.transparent, + actions: [ + IconButton( icon: const Icon( - Icons.filter_list_rounded, + Icons.search_outlined, color: Colors.white, ), onPressed: () { - _showTaskCategoriesDialog(size: size); + Navigator.pushReplacement( + context, + MaterialPageRoute(builder: (c) => SearchScreen()), + ); }, ), - ), - StreamBuilder>>( - stream: FirebaseFirestore.instance.collection("jobs").where("jobCategory", isEqualTo: jobCategoryFilter).where("recruitment", isEqualTo: true).orderBy("createdAt", descending: false).snapshots(), - builder: (context, AsyncSnapshot snapshot){ - if(snapshot.connectionState == ConnectionState.waiting){ - return const Center (child: CircularProgressIndicator(),); - } else if (snapshot.connectionState == ConnectionState.active){ - if(snapshot.data?.docs.isNotEmpty == true){ - return ListView.builder( - shrinkWrap: true, - itemCount: snapshot.data?.docs.length, - itemBuilder: (BuildContext context, int index){ - return JobWidget( - jobTitle: snapshot.data?.docs[index]["jobTitle"], - jobDescription: snapshot.data!.docs[index]["jobDescription"], - jobId: snapshot.data?.docs[index]["jobId"], - uploadedBy: snapshot.data?.docs[index]["uploadedBy"], - userImage: snapshot.data?.docs[index]["userImage"], - name: snapshot.data?.docs[index]["name"], - recruitment: snapshot.data?.docs[index]["recruitment"], - email: snapshot.data?.docs[index]["email"], - location: snapshot.data?.docs[index]["location"], - ); - } - ); - } else { - return const Center( - child: Text("There is no jobs"), - ); - } - } - return const Center( - child: Text( - "Something went wrong", - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 30 - ), - ), - ); - } - ), - const SizedBox(height: 80), - ElevatedButton( + ], + automaticallyImplyLeading: false, + leading: IconButton( + icon: const Icon( + Icons.filter_list_rounded, + color: Colors.white, + ), onPressed: () { - _auth.signOut(); - Navigator.canPop(context) - ? Navigator.pop(context) - : null; - Navigator.pushReplacement( - context, - MaterialPageRoute(builder: (_) => UserState()), + _showTaskCategoriesDialog(size: size); + }, + ), + ), + Expanded( + child: StreamBuilder>>( + stream: FirebaseFirestore.instance + .collection("jobs") + .where("jobCategory", isEqualTo: jobCategoryFilter) + .where("recruitment", isEqualTo: true) + .orderBy("createdAt", descending: false) + .snapshots(), + builder: (context, AsyncSnapshot snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center( + child: CircularProgressIndicator(), + ); + } else if (snapshot.connectionState == + ConnectionState.active) { + if (snapshot.data?.docs.isNotEmpty == true) { + return ListView.builder( + shrinkWrap: true, + itemCount: snapshot.data?.docs.length, + itemBuilder: (BuildContext context, int index) { + return JobWidget( + jobTitle: snapshot.data?.docs[index]["jobTitle"], + jobDescription: snapshot.data!.docs[index]["jobDescription"], + jobId: snapshot.data?.docs[index]["jobId"], + uploadedBy: snapshot.data?.docs[index]["uploadedBy"], + userImage: snapshot.data?.docs[index]["userImage"], + name: snapshot.data?.docs[index]["name"], + recruitment: snapshot.data?.docs[index]["recruitment"], + email: snapshot.data?.docs[index]["email"], + location: snapshot.data?.docs[index]["location"], + ); + }, + ); + } else { + return const Center( + child: Text("There are no jobs"), + ); + } + } + return const Center( + child: Text( + "Something went wrong", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 30, + ), + ), ); }, - child: const Text("Log Out"), ), - ], - ), + ), + const SizedBox(height: 10), + + ], ), ), - ], - ), - ); + ), + ], + ), + ); } } diff --git a/lib/jobs/upload_job.dart b/lib/jobs/upload_job.dart index 977a033..3b3613f 100644 --- a/lib/jobs/upload_job.dart +++ b/lib/jobs/upload_job.dart @@ -241,24 +241,9 @@ class _UploadJobNowState extends State { print("Its not valid"); } } - - void getMyData() async{ - final DocumentSnapshot userDoc = await FirebaseFirestore.instance.collection("users").doc(FirebaseAuth.instance.currentUser!.uid) - .get(); - setState(() { - name = userDoc.get("name"); - userImage = userDoc.get("userImage"); - location = userDoc.get("location"); - }); - } - @override - void initState() { - // TODO: implement initState - super.initState(); - getMyData(); - } + @override Widget build(BuildContext context) { @@ -298,7 +283,6 @@ class _UploadJobNowState extends State { color: Colors.black, fontSize: 40, fontWeight: FontWeight.bold, - fontFamily: "Signatra", ), ), ), @@ -382,7 +366,6 @@ class _UploadJobNowState extends State { color: Colors.white, fontWeight: FontWeight.bold, fontSize: 28, - fontFamily: "Signatra", ), ), SizedBox( diff --git a/lib/signup_page/signup_screen.dart b/lib/signup_page/signup_screen.dart index f3b18fe..34f5412 100644 --- a/lib/signup_page/signup_screen.dart +++ b/lib/signup_page/signup_screen.dart @@ -96,9 +96,13 @@ class _SignUpState extends State { ); final User? user = _auth.currentUser; final _uid = user!.uid; + if (kIsWeb) { + imageUrl= "https://firebasestorage.googleapis.com/v0/b/cpd-last-try.appspot.com/o/userImages%2Fweb_foto.jpeg?alt=media&token=41db34c9-ce68-4d5f-a10b-e45802479999"; + } + else{ final ref = FirebaseStorage.instance.ref().child('userImages').child('$_uid.jpg'); await ref.putFile(imageFile!); - imageUrl = await ref.getDownloadURL(); + imageUrl = await ref.getDownloadURL();} FirebaseFirestore.instance.collection('users').doc(_uid).set({ 'id': _uid, 'name': _nameTextController.text, diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index f6f23bf..7299b5c 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -6,9 +6,13 @@ #include "generated_plugin_registrant.h" +#include #include void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) file_selector_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin"); + file_selector_plugin_register_with_registrar(file_selector_linux_registrar); g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index f16b4c3..786ff5c 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + file_selector_linux url_launcher_linux ) diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 436bdd2..2c33412 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -6,6 +6,7 @@ import FlutterMacOS import Foundation import cloud_firestore +import file_selector_macos import firebase_auth import firebase_core import firebase_storage @@ -15,6 +16,7 @@ import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin")) + FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin")) FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) FLTFirebaseStoragePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseStoragePlugin")) diff --git a/pubspec.lock b/pubspec.lock index 202599d..7a08739 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,10 +5,18 @@ packages: dependency: transitive description: name: _flutterfire_internals - sha256: "8eb354cb8ebed8a9fdf63699d15deff533bc133128898afaf754926b57d611b6" + sha256: a742f71d7f3484253a623b30e19256aa4668ecbb3de6ad1beb0bcf8d4777ecd8 url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.3" + archive: + dependency: transitive + description: + name: archive + sha256: "0c8368c9b3f0abbc193b9d6133649a614204b528982bebc7026372d61677ce3a" + url: "https://pub.dev" + source: hosted + version: "3.3.7" async: dependency: transitive description: @@ -69,26 +77,26 @@ packages: dependency: "direct main" description: name: cloud_firestore - sha256: d597313deea7c06132c3e5d608b6c96b2804f39566f9074fd662753e64659895 + sha256: "988351d4fcc58c47578d95d014018888b2ce7a228f84ce322fea4a127707a0d4" url: "https://pub.dev" source: hosted - version: "4.7.1" + version: "4.8.1" cloud_firestore_platform_interface: dependency: transitive description: name: cloud_firestore_platform_interface - sha256: f6900ac874e326eede700483cc33e034f64bfb98b0cbcdc6c1a5133146de52f9 + sha256: b6652ce95507e604f00cb0c9c9be2363d21746e82667f2f3d61edf2d33cad3bf url: "https://pub.dev" source: hosted - version: "5.14.1" + version: "5.15.1" cloud_firestore_web: dependency: transitive description: name: cloud_firestore_web - sha256: "2f7d865102ff5209d279652d2954e161a1e74d410abe95ed2931818277df4677" + sha256: "22d02595eb7a304c0f1b4a717e78cc054522e8f237eb7b1122886f93130f3f7a" url: "https://pub.dev" source: hosted - version: "3.5.1" + version: "3.6.1" collection: dependency: transitive description: @@ -97,6 +105,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.17.1" + convert: + dependency: transitive + description: + name: convert + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" + source: hosted + version: "3.1.1" cross_file: dependency: transitive description: @@ -153,38 +169,70 @@ packages: url: "https://pub.dev" source: hosted version: "6.1.4" + file_selector_linux: + dependency: transitive + description: + name: file_selector_linux + sha256: d17c5e450192cdc40b718804dfb4eaf79a71bed60ee9530703900879ba50baa3 + url: "https://pub.dev" + source: hosted + version: "0.9.1+3" + file_selector_macos: + dependency: transitive + description: + name: file_selector_macos + sha256: "6290eec24fc4cc62535fe609e0c6714d3c1306191dc8c3b0319eaecc09423a3a" + url: "https://pub.dev" + source: hosted + version: "0.9.2" + file_selector_platform_interface: + dependency: transitive + description: + name: file_selector_platform_interface + sha256: "2a7f4bbf7bd2f022ecea85bfb1754e87f7dd403a9abc17a84a4fa2ddfe2abc0a" + url: "https://pub.dev" + source: hosted + version: "2.5.1" + file_selector_windows: + dependency: transitive + description: + name: file_selector_windows + sha256: ef246380b66d1fb9089fc65622c387bf3780bca79f533424c31d07f12c2c7fd8 + url: "https://pub.dev" + source: hosted + version: "0.9.2" firebase_auth: dependency: "direct main" description: name: firebase_auth - sha256: "64ac4dc04b51aab9d17c23b496c90f948b9ce2065d7b83e0829c7a497d88f9ce" + sha256: f693c0aa998b1101453878951b171b69f0db5199003df1c943b33493a1de7917 url: "https://pub.dev" source: hosted - version: "4.6.1" + version: "4.6.3" firebase_auth_platform_interface: dependency: transitive description: name: firebase_auth_platform_interface - sha256: "63fd67d125ae483722ff3742953e2e06bbc1e6cb3da68e5f7f4430d5f82f9373" + sha256: "689ae048b78ad088ba31acdec45f5badb56201e749ed8b534947a7303ddb32aa" url: "https://pub.dev" source: hosted - version: "6.15.1" + version: "6.15.3" firebase_auth_web: dependency: transitive description: name: firebase_auth_web - sha256: "241a4ecce80da2014e3cd93d7b7e1a66e9b683e4241d466d73676ac90599b805" + sha256: f35d637a1707afd51f30090bb5234b381d5071ccbfef09b8c393bc7c65e440cd url: "https://pub.dev" source: hosted - version: "5.5.1" + version: "5.5.3" firebase_core: dependency: "direct main" description: name: firebase_core - sha256: "250678b816279b3240c3a33e1f76bf712c00718f1fbeffc85873a5da8c077379" + sha256: a4a99204da264a0aa9d54a332ea0315ce7b0768075139c77abefe98093dd98be url: "https://pub.dev" source: hosted - version: "2.13.0" + version: "2.14.0" firebase_core_platform_interface: dependency: transitive description: @@ -197,34 +245,34 @@ packages: dependency: transitive description: name: firebase_core_web - sha256: "8c0f4c87d20e2d001a5915df238c1f9c88704231f591324205f5a5d2a7740a45" + sha256: "0fd5c4b228de29b55fac38aed0d9e42514b3d3bd47675de52bf7f8fccaf922fa" url: "https://pub.dev" source: hosted - version: "2.5.0" + version: "2.6.0" firebase_storage: dependency: "direct main" description: name: firebase_storage - sha256: "89ff2dfd353f953fb2bbbe04359ea1a46d643944f310cfed22dadf352fc16976" + sha256: e9e889adc839a1a68e48762457bd91e247c3b02e4a065842037c039ebb51fa27 url: "https://pub.dev" source: hosted - version: "11.2.1" + version: "11.2.3" firebase_storage_platform_interface: dependency: transitive description: name: firebase_storage_platform_interface - sha256: c06ccd21c3ed20da6128629ab7d525f7b613caddfcd5466ba4a1ff58655261ac + sha256: be0f4254cae3ccaefd5d1435b82c1fa3bda33187387b241c55b27d7516ea9b93 url: "https://pub.dev" source: hosted - version: "4.4.1" + version: "4.4.3" firebase_storage_web: dependency: transitive description: name: firebase_storage_web - sha256: "26a039f211b226fc216f9f06f13402bdf08661edb7c42cb1de3bd236afbbbf75" + sha256: a5aae39af27ecce997ea53e61a35e0a61b3d33f3c247d74748de0bc40f1c5c5a url: "https://pub.dev" source: hosted - version: "3.6.1" + version: "3.6.3" flutter: dependency: "direct main" description: flutter @@ -304,6 +352,14 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.2" + image: + dependency: "direct main" + description: + name: image + sha256: a72242c9a0ffb65d03de1b7113bc4e189686fc07c7147b8b41811d0dd0e0d9bf + url: "https://pub.dev" + source: hosted + version: "4.0.17" image_cropper: dependency: "direct main" description: @@ -332,42 +388,74 @@ packages: dependency: "direct main" description: name: image_picker - sha256: "9978d3510af4e6a902e545ce19229b926e6de6a1828d6134d3aab2e129a4d270" + sha256: b6951e25b795d053a6ba03af5f710069c99349de9341af95155d52665cb4607c url: "https://pub.dev" source: hosted - version: "0.8.7+5" + version: "0.8.9" image_picker_android: dependency: transitive description: name: image_picker_android - sha256: c2f3c66400649bd132f721c88218945d6406f693092b2f741b79ae9cdb046e59 + sha256: "216dbfb6609e46f78613b8913d046a162588ad4f34909ae7bf85e9f94ea6d922" url: "https://pub.dev" source: hosted - version: "0.8.6+16" + version: "0.8.7" image_picker_for_web: dependency: transitive description: name: image_picker_for_web - sha256: "98f50d6b9f294c8ba35e25cc0d13b04bfddd25dbc8d32fa9d566a6572f2c081c" + sha256: "869fe8a64771b7afbc99fc433a5f7be2fea4d1cb3d7c11a48b6b579eb9c797f0" url: "https://pub.dev" source: hosted - version: "2.1.12" + version: "2.2.0" image_picker_ios: dependency: transitive description: name: image_picker_ios - sha256: d779210bda268a03b57e923fb1e410f32f5c5e708ad256348bcbf1f44f558fd0 + sha256: b3e2f21feb28b24dd73a35d7ad6e83f568337c70afab5eabac876e23803f264b url: "https://pub.dev" source: hosted - version: "0.8.7+4" + version: "0.8.8" + image_picker_linux: + dependency: transitive + description: + name: image_picker_linux + sha256: "02cbc21fe1706b97942b575966e5fbbeaac535e76deef70d3a242e4afb857831" + url: "https://pub.dev" + source: hosted + version: "0.2.1" + image_picker_macos: + dependency: transitive + description: + name: image_picker_macos + sha256: cee2aa86c56780c13af2c77b5f2f72973464db204569e1ba2dd744459a065af4 + url: "https://pub.dev" + source: hosted + version: "0.2.1" image_picker_platform_interface: dependency: transitive description: name: image_picker_platform_interface - sha256: "1991219d9dbc42a99aff77e663af8ca51ced592cd6685c9485e3458302d3d4f8" + sha256: "7c7b96bb9413a9c28229e717e6fd1e3edd1cc5569c1778fcca060ecf729b65ee" url: "https://pub.dev" source: hosted - version: "2.6.3" + version: "2.8.0" + image_picker_web: + dependency: "direct main" + description: + name: image_picker_web + sha256: "1185be1cf3cf2ccd99be3f2fd451647147fe512f09db0aad894438ab95a984eb" + url: "https://pub.dev" + source: hosted + version: "3.0.0+1" + image_picker_windows: + dependency: transitive + description: + name: image_picker_windows + sha256: c3066601ea42113922232c7b7b3330a2d86f029f685bba99d82c30e799914952 + url: "https://pub.dev" + source: hosted + version: "0.2.1" js: dependency: transitive description: @@ -408,6 +496,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.9.1" + mime: + dependency: transitive + description: + name: mime + sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + url: "https://pub.dev" + source: hosted + version: "1.0.4" octo_image: dependency: transitive description: @@ -468,10 +564,10 @@ packages: dependency: transitive description: name: path_provider_windows - sha256: d3f80b32e83ec208ac95253e0cd4d298e104fbc63cb29c5c69edaed43b0c69d6 + sha256: "1cb68ba4cd3a795033de62ba1b7b4564dace301f952de6bfb3cd91b202b6ee96" url: "https://pub.dev" source: hosted - version: "2.1.6" + version: "2.1.7" pedantic: dependency: transitive description: @@ -480,6 +576,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.11.1" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 + url: "https://pub.dev" + source: hosted + version: "5.4.0" platform: dependency: transitive description: @@ -496,6 +600,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + pointycastle: + dependency: transitive + description: + name: pointycastle + sha256: "7c1e5f0d23c9016c5bbd8b1473d0d3fb3fc851b876046039509e18e0c7485f2c" + url: "https://pub.dev" + source: hosted + version: "3.7.3" process: dependency: transitive description: @@ -537,10 +649,10 @@ packages: dependency: transitive description: name: sqflite_common - sha256: e77abf6ff961d69dfef41daccbb66b51e9983cdd5cb35bf30733598057401555 + sha256: "8f7603f3f8f126740bc55c4ca2d1027aab4b74a1267a3e31ce51fe40e3b65b8f" url: "https://pub.dev" source: hosted - version: "2.4.5" + version: "2.4.5+1" stack_trace: dependency: transitive description: @@ -641,10 +753,10 @@ packages: dependency: transitive description: name: url_launcher_platform_interface - sha256: "6c9ca697a5ae218ce56cece69d46128169a58aa8653c1b01d26fcd4aad8c4370" + sha256: bfdfa402f1f3298637d71ca8ecfe840b4696698213d5346e9d12d4ab647ee2ea url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.3" url_launcher_web: dependency: transitive description: @@ -693,6 +805,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.0" + xml: + dependency: transitive + description: + name: xml + sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" + url: "https://pub.dev" + source: hosted + version: "6.3.0" sdks: dart: ">=3.0.0-378.0.dev <4.0.0" flutter: ">=3.3.0" diff --git a/pubspec.yaml b/pubspec.yaml index 6a99c0a..6c9dea7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -27,6 +27,8 @@ dependencies: firebase_auth: ^4.6.1 path_provider: ^2.0.15 http: ^0.13.6 + image_picker_web: ^3.0.0+1 + image: ^4.0.17 dev_dependencies: flutter_test: diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index ec8e8d4..df0aa17 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -6,10 +6,13 @@ #include "generated_plugin_registrant.h" +#include #include #include void RegisterPlugins(flutter::PluginRegistry* registry) { + FileSelectorWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FileSelectorWindows")); FirebaseCorePluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); UrlLauncherWindowsRegisterWithRegistrar( diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 02d26c3..420205d 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + file_selector_windows firebase_core url_launcher_windows )