Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kartik Deshmukh #12

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/services/blood_bank_service.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:convert';
import 'package:donorconnect/views/controllers/onboarding/onboarding_controller.dart';
import 'package:http/http.dart' as http;

const String apiKey =
Expand All @@ -13,6 +14,9 @@ class BloodBankService {

if (response.statusCode == 200) {
final data = jsonDecode(response.body);
if (data['records'] == null || data['records'].isBlank) {
return []; // as no records are found.
}
return data['records']; // Modify as per the API response structure
} else {
return [];
Expand Down
2 changes: 1 addition & 1 deletion lib/views/pages/camps/campsPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ class _AddCampFormState extends State<AddCampForm> {
lastDate: DateTime(2100),
);

if (pickedDate != null && pickedDate != _selectedDate) {
if (pickedDate != _selectedDate) {
setState(() {
_selectedDate = pickedDate; // Store the selected date
});
Expand Down
2 changes: 0 additions & 2 deletions lib/views/pages/main_home/chatbot.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:convert';
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
Expand Down
25 changes: 16 additions & 9 deletions lib/views/pages/main_home/home_pages/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,19 @@ class _HomeScreenState extends State<HomeScreen> {
HomeCardConst(
title: _text.donate,
col: const Color.fromARGB(255, 255, 122, 122),
onPressed: () {},
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (ctx) => LocateBloodBanks()));
},
),
HomeCardConst(
title: _text.required,
col: const Color.fromARGB(255, 167, 165, 252),
onPressed: () {
Navigator.push(context, MaterialPageRoute(builder: (ctx)=> RequiredScreen()));
Navigator.push(
context,
MaterialPageRoute(
builder: (ctx) => RequiredScreen()));
},
),
],
Expand All @@ -90,8 +96,7 @@ class _HomeScreenState extends State<HomeScreen> {
Icons.search,
size: 23,
),
onPressed: (){},

onPressed: () {},
),
HomeCard(
title: _text.learn_about_donating,
Expand Down Expand Up @@ -123,11 +128,13 @@ class _HomeScreenState extends State<HomeScreen> {
),
),
),
floatingActionButton: FloatingActionButton(onPressed: () {
Navigator.push(context, MaterialPageRoute(builder: (context) => ChatBot()));
},
child: const Icon(Icons.chat),
),
floatingActionButton: FloatingActionButton(
onPressed: () {
Navigator.push(
context, MaterialPageRoute(builder: (context) => ChatBot()));
},
child: const Icon(Icons.chat),
),
);
}
}
8 changes: 5 additions & 3 deletions lib/views/pages/profile/profile_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:donorconnect/cubit/profile/profile_cubit.dart';
import 'package:donorconnect/cubit/profile/profile_state.dart';
import 'package:donorconnect/language/helper/language_extention.dart';
import 'package:donorconnect/views/common_widgets/toggle_button.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

Expand Down Expand Up @@ -41,7 +42,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
actions: [
IconButton(
onPressed: () {

AuthCubit(_auth, _firestore).signOut(context);
},
icon: const Icon(
Icons.logout,
Expand All @@ -60,7 +61,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
Column(
children: [
Text(
"ALICE",
widget.name,
style: const TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
Expand Down Expand Up @@ -179,7 +180,8 @@ class _ProfileScreenState extends State<ProfileScreen> {
// theme-toggle button
BlocBuilder<ThemeCubit, Themestate>(
builder: (context, themeState) {
final isDarkMode = themeState.themeData.brightness == Brightness.dark;
final isDarkMode =
themeState.themeData.brightness == Brightness.dark;
return ThemeToggleButton(
switchValue: isDarkMode,
);
Expand Down