mirror of
https://github.com/SoPat712/RUSwipeShare.git
synced 2025-08-21 19:08:46 -04:00
Fixed some weird scrolling stuff, buy nav done
This commit is contained in:
89
lib/buy.dart
89
lib/buy.dart
@@ -16,19 +16,7 @@ class BuyScreen extends StatefulWidget {
|
|||||||
class _BuyScreenState extends State<BuyScreen> {
|
class _BuyScreenState extends State<BuyScreen> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
TimeOfDay _time = TimeOfDay.now();
|
return ContentDisplay();
|
||||||
return Scaffold(
|
|
||||||
body: Column(
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
width: double.infinity,
|
|
||||||
child: ElevatedButton(
|
|
||||||
onPressed: () {}, child: Text("Choose A Different Location")),
|
|
||||||
),
|
|
||||||
const Expanded(child: ContentDisplay()),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,12 +161,16 @@ class ContentDisplay extends StatefulWidget {
|
|||||||
class _CampusGridViewState extends State<ContentDisplay> {
|
class _CampusGridViewState extends State<ContentDisplay> {
|
||||||
CampusState _currentState = CampusState.campuses;
|
CampusState _currentState = CampusState.campuses;
|
||||||
List<String> _diningOptions = List.empty();
|
List<String> _diningOptions = List.empty();
|
||||||
String selectedLocation = "";
|
String _selectedLocation = "";
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
switch (_currentState) {
|
switch (_currentState) {
|
||||||
case CampusState.campuses:
|
case CampusState.campuses:
|
||||||
return Center(
|
return Scaffold(
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Center(
|
||||||
child: GridView.count(
|
child: GridView.count(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
physics: NeverScrollableScrollPhysics(),
|
physics: NeverScrollableScrollPhysics(),
|
||||||
@@ -286,9 +278,27 @@ class _CampusGridViewState extends State<ContentDisplay> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
case CampusState.list_options:
|
case CampusState.list_options:
|
||||||
return ListView.builder(
|
return Scaffold(
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: double.infinity,
|
||||||
|
child: ElevatedButton(
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
_currentState = CampusState.campuses;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: Text("Choose A Different Location")),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: ListView.builder(
|
||||||
|
physics: BouncingScrollPhysics(),
|
||||||
itemCount: _diningOptions.length,
|
itemCount: _diningOptions.length,
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
@@ -296,7 +306,7 @@ class _CampusGridViewState extends State<ContentDisplay> {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
_currentState = CampusState.offers;
|
_currentState = CampusState.offers;
|
||||||
selectedLocation = _diningOptions.elementAt(index);
|
_selectedLocation = _diningOptions.elementAt(index);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
@@ -324,10 +334,34 @@ class _CampusGridViewState extends State<ContentDisplay> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
));
|
||||||
case CampusState.offers:
|
case CampusState.offers:
|
||||||
return ListView.builder(
|
return 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: BouncingScrollPhysics(),
|
||||||
itemCount: 30,
|
itemCount: 30,
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
@@ -370,12 +404,15 @@ class _CampusGridViewState extends State<ContentDisplay> {
|
|||||||
flex: 7,
|
flex: 7,
|
||||||
child: Container(
|
child: Container(
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
margin: EdgeInsets.only(top: 4, left: 4, bottom: 4),
|
margin:
|
||||||
|
EdgeInsets.only(top: 4, left: 4, bottom: 4),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
entries[index % entries.length],
|
entries[index % entries.length] +
|
||||||
|
" " +
|
||||||
|
_selectedLocation,
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: const TextStyle(fontSize: 24),
|
style: const TextStyle(fontSize: 24),
|
||||||
@@ -391,7 +428,8 @@ class _CampusGridViewState extends State<ContentDisplay> {
|
|||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.end,
|
||||||
children: const [
|
children: const [
|
||||||
Text(
|
Text(
|
||||||
'88:88PM - 88:88PM',
|
'88:88PM - 88:88PM',
|
||||||
@@ -421,7 +459,10 @@ class _CampusGridViewState extends State<ContentDisplay> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
}),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user