Skip to content

Commit

Permalink
merged
Browse files Browse the repository at this point in the history
  • Loading branch information
Saumya-28 committed Jun 12, 2024
2 parents c356f10 + e08f6ca commit 1fc7c5a
Show file tree
Hide file tree
Showing 15 changed files with 135 additions and 138 deletions.
Binary file added .gradle/8.1.1/checksums/checksums.lock
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file added .gradle/8.1.1/fileChanges/last-build.bin
Binary file not shown.
Binary file added .gradle/8.1.1/fileHashes/fileHashes.lock
Binary file not shown.
Empty file added .gradle/8.1.1/gc.properties
Empty file.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
4 changes: 2 additions & 2 deletions .gradle/buildOutputCleanup/cache.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Sat Jun 08 20:35:59 IST 2024
gradle.version=7.5.1
#Wed Jun 12 11:38:18 IST 2024
gradle.version=8.1.1
Binary file removed .gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
90 changes: 19 additions & 71 deletions lib/home_page.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import 'dart:ui';
import 'package:flutter_screenutil/flutter_screenutil.dart';


import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:opso/ChatBotpage.dart';
import 'package:opso/opso_timeline.dart';
import 'package:opso/programs%20screen/girl_script.dart';
import 'package:opso/programs%20screen/google_season_of_docs_screen.dart';
Expand All @@ -19,29 +16,24 @@ import 'package:opso/widgets/book_mark_screen.dart';
import 'package:adaptive_theme/adaptive_theme.dart';
import 'package:opso/widgets/faq.dart';
import 'dart:math' as math;


import 'package:awesome_notifications/awesome_notifications.dart';
import 'about.dart';


class HomePage extends StatefulWidget {
const HomePage({super.key});


@override
State<HomePage> createState() => _HomePageState();
}


class _HomePageState extends State<HomePage> {
@override
void initState() {
showNotification();
// showNotification();
super.initState();
_getInitialThemeMode();
}


int _initialLabelIndex = 0;
void _getInitialThemeMode() async {
final savedThemeMode = await AdaptiveTheme.getThemeMode();
Expand All @@ -56,7 +48,6 @@ class _HomePageState extends State<HomePage> {
});
}


//show various notification from here
void showNotification() async {
await NotificationService.showNotification(
Expand All @@ -65,7 +56,6 @@ class _HomePageState extends State<HomePage> {
);
}


//used to show the notification every 5 ms
void showScheduleNotification() async {
await NotificationService.showNotification(
Expand All @@ -75,7 +65,6 @@ class _HomePageState extends State<HomePage> {
interval: 5);
}


final List<Program> programs = [
Program(
title: 'Google Summer of Code',
Expand Down Expand Up @@ -111,15 +100,13 @@ class _HomePageState extends State<HomePage> {
),
];


@override
Widget build(BuildContext context) {
// var media = MediaQuery.of(context).size;
Color backgroundColor = Theme.of(context).brightness == Brightness.dark
? Colors.black.withOpacity(0.6) // Example dark mode color
: Colors.white.withOpacity(0.6); // Example light mode color


ScreenUtil.init(
context,
);
Expand All @@ -131,7 +118,7 @@ class _HomePageState extends State<HomePage> {
title: Text(
'OpSo',
style:
TextStyle(fontWeight: FontWeight.bold, fontSize: appBarFontSize),
TextStyle(fontWeight: FontWeight.bold, fontSize: appBarFontSize),
),
actions: [
IconButton(
Expand All @@ -141,25 +128,14 @@ class _HomePageState extends State<HomePage> {
},
),
/*IconButton(
icon: Icon(Icons.menu),
onPressed: () {
// Open drawer when the menu icon is clicked
Scaffold.of(context).openDrawer();
},
),*/
icon: Icon(Icons.menu),
onPressed: () {
// Open drawer when the menu icon is clicked
Scaffold.of(context).openDrawer();
},
),*/
],
),
floatingActionButton: FloatingActionButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const ChatBotPage(),
),
);
},
child: const Icon(Icons.chat_bubble_outline),
),
drawer: Drawer(
backgroundColor: Colors.transparent,
width: MediaQuery.of(context).size.width,
Expand All @@ -177,7 +153,7 @@ class _HomePageState extends State<HomePage> {
child: SafeArea(
child: Padding(
padding:
const EdgeInsets.only(left: 30, right: 30, top: 30),
const EdgeInsets.only(left: 30, right: 30, top: 30),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expand Down Expand Up @@ -242,7 +218,7 @@ class _HomePageState extends State<HomePage> {
context,
MaterialPageRoute(
builder: (context) =>
const BookMarkScreen()));
const BookMarkScreen()));
},
),
const SizedBox(height: 15),
Expand All @@ -259,7 +235,7 @@ class _HomePageState extends State<HomePage> {
context,
MaterialPageRoute(
builder: (context) =>
const OpsoTimeLineScreen(),
const OpsoTimeLineScreen(),
),
);
},
Expand All @@ -273,16 +249,15 @@ class _HomePageState extends State<HomePage> {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
FAQPage(),
builder: (context) => FAQPage(),
),
);
},
),
SizedBox(height: ScreenUtil().setHeight(15)),
ListTile(
leading:
const Icon(FontAwesomeIcons.circleInfo),
const Icon(FontAwesomeIcons.circleInfo),
title: const Text('About'),
onTap: () {
Navigator.push(
Expand Down Expand Up @@ -328,7 +303,6 @@ class _HomePageState extends State<HomePage> {
);
}


void navigateToScreen(BuildContext context, Program program) {
switch (program.title) {
case 'Google Summer of Code':
Expand All @@ -340,7 +314,6 @@ class _HomePageState extends State<HomePage> {
);
break;


case 'Google Season of Docs':
Navigator.push(
context,
Expand All @@ -350,7 +323,6 @@ class _HomePageState extends State<HomePage> {
);
break;


case 'Major League Hacking Fellowship':
Navigator.push(
context,
Expand All @@ -359,7 +331,6 @@ class _HomePageState extends State<HomePage> {
);
break;


case 'GirlScript Summer of Code':
Navigator.push(
context,
Expand All @@ -369,7 +340,6 @@ class _HomePageState extends State<HomePage> {
);
break;


case 'Social Winter of Code':
Navigator.push(
context,
Expand All @@ -379,16 +349,13 @@ class _HomePageState extends State<HomePage> {
);
break;


case 'Outreachy':
Navigator.push(context,
MaterialPageRoute(builder: (context) => const OutReachy()));


case 'Summer of Bitcoin':
Navigator.pushNamed(context, "/summer_of_bitcoin");


case 'Summer of Bitcoin':
Navigator.push(
context,
Expand All @@ -397,7 +364,6 @@ class _HomePageState extends State<HomePage> {
),
);


case 'Linux Foundation':
Navigator.push(context,
MaterialPageRoute(builder: (context) => const LinuxFoundation()));
Expand All @@ -407,21 +373,18 @@ class _HomePageState extends State<HomePage> {
}
}


class ProgramOption extends StatelessWidget {
final String title;
final String imageAssetPath;
final VoidCallback onTap;


const ProgramOption({
super.key,
required this.title,
required this.imageAssetPath,
required this.onTap,
});


@override
Widget build(BuildContext context) {
final isDarkMode = Theme.of(context).brightness == Brightness.dark;
Expand Down Expand Up @@ -468,7 +431,6 @@ class ProgramOption extends StatelessWidget {
}
}


class ProgramSearchDelegate extends SearchDelegate<String> {
final List<Program> programs = [
Program(
Expand Down Expand Up @@ -505,7 +467,6 @@ class ProgramSearchDelegate extends SearchDelegate<String> {
),
];


@override
List<Widget> buildActions(BuildContext context) {
return [
Expand All @@ -518,7 +479,6 @@ class ProgramSearchDelegate extends SearchDelegate<String> {
];
}


@override
Widget buildLeading(BuildContext context) {
return IconButton(
Expand All @@ -529,23 +489,20 @@ class ProgramSearchDelegate extends SearchDelegate<String> {
);
}


@override
Widget buildResults(BuildContext context) {
return Container();
}


@override
Widget buildSuggestions(BuildContext context) {
final List<String> suggestionList = query.isEmpty
? []
: programs
.where((program) =>
program.title.toLowerCase().contains(query.toLowerCase()))
.map((program) => program.title)
.toList();

.where((program) =>
program.title.toLowerCase().contains(query.toLowerCase()))
.map((program) => program.title)
.toList();

return ListView.builder(
itemCount: suggestionList.length,
Expand All @@ -558,10 +515,9 @@ class ProgramSearchDelegate extends SearchDelegate<String> {
);
}


void navigateToScreen(BuildContext context, String title) {
final Program selectedProgram =
programs.firstWhere((program) => program.title == title);
programs.firstWhere((program) => program.title == title);
switch (selectedProgram.title) {
case 'Google Summer of Code':
Navigator.push(
Expand All @@ -580,7 +536,6 @@ class ProgramSearchDelegate extends SearchDelegate<String> {
);
break;


case 'Major League Hacking Fellowship':
Navigator.push(
context,
Expand All @@ -590,7 +545,6 @@ class ProgramSearchDelegate extends SearchDelegate<String> {
);
break;


case 'GirlScript Summer of Code':
Navigator.push(
context,
Expand All @@ -600,7 +554,6 @@ class ProgramSearchDelegate extends SearchDelegate<String> {
);
break;


case 'Social Winter of Code':
Navigator.push(
context,
Expand All @@ -610,28 +563,23 @@ class ProgramSearchDelegate extends SearchDelegate<String> {
);
break;


case 'Linux Foundation':
Navigator.push(context,
MaterialPageRoute(builder: (context) => const LinuxFoundation()));
break;


default:
break;
}
}
}


class Program {
final String title;
final String imageAssetPath;


Program({
required this.title,
required this.imageAssetPath,
});
}

Loading

0 comments on commit 1fc7c5a

Please sign in to comment.