From 094fa115c75a929d151176192598935a2f82838c Mon Sep 17 00:00:00 2001 From: David <1920881@users.noreply.github.com> Date: Sun, 11 Jun 2023 20:09:04 +0200 Subject: [PATCH] Fixed AppBar Joblist overlap --- lib/jobs/jobs_screen.dart | 82 +++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/lib/jobs/jobs_screen.dart b/lib/jobs/jobs_screen.dart index fa19215..231aba4 100644 --- a/lib/jobs/jobs_screen.dart +++ b/lib/jobs/jobs_screen.dart @@ -139,6 +139,47 @@ class _JobScreenState extends State { }, ), ), + 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( onPressed: () { @@ -157,47 +198,6 @@ class _JobScreenState extends State { ), ), ), - //TODO Jobs werden von Appbar überdeckt - 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( - 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 - ), - ), - ); - } - ), ], ), );