Commit 75a2e7d9 authored by Abdallah Alsharrah's avatar Abdallah Alsharrah

Footer and logo added

parent 74aff026
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
["/Users/abdallah/Desktop/CSC190/PaperChase-main/build/app/intermediates/flutter/debug/flutter_assets/vm_snapshot_data","/Users/abdallah/Desktop/CSC190/PaperChase-main/build/app/intermediates/flutter/debug/flutter_assets/isolate_snapshot_data","/Users/abdallah/Desktop/CSC190/PaperChase-main/build/app/intermediates/flutter/debug/flutter_assets/kernel_blob.bin","/Users/abdallah/Desktop/CSC190/PaperChase-main/build/app/intermediates/flutter/debug/flutter_assets/packages/cupertino_icons/assets/CupertinoIcons.ttf","/Users/abdallah/Desktop/CSC190/PaperChase-main/build/app/intermediates/flutter/debug/flutter_assets/fonts/MaterialIcons-Regular.otf","/Users/abdallah/Desktop/CSC190/PaperChase-main/build/app/intermediates/flutter/debug/flutter_assets/shaders/ink_sparkle.frag","/Users/abdallah/Desktop/CSC190/PaperChase-main/build/app/intermediates/flutter/debug/flutter_assets/AssetManifest.json","/Users/abdallah/Desktop/CSC190/PaperChase-main/build/app/intermediates/flutter/debug/flutter_assets/AssetManifest.bin","/Users/abdallah/Desktop/CSC190/PaperChase-main/build/app/intermediates/flutter/debug/flutter_assets/FontManifest.json","/Users/abdallah/Desktop/CSC190/PaperChase-main/build/app/intermediates/flutter/debug/flutter_assets/NOTICES.Z","/Users/abdallah/Desktop/CSC190/PaperChase-main/build/app/intermediates/flutter/debug/flutter_assets/NativeAssetsManifest.json"] ["/Users/abdallah/Desktop/CSC190/PaperChase-main/build/app/intermediates/flutter/debug/flutter_assets/vm_snapshot_data","/Users/abdallah/Desktop/CSC190/PaperChase-main/build/app/intermediates/flutter/debug/flutter_assets/isolate_snapshot_data","/Users/abdallah/Desktop/CSC190/PaperChase-main/build/app/intermediates/flutter/debug/flutter_assets/kernel_blob.bin","/Users/abdallah/Desktop/CSC190/PaperChase-main/build/app/intermediates/flutter/debug/flutter_assets/assets/logo.png","/Users/abdallah/Desktop/CSC190/PaperChase-main/build/app/intermediates/flutter/debug/flutter_assets/packages/cupertino_icons/assets/CupertinoIcons.ttf","/Users/abdallah/Desktop/CSC190/PaperChase-main/build/app/intermediates/flutter/debug/flutter_assets/fonts/MaterialIcons-Regular.otf","/Users/abdallah/Desktop/CSC190/PaperChase-main/build/app/intermediates/flutter/debug/flutter_assets/shaders/ink_sparkle.frag","/Users/abdallah/Desktop/CSC190/PaperChase-main/build/app/intermediates/flutter/debug/flutter_assets/AssetManifest.json","/Users/abdallah/Desktop/CSC190/PaperChase-main/build/app/intermediates/flutter/debug/flutter_assets/AssetManifest.bin","/Users/abdallah/Desktop/CSC190/PaperChase-main/build/app/intermediates/flutter/debug/flutter_assets/FontManifest.json","/Users/abdallah/Desktop/CSC190/PaperChase-main/build/app/intermediates/flutter/debug/flutter_assets/NOTICES.Z","/Users/abdallah/Desktop/CSC190/PaperChase-main/build/app/intermediates/flutter/debug/flutter_assets/NativeAssetsManifest.json"]
\ No newline at end of file \ No newline at end of file
...@@ -524,7 +524,11 @@ ...@@ -524,7 +524,11 @@
"languageVersion": "3.7" "languageVersion": "3.7"
} }
], ],
<<<<<<< HEAD
"generated": "2025-03-11T17:13:55.169144Z", "generated": "2025-03-11T17:13:55.169144Z",
=======
"generated": "2025-03-14T22:47:13.694959Z",
>>>>>>> 08727c91 (Footer and logo added)
"generator": "pub", "generator": "pub",
"generatorVersion": "3.7.0", "generatorVersion": "3.7.0",
"flutterRoot": "file:///C:/Users/allie/OneDrive/flutter_windows_3.24.2-stable/flutter", "flutterRoot": "file:///C:/Users/allie/OneDrive/flutter_windows_3.24.2-stable/flutter",
......
This diff is collapsed.
...@@ -2,9 +2,15 @@ ...@@ -2,9 +2,15 @@
<module type="JAVA_MODULE" version="4"> <module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true"> <component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output /> <exclude-output />
<content url="file://$MODULE_DIR$" /> <content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/.pub" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="project" /> <orderEntry type="library" name="Dart SDK" level="project" />
<orderEntry type="library" name="Dart Packages" level="project" />
<orderEntry type="library" name="Flutter Plugins" level="project" />
</component> </component>
</module> </module>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
<component name="libraryTable">
<library name="Flutter Plugins" type="FlutterPluginsLibraryType">
<CLASSES>
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/permission_handler_html-0.1.3+5" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/image_picker_ios-0.8.12+2" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/permission_handler-11.4.0" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher_linux-3.2.1" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/file_selector_windows-0.9.3+4" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher_ios-6.3.2" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/cloud_firestore-5.6.5" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/firebase_app_check-0.3.2+4" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.14" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/image_picker_macos-0.2.1+2" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/image_picker_windows-0.2.1+1" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/firebase_auth_web-5.14.1" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher_macos-3.2.2" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/cloud_firestore_web-4.4.5" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/firebase_core_web-2.21.1" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/firebase_app_check_web-0.2.0+8" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/firebase_auth-5.5.1" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/image_picker_linux-0.2.1+1" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher-6.3.1" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/file_selector_macos-0.9.4+2" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/image_picker_android-0.8.12+21" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/firebase_core-3.12.1" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/image_picker-1.1.2" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher_web-2.4.0" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/image_picker_for_web-3.0.6" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.4" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/file_selector_linux-0.9.3+2" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectType">
<option name="id" value="io.flutter" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
\ No newline at end of file
library; library;
import 'package:firebase_data_connect/firebase_data_connect.dart'; import 'package:firebase_data_connect/firebase_data_connect.dart';
import 'dart:convert';
......
...@@ -113,4 +113,4 @@ class _SignupPageState extends State<SignupPage> { ...@@ -113,4 +113,4 @@ class _SignupPageState extends State<SignupPage> {
), ),
); );
} }
} }
\ No newline at end of file
import 'package:flutter/material.dart';
import 'post.dart';
import 'inbox.dart';
class HomeScreen extends StatefulWidget {
const HomeScreen({super.key});
@override
_HomeScreenState createState() => _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen> {
int _selectedIndex = 0;
final List<Widget> _screens = [
const HomePage(),
const PostPage(),
const InboxPage(),
];
void _onItemTapped(int index) {
setState(() {
_selectedIndex = index;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: _screens[_selectedIndex],
bottomNavigationBar: BottomNavigationBar(
backgroundColor: widget.isDarkMode ? Colors.white : Colors.black,
selectedItemColor: widget.isDarkMode ? Colors.black : Colors.white,
unselectedItemColor: Colors.grey,
currentIndex: 0, // Home is initially selected
items: const [
BottomNavigationBarItem(icon: Icon(Icons.home), label: "Home"),
BottomNavigationBarItem(icon: Icon(Icons.add), label: "Post"),
BottomNavigationBarItem(icon: Icon(Icons.mail), label: "Inbox"),
],
onTap: (index) {
if (index == 0) {
Navigator.pushNamedAndRemoveUntil(context, '/', (route) => false);
} else if (index == 1) {
Navigator.pushNamed(context, '/post');
} else if (index == 2) {
Navigator.pushNamed(context, '/inbox');
}
},
),
);
}
}
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
return const Center(
child: Text("Home Screen"),
);
}
}
import 'package:flutter/material.dart';
class InboxPage extends StatelessWidget {
const InboxPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text("Inbox")),
body: const Center(child: Text("Inbox Screen")),
bottomNavigationBar: BottomNavigationBar(
backgroundColor: Colors.black,
selectedItemColor: Colors.white,
unselectedItemColor: Colors.grey,
currentIndex: 2, // Highlight the "Inbox" tab
items: const [
BottomNavigationBarItem(icon: Icon(Icons.home), label: "Home"),
BottomNavigationBarItem(icon: Icon(Icons.add), label: "Post"),
BottomNavigationBarItem(icon: Icon(Icons.mail), label: "Inbox"),
],
onTap: (index) {
if (index == 0) {
Navigator.pushNamedAndRemoveUntil(context, '/', (route) => false);
} else if (index == 1) {
Navigator.pushNamed(context, '/post');
} else if (index == 2) {
Navigator.pushNamed(context, '/inbox'); // Stay on the same page
}
},
),
);
}
}
import 'package:flutter/material.dart';
class AppLayout extends StatelessWidget {
final Widget child;
final int currentIndex;
final VoidCallback toggleTheme;
final bool isDarkMode;
const AppLayout({
super.key,
required this.child,
required this.currentIndex,
required this.toggleTheme,
required this.isDarkMode,
});
@override
Widget build(BuildContext context) {
return Scaffold(
body: child,
bottomNavigationBar: CustomFooter(
currentIndex: currentIndex,
toggleTheme: toggleTheme,
isDarkMode: isDarkMode,
),
);
}
}
class CustomFooter extends StatelessWidget {
final int currentIndex;
final VoidCallback toggleTheme;
final bool isDarkMode;
const CustomFooter({
super.key,
required this.currentIndex,
required this.toggleTheme,
required this.isDarkMode,
});
@override
Widget build(BuildContext context) {
return BottomNavigationBar(
currentIndex: currentIndex,
backgroundColor: isDarkMode ? Colors.white : Colors.black,
selectedItemColor: isDarkMode ? Colors.black : Colors.white,
unselectedItemColor: Colors.grey,
items: const [
BottomNavigationBarItem(icon: Icon(Icons.home), label: "Home"),
BottomNavigationBarItem(icon: Icon(Icons.add), label: "Post"),
BottomNavigationBarItem(icon: Icon(Icons.mail), label: "Inbox"),
],
onTap: (index) {
Navigator.pushReplacementNamed(context, ['/', '/post', '/inbox'][index]);
},
);
}
}
...@@ -83,4 +83,4 @@ class _LoginPageState extends State<LoginPage> { ...@@ -83,4 +83,4 @@ class _LoginPageState extends State<LoginPage> {
), ),
); );
} }
} }
\ No newline at end of file
...@@ -7,7 +7,9 @@ import 'dart:convert'; ...@@ -7,7 +7,9 @@ import 'dart:convert';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import 'login.dart'; import 'login.dart';
import 'signup.dart'; import 'signup.dart';
import 'profile.dart'; // Added Profile Page import 'profile.dart';
import 'post.dart';
import 'inbox.dart';
import 'package:firebase_app_check/firebase_app_check.dart'; import 'package:firebase_app_check/firebase_app_check.dart';
void main() async { void main() async {
...@@ -16,10 +18,8 @@ void main() async { ...@@ -16,10 +18,8 @@ void main() async {
options: DefaultFirebaseOptions.currentPlatform, options: DefaultFirebaseOptions.currentPlatform,
); );
// Enable Firebase App Check
await FirebaseAppCheck.instance.activate( await FirebaseAppCheck.instance.activate(
androidProvider: AndroidProvider.playIntegrity, // For real device androidProvider: AndroidProvider.playIntegrity,
// Use AndroidProvider.debug for emulator testing
); );
runApp(const MyApp()); runApp(const MyApp());
...@@ -33,11 +33,11 @@ class MyApp extends StatefulWidget { ...@@ -33,11 +33,11 @@ class MyApp extends StatefulWidget {
} }
class _MyAppState extends State<MyApp> { class _MyAppState extends State<MyApp> {
bool _isDarkMode = false; bool _isDarkMode = false; // Default to Light Mode
void _toggleTheme() { void _toggleTheme() {
setState(() { setState(() {
_isDarkMode = !_isDarkMode; _isDarkMode = !_isDarkMode; // Toggle between Light & Dark Mode
}); });
} }
...@@ -47,18 +47,22 @@ class _MyAppState extends State<MyApp> { ...@@ -47,18 +47,22 @@ class _MyAppState extends State<MyApp> {
title: 'PAPERCHASE', title: 'PAPERCHASE',
theme: ThemeData( theme: ThemeData(
brightness: Brightness.light, brightness: Brightness.light,
primarySwatch: Colors.blue, scaffoldBackgroundColor: Colors.black,
textTheme: const TextTheme( appBarTheme: const AppBarTheme(backgroundColor: Colors.black),
bodyLarge: TextStyle(color: Colors.black), bottomNavigationBarTheme: const BottomNavigationBarThemeData(
bodyMedium: TextStyle(color: Colors.black), backgroundColor: Colors.black,
selectedItemColor: Colors.white,
unselectedItemColor: Colors.grey,
), ),
), ),
darkTheme: ThemeData( darkTheme: ThemeData(
brightness: Brightness.dark, brightness: Brightness.dark,
primarySwatch: Colors.blue, scaffoldBackgroundColor: Colors.cyan,
textTheme: const TextTheme( appBarTheme: const AppBarTheme(backgroundColor: Colors.white),
bodyLarge: TextStyle(color: Colors.white), bottomNavigationBarTheme: const BottomNavigationBarThemeData(
bodyMedium: TextStyle(color: Colors.white), backgroundColor: Colors.white,
selectedItemColor: Colors.black,
unselectedItemColor: Colors.grey,
), ),
), ),
themeMode: _isDarkMode ? ThemeMode.dark : ThemeMode.light, themeMode: _isDarkMode ? ThemeMode.dark : ThemeMode.light,
...@@ -67,7 +71,9 @@ class _MyAppState extends State<MyApp> { ...@@ -67,7 +71,9 @@ class _MyAppState extends State<MyApp> {
'/': (context) => HomePage(toggleTheme: _toggleTheme, isDarkMode: _isDarkMode), '/': (context) => HomePage(toggleTheme: _toggleTheme, isDarkMode: _isDarkMode),
'/login': (context) => const LoginPage(), '/login': (context) => const LoginPage(),
'/signup': (context) => const SignupPage(), '/signup': (context) => const SignupPage(),
'/profile': (context) => const ProfilePage(), // Profile Page Route '/profile': (context) => const ProfilePage(),
'/post': (context) => const PostPage(),
'/inbox': (context) => const InboxPage(),
}, },
); );
} }
...@@ -116,8 +122,7 @@ class _HomePageState extends State<HomePage> { ...@@ -116,8 +122,7 @@ class _HomePageState extends State<HomePage> {
final query = _searchController.text; final query = _searchController.text;
if (query.isEmpty) return; if (query.isEmpty) return;
final url = Uri.parse( final url = Uri.parse('https://www.googleapis.com/books/v1/volumes?q=${Uri.encodeComponent(query)}');
'https://www.googleapis.com/books/v1/volumes?q=${Uri.encodeComponent(query)}');
try { try {
final response = await http.get(url); final response = await http.get(url);
...@@ -135,7 +140,7 @@ class _HomePageState extends State<HomePage> { ...@@ -135,7 +140,7 @@ class _HomePageState extends State<HomePage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: const Text('PAPERCHASE'), title: Image.asset('assets/logo.png', height: 40),
leading: _isLoggedIn leading: _isLoggedIn
? PopupMenuButton<String>( ? PopupMenuButton<String>(
onSelected: (value) { onSelected: (value) {
...@@ -146,30 +151,24 @@ class _HomePageState extends State<HomePage> { ...@@ -146,30 +151,24 @@ class _HomePageState extends State<HomePage> {
} }
}, },
itemBuilder: (BuildContext context) => [ itemBuilder: (BuildContext context) => [
const PopupMenuItem( const PopupMenuItem(value: 'profile', child: Text('Profile')),
value: 'profile', const PopupMenuItem(value: 'logout', child: Text('Logout')),
child: Text('Profile'),
),
const PopupMenuItem(
value: 'logout',
child: Text('Logout'),
),
], ],
) )
: null, : null,
actions: [ actions: [
IconButton( IconButton(
icon: const Icon(Icons.brightness_6), icon: Icon(widget.isDarkMode ? Icons.wb_sunny : Icons.nightlight_round),
onPressed: widget.toggleTheme, onPressed: widget.toggleTheme,
), ),
if (!_isLoggedIn) ...[ if (!_isLoggedIn) ...[
TextButton( TextButton(
onPressed: () => Navigator.pushNamed(context, '/login'), onPressed: () => Navigator.pushNamed(context, '/login'),
child: Text('Login', style: TextStyle(color: widget.isDarkMode ? Colors.white : Colors.black)), child: Text('Login', style: TextStyle(color: widget.isDarkMode ? Colors.black : Colors.white)),
), ),
TextButton( TextButton(
onPressed: () => Navigator.pushNamed(context, '/signup'), onPressed: () => Navigator.pushNamed(context, '/signup'),
child: Text('Sign Up', style: TextStyle(color: widget.isDarkMode ? Colors.white : Colors.black)), child: Text('Sign Up', style: TextStyle(color: widget.isDarkMode ? Colors.black : Colors.white)),
), ),
], ],
], ],
...@@ -219,6 +218,25 @@ class _HomePageState extends State<HomePage> { ...@@ -219,6 +218,25 @@ class _HomePageState extends State<HomePage> {
], ],
), ),
), ),
bottomNavigationBar: BottomNavigationBar(
backgroundColor: widget.isDarkMode ? Colors.white : Colors.black,
selectedItemColor: widget.isDarkMode ? Colors.black : Colors.white,
unselectedItemColor: Colors.grey,
items: const [
BottomNavigationBarItem(icon: Icon(Icons.home), label: "Home"),
BottomNavigationBarItem(icon: Icon(Icons.add), label: "Post"),
BottomNavigationBarItem(icon: Icon(Icons.mail), label: "Inbox"),
],
onTap: (index) {
if (index == 0) {
Navigator.pushNamed(context, '/');
} else if (index == 1) {
Navigator.pushNamed(context, '/post');
} else if (index == 2) {
Navigator.pushNamed(context, '/inbox');
}
},
),
); );
} }
} }
import 'package:flutter/material.dart';
class PostPage extends StatelessWidget {
const PostPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text("Create Post")),
body: const Center(child: Text("Post Screen")),
bottomNavigationBar: BottomNavigationBar(
backgroundColor: Colors.black,
selectedItemColor: Colors.white,
unselectedItemColor: Colors.grey,
currentIndex: 1, // Highlight the "Post" tab
items: const [
BottomNavigationBarItem(icon: Icon(Icons.home), label: "Home"),
BottomNavigationBarItem(icon: Icon(Icons.add), label: "Post"),
BottomNavigationBarItem(icon: Icon(Icons.mail), label: "Inbox"),
],
onTap: (index) {
if (index == 0) {
Navigator.pushNamedAndRemoveUntil(context, '/', (route) => false);
} else if (index == 1) {
Navigator.pushNamed(context, '/post'); // Stay on the same page
} else if (index == 2) {
Navigator.pushNamed(context, '/inbox');
}
},
),
);
}
}
...@@ -130,4 +130,4 @@ class _ProfilePageState extends State<ProfilePage> { ...@@ -130,4 +130,4 @@ class _ProfilePageState extends State<ProfilePage> {
), ),
); );
} }
} }
\ No newline at end of file
...@@ -58,9 +58,11 @@ dev_dependencies: ...@@ -58,9 +58,11 @@ dev_dependencies:
# following page: https://dart.dev/tools/pub/pubspec # following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter packages. # The following section is specific to Flutter packages.
firebase_data_connect: any firebase_data_connect: any
flutter: flutter:
assets:
- assets/logo.png
# The following line ensures that the Material Icons font is # The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in # included with your application, so that you can use the icons in
# the material Icons class. # the material Icons class.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment