Fixed AppBar Joblist overlap

main
David 2023-06-11 20:09:04 +02:00
parent 979c0d0f0d
commit 094fa115c7
1 changed files with 41 additions and 41 deletions

View File

@ -139,6 +139,47 @@ class _JobScreenState extends State<JobScreen> {
},
),
),
StreamBuilder<QuerySnapshot<Map<String, dynamic>>>(
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<JobScreen> {
),
),
),
//TODO Jobs werden von Appbar überdeckt
StreamBuilder<QuerySnapshot<Map<String, dynamic>>>(
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
),
),
);
}
),
],
),
);