diff --git a/assets/afternoon_swipe.jpg b/assets/afternoon_swipe.jpg new file mode 100644 index 0000000..debe3c4 Binary files /dev/null and b/assets/afternoon_swipe.jpg differ diff --git a/assets/bdh.jpg b/assets/bdh.jpg new file mode 100644 index 0000000..8a838c3 Binary files /dev/null and b/assets/bdh.jpg differ diff --git a/assets/brower.jpg b/assets/brower.jpg new file mode 100644 index 0000000..712ced0 Binary files /dev/null and b/assets/brower.jpg differ diff --git a/assets/cafe_west.jpg b/assets/cafe_west.jpg new file mode 100644 index 0000000..1e611d9 Binary files /dev/null and b/assets/cafe_west.jpg differ diff --git a/assets/cook_cafe.jpg b/assets/cook_cafe.jpg new file mode 100644 index 0000000..97591e5 Binary files /dev/null and b/assets/cook_cafe.jpg differ diff --git a/assets/daytime_swipe.jpg b/assets/daytime_swipe.jpg new file mode 100644 index 0000000..b48550c Binary files /dev/null and b/assets/daytime_swipe.jpg differ diff --git a/assets/doug_cafe.jpg b/assets/doug_cafe.jpg new file mode 100644 index 0000000..22a3a18 Binary files /dev/null and b/assets/doug_cafe.jpg differ diff --git a/assets/harvest.jpg b/assets/harvest.jpg new file mode 100644 index 0000000..7da90b7 Binary files /dev/null and b/assets/harvest.jpg differ diff --git a/assets/kilmers.png b/assets/kilmers.png new file mode 100644 index 0000000..e1878b8 Binary files /dev/null and b/assets/kilmers.png differ diff --git a/assets/ldh.jpg b/assets/ldh.jpg new file mode 100644 index 0000000..63d6c8a Binary files /dev/null and b/assets/ldh.jpg differ diff --git a/assets/neilson.jpg b/assets/neilson.jpg new file mode 100644 index 0000000..eb8261c Binary files /dev/null and b/assets/neilson.jpg differ diff --git a/assets/nighttime_swipe.jpg b/assets/nighttime_swipe.jpg new file mode 100644 index 0000000..63f45a8 Binary files /dev/null and b/assets/nighttime_swipe.jpg differ diff --git a/assets/red_pine.jpg b/assets/red_pine.jpg new file mode 100644 index 0000000..b3db13e Binary files /dev/null and b/assets/red_pine.jpg differ diff --git a/assets/sbarros.jpg b/assets/sbarros.jpg new file mode 100644 index 0000000..432b50b Binary files /dev/null and b/assets/sbarros.jpg differ diff --git a/assets/woodys.jpg b/assets/woodys.jpg new file mode 100644 index 0000000..934d62b Binary files /dev/null and b/assets/woodys.jpg differ diff --git a/flutter_01.png b/flutter_01.png new file mode 100644 index 0000000..ad34486 Binary files /dev/null and b/flutter_01.png differ diff --git a/lib/buy.dart b/lib/buy.dart index 3464d6f..454532a 100644 --- a/lib/buy.dart +++ b/lib/buy.dart @@ -1,8 +1,12 @@ +import 'dart:collection'; +import 'dart:ui'; + import 'package:flutter/material.dart'; import 'package:material_dialogs/shared/types.dart'; import 'package:material_dialogs/widgets/buttons/icon_button.dart'; import 'package:material_dialogs/widgets/buttons/icon_outline_button.dart'; import 'package:material_dialogs/material_dialogs.dart'; +import 'package:ruswipeshare/main.dart'; enum CampusState { campuses, list_options, offers } @@ -18,9 +22,23 @@ final List entries = [ 'Pearl Morse', 'Jana Munguia' ]; +final Map nameToAsset = { + 'Brower Dining Hall': 'brower.jpg', + 'Cafe West': 'cafe_west.jpg', + 'Busch Dining Hall': 'bdh.jpg', + 'Woody\'s Cafe': 'woodys.jpg', + 'Livingston Dining Hall': 'ldh.jpg', + 'Kilmer\'s Market': 'kilmers.png', + 'Sbarro\'s': 'sbarros.jpg', + 'Neilson Dining Hall': 'neilson.jpg', + 'Cook Cafe': 'cook_cafe.jpg', + 'Douglass Cafe': 'doug_cafe.jpg', + 'Harvest INFH': 'harvest.jpg', + 'Red Pine Pizza': 'red_pine.jpg' +}; final List> eatingLocations = [ ['Brower Dining Hall', 'Cafe West'], - ['Busch Dining Hall', 'Woody\'s'], + ['Busch Dining Hall', 'Woody\'s Cafe'], [ 'Livingston Dining Hall', 'Kilmer\'s Market', @@ -35,6 +53,11 @@ final List> eatingLocations = [ ] ]; final List colorCodes = [600, 500, 100]; +final List timeBgAssets = [ + 'assets/daytime_swipe.jpg', + 'assets/afternoon_swipe.jpg', + 'assets/nighttime_swipe.jpg' +]; class BuyScreen extends StatefulWidget { const BuyScreen({Key? key}) : super(key: key); @@ -58,22 +81,23 @@ class _BuyScreenState extends State { child: Center( child: GridView.count( shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), + physics: const NeverScrollableScrollPhysics(), crossAxisCount: 2, crossAxisSpacing: 15, childAspectRatio: 0.8, mainAxisSpacing: 20, - padding: EdgeInsets.all(10), + padding: const EdgeInsets.all(10), children: [ InkWell( onTap: () { setState(() { _currentState = CampusState.list_options; - _diningOptions = eatingLocations[3]; + _diningOptions = eatingLocations[0]; }); }, child: ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(25)), + borderRadius: + const BorderRadius.all(Radius.circular(25)), child: Column( children: [ Expanded( @@ -84,9 +108,9 @@ class _BuyScreenState extends State { ), Container( width: double.infinity, - padding: EdgeInsets.all(8), + padding: const EdgeInsets.all(8), color: Colors.red, - child: Text( + child: const Text( "College Avenue", textAlign: TextAlign.center, ), @@ -95,70 +119,97 @@ class _BuyScreenState extends State { ), ), ), - ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(25)), - child: Column( - children: [ - Expanded( - child: Image.asset( - 'assets/busch_bg.jpg', - fit: BoxFit.cover, + InkWell( + onTap: () { + setState(() { + _currentState = CampusState.list_options; + _diningOptions = eatingLocations[1]; + }); + }, + child: ClipRRect( + borderRadius: + const BorderRadius.all(Radius.circular(25)), + child: Column( + children: [ + Expanded( + child: Image.asset( + 'assets/busch_bg.jpg', + fit: BoxFit.cover, + ), ), - ), - Container( - width: double.infinity, - padding: EdgeInsets.all(8), - color: Colors.green, - child: Text( - "Busch", - textAlign: TextAlign.center, + Container( + width: double.infinity, + padding: const EdgeInsets.all(8), + color: Colors.red, + child: const Text( + "Busch", + textAlign: TextAlign.center, + ), ), - ), - ], + ], + ), ), ), - ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(25)), - child: Column( - children: [ - Expanded( - child: Image.asset( - 'assets/livi_bg.jpg', - fit: BoxFit.cover, + InkWell( + onTap: () { + setState(() { + _currentState = CampusState.list_options; + _diningOptions = eatingLocations[2]; + }); + }, + child: ClipRRect( + borderRadius: + const BorderRadius.all(Radius.circular(25)), + child: Column( + children: [ + Expanded( + child: Image.asset( + 'assets/livi_bg.jpg', + fit: BoxFit.cover, + ), ), - ), - Container( - width: double.infinity, - padding: EdgeInsets.all(8), - color: Colors.blue, - child: Text( - "Livingston", - textAlign: TextAlign.center, + Container( + width: double.infinity, + padding: const EdgeInsets.all(8), + color: Colors.red, + child: const Text( + "Livi", + textAlign: TextAlign.center, + ), ), - ), - ], + ], + ), ), ), - ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(25)), - child: Column( - children: [ - Expanded( - child: Image.asset( - 'assets/cd_bg.jpg', - fit: BoxFit.cover, + InkWell( + onTap: () { + setState(() { + _currentState = CampusState.list_options; + _diningOptions = eatingLocations[3]; + }); + }, + child: ClipRRect( + borderRadius: + const BorderRadius.all(Radius.circular(25)), + child: Column( + children: [ + Expanded( + child: Image.asset( + 'assets/cd_bg.jpg', + fit: BoxFit.cover, + ), ), - ), - Container( - width: double.infinity, - padding: EdgeInsets.all(8), - color: Colors.yellow[700], - child: Text( - "Cook-Douglass", - textAlign: TextAlign.center, + Container( + width: double.infinity, + padding: const EdgeInsets.all(8), + color: Colors.red, + child: const Text( + "Cook-Douglass", + textAlign: TextAlign.center, + ), ), - ), - ], + ], + ), ), ), ], @@ -169,8 +220,7 @@ class _BuyScreenState extends State { ); case CampusState.list_options: return Scaffold( - body: Column( - children: [ + body: Column(children: [ Container( width: double.infinity, child: ElevatedButton( @@ -179,51 +229,63 @@ class _BuyScreenState extends State { _currentState = CampusState.campuses; }); }, - child: Text("Choose A Different Location")), + child: const Text("Choose A Different Location")), ), Expanded( child: ListView.builder( - physics: BouncingScrollPhysics(), - itemCount: _diningOptions.length, - padding: EdgeInsets.zero, - itemBuilder: (BuildContext context, int index) { - return InkWell( - onTap: () { - setState(() { - _currentState = CampusState.offers; - _selectedLocation = _diningOptions.elementAt(index); - }); - }, - child: Container( - height: 80, - color: Colors.blue, - margin: const EdgeInsets.only(bottom: 4), - child: Row( - children: [ - Container( - color: Colors.red, - margin: EdgeInsets.only(top: 4, left: 4, bottom: 4), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( + physics: const BouncingScrollPhysics(), + itemCount: _diningOptions.length, + padding: EdgeInsets.zero, + itemBuilder: (BuildContext context, int index) { + return Container( + margin: const EdgeInsets.all(4), + decoration: BoxDecoration( + border: Border.all( + color: CustomMaterialColor(240, 240, 240).mdColor, + width: 2), + borderRadius: + const BorderRadius.all(Radius.circular(40))), + child: InkWell( + onTap: () { + setState(() { + _currentState = CampusState.offers; + _selectedLocation = _diningOptions.elementAt(index); + }); + }, + child: ClipRRect( + borderRadius: + const BorderRadius.all(Radius.circular(40)), + child: Container( + height: 80, + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.cover, + image: AssetImage("assets/" + + nameToAsset[ + _diningOptions.elementAt(index)]!), + )), + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 3, sigmaY: 3), + child: Container( + padding: const EdgeInsets.only(right: 40), + alignment: Alignment.bottomRight, + margin: const EdgeInsets.only( + top: 4, left: 20, bottom: 4), + child: Text( _diningOptions[index], - textAlign: TextAlign.start, overflow: TextOverflow.ellipsis, style: const TextStyle(fontSize: 24), ), - ], + ), ), ), - ], + ), ), - ), - ); - }, - ), - ), - ], - )); + ); + }), + ) + ]), + ); case CampusState.offers: return Scaffold( body: Column( @@ -247,15 +309,15 @@ class _BuyScreenState extends State { ]), Expanded( child: ListView.builder( - physics: BouncingScrollPhysics(), + physics: const BouncingScrollPhysics(), itemCount: 30, padding: EdgeInsets.zero, itemBuilder: (BuildContext context, int index) { return InkWell( onTap: () { Dialogs.materialDialog( - color: Colors.white, - customView: TransactionDetails(), + color: CustomMaterialColor(240, 240, 240).mdColor, + customView: const TransactionDetails(), customViewPosition: CustomViewPosition.BEFORE_ACTION, msg: @@ -267,7 +329,7 @@ class _BuyScreenState extends State { onPressed: () {}, text: 'Cancel', iconData: Icons.cancel_outlined, - textStyle: TextStyle(color: Colors.grey), + textStyle: const TextStyle(color: Colors.grey), iconColor: Colors.grey, ), IconsButton( @@ -275,75 +337,99 @@ class _BuyScreenState extends State { text: 'Purchase', iconData: Icons.done, color: Colors.blue, - textStyle: TextStyle(color: Colors.white), iconColor: Colors.white, ), ], ); }, child: Container( + decoration: BoxDecoration( + border: Border.all( + color: CustomMaterialColor(240, 240, 240) + .mdColor, + width: 2), + borderRadius: + const BorderRadius.all(Radius.circular(40))), + margin: const EdgeInsets.all(4), height: 80, - // color: Colors.blue, - margin: const EdgeInsets.only(bottom: 4), - child: Row( - children: [ - Expanded( - flex: 7, - child: Container( - color: Colors.red, - margin: EdgeInsets.only( - top: 4, left: 4, bottom: 4), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - entries[index % entries.length] + - " " + - _selectedLocation, - textAlign: TextAlign.start, - overflow: TextOverflow.ellipsis, - style: const TextStyle(fontSize: 24), - ), - 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: ClipRRect( + borderRadius: + const BorderRadius.all(Radius.circular(40)), + child: Container( + decoration: BoxDecoration( + image: DecorationImage( + colorFilter: const ColorFilter.mode( + Colors.black26, BlendMode.darken), + fit: BoxFit.cover, + image: AssetImage(timeBgAssets[index % 3]), + )), + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 2, sigmaY: 2), + child: Row( + children: [ + Expanded( + flex: 7, + child: Container( + padding: EdgeInsets.only(left: 20), + // color: Colors.red, + margin: const EdgeInsets.only( + top: 4, left: 4, bottom: 4), child: Column( - mainAxisAlignment: - MainAxisAlignment.end, - children: const [ + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ Text( - '88:88PM - 88:88PM', + entries[index % entries.length], textAlign: TextAlign.start, overflow: TextOverflow.ellipsis, - style: TextStyle(fontSize: 16), + style: + const TextStyle(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: const [ + Text( + '88:88PM - 88:88PM', + textAlign: TextAlign.start, + overflow: + TextOverflow.ellipsis, + style: + TextStyle(fontSize: 16), + ), + ], + ), + ) ], ), - ) - ], - ), + ), + ), + Expanded( + flex: 3, + child: Container( + padding: EdgeInsets.only(right: 15), + child: Text( + '\$88', + textAlign: TextAlign.end, + style: TextStyle(fontSize: 44), + ), + ), + ), + ], ), ), - Expanded( - flex: 3, - child: Container( - color: Colors.orange, - child: const Text( - '\$88', - textAlign: TextAlign.center, - style: const TextStyle(fontSize: 44), - ), - ), - ) - ], + ), ), ), ); diff --git a/lib/home.dart b/lib/home.dart index 9dd15a5..394aca3 100644 --- a/lib/home.dart +++ b/lib/home.dart @@ -79,7 +79,7 @@ class _HomeScreenState extends State { stateManagement: true, // Default is true. hideNavigationBarWhenKeyboardShows: true, // Recommended to set 'resizeToAvoidBottomInset' as true while using this argument. Default is true. - decoration: NavBarDecoration( + decoration: const NavBarDecoration( // border: Border( // top: BorderSide(width: 2.0, color: Colors.white), // ), diff --git a/lib/profile_screen_custom.dart b/lib/profile_screen_custom.dart index 991b7a5..950c499 100644 --- a/lib/profile_screen_custom.dart +++ b/lib/profile_screen_custom.dart @@ -4,13 +4,12 @@ // ignore_for_file: implementation_imports -import 'package:firebase_auth/firebase_auth.dart' show ActionCodeSettings, FirebaseAuth, FirebaseAuthException, User; +import 'package:firebase_auth/firebase_auth.dart' + show ActionCodeSettings, FirebaseAuth, FirebaseAuthException, User; import 'package:flutter/cupertino.dart' hide Title; import 'package:flutter/material.dart'; import 'package:flutter/material.dart' hide Title; import 'package:flutter/material.dart'; -import 'package:flutter_credit_card/credit_card_brand.dart'; -import 'package:flutter_credit_card/flutter_credit_card.dart'; import 'package:flutterfire_ui/auth.dart'; import 'package:flutterfire_ui/src/auth/widgets/internal/loading_button.dart'; @@ -80,7 +79,9 @@ class _EmailVerificationBadgeState extends State { @override Widget build(BuildContext context) { - if (state == EmailVerificationState.dismissed || state == EmailVerificationState.unresolved || state == EmailVerificationState.verified) { + if (state == EmailVerificationState.dismissed || + state == EmailVerificationState.unresolved || + state == EmailVerificationState.verified) { return const SizedBox.shrink(); } @@ -100,7 +101,10 @@ class _EmailVerificationBadgeState extends State { crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Subtitle( - text: state == EmailVerificationState.sent || state == EmailVerificationState.pending ? 'Verification email sent' : 'Email is not verified', + text: state == EmailVerificationState.sent || + state == EmailVerificationState.pending + ? 'Verification email sent' + : 'Email is not verified', fontWeight: FontWeight.bold, ), if (state == EmailVerificationState.pending) ...[ @@ -130,7 +134,8 @@ class _EmailVerificationBadgeState extends State { Row( mainAxisAlignment: MainAxisAlignment.end, children: [ - if (state != EmailVerificationState.sent && state != EmailVerificationState.sending) + if (state != EmailVerificationState.sent && + state != EmailVerificationState.sending) UniversalButton( variant: ButtonVariant.text, color: Theme.of(context).colorScheme.error, @@ -202,11 +207,15 @@ class ProfileScreenCustom extends MultiProviderScreen { } List getLinkedProviders(User user) { - return providerConfigs.where((config) => user.isProviderLinked(config.providerId)).toList(); + return providerConfigs + .where((config) => user.isProviderLinked(config.providerId)) + .toList(); } List getAvailableProviders(User user) { - return providerConfigs.where((config) => !user.isProviderLinked(config.providerId)).toList(); + return providerConfigs + .where((config) => !user.isProviderLinked(config.providerId)) + .toList(); } @override @@ -254,12 +263,15 @@ class ProfileScreenCustom extends MultiProviderScreen { ...children, const SizedBox(height: 300), TextButton( - style: ButtonStyle( - foregroundColor: MaterialStateProperty.all(Colors.red), - ), - onPressed: () {Navigator.push(context, MaterialPageRoute(builder: (context)=> CreditView())); }, - child: Text('Setup Seller'), -), + style: ButtonStyle( + foregroundColor: MaterialStateProperty.all(Colors.red), + ), + onPressed: () { + Navigator.push( + context, MaterialPageRoute(builder: (context) => CreditView())); + }, + child: Text('Setup Seller'), + ), Align( alignment: Alignment.bottomCenter, child: SignOutButton( diff --git a/lib/sell.dart b/lib/sell.dart index 7ef330a..acfbe81 100644 --- a/lib/sell.dart +++ b/lib/sell.dart @@ -38,7 +38,7 @@ class _SellScreenState extends State { children: [ Row( mainAxisAlignment: MainAxisAlignment.center, - children: [ + children: const [ Icon(Icons.store_mall_directory, color: Colors.red), Text('Place'), ], @@ -60,7 +60,7 @@ class _SellScreenState extends State { ), Row( mainAxisAlignment: MainAxisAlignment.center, - children: [ + children: const [ Icon(Icons.access_time, color: Colors.red), Text('Time'), ], @@ -94,10 +94,19 @@ class _SellScreenState extends State { context: context, initialTime: TimeOfDay.fromDateTime(startTimeTime), ); - if (picked != null && picked != TimeOfDay.fromDateTime(startTimeTime)) { + if (picked != null && + picked != TimeOfDay.fromDateTime(startTimeTime)) { setState(() { - startTimeTime = DateTime.fromMicrosecondsSinceEpoch(picked.hour * 60 * 60 * 1000000 + picked.minute * 60 * 1000000, isUtc: true); - startTime = startTimeTime.hour.toString() + ":" + startTimeTime.minute.toString() + ((is24HoursFormat) ? "" : ((startTimeTime.hour > 12) ? "PM" : "AM")); + startTimeTime = DateTime.fromMicrosecondsSinceEpoch( + picked.hour * 60 * 60 * 1000000 + + picked.minute * 60 * 1000000, + isUtc: true); + startTime = startTimeTime.hour.toString() + + ":" + + startTimeTime.minute.toString() + + ((is24HoursFormat) + ? "" + : ((startTimeTime.hour > 12) ? "PM" : "AM")); }); } }, @@ -109,10 +118,19 @@ class _SellScreenState extends State { context: context, initialTime: TimeOfDay.fromDateTime(endTimeTime), ); - if (picked != null && picked != TimeOfDay.fromDateTime(endTimeTime)) { + if (picked != null && + picked != TimeOfDay.fromDateTime(endTimeTime)) { setState(() { - endTimeTime = DateTime.fromMicrosecondsSinceEpoch(picked.hour * 60 * 60 * 1000000 + picked.minute * 60 * 1000000, isUtc: true); - endTime = endTimeTime.hour.toString() + ":" + endTimeTime.minute.toString() + ((is24HoursFormat) ? "" : ((endTimeTime.hour > 12) ? "PM" : "AM")); + endTimeTime = DateTime.fromMicrosecondsSinceEpoch( + picked.hour * 60 * 60 * 1000000 + + picked.minute * 60 * 1000000, + isUtc: true); + endTime = endTimeTime.hour.toString() + + ":" + + endTimeTime.minute.toString() + + ((is24HoursFormat) + ? "" + : ((endTimeTime.hour > 12) ? "PM" : "AM")); }); } }, @@ -122,7 +140,7 @@ class _SellScreenState extends State { ), Row( mainAxisAlignment: MainAxisAlignment.center, - children: [ + children: const [ Icon(Icons.attach_money, color: Colors.red), Text('Cost'), ], @@ -154,7 +172,8 @@ class _SellScreenState extends State { ElevatedButton( onPressed: () {}, style: ButtonStyle( - backgroundColor: MaterialStateColor.resolveWith((states) => Colors.blue), + backgroundColor: + MaterialStateColor.resolveWith((states) => Colors.blue), ), child: const Text('Next'), ),