seller page ui

This commit is contained in:
2023-02-26 12:44:42 -05:00
parent d053a0bdaf
commit 5c20dfa055
4 changed files with 123 additions and 122 deletions

View File

@@ -1,7 +1,6 @@
import 'package:firebase_auth/firebase_auth.dart'; import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutterfire_ui/auth.dart'; import 'package:flutterfire_ui/auth.dart';
import 'package:firebase_database/firebase_database.dart';
import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:cloud_firestore/cloud_firestore.dart';
import 'home.dart'; import 'home.dart';

View File

@@ -1,6 +1,7 @@
// ignore_for_file: prefer_const_constructors // ignore_for_file: prefer_const_constructors
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:currency_text_input_formatter/currency_text_input_formatter.dart';
import 'package:ruswipeshare/meetings.dart'; import 'package:ruswipeshare/meetings.dart';
class SellScreen extends StatefulWidget { class SellScreen extends StatefulWidget {
@@ -33,136 +34,125 @@ class _SellScreenState extends State<SellScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
bool is24HoursFormat = MediaQuery.of(context).alwaysUse24HourFormat; bool is24HoursFormat = MediaQuery.of(context).alwaysUse24HourFormat;
return Scaffold( return Scaffold(
body: Column( resizeToAvoidBottomInset: true,
mainAxisAlignment: MainAxisAlignment.spaceEvenly, body: Padding(
children: [ padding: const EdgeInsets.fromLTRB(0, 20, 0, 0),
Row( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: const [ children: [
Icon(Icons.store_mall_directory, color: Colors.red), Row(
Text('Place'), mainAxisAlignment: MainAxisAlignment.center,
], children: const [
), Icon(Icons.store_mall_directory, color: Colors.red),
ConstrainedBox( Text('Place'),
constraints: const BoxConstraints.expand(height: 250), ],
child: ListView.builder( ),
itemCount: values.length, ConstrainedBox(
itemBuilder: (context, index) => CheckboxListTile( constraints: const BoxConstraints.expand(height: 250),
title: Text(values.keys.elementAt(index)), child: ListView.builder(
value: values.values.elementAt(index), itemCount: values.length,
onChanged: (bool? value) { itemBuilder: (context, index) => CheckboxListTile(
setState(() { title: Text(values.keys.elementAt(index)),
values[values.keys.elementAt(index)] = value!; value: values.values.elementAt(index),
}); onChanged: (bool? value) {
}, setState(() {
values[values.keys.elementAt(index)] = value!;
});
},
),
), ),
), ),
), Row(
Row( mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, children: const [
children: const [ Icon(Icons.access_time, color: Colors.red),
Icon(Icons.access_time, color: Colors.red), Text('Time'),
Text('Time'), ],
], ),
), SizedBox(
SizedBox( height: 100,
height: 100, child: Row(
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, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
Text( ElevatedButton(
startTime, onPressed: () async {
style: TextStyle(fontSize: 35), 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( ElevatedButton(
"to", onPressed: () async {
style: TextStyle(fontSize: 20), final TimeOfDay? picked = await showTimePicker(
), context: context,
Text( initialTime: TimeOfDay.fromDateTime(endTimeTime),
endTime, );
style: TextStyle(fontSize: 35), 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(
Row( mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: const [
children: [ Icon(Icons.attach_money, color: Colors.red),
ElevatedButton( Text('Cost'),
onPressed: () async { ],
final TimeOfDay? picked = await showTimePicker( ),
context: context, SizedBox(
initialTime: TimeOfDay.fromDateTime(startTimeTime), width: 150,
); child: TextField(
if (picked != null && keyboardType: TextInputType.number,
picked != TimeOfDay.fromDateTime(startTimeTime)) { textAlign: TextAlign.center,
setState(() { style: TextStyle(color: Colors.white, fontSize: 30),
startTimeTime = DateTime.fromMicrosecondsSinceEpoch( decoration: InputDecoration(
picked.hour * 60 * 60 * 1000000 + border: OutlineInputBorder(),
picked.minute * 60 * 1000000, hintText: 'Price',
isUtc: true); hintStyle: TextStyle(color: Colors.white24, fontSize: 30),
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',
),
), ),
), ),
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'),
),
],
),
), ),
); );
} }

View File

@@ -50,7 +50,7 @@ packages:
source: hosted source: hosted
version: "1.1.1" version: "1.1.1"
cloud_firestore: cloud_firestore:
dependency: transitive dependency: "direct main"
description: description:
name: cloud_firestore name: cloud_firestore
sha256: "65f148d9f5b4f389320abb45847120cf5e46094c1a8cbc64934ffc1e29688596" sha256: "65f148d9f5b4f389320abb45847120cf5e46094c1a8cbc64934ffc1e29688596"
@@ -105,6 +105,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.0.5" version: "1.0.5"
currency_text_input_formatter:
dependency: "direct main"
description:
name: currency_text_input_formatter
sha256: "9ff3299b37e73ba76a5a40c645ecd234acba7d54bc8e34f60aeedec2c39b0e6e"
url: "https://pub.dev"
source: hosted
version: "2.1.9"
desktop_webview_auth: desktop_webview_auth:
dependency: transitive dependency: transitive
description: description:
@@ -446,7 +454,7 @@ packages:
source: hosted source: hosted
version: "4.0.2" version: "4.0.2"
intl: intl:
dependency: transitive dependency: "direct overridden"
description: description:
name: intl name: intl
sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91" sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91"

View File

@@ -45,6 +45,8 @@ dependencies:
flutter_stripe: any flutter_stripe: any
material_dialogs: any material_dialogs: any
google_fonts: ^4.0.3 google_fonts: ^4.0.3
cloud_firestore: any
currency_text_input_formatter: ^2.1.9
http: any http: any
dev_dependencies: dev_dependencies:
@@ -98,3 +100,5 @@ flutter:
# #
# For details regarding fonts from package dependencies, # For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages # see https://flutter.dev/custom-fonts/#from-packages
dependency_overrides:
intl: 0.17.0