mirror of
https://github.com/SoPat712/RUSwipeShare.git
synced 2025-08-21 19:08:46 -04:00
stripeMergefix
This commit is contained in:
554
lib/buy.dart
554
lib/buy.dart
@@ -1,22 +1,14 @@
|
||||
import 'dart:collection';
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ruswipeshare/sell.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';
|
||||
|
||||
class BuyScreen extends StatefulWidget {
|
||||
const BuyScreen({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_BuyScreenState createState() => _BuyScreenState();
|
||||
}
|
||||
|
||||
class _BuyScreenState extends State<BuyScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
TimeOfDay _time = TimeOfDay.now();
|
||||
return Scaffold(
|
||||
body: const OffersListView(),
|
||||
);
|
||||
}
|
||||
}
|
||||
enum CampusState { campuses, list_options, offers }
|
||||
|
||||
final List<String> entries = <String>[
|
||||
'Antoinette Beauchamp',
|
||||
@@ -30,86 +22,474 @@ final List<String> entries = <String>[
|
||||
'Pearl Morse',
|
||||
'Jana Munguia'
|
||||
];
|
||||
final Map<String, String> 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<List<String>> eatingLocations = [
|
||||
<String>['Brower Dining Hall', 'Cafe West'],
|
||||
<String>['Busch Dining Hall', 'Woody\'s Cafe'],
|
||||
<String>[
|
||||
'Livingston Dining Hall',
|
||||
'Kilmer\'s Market',
|
||||
'Sbarro\'s',
|
||||
],
|
||||
<String>[
|
||||
'Neilson Dining Hall',
|
||||
'Cook Cafe',
|
||||
'Douglass Cafe',
|
||||
'Harvest INFH',
|
||||
'Red Pine Pizza'
|
||||
]
|
||||
];
|
||||
final List<int> colorCodes = <int>[600, 500, 100];
|
||||
final List<String> timeBgAssets = <String>[
|
||||
'assets/daytime_swipe.jpg',
|
||||
'assets/afternoon_swipe.jpg',
|
||||
'assets/nighttime_swipe.jpg'
|
||||
];
|
||||
|
||||
class OffersListView extends StatelessWidget {
|
||||
const OffersListView({super.key});
|
||||
class BuyScreen extends StatefulWidget {
|
||||
const BuyScreen({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_BuyScreenState createState() => _BuyScreenState();
|
||||
}
|
||||
|
||||
class _BuyScreenState extends State<BuyScreen> {
|
||||
CampusState _currentState = CampusState.campuses;
|
||||
List<String> _diningOptions = List.empty();
|
||||
String _selectedLocation = "";
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView.builder(
|
||||
itemCount: 30,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Navigator.push(context,
|
||||
MaterialPageRoute(builder: (context) => const SellScreen()));
|
||||
},
|
||||
child: Container(
|
||||
height: 80,
|
||||
color: Colors.blue,
|
||||
margin: const EdgeInsets.only(top: 4, 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],
|
||||
textAlign: TextAlign.start,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(fontSize: 24),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
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: const TextStyle(fontSize: 16),
|
||||
),
|
||||
],
|
||||
switch (_currentState) {
|
||||
case CampusState.campuses:
|
||||
return Scaffold(
|
||||
body: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: GridView.count(
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
crossAxisCount: 2,
|
||||
crossAxisSpacing: 15,
|
||||
childAspectRatio: 0.8,
|
||||
mainAxisSpacing: 20,
|
||||
padding: const EdgeInsets.all(10),
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_currentState = CampusState.list_options;
|
||||
_diningOptions = eatingLocations[0];
|
||||
});
|
||||
},
|
||||
child: ClipRRect(
|
||||
borderRadius:
|
||||
const BorderRadius.all(Radius.circular(25)),
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Image.asset(
|
||||
'assets/ca_bg.jpg',
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(8),
|
||||
color: Colors.red,
|
||||
child: const Text(
|
||||
"College Avenue",
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Container(
|
||||
color: Colors.orange,
|
||||
child: const Text(
|
||||
'\$88',
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(fontSize: 44),
|
||||
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: const EdgeInsets.all(8),
|
||||
color: Colors.red,
|
||||
child: const Text(
|
||||
"Busch",
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
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: const EdgeInsets.all(8),
|
||||
color: Colors.red,
|
||||
child: const Text(
|
||||
"Livi",
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
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: const EdgeInsets.all(8),
|
||||
color: Colors.red,
|
||||
child: const Text(
|
||||
"Cook-Douglass",
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
);
|
||||
case CampusState.list_options:
|
||||
return Scaffold(
|
||||
body: Column(children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
_currentState = CampusState.campuses;
|
||||
});
|
||||
},
|
||||
child: const Text("Choose A Different Location")),
|
||||
),
|
||||
);
|
||||
});
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
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],
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(fontSize: 24),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
)
|
||||
]),
|
||||
);
|
||||
case CampusState.offers:
|
||||
return Scaffold(
|
||||
body: Column(
|
||||
children: [
|
||||
Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [
|
||||
Flexible(
|
||||
flex: 8,
|
||||
fit: FlexFit.tight,
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
_currentState = CampusState.campuses;
|
||||
});
|
||||
},
|
||||
child: const Text("Choose A Different Location")),
|
||||
),
|
||||
Flexible(
|
||||
flex: 2,
|
||||
child: ElevatedButton(
|
||||
onPressed: () {}, child: const Icon(Icons.filter_list)))
|
||||
]),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
physics: const BouncingScrollPhysics(),
|
||||
itemCount: 30,
|
||||
padding: EdgeInsets.zero,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) => Dialog(
|
||||
backgroundColor:
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(20))),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
const Text('Transaction Details'),
|
||||
const SizedBox(height: 15),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: const Text('Close'),
|
||||
),
|
||||
],
|
||||
),
|
||||
)));
|
||||
// Dialogs.materialDialog(
|
||||
// color: Theme.of(context).scaffoldBackgroundColor,
|
||||
// customView: const TransactionDetails(),
|
||||
// customViewPosition:
|
||||
// CustomViewPosition.BEFORE_ACTION,
|
||||
// msgAlign: TextAlign.center,
|
||||
// msg:
|
||||
// 'Please read all the information below before purchasing.\n',
|
||||
// title: 'Transaction Details',
|
||||
// context: context,
|
||||
// actions: [
|
||||
// IconsOutlineButton(
|
||||
// onPressed: () {},
|
||||
// text: 'Cancel',
|
||||
// iconData: Icons.cancel_outlined,
|
||||
// color: Theme.of(context).primaryColor,
|
||||
// textStyle: TextStyle(
|
||||
// color: CustomMaterialColor(240, 240, 240)
|
||||
// .mdColor,
|
||||
// ),
|
||||
// iconColor: CustomMaterialColor(240, 240, 240)
|
||||
// .mdColor),
|
||||
// IconsButton(
|
||||
// onPressed: () {},
|
||||
// text: 'Purchase',
|
||||
// iconData: Icons.done,
|
||||
// color: Colors.green,
|
||||
// textStyle: TextStyle(
|
||||
// color: CustomMaterialColor(240, 240, 240)
|
||||
// .mdColor,
|
||||
// ),
|
||||
// iconColor: CustomMaterialColor(240, 240, 240)
|
||||
// .mdColor),
|
||||
// ],
|
||||
// );
|
||||
},
|
||||
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,
|
||||
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(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
entries[index % entries.length],
|
||||
textAlign: TextAlign.start,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
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),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class TransactionDetails extends StatefulWidget {
|
||||
const TransactionDetails({super.key});
|
||||
|
||||
@override
|
||||
State<TransactionDetails> createState() => _TransactionDetailsState();
|
||||
}
|
||||
|
||||
class _TransactionDetailsState extends State<TransactionDetails> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
height: 200,
|
||||
color: Colors.blue,
|
||||
);
|
||||
}
|
||||
}
|
||||
// return Container(
|
||||
// height: 80,
|
||||
// color: Colors.amber[colorCodes[index % colorCodes.length]],
|
||||
// );
|
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:persistent_bottom_nav_bar/persistent_tab_view.dart';
|
||||
import 'package:ruswipeshare/buy.dart';
|
||||
import 'package:ruswipeshare/main.dart';
|
||||
import 'package:ruswipeshare/sell.dart';
|
||||
import 'profile_screen_custom.dart';
|
||||
import 'main_screen.dart';
|
||||
@@ -31,14 +32,13 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
PersistentBottomNavBarItem(
|
||||
icon: const Icon(Icons.shopping_cart),
|
||||
title: "Buy",
|
||||
activeColorPrimary: Colors.blue,
|
||||
inactiveColorPrimary: Colors.grey,
|
||||
inactiveColorSecondary: Colors.purple),
|
||||
activeColorPrimary: CustomMaterialColor(240, 240, 240).mdColor,
|
||||
inactiveColorPrimary: Colors.black38),
|
||||
PersistentBottomNavBarItem(
|
||||
icon: const Icon(Icons.attach_money),
|
||||
title: "Sell",
|
||||
activeColorPrimary: Colors.teal,
|
||||
inactiveColorPrimary: Colors.grey,
|
||||
activeColorPrimary: CustomMaterialColor(240, 240, 240).mdColor,
|
||||
inactiveColorPrimary: Colors.black38,
|
||||
routeAndNavigatorSettings: const RouteAndNavigatorSettings(
|
||||
initialRoute: "/",
|
||||
),
|
||||
@@ -46,8 +46,8 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
PersistentBottomNavBarItem(
|
||||
icon: const Icon(Icons.person),
|
||||
title: "Profile",
|
||||
activeColorPrimary: Colors.blueAccent,
|
||||
inactiveColorPrimary: Colors.grey,
|
||||
activeColorPrimary: CustomMaterialColor(240, 240, 240).mdColor,
|
||||
inactiveColorPrimary: Colors.black38,
|
||||
routeAndNavigatorSettings: const RouteAndNavigatorSettings(
|
||||
initialRoute: "/",
|
||||
),
|
||||
@@ -55,8 +55,8 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
PersistentBottomNavBarItem(
|
||||
icon: const Icon(Icons.settings),
|
||||
title: "Settings",
|
||||
activeColorPrimary: Colors.indigo,
|
||||
inactiveColorPrimary: Colors.grey,
|
||||
activeColorPrimary: CustomMaterialColor(240, 240, 240).mdColor,
|
||||
inactiveColorPrimary: Colors.black38,
|
||||
routeAndNavigatorSettings: const RouteAndNavigatorSettings(
|
||||
initialRoute: "/",
|
||||
),
|
||||
@@ -71,17 +71,21 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
screens: _buildScreens(),
|
||||
items: _navBarsItems(),
|
||||
confineInSafeArea: true,
|
||||
backgroundColor: Colors.white, // Default is Colors.white.
|
||||
backgroundColor:
|
||||
Theme.of(context).primaryColor, // Default is Colors.white.
|
||||
handleAndroidBackButtonPress: true, // Default is true.
|
||||
resizeToAvoidBottomInset:
|
||||
true, // This needs to be true if you want to move up the screen when keyboard appears. Default is true.
|
||||
stateManagement: true, // Default is true.
|
||||
hideNavigationBarWhenKeyboardShows:
|
||||
true, // Recommended to set 'resizeToAvoidBottomInset' as true while using this argument. Default is true.
|
||||
decoration: NavBarDecoration(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
colorBehindNavBar: Colors.white,
|
||||
),
|
||||
decoration: const NavBarDecoration(
|
||||
// border: Border(
|
||||
// top: BorderSide(width: 2.0, color: Colors.white),
|
||||
// ),
|
||||
// borderRadius: BorderRadius.circular(10.0),
|
||||
// colorBehindNavBar: Colors.white,
|
||||
),
|
||||
popAllScreensOnTapOfSelectedTab: true,
|
||||
popActionScreens: PopActionScreensType.all,
|
||||
itemAnimationProperties: const ItemAnimationProperties(
|
||||
|
@@ -1,6 +1,7 @@
|
||||
import 'package:firebase_core/firebase_core.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_stripe/flutter_stripe.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
import 'firebase_options.dart';
|
||||
import 'auth_gate.dart';
|
||||
@@ -19,8 +20,17 @@ class MyApp extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
theme: ThemeData(
|
||||
primarySwatch: CustomMaterialColor(200, 61, 61).mdColor,
|
||||
),
|
||||
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))))),
|
||||
home: const AuthGate(),
|
||||
);
|
||||
}
|
||||
|
@@ -6,7 +6,8 @@
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
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;
|
||||
@@ -84,7 +85,9 @@ class _EmailVerificationBadgeState extends State<EmailVerificationBadge> {
|
||||
|
||||
@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();
|
||||
}
|
||||
|
||||
@@ -104,7 +107,10 @@ class _EmailVerificationBadgeState extends State<EmailVerificationBadge> {
|
||||
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) ...[
|
||||
@@ -134,7 +140,8 @@ class _EmailVerificationBadgeState extends State<EmailVerificationBadge> {
|
||||
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,
|
||||
@@ -206,11 +213,15 @@ class ProfileScreenCustom extends MultiProviderScreen {
|
||||
}
|
||||
|
||||
List<ProviderConfiguration> getLinkedProviders(User user) {
|
||||
return providerConfigs.where((config) => user.isProviderLinked(config.providerId)).toList();
|
||||
return providerConfigs
|
||||
.where((config) => user.isProviderLinked(config.providerId))
|
||||
.toList();
|
||||
}
|
||||
|
||||
List<ProviderConfiguration> getAvailableProviders(User user) {
|
||||
return providerConfigs.where((config) => !user.isProviderLinked(config.providerId)).toList();
|
||||
return providerConfigs
|
||||
.where((config) => !user.isProviderLinked(config.providerId))
|
||||
.toList();
|
||||
}
|
||||
|
||||
@override
|
||||
|
@@ -38,7 +38,7 @@ class _SellScreenState extends State<SellScreen> {
|
||||
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<SellScreen> {
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
children: const [
|
||||
Icon(Icons.access_time, color: Colors.red),
|
||||
Text('Time'),
|
||||
],
|
||||
@@ -94,10 +94,19 @@ class _SellScreenState extends State<SellScreen> {
|
||||
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<SellScreen> {
|
||||
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<SellScreen> {
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
children: const [
|
||||
Icon(Icons.attach_money, color: Colors.red),
|
||||
Text('Cost'),
|
||||
],
|
||||
@@ -154,7 +172,8 @@ class _SellScreenState extends State<SellScreen> {
|
||||
ElevatedButton(
|
||||
onPressed: () {},
|
||||
style: ButtonStyle(
|
||||
backgroundColor: MaterialStateColor.resolveWith((states) => Colors.blue),
|
||||
backgroundColor:
|
||||
MaterialStateColor.resolveWith((states) => Colors.blue),
|
||||
),
|
||||
child: const Text('Next'),
|
||||
),
|
||||
|
Reference in New Issue
Block a user