mirror of
https://github.com/SoPat712/RUSwipeShare.git
synced 2025-08-21 19:08:46 -04:00
holy fuck its future
This commit is contained in:
325
lib/buy.dart
325
lib/buy.dart
@@ -2,6 +2,9 @@ import 'dart:ui';
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:ruswipeshare/main.dart';
|
import 'package:ruswipeshare/main.dart';
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
|
import 'meetings.dart';
|
||||||
|
|
||||||
enum CampusState { campuses, list_options, offers }
|
enum CampusState { campuses, list_options, offers }
|
||||||
|
|
||||||
@@ -64,6 +67,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) {
|
||||||
@@ -348,157 +353,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();
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
|
Reference in New Issue
Block a user