From 67b5ce90b2e34950740102c59af054f361ce335d Mon Sep 17 00:00:00 2001 From: David <1920881@users.noreply.github.com> Date: Thu, 8 Jun 2023 21:30:25 +0200 Subject: [PATCH] Add bottom_nav_bar.dart to jobs_screen.dart Add search_companies.dart --- lib/Search/search_companies.dart | 41 ++++++++++++++++++++++++++++++++ lib/Widgets/bottom_nav_bar.dart | 36 ++++++++++++++++++++++++++++ lib/jobs/jobs_screen.dart | 2 ++ 3 files changed, 79 insertions(+) create mode 100644 lib/Search/search_companies.dart create mode 100644 lib/Widgets/bottom_nav_bar.dart diff --git a/lib/Search/search_companies.dart b/lib/Search/search_companies.dart new file mode 100644 index 0000000..a11637a --- /dev/null +++ b/lib/Search/search_companies.dart @@ -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 createState() => _AllWorkersScreenState(); +} + +class _AllWorkersScreenState extends State { + @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 + }, + ), + ], + ), + ), + ); + } +} diff --git a/lib/Widgets/bottom_nav_bar.dart b/lib/Widgets/bottom_nav_bar.dart new file mode 100644 index 0000000..a0a5659 --- /dev/null +++ b/lib/Widgets/bottom_nav_bar.dart @@ -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())); + } + }, + ); + } +} diff --git a/lib/jobs/jobs_screen.dart b/lib/jobs/jobs_screen.dart index 9e20675..80b2179 100644 --- a/lib/jobs/jobs_screen.dart +++ b/lib/jobs/jobs_screen.dart @@ -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 { Size size = MediaQuery.of(context).size; return Scaffold( + bottomNavigationBar: BottomNavigationBarForApp(indexNum:0), body: Stack( children: [ Image.network(