Commit c08d00b7 authored by Adam Bruck's avatar Adam Bruck

Post Page

parent 6e8344eb
......@@ -11,6 +11,7 @@ import 'package:cloud_firestore_web/cloud_firestore_web.dart';
import 'package:firebase_app_check_web/firebase_app_check_web.dart';
import 'package:firebase_auth_web/firebase_auth_web.dart';
import 'package:firebase_core_web/firebase_core_web.dart';
import 'package:firebase_storage_web/firebase_storage_web.dart';
import 'package:image_picker_for_web/image_picker_for_web.dart';
import 'package:permission_handler_html/permission_handler_html.dart';
import 'package:url_launcher_web/url_launcher_web.dart';
......@@ -23,6 +24,7 @@ void registerPlugins([final Registrar? pluginRegistrar]) {
FirebaseAppCheckWeb.registerWith(registrar);
FirebaseAuthWeb.registerWith(registrar);
FirebaseCoreWeb.registerWith(registrar);
FirebaseStorageWeb.registerWith(registrar);
ImagePickerPlugin.registerWith(registrar);
WebPermissionHandler.registerWith(registrar);
UrlLauncherPlugin.registerWith(registrar);
......
......@@ -205,6 +205,24 @@
"packageUri": "lib/",
"languageVersion": "3.2"
},
{
"name": "firebase_storage",
"rootUri": "file:///Users/arbruck/.pub-cache/hosted/pub.dev/firebase_storage-12.4.4",
"packageUri": "lib/",
"languageVersion": "3.2"
},
{
"name": "firebase_storage_platform_interface",
"rootUri": "file:///Users/arbruck/.pub-cache/hosted/pub.dev/firebase_storage_platform_interface-5.2.4",
"packageUri": "lib/",
"languageVersion": "3.2"
},
{
"name": "firebase_storage_web",
"rootUri": "file:///Users/arbruck/.pub-cache/hosted/pub.dev/firebase_storage_web-3.10.11",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "fixnum",
"rootUri": "file:///Users/arbruck/.pub-cache/hosted/pub.dev/fixnum-1.1.1",
......@@ -560,7 +578,7 @@
"languageVersion": "3.7"
}
],
"generated": "2025-03-21T21:20:13.018829Z",
"generated": "2025-03-26T00:42:17.344083Z",
"generator": "pub",
"generatorVersion": "3.7.2",
"flutterRoot": "file:///Users/arbruck/Downloads/flutter",
......
......@@ -134,6 +134,18 @@ firebase_data_connect
3.2
file:///Users/arbruck/.pub-cache/hosted/pub.dev/firebase_data_connect-0.1.3+2/
file:///Users/arbruck/.pub-cache/hosted/pub.dev/firebase_data_connect-0.1.3+2/lib/
firebase_storage
3.2
file:///Users/arbruck/.pub-cache/hosted/pub.dev/firebase_storage-12.4.4/
file:///Users/arbruck/.pub-cache/hosted/pub.dev/firebase_storage-12.4.4/lib/
firebase_storage_platform_interface
3.2
file:///Users/arbruck/.pub-cache/hosted/pub.dev/firebase_storage_platform_interface-5.2.4/
file:///Users/arbruck/.pub-cache/hosted/pub.dev/firebase_storage_platform_interface-5.2.4/lib/
firebase_storage_web
3.4
file:///Users/arbruck/.pub-cache/hosted/pub.dev/firebase_storage_web-3.10.11/
file:///Users/arbruck/.pub-cache/hosted/pub.dev/firebase_storage_web-3.10.11/lib/
fixnum
3.1
file:///Users/arbruck/.pub-cache/hosted/pub.dev/fixnum-1.1.1/
......
......@@ -14,6 +14,8 @@ firebase_auth=/Users/arbruck/.pub-cache/hosted/pub.dev/firebase_auth-5.5.1/
firebase_auth_web=/Users/arbruck/.pub-cache/hosted/pub.dev/firebase_auth_web-5.14.1/
firebase_core=/Users/arbruck/.pub-cache/hosted/pub.dev/firebase_core-3.12.1/
firebase_core_web=/Users/arbruck/.pub-cache/hosted/pub.dev/firebase_core_web-2.21.1/
firebase_storage=/Users/arbruck/.pub-cache/hosted/pub.dev/firebase_storage-12.4.4/
firebase_storage_web=/Users/arbruck/.pub-cache/hosted/pub.dev/firebase_storage_web-3.10.11/
flutter_plugin_android_lifecycle=/Users/arbruck/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.26/
image_picker=/Users/arbruck/.pub-cache/hosted/pub.dev/image_picker-1.1.2/
image_picker_android=/Users/arbruck/.pub-cache/hosted/pub.dev/image_picker_android-0.8.12+21/
......
This diff is collapsed.
......@@ -1169,6 +1169,9 @@ PODS:
- Firebase/Firestore (11.8.0):
- Firebase/CoreOnly
- FirebaseFirestore (~> 11.8.0)
- Firebase/Storage (11.8.0):
- Firebase/CoreOnly
- FirebaseStorage (~> 11.8.0)
- firebase_app_check (0.3.2-4):
- Firebase/CoreOnly (~> 11.8.0)
- firebase_core
......@@ -1181,6 +1184,10 @@ PODS:
- firebase_core (3.12.1):
- Firebase/CoreOnly (= 11.8.0)
- Flutter
- firebase_storage (12.4.4):
- Firebase/Storage (= 11.8.0)
- firebase_core
- Flutter
- FirebaseAppCheck (11.8.0):
- AppCheckCore (~> 11.0)
- FirebaseAppCheckInterop (~> 11.0)
......@@ -1227,6 +1234,13 @@ PODS:
- leveldb-library (~> 1.22)
- nanopb (~> 3.30910.0)
- FirebaseSharedSwift (11.10.0)
- FirebaseStorage (11.8.0):
- FirebaseAppCheckInterop (~> 11.0)
- FirebaseAuthInterop (~> 11.0)
- FirebaseCore (~> 11.8.0)
- FirebaseCoreExtension (~> 11.8.0)
- GoogleUtilities/Environment (~> 8.0)
- GTMSessionFetcher/Core (< 5.0, >= 3.4)
- Flutter (1.0.0)
- GoogleUtilities/AppDelegateSwizzler (8.0.2):
- GoogleUtilities/Environment
......@@ -1364,6 +1378,7 @@ DEPENDENCIES:
- firebase_app_check (from `.symlinks/plugins/firebase_app_check/ios`)
- firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
- firebase_storage (from `.symlinks/plugins/firebase_storage/ios`)
- Flutter (from `Flutter`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
......@@ -1385,6 +1400,7 @@ SPEC REPOS:
- FirebaseFirestore
- FirebaseFirestoreInternal
- FirebaseSharedSwift
- FirebaseStorage
- GoogleUtilities
- "gRPC-C++"
- gRPC-Core
......@@ -1405,6 +1421,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/firebase_auth/ios"
firebase_core:
:path: ".symlinks/plugins/firebase_core/ios"
firebase_storage:
:path: ".symlinks/plugins/firebase_storage/ios"
Flutter:
:path: Flutter
image_picker_ios:
......@@ -1424,6 +1442,7 @@ SPEC CHECKSUMS:
firebase_app_check: 41ab298dc5440c44fba8b12a8f949062c049f3fa
firebase_auth: 3d848b9b866b201e5c8e0c06d8b2cec272fd8825
firebase_core: ac395f994af4e28f6a38b59e05a88ca57abeb874
firebase_storage: b31bacb1f1d7abeb753d9195e97eb5d2180e1d6f
FirebaseAppCheck: f6648d6d2b321ecf94cf72f6737fc68d4fddc010
FirebaseAppCheckInterop: 9664c858489710f682766ef54e2b6741d3b62070
FirebaseAuth: ad59a1a7b161e75f74c39f70179d2482d40e2737
......@@ -1434,6 +1453,7 @@ SPEC CHECKSUMS:
FirebaseFirestore: 563a4ab1a65e2858f05e150bb4c31b0f8f79248b
FirebaseFirestoreInternal: 8c5921c360a70e447bfeefb245f450e8b50e750b
FirebaseSharedSwift: 1baacae75939499b5def867cbe34129464536a38
FirebaseStorage: 8eede00081a6ce904eaa8d2daa66f1e053e8e6ea
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d
"gRPC-C++": 2fa52b3141e7789a28a737f251e0c45b4cb20a87
......
......@@ -14,7 +14,7 @@ class _HomeScreenState extends State<HomeScreen> {
final List<Widget> _screens = [
const HomePage(),
const PostPage(),
PostBookPage(),
const InboxPage(),
];
......
import 'package:flutter/material.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:paperchase_app/mybooks.dart';
import 'firebase_options.dart';
import 'package:http/http.dart' as http;
import 'dart:convert';
......@@ -72,8 +73,9 @@ class _MyAppState extends State<MyApp> {
'/login': (context) => const LoginPage(),
'/signup': (context) => const SignupPage(),
'/profile': (context) => const ProfilePage(),
'/post': (context) => PostPage(),
'/post': (context) => PostBookPage(),
'/inbox': (context) => const InboxPage(),
'/mybooks': (context) => MyBooksPage(),
},
);
}
......@@ -148,11 +150,14 @@ class _HomePageState extends State<HomePage> {
_logout();
} else if (value == 'profile') {
Navigator.pushNamed(context, '/profile');
} else if (value == 'My Books'){
Navigator.push(context, MaterialPageRoute(builder: (context) => MyBooksPage()));
}
},
itemBuilder: (BuildContext context) => [
const PopupMenuItem(value: 'profile', child: Text('Profile')),
const PopupMenuItem(value: 'logout', child: Text('Logout')),
const PopupMenuItem(value: 'My Books' , child: Text('My Books'))
],
)
: null,
......
import 'package:flutter/material.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
class MyBooksPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('My Books')),
body: StreamBuilder<QuerySnapshot>(
stream: FirebaseFirestore.instance.collection('books').snapshots(),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return Center(child: CircularProgressIndicator());
}
if (!snapshot.hasData || snapshot.data!.docs.isEmpty) {
return Center(child: Text('No books found.'));
}
var books = snapshot.data!.docs;
return ListView.builder(
itemCount: books.length,
itemBuilder: (context, index) {
var book = books[index].data() as Map<String, dynamic>;
return ListTile(
title: Text(book['title'] ?? 'No Title'),
subtitle: Text(book['author'] ?? 'Unknown Author'),
trailing: Text("\$${book['price']}"),
);
},
);
},
),
);
}
}
This diff is collapsed.
......@@ -10,6 +10,7 @@ import file_selector_macos
import firebase_app_check
import firebase_auth
import firebase_core
import firebase_storage
import url_launcher_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
......@@ -18,5 +19,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FLTFirebaseAppCheckPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAppCheckPlugin"))
FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
FLTFirebaseStoragePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseStoragePlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
}
......@@ -273,6 +273,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.1.3+2"
firebase_storage:
dependency: "direct main"
description:
name: firebase_storage
sha256: "2274bb277d0d56d4a106fd89bad5e8f7c005bae77dc3df5abd36101957010840"
url: "https://pub.dev"
source: hosted
version: "12.4.4"
firebase_storage_platform_interface:
dependency: transitive
description:
name: firebase_storage_platform_interface
sha256: "36ed6ebc2453a500c6d1e63c8126459056a70a798d53636242b0325951814cf5"
url: "https://pub.dev"
source: hosted
version: "5.2.4"
firebase_storage_web:
dependency: transitive
description:
name: firebase_storage_web
sha256: e169fc825cbd91c70d73f75b7e8be9ada272b4297184f779ca124b42945828fe
url: "https://pub.dev"
source: hosted
version: "3.10.11"
fixnum:
dependency: transitive
description:
......
......@@ -44,6 +44,7 @@ dependencies:
permission_handler: ^11.4.0
firebase_app_check: ^0.3.2+4
camera: ^0.10.0+2
firebase_storage: ^12.4.4
dev_dependencies:
......
......@@ -10,6 +10,7 @@
#include <file_selector_windows/file_selector_windows.h>
#include <firebase_auth/firebase_auth_plugin_c_api.h>
#include <firebase_core/firebase_core_plugin_c_api.h>
#include <firebase_storage/firebase_storage_plugin_c_api.h>
#include <permission_handler_windows/permission_handler_windows_plugin.h>
#include <url_launcher_windows/url_launcher_windows.h>
......@@ -22,6 +23,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
registry->GetRegistrarForPlugin("FirebaseAuthPluginCApi"));
FirebaseCorePluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FirebaseCorePluginCApi"));
FirebaseStoragePluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FirebaseStoragePluginCApi"));
PermissionHandlerWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin"));
UrlLauncherWindowsRegisterWithRegistrar(
......
......@@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
file_selector_windows
firebase_auth
firebase_core
firebase_storage
permission_handler_windows
url_launcher_windows
)
......
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