update
This commit is contained in:
parent
478b8e70f1
commit
55de28532f
14 changed files with 149 additions and 115 deletions
|
|
@ -15,7 +15,7 @@ class CustomerCartPage extends StatelessWidget {
|
|||
body: CustomerPagebackgroundWidget(
|
||||
child: Column(
|
||||
children: [
|
||||
const Gap(96),
|
||||
const Gap(68),
|
||||
const CustomerTitleWidget(),
|
||||
const Gap(32),
|
||||
const TextWidget(text: 'My Cart'),
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class _CustomerMainPageState extends State<CustomerMainPage> {
|
|||
body: CustomerPagebackgroundWidget(
|
||||
child: Column(
|
||||
children: [
|
||||
const Gap(96),
|
||||
const Gap(68),
|
||||
const CustomerTitleWidget(),
|
||||
const Gap(16),
|
||||
const Row(
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class _CustomerProfilePageState extends State<CustomerProfilePage> {
|
|||
children: [
|
||||
Column(
|
||||
children: [
|
||||
const Gap(96),
|
||||
const Gap(68),
|
||||
const CustomerTitleWidget(),
|
||||
const Gap(32),
|
||||
const TextWidget(text: 'My Profile'),
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
|
||||
void autoRun() async {
|
||||
await _getAllStocks();
|
||||
await _getAllMedicines();
|
||||
// await _getAllMedicines();
|
||||
await _getURL();
|
||||
}
|
||||
|
||||
|
|
@ -92,12 +92,12 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
|
||||
return Scaffold(
|
||||
body: CustomerPagebackgroundWidget(
|
||||
height: MediaQuery.of(context).size.height + 600,
|
||||
height: MediaQuery.of(context).size.height + 800,
|
||||
child: Column(
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
const Gap(96),
|
||||
const Gap(68),
|
||||
const CustomerTitleWidget(),
|
||||
const Gap(8),
|
||||
Container(
|
||||
|
|
@ -145,24 +145,24 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
child: Row(
|
||||
children: [
|
||||
if (imageUrl.isEmpty)
|
||||
Row(
|
||||
const Row(
|
||||
children: [
|
||||
ItemCardWidget(
|
||||
imageUrl: imageUrl,
|
||||
imageUrl: 'imageUrl',
|
||||
text: 'item[medicine_name]',
|
||||
price: 123,
|
||||
quantity: 123,
|
||||
isLoading: true,
|
||||
),
|
||||
ItemCardWidget(
|
||||
imageUrl: imageUrl,
|
||||
imageUrl: 'imageUrl',
|
||||
text: 'item[medicine_name]',
|
||||
price: 123,
|
||||
quantity: 123,
|
||||
isLoading: true,
|
||||
),
|
||||
ItemCardWidget(
|
||||
imageUrl: imageUrl,
|
||||
imageUrl: 'imageUrl',
|
||||
text: 'item[medicine_name]',
|
||||
price: 123,
|
||||
quantity: 123,
|
||||
|
|
@ -192,7 +192,7 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
imageUrl: imageUrl,
|
||||
text: 'sample',
|
||||
price: 500,
|
||||
quantity: 15,
|
||||
quantity: 0,
|
||||
isLoading: imageUrl.isEmpty,
|
||||
),
|
||||
ItemCardWidget(
|
||||
|
|
@ -271,6 +271,36 @@ class _CustomerSearchPageState extends State<CustomerSearchPage> {
|
|||
),
|
||||
],
|
||||
)),
|
||||
const Gap(16),
|
||||
const IndicatorWidget(text: 'For Infection and Irritations'),
|
||||
const Gap(8),
|
||||
SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Row(
|
||||
children: [
|
||||
ItemCardWidget(
|
||||
imageUrl: imageUrl,
|
||||
text: 'sample',
|
||||
price: 500,
|
||||
quantity: 15,
|
||||
isLoading: imageUrl.isEmpty,
|
||||
),
|
||||
ItemCardWidget(
|
||||
imageUrl: imageUrl,
|
||||
text: 'sample',
|
||||
price: 500,
|
||||
quantity: 15,
|
||||
isLoading: imageUrl.isEmpty,
|
||||
),
|
||||
ItemCardWidget(
|
||||
imageUrl: imageUrl,
|
||||
text: 'sample',
|
||||
price: 500,
|
||||
quantity: 15,
|
||||
isLoading: imageUrl.isEmpty,
|
||||
),
|
||||
],
|
||||
)),
|
||||
],
|
||||
)
|
||||
],
|
||||
|
|
|
|||
|
|
@ -8,8 +8,10 @@ class Stocks {
|
|||
List<Map<String, dynamic>> stockData = [];
|
||||
|
||||
try {
|
||||
final data =
|
||||
await _supabase.from('stocks').select('ref_medicines(medicine_name), expiration_date, quantity, price');
|
||||
final data = await _supabase
|
||||
.from('stocks')
|
||||
.select('ref_medicines(medicine_name), expiration_date, quantity, price')
|
||||
.order('ref_medicines(medicine_name)', ascending: true);
|
||||
|
||||
for (var item in data) {
|
||||
stockData.add({
|
||||
|
|
|
|||
|
|
@ -56,21 +56,23 @@ class ItemCardWidget extends StatelessWidget {
|
|||
TextWidget(
|
||||
text: text,
|
||||
size: 12,
|
||||
color: Colors.black,
|
||||
color: const Color.fromRGBO(0, 0, 0, 1),
|
||||
)
|
||||
],
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
padding: EdgeInsets.symmetric(vertical: 4, horizontal: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: quantity > 20
|
||||
? const Color.fromRGBO(254, 160, 44, 1)
|
||||
: const Color.fromRGBO(136, 136, 136, 1),
|
||||
color: quantity == 0
|
||||
? const Color.fromRGBO(162, 55, 41, 1)
|
||||
: quantity > 20
|
||||
? const Color.fromRGBO(246, 200, 99, 1)
|
||||
: const Color.fromRGBO(136, 136, 136, 1),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
border: Border.all(color: const Color.fromRGBO(217, 217, 217, 1)),
|
||||
),
|
||||
child: TextWidget(
|
||||
text: quantity.toStringAsFixed(0),
|
||||
text: quantity == 0 ? 'no stock' : quantity.toStringAsFixed(0),
|
||||
size: 12,
|
||||
color:
|
||||
quantity > 20 ? const Color.fromRGBO(0, 0, 0, 1) : const Color.fromRGBO(255, 255, 255, 1),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue