add pickups
This commit is contained in:
@@ -51,7 +51,7 @@ class MainModel extends ChangeNotifier {
|
||||
phoneNumber: '+95 9 444444444',
|
||||
fcsID: 'FCS-0203-390-2',
|
||||
shippingAddress:
|
||||
'154-19 64th Ave.Flushing, NY 11367 TEL. +1 (929) 215-2247',
|
||||
'154-19 64th Ave.Flushing, \nNY 11367 \nTEL. +1 (929) 215-2247',
|
||||
deliveryAddress: '39 42th St. Kyaut Ta Thar Township Yangon');
|
||||
|
||||
Setting setting;
|
||||
@@ -70,6 +70,23 @@ class MainModel extends ChangeNotifier {
|
||||
// this.isOnline = _isOnline;
|
||||
// notifyListeners();
|
||||
// });
|
||||
_loadFcs();
|
||||
}
|
||||
|
||||
_loadFcs() async {
|
||||
user = await SharedPref.getUser();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
saveUser(String pin, String phone) {
|
||||
if (pin == "000000") {
|
||||
user = User(name: "Owner", phoneNumber: phone);
|
||||
SharedPref.saveUser(user);
|
||||
} else {
|
||||
user = User(name: "Customer", phoneNumber: phone);
|
||||
SharedPref.saveUser(user);
|
||||
}
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
resetPinTimer() {
|
||||
@@ -83,7 +100,7 @@ class MainModel extends ChangeNotifier {
|
||||
}
|
||||
|
||||
bool isLogin() {
|
||||
return true;
|
||||
return this.user != null;
|
||||
}
|
||||
|
||||
bool hasEmail() {
|
||||
@@ -138,7 +155,6 @@ class MainModel extends ChangeNotifier {
|
||||
|
||||
void addModel(BaseModel model) {
|
||||
models.add(model);
|
||||
model.mainModel = this;
|
||||
}
|
||||
|
||||
void _initUser(User user) {
|
||||
@@ -292,6 +308,10 @@ class MainModel extends ChangeNotifier {
|
||||
}
|
||||
|
||||
Future<void> logout() async {
|
||||
this.user = null;
|
||||
notifyListeners();
|
||||
return;
|
||||
|
||||
if (this.userListener != null) {
|
||||
await this.userListener.cancel();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user