This commit is contained in:
Hitesh Ale
2023-02-26 15:35:58 -05:00
8 changed files with 223 additions and 212 deletions

View File

@@ -25,7 +25,7 @@ class AuthGate extends StatelessWidget {
stream: FirebaseAuth.instance.authStateChanges(), stream: FirebaseAuth.instance.authStateChanges(),
builder: (context, snapshot) { builder: (context, snapshot) {
if (!snapshot.hasData) { if (!snapshot.hasData) {
return SignInScreen( return SignInScreen(
providerConfigs: const [ providerConfigs: const [
EmailProviderConfiguration(), EmailProviderConfiguration(),
], ],

View File

@@ -6,6 +6,9 @@ import 'package:flutter/material.dart';
import 'package:flutter_stripe/flutter_stripe.dart'; import 'package:flutter_stripe/flutter_stripe.dart';
import 'package:ruswipeshare/main.dart'; import 'package:ruswipeshare/main.dart';
import 'package:flutter_email_sender/flutter_email_sender.dart'; import 'package:flutter_email_sender/flutter_email_sender.dart';
import 'package:intl/intl.dart';
import 'meetings.dart';
enum CampusState { campuses, list_options, offers } enum CampusState { campuses, list_options, offers }
@@ -68,6 +71,8 @@ class BuyScreen extends StatefulWidget {
class _BuyScreenState extends State<BuyScreen> { class _BuyScreenState extends State<BuyScreen> {
CampusState _currentState = CampusState.campuses; CampusState _currentState = CampusState.campuses;
List<String> _diningOptions = List.empty(); List<String> _diningOptions = List.empty();
List<Seller> _sellersAtDiningHall = [];
String _selectedLocation = ""; String _selectedLocation = "";
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@@ -352,157 +357,199 @@ class _BuyScreenState extends State<BuyScreen> {
itemCount: 30, itemCount: 30,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0), padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return InkWell( List<Seller> sellers = [];
onTap: () { var loc = _diningOptions[index % _diningOptions.length];
showSheet(context, index);
// showDialog( return FutureBuilder<List<Seller>>(
// context: context, future: getSellers(Filter([loc], null, null)),
// builder: (BuildContext context) => Dialog( builder: (BuildContext context,
// backgroundColor: Theme.of(context).scaffoldBackgroundColor, AsyncSnapshot<List<Seller>> snapshot) {
// shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(20))), if (snapshot.hasData) {
// child: Padding( final data = snapshot.data ?? [];
// padding: const EdgeInsets.all(8.0), String startTimeFmt = DateFormat("h:mm a").format(
// child: Column( data[index % data.length]
// mainAxisSize: MainAxisSize.min, .availableTime
// mainAxisAlignment: MainAxisAlignment.center, .startTime
// children: <Widget>[ .toDate());
// const Text('Transaction Details'),
// const SizedBox(height: 15), String endTimeFmt = DateFormat("h:mm a").format(
// TextButton( data[index % data.length]
// onPressed: () { .availableTime
// Navigator.pop(context); .endTime
// }, .toDate());
// child: const Text('Close'),
// ), final price = data[index % data.length].price;
// ],
// ), return InkWell(
// ))); onTap: () {
// // Dialogs.materialDialog( showSheet(context, index);
// // color: Theme.of(context).scaffoldBackgroundColor, // showDialog(
// // customView: const TransactionDetails(), // context: context,
// // customViewPosition: // builder: (BuildContext context) => Dialog(
// // CustomViewPosition.BEFORE_ACTION, // backgroundColor: Theme.of(context).scaffoldBackgroundColor,
// // msgAlign: TextAlign.center, // shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(20))),
// // msg: // child: Padding(
// // 'Please read all the information below before purchasing.\n', // padding: const EdgeInsets.all(8.0),
// // title: 'Transaction Details', // child: Column(
// // context: context, // mainAxisSize: MainAxisSize.min,
// // actions: [ // mainAxisAlignment: MainAxisAlignment.center,
// // IconsOutlineButton( // children: <Widget>[
// // onPressed: () {}, // const Text('Transaction Details'),
// // text: 'Cancel', // const SizedBox(height: 15),
// // iconData: Icons.cancel_outlined, // TextButton(
// // color: Theme.of(context).primaryColor, // onPressed: () {
// // textStyle: TextStyle( // Navigator.pop(context);
// // color: CustomMaterialColor(240, 240, 240) // },
// // .mdColor, // child: const Text('Close'),
// // ), // ),
// // iconColor: CustomMaterialColor(240, 240, 240) // ],
// // .mdColor), // ),
// // IconsButton( // )));
// // onPressed: () {}, // // Dialogs.materialDialog(
// // text: 'Purchase', // // color: Theme.of(context).scaffoldBackgroundColor,
// // iconData: Icons.done, // // customView: const TransactionDetails(),
// // color: Colors.green, // // customViewPosition:
// // textStyle: TextStyle( // // CustomViewPosition.BEFORE_ACTION,
// // color: CustomMaterialColor(240, 240, 240) // // msgAlign: TextAlign.center,
// // .mdColor, // // msg:
// // ), // // 'Please read all the information below before purchasing.\n',
// // iconColor: CustomMaterialColor(240, 240, 240) // // title: 'Transaction Details',
// // .mdColor), // // context: context,
// // ], // // actions: [
// // ); // // IconsOutlineButton(
}, // // onPressed: () {},
child: Container( // // text: 'Cancel',
decoration: BoxDecoration( // // iconData: Icons.cancel_outlined,
border: Border.all( // // color: Theme.of(context).primaryColor,
color: CustomMaterialColor(240, 240, 240) // // textStyle: TextStyle(
.mdColor, // // color: CustomMaterialColor(240, 240, 240)
width: 2), // // .mdColor,
borderRadius: // // ),
const BorderRadius.all(Radius.circular(10))), // // iconColor: CustomMaterialColor(240, 240, 240)
margin: const EdgeInsets.all(4), // // .mdColor),
height: 120, // // IconsButton(
child: ClipRRect( // // onPressed: () {},
borderRadius: // // text: 'Purchase',
const BorderRadius.all(Radius.circular(10)), // // iconData: Icons.done,
child: Container( // // color: Colors.green,
decoration: BoxDecoration( // // textStyle: TextStyle(
image: DecorationImage( // // color: CustomMaterialColor(240, 240, 240)
colorFilter: const ColorFilter.mode( // // .mdColor,
Colors.black26, BlendMode.darken), // // ),
fit: BoxFit.cover, // // iconColor: CustomMaterialColor(240, 240, 240)
image: AssetImage(timeBgAssets[index % 3]), // // .mdColor),
)), // // ],
child: BackdropFilter( // // );
filter: ImageFilter.blur(sigmaX: 2, sigmaY: 2), },
child: Row( child: Container(
children: [ decoration: BoxDecoration(
Expanded( border: Border.all(
flex: 7, color:
child: Container( CustomMaterialColor(240, 240, 240)
padding: EdgeInsets.only(left: 20), .mdColor,
// color: Colors.red, width: 2),
margin: const EdgeInsets.only( borderRadius: const BorderRadius.all(
top: 4, left: 4, bottom: 4), Radius.circular(10))),
child: Column( margin: const EdgeInsets.all(4),
crossAxisAlignment: height: 120,
CrossAxisAlignment.start, child: ClipRRect(
children: [ borderRadius: const BorderRadius.all(
Text( Radius.circular(10)),
entries[index % entries.length], child: Container(
textAlign: TextAlign.start, decoration: BoxDecoration(
overflow: TextOverflow.ellipsis, image: DecorationImage(
style: colorFilter: const ColorFilter.mode(
const TextStyle(fontSize: 20), Colors.black26, BlendMode.darken),
), fit: BoxFit.cover,
Row( image:
children: const [ AssetImage(timeBgAssets[index % 3]),
Icon(Icons.star, size: 16), )),
Icon(Icons.star, size: 16), child: BackdropFilter(
Icon(Icons.star, size: 16), filter: ImageFilter.blur(
Icon(Icons.star_half, size: 16), sigmaX: 2, sigmaY: 2),
Icon(Icons.star_border, child: Row(
size: 16), children: [
], Expanded(
), flex: 7,
Expanded( child: Container(
padding:
EdgeInsets.only(left: 20),
// color: Colors.red,
margin: const EdgeInsets.only(
top: 4, left: 4, bottom: 4),
child: Column( child: Column(
mainAxisAlignment: crossAxisAlignment:
MainAxisAlignment.end, CrossAxisAlignment.start,
children: const [ children: [
Text( Text(
'88:88PM - 88:88PM', data?[index % data.length]
.name ??
"Unknown Seller",
textAlign: TextAlign.start, textAlign: TextAlign.start,
overflow: overflow:
TextOverflow.ellipsis, TextOverflow.ellipsis,
style: style: const TextStyle(
TextStyle(fontSize: 16), fontSize: 20),
), ),
Row(
children: const [
Icon(Icons.star,
size: 16),
Icon(Icons.star,
size: 16),
Icon(Icons.star,
size: 16),
Icon(Icons.star_half,
size: 16),
Icon(Icons.star_border,
size: 16),
],
),
Expanded(
child: Column(
mainAxisAlignment:
MainAxisAlignment.end,
children: [
Text(
"$startTimeFmt - $endTimeFmt",
textAlign:
TextAlign.start,
overflow: TextOverflow
.ellipsis,
style: TextStyle(
fontSize: 16),
),
],
),
)
], ],
), ),
) ),
], ),
), Expanded(
flex: 3,
child: Container(
padding:
EdgeInsets.only(right: 15),
child: Text(
'\$${price}',
textAlign: TextAlign.end,
style: TextStyle(fontSize: 44),
),
),
),
],
), ),
), ),
Expanded( ),
flex: 3,
child: Container(
padding: EdgeInsets.only(right: 15),
child: Text(
'\$88',
textAlign: TextAlign.end,
style: TextStyle(fontSize: 44),
),
),
),
],
), ),
), ),
), );
), } else if (snapshot.hasError) {
), return Text("${snapshot.error}");
}
return CircularProgressIndicator();
},
); );
}), }),
), ),

View File

@@ -9,8 +9,7 @@ import 'auth_gate.dart';
void main() async { void main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform); await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
Stripe.publishableKey = Stripe.publishableKey = "pk_test_51MfY7PFVdcWv896FKvDhgKabYeDq4AnoFcWxCAg4hquj6TBAsN0kznXPVyKA7M1pMq5PsieGQwsx6QY5ld5ZQzJ500rVCMPPXp";
"pk_test_51MfY7PFVdcWv896FKvDhgKabYeDq4AnoFcWxCAg4hquj6TBAsN0kznXPVyKA7M1pMq5PsieGQwsx6QY5ld5ZQzJ500rVCMPPXp";
runApp(const MyApp()); runApp(const MyApp());
} }
@@ -21,6 +20,39 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(
theme: ThemeData( theme: ThemeData(
inputDecorationTheme: InputDecorationTheme(
fillColor: Color.fromARGB(255, 40, 40, 40),
filled: true,
outlineBorder: BorderSide(
color: Colors.white,
),
labelStyle: TextStyle(
color: Color.fromARGB(255, 205, 0, 48),
),
focusColor: Colors.white,
hintStyle: TextStyle(
color: Color.fromARGB(255, 205, 0, 48),
),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
),
),
textSelectionTheme: TextSelectionThemeData(),
fixTextFieldOutlineLabel: true,
outlinedButtonTheme: OutlinedButtonThemeData(
style: ButtonStyle(
padding: MaterialStateProperty.all<EdgeInsets>(
const EdgeInsets.all(24),
),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
),
backgroundColor: MaterialStateProperty.all<Color>(Color.fromARGB(255, 205, 0, 48)),
foregroundColor: MaterialStateProperty.all<Color>(Colors.white),
),
),
primarySwatch: CustomMaterialColor(205, 0, 48).mdColor, primarySwatch: CustomMaterialColor(205, 0, 48).mdColor,
scaffoldBackgroundColor: Colors.black87, scaffoldBackgroundColor: Colors.black87,
fontFamily: GoogleFonts.figtree().fontFamily, fontFamily: GoogleFonts.figtree().fontFamily,
@@ -28,13 +60,9 @@ class MyApp extends StatelessWidget {
bodyColor: CustomMaterialColor(240, 240, 240).mdColor, bodyColor: CustomMaterialColor(240, 240, 240).mdColor,
displayColor: CustomMaterialColor(240, 240, 240).mdColor, displayColor: CustomMaterialColor(240, 240, 240).mdColor,
), ),
textButtonTheme: TextButtonThemeData( textButtonTheme: TextButtonThemeData(style: ButtonStyle(textStyle: MaterialStatePropertyAll(TextStyle(color: CustomMaterialColor(240, 240, 240).mdColor)))),
style: ButtonStyle(
textStyle: MaterialStatePropertyAll(TextStyle(
color: CustomMaterialColor(240, 240, 240).mdColor)))),
checkboxTheme: CheckboxThemeData( checkboxTheme: CheckboxThemeData(
fillColor: MaterialStatePropertyAll( fillColor: MaterialStatePropertyAll(CustomMaterialColor(240, 240, 240).mdColor),
CustomMaterialColor(240, 240, 240).mdColor),
checkColor: MaterialStatePropertyAll(Colors.black), checkColor: MaterialStatePropertyAll(Colors.black),
), ),
), ),

View File

@@ -10,7 +10,6 @@ import desktop_webview_auth
import firebase_auth import firebase_auth
import firebase_core import firebase_core
import firebase_database import firebase_database
import geolocator_apple
import path_provider_foundation import path_provider_foundation
import sign_in_with_apple import sign_in_with_apple
import twitter_login import twitter_login
@@ -22,7 +21,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin")) FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
FLTFirebaseDatabasePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseDatabasePlugin")) FLTFirebaseDatabasePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseDatabasePlugin"))
GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SignInWithApplePlugin.register(with: registry.registrar(forPlugin: "SignInWithApplePlugin")) SignInWithApplePlugin.register(with: registry.registrar(forPlugin: "SignInWithApplePlugin"))
TwitterLoginPlugin.register(with: registry.registrar(forPlugin: "TwitterLoginPlugin")) TwitterLoginPlugin.register(with: registry.registrar(forPlugin: "TwitterLoginPlugin"))

View File

@@ -262,14 +262,6 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.5.1" version: "1.5.1"
flutter_dotenv:
dependency: "direct main"
description:
name: flutter_dotenv
sha256: d9283d92059a22e9834bc0a31336658ffba77089fb6f3cc36751f1fc7c6661a3
url: "https://pub.dev"
source: hosted
version: "5.0.2"
flutter_email_sender: flutter_email_sender:
dependency: "direct main" dependency: "direct main"
description: description:
@@ -357,54 +349,6 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.2.0" version: "2.2.0"
geolocator:
dependency: "direct main"
description:
name: geolocator
sha256: "5c23f3613f50586c0bbb2b8f970240ae66b3bd992088cf60dd5ee2e6f7dde3a8"
url: "https://pub.dev"
source: hosted
version: "9.0.2"
geolocator_android:
dependency: transitive
description:
name: geolocator_android
sha256: "2ba24690aee0a3e1b6b7bd47c2711a50c874e95e4c758346589d35194adf6d6a"
url: "https://pub.dev"
source: hosted
version: "4.1.7"
geolocator_apple:
dependency: transitive
description:
name: geolocator_apple
sha256: "22b60ca3b8c0f58e6a9688ff855ee39ab813ca3f0c0609a48d282f6631266f2e"
url: "https://pub.dev"
source: hosted
version: "2.2.5"
geolocator_platform_interface:
dependency: transitive
description:
name: geolocator_platform_interface
sha256: af4d69231452f9620718588f41acc4cb58312368716bfff2e92e770b46ce6386
url: "https://pub.dev"
source: hosted
version: "4.0.7"
geolocator_web:
dependency: transitive
description:
name: geolocator_web
sha256: f68a122da48fcfff68bbc9846bb0b74ef651afe84a1b1f6ec20939de4d6860e1
url: "https://pub.dev"
source: hosted
version: "2.1.6"
geolocator_windows:
dependency: transitive
description:
name: geolocator_windows
sha256: f5911c88e23f48b598dd506c7c19eff0e001645bdc03bb6fecb9f4549208354d
url: "https://pub.dev"
source: hosted
version: "0.1.1"
google_fonts: google_fonts:
dependency: "direct main" dependency: "direct main"
description: description:

View File

@@ -38,9 +38,7 @@ dependencies:
firebase_core: ^2.7.0 firebase_core: ^2.7.0
firebase_auth: ^4.2.9 firebase_auth: ^4.2.9
flutterfire_ui: ^0.4.3+20 flutterfire_ui: ^0.4.3+20
flutter_dotenv: ^5.0.2
persistent_bottom_nav_bar: any persistent_bottom_nav_bar: any
geolocator: ^9.0.2
flutter_credit_card: any flutter_credit_card: any
flutter_stripe: any flutter_stripe: any
material_dialogs: any material_dialogs: any

View File

@@ -7,14 +7,11 @@
#include "generated_plugin_registrant.h" #include "generated_plugin_registrant.h"
#include <desktop_webview_auth/desktop_webview_auth_plugin.h> #include <desktop_webview_auth/desktop_webview_auth_plugin.h>
#include <geolocator_windows/geolocator_windows.h>
#include <url_launcher_windows/url_launcher_windows.h> #include <url_launcher_windows/url_launcher_windows.h>
void RegisterPlugins(flutter::PluginRegistry* registry) { void RegisterPlugins(flutter::PluginRegistry* registry) {
DesktopWebviewAuthPluginRegisterWithRegistrar( DesktopWebviewAuthPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("DesktopWebviewAuthPlugin")); registry->GetRegistrarForPlugin("DesktopWebviewAuthPlugin"));
GeolocatorWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("GeolocatorWindows"));
UrlLauncherWindowsRegisterWithRegistrar( UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows")); registry->GetRegistrarForPlugin("UrlLauncherWindows"));
} }

View File

@@ -4,7 +4,6 @@
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
desktop_webview_auth desktop_webview_auth
geolocator_windows
url_launcher_windows url_launcher_windows
) )