Add bottom_nav_bar.dart to jobs_screen.dart

Add search_companies.dart
main
David 2023-06-08 21:30:25 +02:00
parent 3814f8d08d
commit 67b5ce90b2
3 changed files with 79 additions and 0 deletions

View File

@ -0,0 +1,41 @@
import 'package:cpd_ss23/Widgets/bottom_nav_bar.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
class AllWorkersScreen extends StatefulWidget {
@override
State<AllWorkersScreen> createState() => _AllWorkersScreenState();
}
class _AllWorkersScreenState extends State<AllWorkersScreen> {
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Colors.deepOrange.shade300, Colors.blueAccent],
begin: Alignment.centerLeft,
end: Alignment.centerRight,
stops: const [0.2, 0.9],
)
),
child: Scaffold(
bottomNavigationBar: BottomNavigationBarForApp(indexNum: 1,),
backgroundColor: Colors.transparent,
appBar: AppBar(
backgroundColor: Colors.cyan,
title: const Text('All Workers Screen'),
actions: [
IconButton(
icon: const Icon(Icons.search),
onPressed: () {
// Action when the search icon is clicked
},
),
],
),
),
);
}
}

View File

@ -0,0 +1,36 @@
import 'package:cpd_ss23/Search/search_companies.dart';
import 'package:curved_navigation_bar/curved_navigation_bar.dart';
import 'package:flutter/material.dart';
import '../jobs/jobs_screen.dart';
class BottomNavigationBarForApp extends StatelessWidget {
int indexNum = 0;
BottomNavigationBarForApp({required this.indexNum});
@override
Widget build(BuildContext context) {
return CurvedNavigationBar(
color: Colors.deepOrange.shade400,
backgroundColor: Colors.blueAccent,
buttonBackgroundColor: Colors.deepOrange.shade300,
height: 50,
items: const [
Icon(Icons.list, size: 19, color: Colors.black,),
Icon(Icons.search, size: 19, color: Colors.black,)
],
animationDuration: const Duration(
milliseconds: 300,
),
animationCurve: Curves.bounceInOut,
onTap: (index){
if(index == 0){
Navigator.pushReplacement(context, MaterialPageRoute(builder: (_) => JobScreen()));
} else if (index == 1){
Navigator.pushReplacement(context, MaterialPageRoute(builder: (_) => AllWorkersScreen()));
}
},
);
}
}

View File

@ -1,3 +1,4 @@
import 'package:cpd_ss23/Widgets/bottom_nav_bar.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
@ -17,6 +18,7 @@ class _JobScreenState extends State<JobScreen> {
Size size = MediaQuery.of(context).size;
return Scaffold(
bottomNavigationBar: BottomNavigationBarForApp(indexNum:0),
body: Stack(
children: [
Image.network(