Merge branch 'master' of github.com:SoPat712/RUSwipeShare

This commit is contained in:
Ashish Bailkeri
2023-02-26 15:28:18 -05:00
8 changed files with 73 additions and 99 deletions

View File

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

View File

@@ -10,8 +10,8 @@ void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
Stripe.publishableKey = "pk_test_51MfY7PFVdcWv896FKvDhgKabYeDq4AnoFcWxCAg4hquj6TBAsN0kznXPVyKA7M1pMq5PsieGQwsx6QY5ld5ZQzJ500rVCMPPXp";
runApp(const MyApp());
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
@@ -20,23 +20,58 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
primarySwatch: CustomMaterialColor(205, 0, 48).mdColor,
scaffoldBackgroundColor: Colors.black87,
fontFamily: GoogleFonts.figtree().fontFamily,
textTheme: Theme.of(context).textTheme.apply(
bodyColor: CustomMaterialColor(240, 240, 240).mdColor,
displayColor: CustomMaterialColor(240, 240, 240).mdColor,
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),
),
textButtonTheme: TextButtonThemeData(
style: ButtonStyle(
textStyle: MaterialStatePropertyAll(TextStyle(
color: CustomMaterialColor(240, 240, 240).mdColor))))),
),
backgroundColor: MaterialStateProperty.all<Color>(Color.fromARGB(255, 205, 0, 48)),
foregroundColor: MaterialStateProperty.all<Color>(Colors.white),
),
),
primarySwatch: CustomMaterialColor(205, 0, 48).mdColor,
scaffoldBackgroundColor: Colors.black87,
fontFamily: GoogleFonts.figtree().fontFamily,
textTheme: Theme.of(context).textTheme.apply(
bodyColor: CustomMaterialColor(240, 240, 240).mdColor,
displayColor: CustomMaterialColor(240, 240, 240).mdColor,
),
textButtonTheme: TextButtonThemeData(style: ButtonStyle(textStyle: MaterialStatePropertyAll(TextStyle(color: CustomMaterialColor(240, 240, 240).mdColor)))),
checkboxTheme: CheckboxThemeData(
fillColor: MaterialStatePropertyAll(CustomMaterialColor(240, 240, 240).mdColor),
checkColor: MaterialStatePropertyAll(Colors.black),
),
),
home: const AuthGate(),
);
}
}
class CustomMaterialColor {
class CustomMaterialColor {
final int r;
final int g;
final int b;

View File

@@ -46,18 +46,32 @@ class _SellScreenState extends State<SellScreen> {
resizeToAvoidBottomInset: true,
body: Padding(
padding: const EdgeInsets.fromLTRB(0, 8, 0, 0),
child:
Column(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [
child: Column(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: const [
Icon(Icons.store_mall_directory, color: Colors.red),
Text('Place'),
children: [
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.store_mall_directory,
color: Colors.red,
size: 40,
),
Text(
'Place',
style: TextStyle(
fontSize: 30,
),
),
],
))
],
),
ConstrainedBox(
constraints: const BoxConstraints.expand(height: 250),
child: ListView.builder(
physics: BouncingScrollPhysics(),
itemCount: values.length,
itemBuilder: (context, index) => CheckboxListTile(
title: Text(values.keys.elementAt(index)),
@@ -102,9 +116,7 @@ class _SellScreenState extends State<SellScreen> {
children: [
ElevatedButton(
onPressed: () async {
DatePicker.showDateTimePicker(context,
showTitleActions: true,
minTime: DateTime.now(), onChanged: (date) {
DatePicker.showDateTimePicker(context, showTitleActions: true, minTime: DateTime.now(), onChanged: (date) {
print('change $date');
}, onConfirm: (date) {
setState(() {
@@ -128,9 +140,7 @@ class _SellScreenState extends State<SellScreen> {
),
ElevatedButton(
onPressed: () async {
DatePicker.showDateTimePicker(context,
showTitleActions: true,
minTime: DateTime.now(), onChanged: (date) {
DatePicker.showDateTimePicker(context, showTitleActions: true, minTime: DateTime.now(), onChanged: (date) {
print('change $date');
}, onConfirm: (date) {
setState(() {
@@ -183,19 +193,12 @@ class _SellScreenState extends State<SellScreen> {
if (value == true) locations.add(key);
});
if (user != null) {
Seller seller = Seller(
user.displayName,
user.uid,
locations,
TimeRange(Timestamp.fromDate(startTimeTime),
Timestamp.fromDate(endTimeTime)),
double.parse(priceController.text));
Seller seller = Seller(user.displayName, user.uid, locations, TimeRange(Timestamp.fromDate(startTimeTime), Timestamp.fromDate(endTimeTime)), double.parse(priceController.text));
addSeller(seller);
}
},
style: ButtonStyle(
backgroundColor:
MaterialStateColor.resolveWith((states) => Colors.blue),
backgroundColor: MaterialStateColor.resolveWith((states) => Colors.blue),
),
child: const Text('Submit Sell Request'),
),