fix profile

This commit is contained in:
Sai Naw Wun
2020-10-11 02:17:23 +06:30
parent b0ce53f856
commit 32e6be2abd
42 changed files with 938 additions and 626 deletions

View File

@@ -5,8 +5,8 @@ class DeliveryAddress {
String addressLine2;
String city;
String state;
String country;
String phoneNumber;
bool isDefault;
DeliveryAddress(
{this.id,
this.fullName,
@@ -14,8 +14,8 @@ class DeliveryAddress {
this.addressLine2,
this.city,
this.state,
this.country,
this.phoneNumber});
this.phoneNumber,
this.isDefault = false});
factory DeliveryAddress.fromMap(Map<String, dynamic> map, String docID) {
return DeliveryAddress(
@@ -25,8 +25,8 @@ class DeliveryAddress {
addressLine2: map['address_line2'],
city: map['city'],
state: map['state'],
country: map['country'],
phoneNumber: map['phone_number'],
isDefault: map['is_defalut'] ?? false,
);
}
@@ -39,7 +39,6 @@ class DeliveryAddress {
'city': city,
'state': state,
'phone_number': phoneNumber,
'country': country,
};
}
}

View File

@@ -0,0 +1,54 @@
import 'package:fcs/domain/constants.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class Privilege {
String id;
String name;
String desc;
bool sysAdminOnly = true;
bool isChecked = false;
IconData iconData;
Privilege(
{this.id, this.name, this.desc, this.isChecked, this.sysAdminOnly}) {
if (this.id == privilege_admin) {
iconData = MaterialCommunityIcons.account_tie;
} else if (this.id == privilege_support) {
iconData = SimpleLineIcons.support;
} else if (this.id == privilege_package) {
iconData = Octicons.package;
} else if (this.id == privilege_shipment) {
iconData = SimpleLineIcons.direction;
} else if (this.id == privilege_fcs_shipment) {
iconData = Ionicons.ios_airplane;
} else if (this.id == privilege_staff) {
iconData = MaterialCommunityIcons.worker;
} else if (this.id == privilege_carton) {
iconData = MaterialCommunityIcons.package;
} else if (this.id == privilege_customer) {
iconData = Feather.users;
} else if (this.id == privilege_delivery) {
iconData = MaterialCommunityIcons.truck_fast;
} else if (this.id == privilege_invoice) {
iconData = FontAwesomeIcons.fileInvoice;
} else if (this.id == privilege_processing) {
iconData = FontAwesome.dropbox;
} else if (this.id == privilege_receiving) {
iconData = MaterialCommunityIcons.inbox_arrow_down;
} else {
iconData = MaterialCommunityIcons.account_question;
}
}
factory Privilege.fromMap(Map<String, dynamic> map, String docID) {
return Privilege(
id: docID,
name: map['name'],
desc: map['desc'],
sysAdminOnly: map['sys_admin_only']);
}
}