Half done with ui for sell

This commit is contained in:
NATHANIEL ENDICK
2023-02-25 21:46:56 -05:00
parent a0383a7854
commit 1c7a910918

View File

@@ -10,6 +10,7 @@ class SellScreen extends StatefulWidget {
class _SellScreenState extends State<SellScreen> {
@override
Widget build(BuildContext context) {
TimeOfDay _time = TimeOfDay.now();
return Scaffold(
appBar: AppBar(
title: const Text('Sell'),
@@ -19,9 +20,21 @@ class _SellScreenState extends State<SellScreen> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.store_mall_directory, color: Colors.red),
Expanded(
child: const Text('Place'),
const Text('Place'),
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);
});
},
),
LocationDropdown(),
Icon(Icons.access_time, color: Colors.red),
Expanded(
child: const Text('Time'),
@@ -35,3 +48,41 @@ class _SellScreenState extends State<SellScreen> {
);
}
}
const List<String> list = <String>[
'Brower',
'BDH',
'LDH',
'Neilson',
'Woody\'s'
];
class LocationDropdown extends StatefulWidget {
const LocationDropdown({super.key});
@override
State<LocationDropdown> createState() => _LocationDropdownState();
}
class _LocationDropdownState extends State<LocationDropdown> {
String dropdownValue = list.first;
@override
Widget build(BuildContext context) {
return DropdownButton<String>(
value: dropdownValue,
onChanged: (String? value) {
// This is called when the user selects an item.
setState(() {
dropdownValue = value!;
});
},
items: list.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
);
}
}