Initial commit

This commit is contained in:
2022-11-04 10:46:07 -04:00
commit 1c0ac122d0
183 changed files with 7167 additions and 0 deletions

43
lib/models/car.dart Normal file
View File

@@ -0,0 +1,43 @@
class Car {
static const tblCars = 'cars';
static const colId = 'id';
static const colVin = 'vin';
static const colNickname = 'nickname';
static const colPlate = 'plate';
static const colMileage = 'mileage';
Car({this.id, this.vin, this.plate, this.nickname, this.mileage});
Car.fromMap(Map<String, dynamic> map) {
id = map[colId];
vin = map[colVin];
nickname = map[colNickname];
plate = map[colPlate];
mileage = map[colMileage];
}
int? id;
String? vin;
String? plate;
String? nickname;
int? mileage;
Map<String, dynamic> toMap() {
var map = <String, dynamic>{
colVin: vin,
colPlate: plate,
colNickname: nickname,
colMileage: mileage,
};
// if (id != null) {
// map[colId] = id; //not sure https://www.youtube.com/watch?v=tj7Lj9a3fyM
// }
return map;
}
/* <String, dynamic> toString() {
const output = """nickname: $colNickname, id: $colId, vin: $colVin,
plate: $colPlate, mileage: ($colMileage.runtimeType) $colMileage """;
return output;
} */
}

49
lib/models/txn.dart Normal file
View File

@@ -0,0 +1,49 @@
class Txn {
static const tblTxns = 'txns';
static const colId = 'id';
static const colType = 'txntype';
static const colDatetime = 'datetime';
static const colCost = 'cost';
static const colMileage = 'mileage';
static const colNote = 'note';
static const colCarId = 'carid';
Txn(
{this.id,
this.txntype,
this.datetime,
this.cost,
this.mileage,
this.note,
this.carid});
Txn.fromMap(Map<String, dynamic> map) {
id = map[colId];
txntype = map[colType];
datetime = map[colDatetime];
cost = map[colCost];
mileage = map[colMileage];
note = map[colNote];
carid = map[colCarId];
}
int? id;
String? txntype;
int? datetime; // store as integer unix time
double? cost;
int? mileage;
String? note;
int? carid;
Map<String, dynamic> toMap() {
var map = <String, dynamic>{
colType: txntype,
colDatetime: datetime,
colCost: cost,
colMileage: mileage,
colNote: note,
colCarId: carid,
};
return map;
}
}