This commit is contained in:
Sai Naw Wun
2020-10-07 02:33:06 +06:30
parent 01a2798a74
commit 65dda16fe6
475 changed files with 1543 additions and 90780 deletions

View File

@@ -0,0 +1,45 @@
import 'package:fcs/domain/entities/setting.dart';
class Contact {
String usaAddress;
String mmAddress;
String usaContactNumber;
String mmContactNumber;
String emailAddress;
String facebookLink;
Contact({
this.usaAddress,
this.mmAddress,
this.usaContactNumber,
this.mmContactNumber,
this.emailAddress,
this.facebookLink,
});
factory Contact.fromSetting(Setting setting) {
return Contact(
usaContactNumber: setting.usaContactNumber,
mmContactNumber: setting.mmContactNumber,
usaAddress: setting.usaAddress,
mmAddress: setting.mmAddress,
emailAddress: setting.emailAddress,
facebookLink: setting.facebookLink);
}
Map<String, dynamic> toMap() {
return {
'usa_address': usaAddress,
'mm_address': mmAddress,
'usa_contact_number': usaContactNumber,
'mm_contact_number': mmContactNumber,
'email_address': emailAddress,
'facebook_link': facebookLink,
};
}
@override
String toString() {
return 'Contact{usa_address:$usaAddress,mm_address:$mmAddress}';
}
}

View File

@@ -0,0 +1,58 @@
import 'package:cloud_firestore/cloud_firestore.dart';
class Message {
String id;
String message;
DateTime date;
String receiverID;
String receiverName;
String senderID;
String senderName;
String messageType;
String messageID;
Message(
{this.id,
this.message,
this.date,
this.receiverID,
this.receiverName,
this.senderID,
this.senderName,
this.messageType,
this.messageID});
bool fromToday() {
var now = DateTime.now();
return date.day == now.day &&
date.month == now.month &&
date.year == now.year;
}
Map<String, dynamic> toMap() {
return {
'message': message,
"receiver_id": receiverID,
};
}
bool sameDay(Message another) {
return date.year == another.date.year &&
date.month == another.date.month &&
date.day == another.date.day;
}
factory Message.fromMap(Map<String, dynamic> map, String id) {
var date = (map['date'] as Timestamp);
return Message(
id: id,
message: map['message'],
senderID: map['sender_id'],
senderName: map['sender_name'],
receiverID: map['receiver_id'],
receiverName: map['receiver_name'],
messageType: map['msg_type'],
messageID: map['msg_id'],
date: date != null ? date.toDate() : null,
);
}
}

5
lib/domain/vo/radio.dart Normal file
View File

@@ -0,0 +1,5 @@
class RadioGroup {
String text;
int index;
RadioGroup({this.text, this.index});
}

View File

@@ -0,0 +1,17 @@
import 'package:cloud_firestore/cloud_firestore.dart';
class ShipmentStatus {
String status;
DateTime date;
bool done;
ShipmentStatus({this.status, this.date, this.done});
factory ShipmentStatus.fromMap(Map<String, dynamic> map) {
var _date = (map['date'] as Timestamp);
return ShipmentStatus(
status: map['status'],
date: _date == null ? null : _date.toDate(),
done: map['done'],
);
}
}

View File

@@ -0,0 +1,15 @@
class ShippingAddress {
String fullName;
String addressLine1;
String addressLine2;
String city;
String state;
String phoneNumber;
ShippingAddress(
{this.fullName,
this.addressLine1,
this.addressLine2,
this.city,
this.state,
this.phoneNumber});
}

13
lib/domain/vo/status.dart Normal file
View File

@@ -0,0 +1,13 @@
class Status {
String status;
String message;
String errorCode;
Status(this.status, this.message);
Status.fromJson(Map<String, dynamic> json) {
status = json['status'];
message = json['message'];
errorCode = json['error_code'];
}
}

24
lib/domain/vo/term.dart Normal file
View File

@@ -0,0 +1,24 @@
import 'package:fcs/domain/entities/setting.dart';
class Term {
String termEng;
String termMm;
Term({this.termEng, this.termMm});
factory Term.fromSetting(Setting setting) {
return Term(termEng: setting.termsEng, termMm: setting.termsMm);
}
Map<String, dynamic> toMap() {
return {
'terms_eng': termEng,
'terms_mm': termMm,
};
}
@override
String toString() {
return 'Contact{terms_eng:$termEng}';
}
}