Skip to content

Commit

Permalink
task: store details adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
Atuoha committed Oct 8, 2022
1 parent 8da2e2d commit 4963c45
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 18 deletions.
2 changes: 1 addition & 1 deletion lib/views/main/seller/edit_profile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ class _EditProfileState extends State<EditProfile> {

// TODO: persisting new details to firebase
_auth.currentUser!.updateEmail(_emailController.text.trim());
firebase.collection('users').doc(userId).set({
firebase.collection('sellers').doc(userId).set({
"email": _emailController.text.trim(),
"fullname": _fullnameController.text.trim(),
"phone": _phoneController.text.trim(),
Expand Down
70 changes: 53 additions & 17 deletions lib/views/main/store/store_details.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

import '../../../constants/colors.dart';
Expand All @@ -18,6 +19,16 @@ class StoreDetails extends StatefulWidget {
class _StoreDetailsState extends State<StoreDetails> {
void placeCall() {
// TODO: Implement placeCall
if (kDebugMode) {
print(widget.store['phone']);
}
}

void sendMail(){
// TODO: Implement sendMail
if (kDebugMode) {
print(widget.store['email']);
}
}

@override
Expand All @@ -38,9 +49,9 @@ class _StoreDetailsState extends State<StoreDetails> {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
store['phone'],
style: const TextStyle(
const Text(
'Contact us',
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
Expand All @@ -59,7 +70,30 @@ class _StoreDetailsState extends State<StoreDetails> {
color: Colors.white,
),
label: const Text(
'Place Call',
'Place call',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
),
),
),
),
Directionality(
textDirection: TextDirection.rtl,
child: ElevatedButton.icon(
style: ElevatedButton.styleFrom(
primary: primaryColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
),
onPressed: () => sendMail(),
icon: const Icon(
Icons.email,
color: Colors.white,
),
label: const Text(
'Send mail',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
Expand Down Expand Up @@ -111,19 +145,21 @@ class _StoreDetailsState extends State<StoreDetails> {
),
const SizedBox(height: 10),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 18.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
store['fullname'],
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 30,
),
),
Text(store['address']),
])),
padding: const EdgeInsets.symmetric(horizontal: 18.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
store['fullname'],
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 30,
),
),
Text(store['address']),
],
),
),
SizedBox(
height: size.height / 1,
child: ProductStreamBuilder(
Expand Down
Binary file added store.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added stores.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4963c45

Please sign in to comment.