Skip to content

Commit

Permalink
Merge pull request prajapatihet#108 from singhtrivendra/main
Browse files Browse the repository at this point in the history
added Screen for the donate button at home page
  • Loading branch information
prajapatihet authored Oct 25, 2024
2 parents 6850322 + 474136b commit 927581c
Show file tree
Hide file tree
Showing 7 changed files with 204 additions and 2 deletions.
5 changes: 5 additions & 0 deletions PROJECT_STRUCTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
│ │ └── verification_service.dart
│ └── views/
│ ├── common_widgets/
│ │ ├── donate_card.dart
│ │ ├── donor_card.dart
│ │ ├── events_card.dart
│ │ ├── home_card.dart
Expand All @@ -261,6 +262,10 @@
│ │ ├── camps/
│ │ │ ├── calendarPage.dart
│ │ │ └── campsPage.dart
│ │ ├── donate/
│ │ │ ├── donate_screen.dart
│ │ │ └── widgets/
│ │ │ └── donate_screen_tabbar.dart
│ │ ├── forgot_password/
│ │ │ ├── change-password.dart
│ │ │ └── forgot-password.dart
Expand Down
77 changes: 77 additions & 0 deletions lib/views/common_widgets/donate_card.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import 'package:donorconnect/Utils/constants/images_string.dart';
import 'package:donorconnect/views/common_widgets/rounded_conatiner.dart';
import 'package:donorconnect/views/common_widgets/rounded_image.dart';
import 'package:flutter/material.dart';
import 'package:iconsax/iconsax.dart';

class TDonateCardHorizontal extends StatelessWidget {
const TDonateCardHorizontal({super.key});

@override
Widget build(BuildContext context) {
return Container(
// color: Colors.red,
// decoration: BoxDecoration(border: Border.all(color: Colors.black)),
child: Padding(
padding: EdgeInsets.fromLTRB(10, 20, 10, 360),
child: Card(
clipBehavior: Clip.hardEdge,
child: InkWell(
splashColor: Colors.blue.withAlpha(30),
child: SizedBox(
width: 300,
height: 200,
child:Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [

const Padding(
padding: EdgeInsets.all(15),
child: CircleAvatar(child: Icon(Iconsax.user,size: 30,),
),
),

const Padding(
padding: EdgeInsets.fromLTRB(5, 5, 50, 0),
child: Text('Oliver James',style: TextStyle(fontSize: 16,fontWeight: FontWeight.bold),)),
const Padding(
padding: EdgeInsets.fromLTRB(5, 5, 50, 0),
child: Text('working Professional 21 year old having problem of low RBC ')),
const Padding(
padding: EdgeInsets.all(10),
child: Chip(
backgroundColor: Color.fromARGB(255, 246, 177, 172),
label: Text('7 min ago',style: TextStyle(color: Color.fromARGB(255, 189, 20, 152)),),

),
),

Row(
children: [
const Icon(Icons.location_pin,size: 40),
SizedBox(width: 10),
const Text('Chandigarh'),
SizedBox(width: 60),
TextButton(
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30),
),
backgroundColor: Theme.of(context).colorScheme.primary,
padding: const EdgeInsets.fromLTRB(30, 10, 30, 15),
),
onPressed: (){}, child: Text(textAlign: TextAlign.right ,'Donate', style: TextStyle(
color: Theme.of(context).colorScheme.onPrimary,
fontWeight: FontWeight.bold,
),))
],
)
],
)
)
),
),
)
);
}
}
3 changes: 2 additions & 1 deletion lib/views/pages/Required/required_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ class RequiredScreen extends StatelessWidget {
fontSize: 20,
color: Theme.of(context).colorScheme.onSurface,
fontWeight: FontWeight.bold,
),),
),
),
),
const SizedBox(height: 20),
const TDonorCardHorizontal(),
Expand Down
23 changes: 23 additions & 0 deletions lib/views/pages/donate/donate_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import 'package:donorconnect/views/pages/donate/widgets/donate_screen_tabbar.dart';
import 'package:flutter/material.dart';

class DonateScreen extends StatelessWidget{
const DonateScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar:AppBar(
title: Center(child: Text('Donate',style: TextStyle(
fontSize: 20,
color: Theme.of(context).colorScheme.onSurface,
fontWeight: FontWeight.bold,
),)),
) ,
body:
const DonateScreenTabbar(),


);
}

}
88 changes: 88 additions & 0 deletions lib/views/pages/donate/widgets/donate_screen_tabbar.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import 'package:donorconnect/Utils/constants/images_string.dart';
import 'package:donorconnect/views/common_widgets/donate_card.dart';
import 'package:donorconnect/views/common_widgets/donor_card.dart';
import 'package:donorconnect/views/common_widgets/rounded_conatiner.dart';
import 'package:flutter/material.dart';
import 'package:iconsax/iconsax.dart';

import '../../../common_widgets/rounded_image.dart';

class DonateScreenTabbar extends StatelessWidget {
const DonateScreenTabbar({super.key});

@override
Widget build(BuildContext context) {
return const TabBarExample();
}
}

class TabBarExample extends StatelessWidget {
const TabBarExample({super.key});

@override
Widget build(BuildContext context) {
return const DefaultTabController(
initialIndex: 1,
length: 3,
child: TabBarView(
children: <Widget>[
NestedTabBar(''),
NestedTabBar(''),
NestedTabBar(''),
],
),

);
}
}

class NestedTabBar extends StatefulWidget {
const NestedTabBar(this.outerTab, {super.key});

final String outerTab;

@override
State<NestedTabBar> createState() => _NestedTabBarState();
}

class _NestedTabBarState extends State<NestedTabBar>
with TickerProviderStateMixin {
late final TabController _tabController;

@override
void initState() {
super.initState();
_tabController = TabController(length: 2, vsync: this);
}

@override
void dispose() {
_tabController.dispose();
super.dispose();
}

@override
Widget build(BuildContext context) {
return Column(
children: <Widget>[
TabBar.secondary(
controller: _tabController,
tabs: <Widget>[
Tab(text: 'All'),
Tab(text: 'Urgent'),
],
),
Expanded(
child: TabBarView(
controller: _tabController,
children: <Widget>[
TDonateCardHorizontal(),
TDonateCardHorizontal(),

],
),
),
],
);
}
}
5 changes: 4 additions & 1 deletion lib/views/pages/main_home/home_pages/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:donorconnect/language/helper/language_extention.dart';
import 'package:donorconnect/views/common_widgets/home_card.dart';
import 'package:donorconnect/views/common_widgets/home_card_form.dart';
import 'package:donorconnect/views/pages/Required/required_screen.dart';
import 'package:donorconnect/views/pages/donate/donate_Screen.dart';
import 'package:donorconnect/views/pages/learn_about_donation/learn_about_donation.dart';
import 'package:donorconnect/views/pages/locate_blood_banks/locate_blood_banks.dart';
import 'package:donorconnect/views/pages/main_home/chatbot.dart';
Expand Down Expand Up @@ -70,7 +71,9 @@ class _HomeScreenState extends State<HomeScreen> {
HomeCardConst(
title: _text.donate,
col: const Color.fromARGB(255, 255, 122, 122),
onPressed: () {},
onPressed: () {
Navigator.push(context, MaterialPageRoute(builder: (ctx)=> DonateScreen()));
},
),
HomeCardConst(
title: _text.required,
Expand Down
5 changes: 5 additions & 0 deletions repo_structure.txt
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@
│ │ └── verification_service.dart
│ └── views/
│ ├── common_widgets/
│ │ ├── donate_card.dart
│ │ ├── donor_card.dart
│ │ ├── events_card.dart
│ │ ├── home_card.dart
Expand All @@ -257,6 +258,10 @@
│ │ ├── camps/
│ │ │ ├── calendarPage.dart
│ │ │ └── campsPage.dart
│ │ ├── donate/
│ │ │ ├── donate_screen.dart
│ │ │ └── widgets/
│ │ │ └── donate_screen_tabbar.dart
│ │ ├── forgot_password/
│ │ │ ├── change-password.dart
│ │ │ └── forgot-password.dart
Expand Down

0 comments on commit 927581c

Please sign in to comment.