mirror of
https://github.com/SoPat712/RUSwipeShare.git
synced 2025-08-21 19:08:46 -04:00
buy fixes
This commit is contained in:
107
lib/buy.dart
107
lib/buy.dart
@@ -44,20 +44,10 @@ final List<List<String>> eatingLocations = [
|
|||||||
'Kilmer\'s Market',
|
'Kilmer\'s Market',
|
||||||
'Sbarro\'s',
|
'Sbarro\'s',
|
||||||
],
|
],
|
||||||
<String>[
|
<String>['Neilson Dining Hall', 'Cook Cafe', 'Douglass Cafe', 'Harvest INFH', 'Red Pine Pizza']
|
||||||
'Neilson Dining Hall',
|
|
||||||
'Cook Cafe',
|
|
||||||
'Douglass Cafe',
|
|
||||||
'Harvest INFH',
|
|
||||||
'Red Pine Pizza'
|
|
||||||
]
|
|
||||||
];
|
];
|
||||||
final List<int> colorCodes = <int>[600, 500, 100];
|
final List<int> colorCodes = <int>[600, 500, 100];
|
||||||
final List<String> timeBgAssets = <String>[
|
final List<String> timeBgAssets = <String>['assets/daytime_swipe.jpg', 'assets/afternoon_swipe.jpg', 'assets/nighttime_swipe.jpg'];
|
||||||
'assets/daytime_swipe.jpg',
|
|
||||||
'assets/afternoon_swipe.jpg',
|
|
||||||
'assets/nighttime_swipe.jpg'
|
|
||||||
];
|
|
||||||
|
|
||||||
class BuyScreen extends StatefulWidget {
|
class BuyScreen extends StatefulWidget {
|
||||||
const BuyScreen({Key? key}) : super(key: key);
|
const BuyScreen({Key? key}) : super(key: key);
|
||||||
@@ -96,8 +86,7 @@ class _BuyScreenState extends State<BuyScreen> {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius:
|
borderRadius: const BorderRadius.all(Radius.circular(25)),
|
||||||
const BorderRadius.all(Radius.circular(25)),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
@@ -127,8 +116,7 @@ class _BuyScreenState extends State<BuyScreen> {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius:
|
borderRadius: const BorderRadius.all(Radius.circular(25)),
|
||||||
const BorderRadius.all(Radius.circular(25)),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
@@ -158,8 +146,7 @@ class _BuyScreenState extends State<BuyScreen> {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius:
|
borderRadius: const BorderRadius.all(Radius.circular(25)),
|
||||||
const BorderRadius.all(Radius.circular(25)),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
@@ -189,8 +176,7 @@ class _BuyScreenState extends State<BuyScreen> {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius:
|
borderRadius: const BorderRadius.all(Radius.circular(25)),
|
||||||
const BorderRadius.all(Radius.circular(25)),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
@@ -222,6 +208,7 @@ class _BuyScreenState extends State<BuyScreen> {
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Column(children: [
|
body: Column(children: [
|
||||||
Container(
|
Container(
|
||||||
|
padding: EdgeInsets.fromLTRB(0, 30, 0, 0),
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
@@ -235,16 +222,11 @@ class _BuyScreenState extends State<BuyScreen> {
|
|||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
physics: const BouncingScrollPhysics(),
|
physics: const BouncingScrollPhysics(),
|
||||||
itemCount: _diningOptions.length,
|
itemCount: _diningOptions.length,
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
return Container(
|
return Container(
|
||||||
margin: const EdgeInsets.all(4),
|
margin: const EdgeInsets.all(4),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(border: Border.all(color: CustomMaterialColor(240, 240, 240).mdColor, width: 2), borderRadius: const BorderRadius.all(Radius.circular(10))),
|
||||||
border: Border.all(
|
|
||||||
color: CustomMaterialColor(240, 240, 240).mdColor,
|
|
||||||
width: 2),
|
|
||||||
borderRadius:
|
|
||||||
const BorderRadius.all(Radius.circular(40))),
|
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
@@ -253,24 +235,20 @@ class _BuyScreenState extends State<BuyScreen> {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius:
|
borderRadius: const BorderRadius.all(Radius.circular(10)),
|
||||||
const BorderRadius.all(Radius.circular(40)),
|
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 80,
|
height: 120,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
image: AssetImage("assets/" +
|
image: AssetImage("assets/" + nameToAsset[_diningOptions.elementAt(index)]!),
|
||||||
nameToAsset[
|
|
||||||
_diningOptions.elementAt(index)]!),
|
|
||||||
)),
|
)),
|
||||||
child: BackdropFilter(
|
child: BackdropFilter(
|
||||||
filter: ImageFilter.blur(sigmaX: 3, sigmaY: 3),
|
filter: ImageFilter.blur(sigmaX: 3, sigmaY: 3),
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.only(right: 40),
|
padding: const EdgeInsets.only(right: 40),
|
||||||
alignment: Alignment.bottomRight,
|
alignment: Alignment.bottomRight,
|
||||||
margin: const EdgeInsets.only(
|
margin: const EdgeInsets.only(top: 4, left: 20, bottom: 4),
|
||||||
top: 4, left: 20, bottom: 4),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
_diningOptions[index],
|
_diningOptions[index],
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
@@ -290,7 +268,9 @@ class _BuyScreenState extends State<BuyScreen> {
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [
|
Padding(
|
||||||
|
padding: EdgeInsets.fromLTRB(0, 30, 0, 0),
|
||||||
|
child: Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [
|
||||||
Flexible(
|
Flexible(
|
||||||
flex: 8,
|
flex: 8,
|
||||||
fit: FlexFit.tight,
|
fit: FlexFit.tight,
|
||||||
@@ -302,33 +282,27 @@ class _BuyScreenState extends State<BuyScreen> {
|
|||||||
},
|
},
|
||||||
child: const Text("Choose A Different Location")),
|
child: const Text("Choose A Different Location")),
|
||||||
),
|
),
|
||||||
Flexible(
|
Flexible(flex: 2, child: ElevatedButton(onPressed: () {}, child: const Icon(Icons.filter_list)))
|
||||||
flex: 2,
|
|
||||||
child: ElevatedButton(
|
|
||||||
onPressed: () {}, child: const Icon(Icons.filter_list)))
|
|
||||||
]),
|
]),
|
||||||
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
physics: const BouncingScrollPhysics(),
|
physics: const BouncingScrollPhysics(),
|
||||||
itemCount: 30,
|
itemCount: 30,
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) => Dialog(
|
builder: (BuildContext context) => Dialog(
|
||||||
backgroundColor:
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
Theme.of(context).scaffoldBackgroundColor,
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(20))),
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.all(
|
|
||||||
Radius.circular(20))),
|
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
MainAxisAlignment.center,
|
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const Text('Transaction Details'),
|
const Text('Transaction Details'),
|
||||||
const SizedBox(height: 15),
|
const SizedBox(height: 15),
|
||||||
@@ -378,23 +352,15 @@ class _BuyScreenState extends State<BuyScreen> {
|
|||||||
// );
|
// );
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(border: Border.all(color: CustomMaterialColor(240, 240, 240).mdColor, width: 2), borderRadius: const BorderRadius.all(Radius.circular(10))),
|
||||||
border: Border.all(
|
|
||||||
color: CustomMaterialColor(240, 240, 240)
|
|
||||||
.mdColor,
|
|
||||||
width: 2),
|
|
||||||
borderRadius:
|
|
||||||
const BorderRadius.all(Radius.circular(40))),
|
|
||||||
margin: const EdgeInsets.all(4),
|
margin: const EdgeInsets.all(4),
|
||||||
height: 80,
|
height: 120,
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius:
|
borderRadius: const BorderRadius.all(Radius.circular(10)),
|
||||||
const BorderRadius.all(Radius.circular(40)),
|
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
colorFilter: const ColorFilter.mode(
|
colorFilter: const ColorFilter.mode(Colors.black26, BlendMode.darken),
|
||||||
Colors.black26, BlendMode.darken),
|
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
image: AssetImage(timeBgAssets[index % 3]),
|
image: AssetImage(timeBgAssets[index % 3]),
|
||||||
)),
|
)),
|
||||||
@@ -407,18 +373,15 @@ class _BuyScreenState extends State<BuyScreen> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.only(left: 20),
|
padding: EdgeInsets.only(left: 20),
|
||||||
// color: Colors.red,
|
// color: Colors.red,
|
||||||
margin: const EdgeInsets.only(
|
margin: const EdgeInsets.only(top: 4, left: 4, bottom: 4),
|
||||||
top: 4, left: 4, bottom: 4),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment:
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
CrossAxisAlignment.start,
|
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
entries[index % entries.length],
|
entries[index % entries.length],
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style:
|
style: const TextStyle(fontSize: 20),
|
||||||
const TextStyle(fontSize: 20),
|
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
children: const [
|
children: const [
|
||||||
@@ -426,22 +389,18 @@ class _BuyScreenState extends State<BuyScreen> {
|
|||||||
Icon(Icons.star, size: 16),
|
Icon(Icons.star, size: 16),
|
||||||
Icon(Icons.star, size: 16),
|
Icon(Icons.star, size: 16),
|
||||||
Icon(Icons.star_half, size: 16),
|
Icon(Icons.star_half, size: 16),
|
||||||
Icon(Icons.star_border,
|
Icon(Icons.star_border, size: 16),
|
||||||
size: 16),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
MainAxisAlignment.end,
|
|
||||||
children: const [
|
children: const [
|
||||||
Text(
|
Text(
|
||||||
'88:88PM - 88:88PM',
|
'88:88PM - 88:88PM',
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
overflow:
|
overflow: TextOverflow.ellipsis,
|
||||||
TextOverflow.ellipsis,
|
style: TextStyle(fontSize: 16),
|
||||||
style:
|
|
||||||
TextStyle(fontSize: 16),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
Reference in New Issue
Block a user