WT1.1.2f Property, Purchase, Product, BMR, BMI
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
class CustomerProperty {
|
||||
int propertyId;
|
||||
int customerId;
|
||||
DateTime dateAdd;
|
||||
double propertyValue;
|
||||
bool newData = false;
|
||||
|
||||
CustomerProperty({this.propertyId, this.customerId, this.dateAdd, this.propertyValue});
|
||||
|
||||
CustomerProperty.fromJson(Map json) {
|
||||
this.propertyId = json['propertyId'];
|
||||
this.customerId = json['customerId'];
|
||||
this.dateAdd = json['propertyName'];
|
||||
this.propertyValue = json['propertyValue'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() =>
|
||||
{"propertyId": this.propertyId, "customerId": this.customerId, "dateAdd": this.dateAdd, "propertyValue": this.propertyValue};
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
import 'package:flutter/semantics.dart';
|
||||
|
||||
class FitnessState {
|
||||
final String value;
|
||||
final String stateText;
|
||||
final String explanation;
|
||||
|
||||
static String beginner = "beginner";
|
||||
static String intermediate = "intermediate";
|
||||
static String advanced = "advanced";
|
||||
static String professional = "professional";
|
||||
|
||||
FitnessState({this.value, this.stateText, this.explanation});
|
||||
|
||||
bool isEqual(FitnessState state) {
|
||||
if (state == null) {
|
||||
return false;
|
||||
}
|
||||
return state.value == this.value;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return stateText;
|
||||
}
|
||||
}
|
||||
|
||||
class FitnessItem {
|
||||
static final FitnessItem _singleton = FitnessItem._internal();
|
||||
List<FitnessState> elements = List();
|
||||
|
||||
factory FitnessItem() {
|
||||
return _singleton;
|
||||
}
|
||||
|
||||
FitnessItem._internal() {
|
||||
elements.add(FitnessState(
|
||||
value: FitnessState.beginner, stateText: _capitalize(FitnessState.beginner), explanation: "I am " + FitnessState.beginner));
|
||||
elements.add(FitnessState(
|
||||
value: FitnessState.intermediate,
|
||||
stateText: _capitalize(FitnessState.intermediate),
|
||||
explanation: "I am " + FitnessState.intermediate));
|
||||
elements.add(FitnessState(
|
||||
value: FitnessState.advanced, stateText: _capitalize(FitnessState.advanced), explanation: "I am " + FitnessState.advanced));
|
||||
elements.add(FitnessState(
|
||||
value: FitnessState.professional,
|
||||
stateText: _capitalize(FitnessState.professional),
|
||||
explanation: "I am " + FitnessState.professional));
|
||||
}
|
||||
|
||||
String _capitalize(String value) {
|
||||
return "${value[0].toUpperCase()}${value.substring(1)}";
|
||||
}
|
||||
|
||||
List<FitnessState> toList() => elements;
|
||||
|
||||
FitnessState getItem(String value) {
|
||||
if (value == null || value.length == 0) {
|
||||
return elements[0];
|
||||
}
|
||||
FitnessState selected;
|
||||
elements.forEach((element) {
|
||||
if (element.value == value) {
|
||||
print("selected " + element.value);
|
||||
selected = element;
|
||||
}
|
||||
});
|
||||
return selected;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
class ExerciseTree {
|
||||
int treeId;
|
||||
int parentId;
|
||||
String name;
|
||||
String imageUrl;
|
||||
bool active;
|
||||
String nameTranslation;
|
||||
|
||||
ExerciseTree.fromJson(Map json) {
|
||||
this.treeId = json['treeId'];
|
||||
this.name = json['name'];
|
||||
this.parentId = json['parentId'];
|
||||
this.imageUrl = json['imageUrl'];
|
||||
this.active = json['active'];
|
||||
this.nameTranslation =
|
||||
json['translations'] != null && (json['translations']).length > 0
|
||||
? json['translations'][0]['name']
|
||||
: this.name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
class Product {
|
||||
int productId;
|
||||
String name;
|
||||
String description;
|
||||
String type;
|
||||
DateTime validFrom;
|
||||
DateTime validTo;
|
||||
|
||||
Product.fromJson(Map json) {
|
||||
this.productId = json['productId'];
|
||||
this.name = json['name'];
|
||||
this.description = json['description'];
|
||||
this.type = json['type'];
|
||||
this.validFrom = json['validFrom'];
|
||||
this.validTo = json['validTo'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
class Property {
|
||||
int propertyId;
|
||||
String propertyName;
|
||||
String propertyUnit;
|
||||
String propertyNameTranslation;
|
||||
|
||||
Property.fromJson(Map json) {
|
||||
this.propertyId = json['propertyId'];
|
||||
this.propertyName = json['propertyName'];
|
||||
this.propertyUnit = json['propertyUnit'];
|
||||
this.propertyNameTranslation =
|
||||
json['translations'] != null && (json['translations']).length > 0
|
||||
? json['translations'][0]['propertyName']
|
||||
: this.propertyName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
class Product {
|
||||
int productId;
|
||||
String name;
|
||||
String description;
|
||||
String type;
|
||||
DateTime validFrom;
|
||||
DateTime validTo;
|
||||
|
||||
Product.fromJson(Map json) {
|
||||
this.productId = json['productId'];
|
||||
this.name = json['name'];
|
||||
this.description = json['description'];
|
||||
this.type = json['type'];
|
||||
this.validFrom = json['validFrom'];
|
||||
this.validTo = json['validTo'];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user