mirror of
https://github.com/SoPat712/RUSwipeShare.git
synced 2025-08-21 19:08:46 -04:00
Merge branch 'master' of github.com:SoPat712/RUSwipeShare
This commit is contained in:
43
lib/buy.dart
Normal file
43
lib/buy.dart
Normal file
@@ -0,0 +1,43 @@
|
||||
import 'package:flutter/material.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(
|
||||
appBar: AppBar(
|
||||
title: const Text('Sell'),
|
||||
automaticallyImplyLeading: false,
|
||||
),
|
||||
body: OffersListView(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
final List<String> entries = <String>['A', 'B', 'C'];
|
||||
final List<int> colorCodes = <int>[600, 500, 100];
|
||||
|
||||
class OffersListView extends StatelessWidget {
|
||||
const OffersListView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView.builder(
|
||||
padding: const EdgeInsets.all(8),
|
||||
itemCount: 30,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return Container(
|
||||
height: 80,
|
||||
color: Colors.amber[colorCodes[index % 3]],
|
||||
child: Center(child: Text('Entry ${entries[index % 3]}')),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:persistent_bottom_nav_bar/persistent_tab_view.dart';
|
||||
import 'package:ruswipeshare/buy.dart';
|
||||
import 'package:ruswipeshare/sell.dart';
|
||||
import 'profile_screen_custom.dart';
|
||||
import 'main_screen.dart';
|
||||
@@ -20,7 +21,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
}
|
||||
|
||||
List<Widget> _buildScreens() => [
|
||||
const MainScreen(),
|
||||
const BuyScreen(),
|
||||
const SellScreen(),
|
||||
const ProfileScreenCustom(),
|
||||
const MainScreen(),
|
||||
|
@@ -8,9 +8,25 @@ class SellScreen extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _SellScreenState extends State<SellScreen> {
|
||||
Map<String, bool> values = {
|
||||
'Busch Dining Hall': false,
|
||||
'Livingston Dining Hall': false,
|
||||
'Brower Dining Hall': false,
|
||||
'Neilson Dining Hall': false,
|
||||
'Cafe West': false,
|
||||
'Cook Cafe': false,
|
||||
'Douglass Cafe': false,
|
||||
'Harvest INFH': false,
|
||||
'Kilmer\'s Market': false,
|
||||
'College Ave Dining Hall': false,
|
||||
'Red Pine Pizza': false,
|
||||
'Rock Cafe': false,
|
||||
'Sbarro': false,
|
||||
'Woody\'s Cafe': false,
|
||||
};
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
TimeOfDay _time = TimeOfDay.now();
|
||||
TimeOfDay time = TimeOfDay.now();
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Sell'),
|
||||
@@ -21,24 +37,40 @@ class _SellScreenState extends State<SellScreen> {
|
||||
children: [
|
||||
Icon(Icons.store_mall_directory, color: Colors.red),
|
||||
const Text('Place'),
|
||||
ListTile(
|
||||
title: Text(_time.format(context)),
|
||||
onTap: () {
|
||||
Future<TimeOfDay?> selectedTime = showTimePicker(
|
||||
context: context,
|
||||
initialTime: _time,
|
||||
);
|
||||
ConstrainedBox(
|
||||
constraints: BoxConstraints.expand(height: 100),
|
||||
child: ListView(
|
||||
children: values.keys.map((String key) {
|
||||
return CheckboxListTile(
|
||||
title: Text(key),
|
||||
value: values[key],
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
selectedTime.then((value) => _time = value!);
|
||||
_time = TimeOfDay(hour: 10, minute: 00);
|
||||
values[key] = value!;
|
||||
});
|
||||
},
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
LocationDropdown(),
|
||||
Icon(Icons.access_time, color: Colors.red),
|
||||
Expanded(
|
||||
child: const Text('Time'),
|
||||
),
|
||||
ListTile(
|
||||
title: Text(time.format(context)),
|
||||
onTap: () {
|
||||
Future<TimeOfDay?> selectedTime = showTimePicker(
|
||||
context: context,
|
||||
initialTime: time,
|
||||
);
|
||||
setState(() {
|
||||
selectedTime.then((value) => time = value!);
|
||||
time = TimeOfDay(hour: 10, minute: 00);
|
||||
});
|
||||
},
|
||||
),
|
||||
Icon(Icons.attach_money, color: Colors.red),
|
||||
Expanded(
|
||||
child: const Text('Cost'),
|
||||
@@ -49,13 +81,7 @@ class _SellScreenState extends State<SellScreen> {
|
||||
}
|
||||
}
|
||||
|
||||
const List<String> list = <String>[
|
||||
'Brower',
|
||||
'BDH',
|
||||
'LDH',
|
||||
'Neilson',
|
||||
'Woody\'s'
|
||||
];
|
||||
const List<String> list = <String>['Brower', 'BDH', 'LDH', 'Neilson', 'Woody\'s'];
|
||||
|
||||
class LocationDropdown extends StatefulWidget {
|
||||
const LocationDropdown({super.key});
|
||||
|
Reference in New Issue
Block a user