mirror of
https://github.com/SoPat712/RUSwipeShare.git
synced 2025-08-21 19:08:46 -04:00
seller page ui
This commit is contained in:
228
lib/sell.dart
228
lib/sell.dart
@@ -1,6 +1,7 @@
|
||||
// ignore_for_file: prefer_const_constructors
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:currency_text_input_formatter/currency_text_input_formatter.dart';
|
||||
import 'package:ruswipeshare/meetings.dart';
|
||||
|
||||
class SellScreen extends StatefulWidget {
|
||||
@@ -33,136 +34,125 @@ class _SellScreenState extends State<SellScreen> {
|
||||
Widget build(BuildContext context) {
|
||||
bool is24HoursFormat = MediaQuery.of(context).alwaysUse24HourFormat;
|
||||
return Scaffold(
|
||||
body: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: const [
|
||||
Icon(Icons.store_mall_directory, color: Colors.red),
|
||||
Text('Place'),
|
||||
],
|
||||
),
|
||||
ConstrainedBox(
|
||||
constraints: const BoxConstraints.expand(height: 250),
|
||||
child: ListView.builder(
|
||||
itemCount: values.length,
|
||||
itemBuilder: (context, index) => CheckboxListTile(
|
||||
title: Text(values.keys.elementAt(index)),
|
||||
value: values.values.elementAt(index),
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
values[values.keys.elementAt(index)] = value!;
|
||||
});
|
||||
},
|
||||
resizeToAvoidBottomInset: true,
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0, 20, 0, 0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: const [
|
||||
Icon(Icons.store_mall_directory, color: Colors.red),
|
||||
Text('Place'),
|
||||
],
|
||||
),
|
||||
ConstrainedBox(
|
||||
constraints: const BoxConstraints.expand(height: 250),
|
||||
child: ListView.builder(
|
||||
itemCount: values.length,
|
||||
itemBuilder: (context, index) => CheckboxListTile(
|
||||
title: Text(values.keys.elementAt(index)),
|
||||
value: values.values.elementAt(index),
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
values[values.keys.elementAt(index)] = value!;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: const [
|
||||
Icon(Icons.access_time, color: Colors.red),
|
||||
Text('Time'),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 100,
|
||||
child: Row(
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: const [
|
||||
Icon(Icons.access_time, color: Colors.red),
|
||||
Text('Time'),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 100,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
startTime,
|
||||
style: TextStyle(fontSize: 35),
|
||||
),
|
||||
Text(
|
||||
"to",
|
||||
style: TextStyle(fontSize: 20),
|
||||
),
|
||||
Text(
|
||||
endTime,
|
||||
style: TextStyle(fontSize: 35),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
startTime,
|
||||
style: TextStyle(fontSize: 35),
|
||||
ElevatedButton(
|
||||
onPressed: () async {
|
||||
final TimeOfDay? picked = await showTimePicker(
|
||||
context: context,
|
||||
initialTime: TimeOfDay.fromDateTime(startTimeTime),
|
||||
);
|
||||
if (picked != null && picked != TimeOfDay.fromDateTime(startTimeTime)) {
|
||||
setState(() {
|
||||
startTimeTime = DateTime.fromMicrosecondsSinceEpoch(picked.hour * 60 * 60 * 1000000 + picked.minute * 60 * 1000000, isUtc: true);
|
||||
startTime = startTimeTime.hour.toString() + ":" + startTimeTime.minute.toString() + ((is24HoursFormat) ? "" : ((startTimeTime.hour > 12) ? "PM" : "AM"));
|
||||
});
|
||||
}
|
||||
},
|
||||
child: const Text('Select Start Time'),
|
||||
),
|
||||
Text(
|
||||
"to",
|
||||
style: TextStyle(fontSize: 20),
|
||||
),
|
||||
Text(
|
||||
endTime,
|
||||
style: TextStyle(fontSize: 35),
|
||||
ElevatedButton(
|
||||
onPressed: () async {
|
||||
final TimeOfDay? picked = await showTimePicker(
|
||||
context: context,
|
||||
initialTime: TimeOfDay.fromDateTime(endTimeTime),
|
||||
);
|
||||
if (picked != null && picked != TimeOfDay.fromDateTime(endTimeTime)) {
|
||||
setState(() {
|
||||
endTimeTime = DateTime.fromMicrosecondsSinceEpoch(picked.hour * 60 * 60 * 1000000 + picked.minute * 60 * 1000000, isUtc: true);
|
||||
endTime = endTimeTime.hour.toString() + ":" + endTimeTime.minute.toString() + ((is24HoursFormat) ? "" : ((endTimeTime.hour > 12) ? "PM" : "AM"));
|
||||
});
|
||||
}
|
||||
},
|
||||
child: const Text('Select End Time'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
ElevatedButton(
|
||||
onPressed: () async {
|
||||
final TimeOfDay? picked = await showTimePicker(
|
||||
context: context,
|
||||
initialTime: TimeOfDay.fromDateTime(startTimeTime),
|
||||
);
|
||||
if (picked != null &&
|
||||
picked != TimeOfDay.fromDateTime(startTimeTime)) {
|
||||
setState(() {
|
||||
startTimeTime = DateTime.fromMicrosecondsSinceEpoch(
|
||||
picked.hour * 60 * 60 * 1000000 +
|
||||
picked.minute * 60 * 1000000,
|
||||
isUtc: true);
|
||||
startTime = startTimeTime.hour.toString() +
|
||||
":" +
|
||||
startTimeTime.minute.toString() +
|
||||
((is24HoursFormat)
|
||||
? ""
|
||||
: ((startTimeTime.hour > 12) ? "PM" : "AM"));
|
||||
});
|
||||
}
|
||||
},
|
||||
child: const Text('Select Start Time'),
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: () async {
|
||||
final TimeOfDay? picked = await showTimePicker(
|
||||
context: context,
|
||||
initialTime: TimeOfDay.fromDateTime(endTimeTime),
|
||||
);
|
||||
if (picked != null &&
|
||||
picked != TimeOfDay.fromDateTime(endTimeTime)) {
|
||||
setState(() {
|
||||
endTimeTime = DateTime.fromMicrosecondsSinceEpoch(
|
||||
picked.hour * 60 * 60 * 1000000 +
|
||||
picked.minute * 60 * 1000000,
|
||||
isUtc: true);
|
||||
endTime = endTimeTime.hour.toString() +
|
||||
":" +
|
||||
endTimeTime.minute.toString() +
|
||||
((is24HoursFormat)
|
||||
? ""
|
||||
: ((endTimeTime.hour > 12) ? "PM" : "AM"));
|
||||
});
|
||||
}
|
||||
},
|
||||
child: const Text('Select End Time'),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: const [
|
||||
Icon(Icons.attach_money, color: Colors.red),
|
||||
Text('Cost'),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
width: 150,
|
||||
child: TextField(
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
hintText: 'Max price',
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: const [
|
||||
Icon(Icons.attach_money, color: Colors.red),
|
||||
Text('Cost'),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
width: 150,
|
||||
child: TextField(
|
||||
keyboardType: TextInputType.number,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: Colors.white, fontSize: 30),
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
hintText: 'Price',
|
||||
hintStyle: TextStyle(color: Colors.white24, fontSize: 30),
|
||||
),
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: () {},
|
||||
style: ButtonStyle(
|
||||
backgroundColor:
|
||||
MaterialStateColor.resolveWith((states) => Colors.blue),
|
||||
),
|
||||
child: const Text('Next'),
|
||||
),
|
||||
],
|
||||
ElevatedButton(
|
||||
onPressed: () {},
|
||||
style: ButtonStyle(
|
||||
backgroundColor: MaterialStateColor.resolveWith((states) => Colors.blue),
|
||||
),
|
||||
child: const Text('Submit Sell Request'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user