Skip to content

Commit

Permalink
Revert "Added Projects Section For Certain Org"
Browse files Browse the repository at this point in the history
This reverts commit ebbe14c.
  • Loading branch information
rishabh7923 committed Nov 1, 2024
1 parent ebbe14c commit 2715f29
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 174 deletions.
16 changes: 5 additions & 11 deletions lib/programs screen/google_summer_of_code_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -339,16 +339,11 @@ class _GoogleSummerOfCodeScreenState extends State<GoogleSummerOfCodeScreen> {
),
],
),
child: Column(
children: [
GsocProjectWidget(
index: index + 1,
modal: orgList[index],
height: height * 0.2,
width: width,
),

],
child: GsocProjectWidget(
index: index + 1,
modal: orgList[index],
height: height * 0.2,
width: width,
),
),
);
Expand All @@ -365,7 +360,6 @@ class _GoogleSummerOfCodeScreenState extends State<GoogleSummerOfCodeScreen> {
);
}


Widget _buildMultiSelectField({
required List<String> items,
required List<String> selectedValues,
Expand Down
225 changes: 62 additions & 163 deletions lib/widgets/gsoc/GsocProjectWidget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class GsocProjectWidget extends StatelessWidget {
throw 'Could not launch $url';
}
}

@override
Widget build(BuildContext context) {
final isDarkMode = Theme.of(context).brightness == Brightness.dark;
Expand Down Expand Up @@ -55,37 +54,70 @@ class GsocProjectWidget extends StatelessWidget {
fontWeight: FontWeight.bold,
),
),
Text(
modal.description,
style: TextStyle(
color: textColor,
Padding(
padding: const EdgeInsets.only(top: 10.0),
child: Text(
"By ${modal.description}",
style: TextStyle(
color: textColor,
),
),
),
SizedBox(
height: 10,
Padding(
padding: const EdgeInsets.only(top: 20.0),
child: Wrap(
spacing: 10,
runSpacing: 10,
children: [
if (modal.contactEmail.isNotEmpty)
ElevatedButton.icon(
onPressed: () {
_launchUrl('mailto:${modal.contactEmail}');
},
icon: Icon(Icons.email, color: Colors.white),
label: Text("Email"),
style: ElevatedButton.styleFrom(
foregroundColor: Colors.white, backgroundColor: Colors.orange,
),
),
if (modal.blogUrl.isNotEmpty)
ElevatedButton.icon(
onPressed: () {
_launchUrl(modal.blogUrl);
},
icon: Icon(Icons.web, color: Colors.white),
label: Text("Blog"),
style: ElevatedButton.styleFrom(
foregroundColor: Colors.white, backgroundColor: Colors.orange,
),
),
],
),
),
Wrap(
alignment: WrapAlignment.start,
runSpacing: 10,
children: List.generate(
modal.technologies.length,
(index) => Container(
margin: const EdgeInsets.only(right: 5),
decoration: BoxDecoration(
color: const Color.fromARGB(255, 249, 241, 226),
borderRadius: BorderRadius.circular(20),
),
child: IntrinsicWidth(
stepWidth: 30,
child: Padding(
padding: const EdgeInsets.all(5.0),
child: Center(
child: Text(
modal.technologies[index],
style: TextStyle(
color: Colors.orange,
fontSize: 10,
fontWeight: FontWeight.w500,
Padding(
padding: const EdgeInsets.only(top: 20.0),
child: Wrap(
alignment: WrapAlignment.start,
runSpacing: 10,
children: List.generate(
modal.technologies.length,
(index) => Container(
margin: const EdgeInsets.only(right: 10),
decoration: BoxDecoration(
color: const Color.fromARGB(255, 249, 241, 226),
borderRadius: BorderRadius.circular(20),
),
child: IntrinsicWidth(
stepWidth: 30,
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Center(
child: Text(
modal.technologies[index],
style: TextStyle(
color: Colors.orange,
fontWeight: FontWeight.bold,
),
),
),
),
Expand All @@ -94,143 +126,10 @@ class GsocProjectWidget extends StatelessWidget {
),
),
),
SizedBox(
height: 10,
),
SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: () {
showModalBottomSheet(
backgroundColor: Colors.white,
showDragHandle: true,
context: context,
isScrollControlled: true,
useSafeArea: true,
builder: (BuildContext context) {
return SingleChildScrollView(
child: Padding(
padding:
const EdgeInsets.fromLTRB(16, 16, 16, 16),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.all(20),
color: Colors.grey[100],
child: Center(
child: Image.network(
modal.imageUrl,
width: 80,
height: 80,
),
),
),
SizedBox(
height: 10,
),
Text(modal.description),
Divider(
thickness: 2,
color: Colors.grey[200],
),
ListView.builder(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: modal.projects.length,
itemBuilder: (context, projectIndex) {
return _buildProjectCard(
modal.projects[projectIndex]);
},
)
]),
),
);
},
);
},
style: ButtonStyle(
backgroundColor:
WidgetStateProperty.all(Colors.orange),
foregroundColor:
WidgetStateProperty.all(Colors.white)),
child: Text('View Projects')))
],
),
),
),
);
}

Widget _buildProjectCard(Project project) {
return Card(
color: Colors.grey[100],
elevation: 0,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
project.title,
style: TextStyle(fontWeight: FontWeight.w600),
),
SizedBox(
height: 10,
),
Text(project.shortDescription,
style: TextStyle(color: Colors.grey[700])),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: ElevatedButton(
onPressed: () async {
await _launchUrl(project.projectUrl);
},
style: ButtonStyle(
backgroundColor: WidgetStateProperty.all(Colors.orange),
foregroundColor: WidgetStateProperty.all(Colors.white),
shape: WidgetStateProperty.all(RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8))),
padding: WidgetStateProperty.all(
EdgeInsets.symmetric(vertical: 8, horizontal: 16)),
),
child: Text('View Project Details'),
),
),
SizedBox(width: 8),
SizedBox(
width: 100, // Reduced width of the button
child: OutlinedButton(
onPressed: () async {
await _launchUrl(project.codeUrl);
},
style: ButtonStyle(
side: WidgetStateProperty.all(
BorderSide(
color: Colors.orange,
width: 1), // Outline color and width
),
foregroundColor: WidgetStateProperty.all(Colors.orange),
shape: WidgetStateProperty.all(RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8))),
padding: WidgetStateProperty.all(
EdgeInsets.symmetric(vertical: 8, horizontal: 8)),
),
child: Text('View Code'),
),
),
],
),
],
),
),
);
}
}
}

0 comments on commit 2715f29

Please sign in to comment.