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> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
TimeOfDay _time = TimeOfDay.now();
|
||||
return Scaffold(
|
||||
body: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
onPressed: () {}, child: Text("Choose A Different Location")),
|
||||
),
|
||||
const Expanded(child: ContentDisplay()),
|
||||
],
|
||||
),
|
||||
);
|
||||
return ContentDisplay();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,12 +161,16 @@ class ContentDisplay extends StatefulWidget {
|
||||
class _CampusGridViewState extends State<ContentDisplay> {
|
||||
CampusState _currentState = CampusState.campuses;
|
||||
List<String> _diningOptions = List.empty();
|
||||
String selectedLocation = "";
|
||||
String _selectedLocation = "";
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
switch (_currentState) {
|
||||
case CampusState.campuses:
|
||||
return Center(
|
||||
return Scaffold(
|
||||
body: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: GridView.count(
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
@@ -286,9 +278,27 @@ class _CampusGridViewState extends State<ContentDisplay> {
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
);
|
||||
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,
|
||||
padding: EdgeInsets.zero,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
@@ -296,7 +306,7 @@ class _CampusGridViewState extends State<ContentDisplay> {
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_currentState = CampusState.offers;
|
||||
selectedLocation = _diningOptions.elementAt(index);
|
||||
_selectedLocation = _diningOptions.elementAt(index);
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
@@ -324,10 +334,34 @@ class _CampusGridViewState extends State<ContentDisplay> {
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
));
|
||||
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,
|
||||
padding: EdgeInsets.zero,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
@@ -370,12 +404,15 @@ class _CampusGridViewState extends State<ContentDisplay> {
|
||||
flex: 7,
|
||||
child: Container(
|
||||
color: Colors.red,
|
||||
margin: EdgeInsets.only(top: 4, left: 4, bottom: 4),
|
||||
margin:
|
||||
EdgeInsets.only(top: 4, left: 4, bottom: 4),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
entries[index % entries.length],
|
||||
entries[index % entries.length] +
|
||||
" " +
|
||||
_selectedLocation,
|
||||
textAlign: TextAlign.start,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(fontSize: 24),
|
||||
@@ -391,7 +428,8 @@ class _CampusGridViewState extends State<ContentDisplay> {
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.end,
|
||||
children: const [
|
||||
Text(
|
||||
'88:88PM - 88:88PM',
|
||||
@@ -421,7 +459,10 @@ class _CampusGridViewState extends State<ContentDisplay> {
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
}),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user