Skip to content

Commit

Permalink
Merge pull request #85 from singhtrivendra/singhtri/added_new_search_…
Browse files Browse the repository at this point in the history
…page

added the Search Page features
  • Loading branch information
prajapatihet authored Oct 20, 2024
2 parents ca5017c + 73290f6 commit 31fe5e2
Show file tree
Hide file tree
Showing 12 changed files with 440 additions and 7 deletions.
18 changes: 18 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"configurations": [
{
"name": "windows-gcc-x86",
"includePath": [
"${workspaceFolder}/**"
],
"compilerPath": "C:/MinGW/bin/gcc.exe",
"cStandard": "${default}",
"cppStandard": "${default}",
"intelliSenseMode": "windows-gcc-x86",
"compilerArgs": [
""
]
}
],
"version": 4
}
24 changes: 24 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "C/C++ Runner: Debug Session",
"type": "cppdbg",
"request": "launch",
"args": [],
"stopAtEntry": false,
"externalConsole": true,
"cwd": "c:/Users/conta/OneDrive/Documents/Desktop/donorconnect/lib/views/pages/search/widgets",
"program": "c:/Users/conta/OneDrive/Documents/Desktop/donorconnect/lib/views/pages/search/widgets/build/Debug/outDebug",
"MIMode": "gdb",
"miDebuggerPath": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
59 changes: 59 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"C_Cpp_Runner.cCompilerPath": "gcc",
"C_Cpp_Runner.cppCompilerPath": "g++",
"C_Cpp_Runner.debuggerPath": "gdb",
"C_Cpp_Runner.cStandard": "",
"C_Cpp_Runner.cppStandard": "",
"C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvarsall.bat",
"C_Cpp_Runner.useMsvc": false,
"C_Cpp_Runner.warnings": [
"-Wall",
"-Wextra",
"-Wpedantic",
"-Wshadow",
"-Wformat=2",
"-Wcast-align",
"-Wconversion",
"-Wsign-conversion",
"-Wnull-dereference"
],
"C_Cpp_Runner.msvcWarnings": [
"/W4",
"/permissive-",
"/w14242",
"/w14287",
"/w14296",
"/w14311",
"/w14826",
"/w44062",
"/w44242",
"/w14905",
"/w14906",
"/w14263",
"/w44265",
"/w14928"
],
"C_Cpp_Runner.enableWarnings": true,
"C_Cpp_Runner.warningsAsError": false,
"C_Cpp_Runner.compilerArgs": [],
"C_Cpp_Runner.linkerArgs": [],
"C_Cpp_Runner.includePaths": [],
"C_Cpp_Runner.includeSearch": [
"*",
"**/*"
],
"C_Cpp_Runner.excludeSearch": [
"**/build",
"**/build/**",
"**/.*",
"**/.*/**",
"**/.vscode",
"**/.vscode/**"
],
"C_Cpp_Runner.useAddressSanitizer": false,
"C_Cpp_Runner.useUndefinedSanitizer": false,
"C_Cpp_Runner.useLeakSanitizer": false,
"C_Cpp_Runner.showCompilationTime": false,
"C_Cpp_Runner.useLinkTimeOptimization": false,
"C_Cpp_Runner.msvcSecureNoWarnings": false
}
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ class MyApp extends StatelessWidget {
),
);
}
}
}
5 changes: 1 addition & 4 deletions lib/views/pages/main_home/bottom_nav.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ class NavigationController extends GetxController {
const HomeScreen(),
const HomeScreen(),
const HomeScreen(),
ProfileScreen(
name: name,
userId: email,
),
ProfileScreen(name: name,userId: email,),
];
}
}
2 changes: 1 addition & 1 deletion lib/views/pages/main_home/home_pages/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class _HomeScreenState extends State<HomeScreen> {
onPressed: () {
Navigator.push(
context,
PageRouteBuilder(
PageRouteBuilder(
pageBuilder: (context, animation, secondaryAnimation) => const LocateBloodBanks(),
transitionsBuilder: (context, animation, secondaryAnimation, child) {
return FadeTransition(
Expand Down
3 changes: 2 additions & 1 deletion lib/views/pages/main_home/homepage.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:custom_navigation_bar/custom_navigation_bar.dart';
import 'package:donorconnect/views/pages/camps/campsPage.dart';
import 'package:donorconnect/views/pages/search/search_screen.dart';
import 'package:flutter/material.dart';
import '../profile/profile_screen.dart';
import 'home_pages/home_screen.dart';
Expand Down Expand Up @@ -45,7 +46,7 @@ class _HomePageState extends State<HomePage> {
final _text = context.localizedString;
final pages = [
const HomeScreen(),
const HomeScreen(),
const SearchScreen(),
const Camps(),
ProfileScreen(
name: widget.name ?? "No Name",
Expand Down
87 changes: 87 additions & 0 deletions lib/views/pages/search/search_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import 'package:donorconnect/language/helper/language_extention.dart';
import 'package:donorconnect/views/common_widgets/home_card.dart';
import 'package:donorconnect/views/pages/search/widgets/blood_bank_form.dart';
import 'package:donorconnect/views/pages/search/widgets/blood_donor_form.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
class SearchScreen extends StatefulWidget{
const SearchScreen({super.key});

@override
State<SearchScreen> createState() => _SearchScreenState();
}

class _SearchScreenState extends State<SearchScreen> {
@override
Widget build(BuildContext context) {
final _text = context.localizedString;
return Scaffold(
appBar: AppBar(
title: Padding(
padding: const EdgeInsets.only(
top: 16.0,
),
child: Text(
_text.locate_nearby_bloodbank,
maxLines: 3,
style: GoogleFonts.montserrat(
fontSize: 20,
fontWeight: FontWeight.w700,
letterSpacing: 1,
),
),
),

),
body: SingleChildScrollView(
child: Column(
children: [
Padding(
padding: EdgeInsets.all(30),
child: Container(
height: 50,
width: double.infinity,
decoration: BoxDecoration(
border: Border.all(color: Colors.black),borderRadius: BorderRadius.all(Radius.circular(19)),
),
child: Padding(
padding: EdgeInsets.all(9),
child: Row(
children: [
Icon(Icons.search, color: Colors.grey),
const SizedBox(width: 20),
Text('Search nearby bloodbanks', style: Theme.of(context).textTheme.bodySmall),
],
),
),
),
),
SizedBox(height: 15),
HomeCard(
title: 'Blood Bank',
description: 'Search near by blood bank',
button: 'Find',
image: 'assets/images/home_image1.png',
onPressed:(){Navigator.push(
context,MaterialPageRoute(
builder: (ctx)=> const BloodBankForm())
);} ,
icon: Icon(Icons.local_hospital),),
SizedBox(height: 15),
HomeCard(
title: 'Blood Donors',
description: 'Find nearby donor if available and acc.to blood type',
button: 'explore',
image: 'assets/images/home_image2.png',
onPressed: (){
Navigator.push(context, MaterialPageRoute(
builder:(ctx)=>const BloodDonorForm()));
},
icon: Icon(Icons.bloodtype))
],
),
),
);

}
}
139 changes: 139 additions & 0 deletions lib/views/pages/search/widgets/blood_bank_form.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
import 'package:dropdown_textfield/dropdown_textfield.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

class BloodBankForm extends StatelessWidget{
const BloodBankForm({super.key});
@override
Widget build(BuildContext context) {

return Scaffold(

body:

Container(
height: double.infinity,
width: double.infinity,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
const Color.fromARGB(255, 221, 45, 45).withOpacity(0.6),
const Color.fromARGB(255, 232, 62, 50).withOpacity(0.6),
const Color.fromARGB(255, 240, 62, 39),
const Color.fromARGB(255, 222, 69, 69)
],
begin: Alignment.bottomCenter,
end: Alignment.topCenter,
),
),

child: Padding(
padding: EdgeInsets.fromLTRB(30, 150, 30, 90),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(30)),
color:Colors.white
),
child: Padding(
padding: EdgeInsets.all(16.0),
child: Form(
child:Column(
children: [
Text('Blood Bank',style: TextStyle(
color: Theme.of(context).colorScheme.onSurface,
fontWeight: FontWeight.bold,
fontSize: 30,
),
),

SizedBox(height: 50,),
const DropdownMenu(dropdownMenuEntries: [
DropdownMenuEntry(value: '1', label: 'Agra'),
DropdownMenuEntry(value: '2', label: 'Delhi'),
DropdownMenuEntry(value: '3', label: 'Chandigarh'),
DropdownMenuEntry(value: '4', label: 'Banglore'),
DropdownMenuEntry(value: '5', label: 'Pune'),
DropdownMenuEntry(value: '6', label: 'Noida'),
DropdownMenuEntry(value: '7', label: 'Mumbai'),
DropdownMenuEntry(value: '8', label: 'Kolkata'),

],
width: 600,

label: Text('Select City'),
),
SizedBox(height: 30,),
const DropdownMenu(dropdownMenuEntries: [
DropdownMenuEntry(value: '1', label: 'xx'),
DropdownMenuEntry(value: '2', label: 'zx'),
DropdownMenuEntry(value: '3', label: 'xy'),
DropdownMenuEntry(value: '4', label: 'xm'),
DropdownMenuEntry(value: '5', label: 'xk'),
],
width: 600,

label: Text('Select Taluka/Zila'),
),
SizedBox(height: 30,),
const DropdownMenu(dropdownMenuEntries: [
DropdownMenuEntry(value: '1', label: 'AIIMS'),
DropdownMenuEntry(value: '2', label: 'City Hospital'),
DropdownMenuEntry(value: '3', label: 'General Hospital'),
DropdownMenuEntry(value: '4', label: 'Trama center'),


],
width: 600,

label: Text('Select Hospital'),
),


SizedBox(height: 30,),

const DropdownMenu(dropdownMenuEntries: [
DropdownMenuEntry(value: '1', label: 'A'),
DropdownMenuEntry(value: '2', label: 'A+'),
DropdownMenuEntry(value: '3', label: 'AB'),
DropdownMenuEntry(value: '4', label: 'AB+'),
DropdownMenuEntry(value: '5', label: 'B'),
DropdownMenuEntry(value: '6', label: 'B+'),
DropdownMenuEntry(value: '7', label: 'O'),
DropdownMenuEntry(value: '8', label: 'O+'),
],
width: 600,
label: Text('Needed blood group'),
),
SizedBox(height: 30),

ElevatedButton(
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30),
),
backgroundColor: Theme.of(context).colorScheme.primary,
padding: const EdgeInsets.fromLTRB(112, 10, 140, 15),
),
onPressed: () {},
child: Text(maxLines: 1,
'Search',
style: TextStyle(
color: Theme.of(context).colorScheme.onPrimary,
fontWeight: FontWeight.bold,

),
),

),
]
),
),
),
),
)
)
);
}

}

Loading

0 comments on commit 31fe5e2

Please sign in to comment.