Refactor Supadart model classes for consistency and clarity
- Renamed model classes to follow a unified naming convention (e.g., Evidence to EvidenceSupadartModel). - Updated references to related models to match new naming conventions (e.g., IncidentLogs to IncidentLogSupadartModel). - Adjusted static methods for conversion and JSON parsing to reflect the new class names. - Modified table names in the models to align with the new naming scheme. - Changed output directory in supadart.yaml to 'lib/generated/' for better organization. - Mapped database table names to the new model class names in supadart.yaml.
This commit is contained in:
parent
c7bdb24ceb
commit
01d166816d
|
@ -4,7 +4,7 @@
|
||||||
import 'package:sigap/supadart/supadart_exports.dart';
|
import 'package:sigap/supadart/supadart_exports.dart';
|
||||||
import 'package:sigap/supadart/supadart_header.dart';
|
import 'package:sigap/supadart/supadart_header.dart';
|
||||||
|
|
||||||
class Officers implements SupadartClass<Officers> {
|
class OfficerSupadartModel implements SupadartClass<OfficerSupadartModel> {
|
||||||
final String unitId;
|
final String unitId;
|
||||||
final String roleId;
|
final String roleId;
|
||||||
final String nrp;
|
final String nrp;
|
||||||
|
@ -25,11 +25,11 @@ class Officers implements SupadartClass<Officers> {
|
||||||
final bool isBanned;
|
final bool isBanned;
|
||||||
final int panicStrike;
|
final int panicStrike;
|
||||||
final int spoofingAttempts;
|
final int spoofingAttempts;
|
||||||
final PatrolUnits? patrolUnit;
|
final PatrolUnitSupadartModel? patrolUnit;
|
||||||
final Roles? roleObj;
|
final RoleSupadartModel? role;
|
||||||
final Units? unit;
|
final UnitSupadartModel? unit;
|
||||||
|
|
||||||
const Officers({
|
const OfficerSupadartModel({
|
||||||
required this.unitId,
|
required this.unitId,
|
||||||
required this.roleId,
|
required this.roleId,
|
||||||
required this.nrp,
|
required this.nrp,
|
||||||
|
@ -51,11 +51,11 @@ class Officers implements SupadartClass<Officers> {
|
||||||
required this.panicStrike,
|
required this.panicStrike,
|
||||||
required this.spoofingAttempts,
|
required this.spoofingAttempts,
|
||||||
this.patrolUnit,
|
this.patrolUnit,
|
||||||
this.roleObj,
|
this.role,
|
||||||
this.unit,
|
this.unit,
|
||||||
});
|
});
|
||||||
|
|
||||||
static String get table_name => 'officers';
|
static String get table_name => 'officerSupadartModel';
|
||||||
static String get c_unitId => 'unit_id';
|
static String get c_unitId => 'unit_id';
|
||||||
static String get c_roleId => 'role_id';
|
static String get c_roleId => 'role_id';
|
||||||
static String get c_nrp => 'nrp';
|
static String get c_nrp => 'nrp';
|
||||||
|
@ -77,12 +77,12 @@ class Officers implements SupadartClass<Officers> {
|
||||||
static String get c_panicStrike => 'panic_strike';
|
static String get c_panicStrike => 'panic_strike';
|
||||||
static String get c_spoofingAttempts => 'spoofing_attempts';
|
static String get c_spoofingAttempts => 'spoofing_attempts';
|
||||||
|
|
||||||
static List<Officers> converter(List<Map<String, dynamic>> data) {
|
static List<OfficerSupadartModel> converter(List<Map<String, dynamic>> data) {
|
||||||
return data.map(Officers.fromJson).toList();
|
return data.map(OfficerSupadartModel.fromJson).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
static Officers converterSingle(Map<String, dynamic> data) {
|
static OfficerSupadartModel converterSingle(Map<String, dynamic> data) {
|
||||||
return Officers.fromJson(data);
|
return OfficerSupadartModel.fromJson(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map<String, dynamic> _generateMap({
|
static Map<String, dynamic> _generateMap({
|
||||||
|
@ -223,8 +223,8 @@ class Officers implements SupadartClass<Officers> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory Officers.fromJson(Map<String, dynamic> jsonn) {
|
factory OfficerSupadartModel.fromJson(Map<String, dynamic> jsonn) {
|
||||||
return Officers(
|
return OfficerSupadartModel(
|
||||||
unitId: jsonn['unit_id'] != null ? jsonn['unit_id'].toString() : '',
|
unitId: jsonn['unit_id'] != null ? jsonn['unit_id'].toString() : '',
|
||||||
roleId: jsonn['role_id'] != null ? jsonn['role_id'].toString() : '',
|
roleId: jsonn['role_id'] != null ? jsonn['role_id'].toString() : '',
|
||||||
nrp: jsonn['nrp'] != null ? jsonn['nrp'].toString() : '',
|
nrp: jsonn['nrp'] != null ? jsonn['nrp'].toString() : '',
|
||||||
|
@ -271,17 +271,21 @@ class Officers implements SupadartClass<Officers> {
|
||||||
: 0,
|
: 0,
|
||||||
patrolUnit:
|
patrolUnit:
|
||||||
jsonn['patrol_units'] != null
|
jsonn['patrol_units'] != null
|
||||||
? PatrolUnits.fromJson(
|
? PatrolUnitSupadartModel.fromJson(
|
||||||
jsonn['patrol_units'] as Map<String, dynamic>,
|
jsonn['patrol_units'] as Map<String, dynamic>,
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
roleObj:
|
role:
|
||||||
jsonn['roles'] != null
|
jsonn['roles'] != null
|
||||||
? Roles.fromJson(jsonn['roles'] as Map<String, dynamic>)
|
? RoleSupadartModel.fromJson(
|
||||||
|
jsonn['roles'] as Map<String, dynamic>,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
unit:
|
unit:
|
||||||
jsonn['units'] != null
|
jsonn['unitSupadartModel'] != null
|
||||||
? Units.fromJson(jsonn['units'] as Map<String, dynamic>)
|
? UnitSupadartModel.fromJson(
|
||||||
|
jsonn['unitSupadartModel'] as Map<String, dynamic>,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -309,13 +313,13 @@ class Officers implements SupadartClass<Officers> {
|
||||||
panicStrike: panicStrike,
|
panicStrike: panicStrike,
|
||||||
spoofingAttempts: spoofingAttempts,
|
spoofingAttempts: spoofingAttempts,
|
||||||
// 'patrol_units': patrolUnit?.toJson(),
|
// 'patrol_units': patrolUnit?.toJson(),
|
||||||
// 'roles': roleObj?.toJson(),
|
// 'roles': role?.toJson(),
|
||||||
// 'units': unit?.toJson(),
|
// 'unitSupadartModel': unit?.toJson(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const _unset = Object();
|
static const _unset = Object();
|
||||||
Officers copyWith({
|
OfficerSupadartModel copyWith({
|
||||||
Object? unitId = _unset,
|
Object? unitId = _unset,
|
||||||
Object? roleId = _unset,
|
Object? roleId = _unset,
|
||||||
Object? nrp = _unset,
|
Object? nrp = _unset,
|
||||||
|
@ -337,10 +341,10 @@ class Officers implements SupadartClass<Officers> {
|
||||||
Object? panicStrike = _unset,
|
Object? panicStrike = _unset,
|
||||||
Object? spoofingAttempts = _unset,
|
Object? spoofingAttempts = _unset,
|
||||||
Object? patrolUnit = _unset,
|
Object? patrolUnit = _unset,
|
||||||
Object? roleObj = _unset,
|
Object? role = _unset,
|
||||||
Object? unit = _unset,
|
Object? unit = _unset,
|
||||||
}) {
|
}) {
|
||||||
return Officers(
|
return OfficerSupadartModel(
|
||||||
unitId: unitId == _unset ? this.unitId : unitId as String,
|
unitId: unitId == _unset ? this.unitId : unitId as String,
|
||||||
roleId: roleId == _unset ? this.roleId : roleId as String,
|
roleId: roleId == _unset ? this.roleId : roleId as String,
|
||||||
nrp: nrp == _unset ? this.nrp : nrp as String,
|
nrp: nrp == _unset ? this.nrp : nrp as String,
|
||||||
|
@ -370,9 +374,11 @@ class Officers implements SupadartClass<Officers> {
|
||||||
? this.spoofingAttempts
|
? this.spoofingAttempts
|
||||||
: spoofingAttempts as int,
|
: spoofingAttempts as int,
|
||||||
patrolUnit:
|
patrolUnit:
|
||||||
patrolUnit == _unset ? this.patrolUnit : patrolUnit as PatrolUnits?,
|
patrolUnit == _unset
|
||||||
roleObj: roleObj == _unset ? this.roleObj : roleObj as Roles?,
|
? this.patrolUnit
|
||||||
unit: unit == _unset ? this.unit : unit as Units?,
|
: patrolUnit as PatrolUnitSupadartModel?,
|
||||||
|
role: role == _unset ? this.role : role as RoleSupadartModel?,
|
||||||
|
unit: unit == _unset ? this.unit : unit as UnitSupadartModel?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
import 'package:sigap/supadart/supadart_exports.dart';
|
import 'package:sigap/supadart/supadart_exports.dart';
|
||||||
import 'package:sigap/supadart/supadart_header.dart';
|
import 'package:sigap/supadart/supadart_header.dart';
|
||||||
|
|
||||||
class PatrolUnits implements SupadartClass<PatrolUnits> {
|
class PatrolUnitSupadartModel
|
||||||
|
implements SupadartClass<PatrolUnitSupadartModel> {
|
||||||
final String unitId;
|
final String unitId;
|
||||||
final String locationId;
|
final String locationId;
|
||||||
final String name;
|
final String name;
|
||||||
|
@ -13,10 +14,10 @@ class PatrolUnits implements SupadartClass<PatrolUnits> {
|
||||||
final double radius;
|
final double radius;
|
||||||
final DateTime createdAt;
|
final DateTime createdAt;
|
||||||
final String id;
|
final String id;
|
||||||
final Locations? locationObj;
|
final LocationSupadartModel? location;
|
||||||
final Units? unitObj;
|
final UnitSupadartModel? unit;
|
||||||
|
|
||||||
const PatrolUnits({
|
const PatrolUnitSupadartModel({
|
||||||
required this.unitId,
|
required this.unitId,
|
||||||
required this.locationId,
|
required this.locationId,
|
||||||
required this.name,
|
required this.name,
|
||||||
|
@ -25,8 +26,8 @@ class PatrolUnits implements SupadartClass<PatrolUnits> {
|
||||||
required this.radius,
|
required this.radius,
|
||||||
required this.createdAt,
|
required this.createdAt,
|
||||||
required this.id,
|
required this.id,
|
||||||
this.locationObj,
|
this.location,
|
||||||
this.unitObj,
|
this.unit,
|
||||||
});
|
});
|
||||||
|
|
||||||
static String get table_name => 'patrol_units';
|
static String get table_name => 'patrol_units';
|
||||||
|
@ -39,12 +40,14 @@ class PatrolUnits implements SupadartClass<PatrolUnits> {
|
||||||
static String get c_createdAt => 'created_at';
|
static String get c_createdAt => 'created_at';
|
||||||
static String get c_id => 'id';
|
static String get c_id => 'id';
|
||||||
|
|
||||||
static List<PatrolUnits> converter(List<Map<String, dynamic>> data) {
|
static List<PatrolUnitSupadartModel> converter(
|
||||||
return data.map(PatrolUnits.fromJson).toList();
|
List<Map<String, dynamic>> data,
|
||||||
|
) {
|
||||||
|
return data.map(PatrolUnitSupadartModel.fromJson).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
static PatrolUnits converterSingle(Map<String, dynamic> data) {
|
static PatrolUnitSupadartModel converterSingle(Map<String, dynamic> data) {
|
||||||
return PatrolUnits.fromJson(data);
|
return PatrolUnitSupadartModel.fromJson(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map<String, dynamic> _generateMap({
|
static Map<String, dynamic> _generateMap({
|
||||||
|
@ -113,8 +116,8 @@ class PatrolUnits implements SupadartClass<PatrolUnits> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory PatrolUnits.fromJson(Map<String, dynamic> jsonn) {
|
factory PatrolUnitSupadartModel.fromJson(Map<String, dynamic> jsonn) {
|
||||||
return PatrolUnits(
|
return PatrolUnitSupadartModel(
|
||||||
unitId: jsonn['unit_id'] != null ? jsonn['unit_id'].toString() : '',
|
unitId: jsonn['unit_id'] != null ? jsonn['unit_id'].toString() : '',
|
||||||
locationId:
|
locationId:
|
||||||
jsonn['location_id'] != null ? jsonn['location_id'].toString() : '',
|
jsonn['location_id'] != null ? jsonn['location_id'].toString() : '',
|
||||||
|
@ -130,13 +133,17 @@ class PatrolUnits implements SupadartClass<PatrolUnits> {
|
||||||
? DateTime.parse(jsonn['created_at'].toString())
|
? DateTime.parse(jsonn['created_at'].toString())
|
||||||
: DateTime.fromMillisecondsSinceEpoch(0),
|
: DateTime.fromMillisecondsSinceEpoch(0),
|
||||||
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
||||||
locationObj:
|
location:
|
||||||
jsonn['locations'] != null
|
jsonn['locations'] != null
|
||||||
? Locations.fromJson(jsonn['locations'] as Map<String, dynamic>)
|
? LocationSupadartModel.fromJson(
|
||||||
|
jsonn['locations'] as Map<String, dynamic>,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
unitObj:
|
unit:
|
||||||
jsonn['units'] != null
|
jsonn['unitSupadartModel'] != null
|
||||||
? Units.fromJson(jsonn['units'] as Map<String, dynamic>)
|
? UnitSupadartModel.fromJson(
|
||||||
|
jsonn['unitSupadartModel'] as Map<String, dynamic>,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -151,13 +158,13 @@ class PatrolUnits implements SupadartClass<PatrolUnits> {
|
||||||
radius: radius,
|
radius: radius,
|
||||||
createdAt: createdAt,
|
createdAt: createdAt,
|
||||||
id: id,
|
id: id,
|
||||||
// 'locations': locationObj?.toJson(),
|
// 'locations': location?.toJson(),
|
||||||
// 'units': unitObj?.toJson(),
|
// 'unitSupadartModel': unit?.toJson(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const _unset = Object();
|
static const _unset = Object();
|
||||||
PatrolUnits copyWith({
|
PatrolUnitSupadartModel copyWith({
|
||||||
Object? unitId = _unset,
|
Object? unitId = _unset,
|
||||||
Object? locationId = _unset,
|
Object? locationId = _unset,
|
||||||
Object? name = _unset,
|
Object? name = _unset,
|
||||||
|
@ -166,10 +173,10 @@ class PatrolUnits implements SupadartClass<PatrolUnits> {
|
||||||
Object? radius = _unset,
|
Object? radius = _unset,
|
||||||
Object? createdAt = _unset,
|
Object? createdAt = _unset,
|
||||||
Object? id = _unset,
|
Object? id = _unset,
|
||||||
Object? locationObj = _unset,
|
Object? location = _unset,
|
||||||
Object? unitObj = _unset,
|
Object? unit = _unset,
|
||||||
}) {
|
}) {
|
||||||
return PatrolUnits(
|
return PatrolUnitSupadartModel(
|
||||||
unitId: unitId == _unset ? this.unitId : unitId as String,
|
unitId: unitId == _unset ? this.unitId : unitId as String,
|
||||||
locationId: locationId == _unset ? this.locationId : locationId as String,
|
locationId: locationId == _unset ? this.locationId : locationId as String,
|
||||||
name: name == _unset ? this.name : name as String,
|
name: name == _unset ? this.name : name as String,
|
||||||
|
@ -178,9 +185,11 @@ class PatrolUnits implements SupadartClass<PatrolUnits> {
|
||||||
radius: radius == _unset ? this.radius : radius as double,
|
radius: radius == _unset ? this.radius : radius as double,
|
||||||
createdAt: createdAt == _unset ? this.createdAt : createdAt as DateTime,
|
createdAt: createdAt == _unset ? this.createdAt : createdAt as DateTime,
|
||||||
id: id == _unset ? this.id : id as String,
|
id: id == _unset ? this.id : id as String,
|
||||||
locationObj:
|
location:
|
||||||
locationObj == _unset ? this.locationObj : locationObj as Locations?,
|
location == _unset
|
||||||
unitObj: unitObj == _unset ? this.unitObj : unitObj as Units?,
|
? this.location
|
||||||
|
: location as LocationSupadartModel?,
|
||||||
|
unit: unit == _unset ? this.unit : unit as UnitSupadartModel?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
import 'package:sigap/supadart/supadart_exports.dart';
|
import 'package:sigap/supadart/supadart_exports.dart';
|
||||||
import 'package:sigap/supadart/supadart_header.dart';
|
import 'package:sigap/supadart/supadart_header.dart';
|
||||||
|
|
||||||
class UnitStatistics implements SupadartClass<UnitStatistics> {
|
class UnitStatisticSupadartModel
|
||||||
|
implements SupadartClass<UnitStatisticSupadartModel> {
|
||||||
final String id;
|
final String id;
|
||||||
final int crimeTotal;
|
final int crimeTotal;
|
||||||
final int crimeCleared;
|
final int crimeCleared;
|
||||||
|
@ -15,9 +16,9 @@ class UnitStatistics implements SupadartClass<UnitStatistics> {
|
||||||
final DateTime? createdAt;
|
final DateTime? createdAt;
|
||||||
final DateTime? updatedAt;
|
final DateTime? updatedAt;
|
||||||
final String codeUnit;
|
final String codeUnit;
|
||||||
final Units? unit;
|
final UnitSupadartModel? unit;
|
||||||
|
|
||||||
const UnitStatistics({
|
const UnitStatisticSupadartModel({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.crimeTotal,
|
required this.crimeTotal,
|
||||||
required this.crimeCleared,
|
required this.crimeCleared,
|
||||||
|
@ -43,12 +44,14 @@ class UnitStatistics implements SupadartClass<UnitStatistics> {
|
||||||
static String get c_updatedAt => 'updated_at';
|
static String get c_updatedAt => 'updated_at';
|
||||||
static String get c_codeUnit => 'code_unit';
|
static String get c_codeUnit => 'code_unit';
|
||||||
|
|
||||||
static List<UnitStatistics> converter(List<Map<String, dynamic>> data) {
|
static List<UnitStatisticSupadartModel> converter(
|
||||||
return data.map(UnitStatistics.fromJson).toList();
|
List<Map<String, dynamic>> data,
|
||||||
|
) {
|
||||||
|
return data.map(UnitStatisticSupadartModel.fromJson).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
static UnitStatistics converterSingle(Map<String, dynamic> data) {
|
static UnitStatisticSupadartModel converterSingle(Map<String, dynamic> data) {
|
||||||
return UnitStatistics.fromJson(data);
|
return UnitStatisticSupadartModel.fromJson(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map<String, dynamic> _generateMap({
|
static Map<String, dynamic> _generateMap({
|
||||||
|
@ -129,8 +132,8 @@ class UnitStatistics implements SupadartClass<UnitStatistics> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory UnitStatistics.fromJson(Map<String, dynamic> jsonn) {
|
factory UnitStatisticSupadartModel.fromJson(Map<String, dynamic> jsonn) {
|
||||||
return UnitStatistics(
|
return UnitStatisticSupadartModel(
|
||||||
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
||||||
crimeTotal:
|
crimeTotal:
|
||||||
jsonn['crime_total'] != null
|
jsonn['crime_total'] != null
|
||||||
|
@ -160,8 +163,10 @@ class UnitStatistics implements SupadartClass<UnitStatistics> {
|
||||||
: null,
|
: null,
|
||||||
codeUnit: jsonn['code_unit'] != null ? jsonn['code_unit'].toString() : '',
|
codeUnit: jsonn['code_unit'] != null ? jsonn['code_unit'].toString() : '',
|
||||||
unit:
|
unit:
|
||||||
jsonn['units'] != null
|
jsonn['unitUnitSupadartModel'] != null
|
||||||
? Units.fromJson(jsonn['units'] as Map<String, dynamic>)
|
? UnitSupadartModel.fromJson(
|
||||||
|
jsonn['unitUnitSupadartModel'] as Map<String, dynamic>,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -178,12 +183,12 @@ class UnitStatistics implements SupadartClass<UnitStatistics> {
|
||||||
createdAt: createdAt,
|
createdAt: createdAt,
|
||||||
updatedAt: updatedAt,
|
updatedAt: updatedAt,
|
||||||
codeUnit: codeUnit,
|
codeUnit: codeUnit,
|
||||||
// 'units': unit?.toJson(),
|
// 'unitUnitSupadartModel': unit?.toJson(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const _unset = Object();
|
static const _unset = Object();
|
||||||
UnitStatistics copyWith({
|
UnitStatisticSupadartModel copyWith({
|
||||||
Object? id = _unset,
|
Object? id = _unset,
|
||||||
Object? crimeTotal = _unset,
|
Object? crimeTotal = _unset,
|
||||||
Object? crimeCleared = _unset,
|
Object? crimeCleared = _unset,
|
||||||
|
@ -196,7 +201,7 @@ class UnitStatistics implements SupadartClass<UnitStatistics> {
|
||||||
Object? codeUnit = _unset,
|
Object? codeUnit = _unset,
|
||||||
Object? unit = _unset,
|
Object? unit = _unset,
|
||||||
}) {
|
}) {
|
||||||
return UnitStatistics(
|
return UnitStatisticSupadartModel(
|
||||||
id: id == _unset ? this.id : id as String,
|
id: id == _unset ? this.id : id as String,
|
||||||
crimeTotal: crimeTotal == _unset ? this.crimeTotal : crimeTotal as int,
|
crimeTotal: crimeTotal == _unset ? this.crimeTotal : crimeTotal as int,
|
||||||
crimeCleared:
|
crimeCleared:
|
||||||
|
@ -209,7 +214,7 @@ class UnitStatistics implements SupadartClass<UnitStatistics> {
|
||||||
createdAt: createdAt == _unset ? this.createdAt : createdAt as DateTime?,
|
createdAt: createdAt == _unset ? this.createdAt : createdAt as DateTime?,
|
||||||
updatedAt: updatedAt == _unset ? this.updatedAt : updatedAt as DateTime?,
|
updatedAt: updatedAt == _unset ? this.updatedAt : updatedAt as DateTime?,
|
||||||
codeUnit: codeUnit == _unset ? this.codeUnit : codeUnit as String,
|
codeUnit: codeUnit == _unset ? this.codeUnit : codeUnit as String,
|
||||||
unit: unit == _unset ? this.unit : unit as Units?,
|
unit: unit == _unset ? this.unit : unit as UnitSupadartModel?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ import 'package:sigap/supadart/supadart_header.dart';
|
||||||
|
|
||||||
enum UNIT_TYPE { other, polda, polres, polsek }
|
enum UNIT_TYPE { other, polda, polres, polsek }
|
||||||
|
|
||||||
class Units implements SupadartClass<Units> {
|
class UnitSupadartModel implements SupadartClass<UnitSupadartModel> {
|
||||||
final String codeUnit;
|
final String codeUnit;
|
||||||
final String? districtId;
|
final String? districtId;
|
||||||
final String name;
|
final String name;
|
||||||
|
@ -21,10 +21,10 @@ class Units implements SupadartClass<Units> {
|
||||||
final String location;
|
final String location;
|
||||||
final String cityId;
|
final String cityId;
|
||||||
final String? phone;
|
final String? phone;
|
||||||
final Cities? city;
|
final CitySupadartModel? city;
|
||||||
final Districts? district;
|
final DistrictSupadartModel? district;
|
||||||
|
|
||||||
const Units({
|
const UnitSupadartModel({
|
||||||
required this.codeUnit,
|
required this.codeUnit,
|
||||||
this.districtId,
|
this.districtId,
|
||||||
required this.name,
|
required this.name,
|
||||||
|
@ -43,7 +43,7 @@ class Units implements SupadartClass<Units> {
|
||||||
this.district,
|
this.district,
|
||||||
});
|
});
|
||||||
|
|
||||||
static String get table_name => 'units';
|
static String get table_name => 'unitSupadartModel';
|
||||||
static String get c_codeUnit => 'code_unit';
|
static String get c_codeUnit => 'code_unit';
|
||||||
static String get c_districtId => 'district_id';
|
static String get c_districtId => 'district_id';
|
||||||
static String get c_name => 'name';
|
static String get c_name => 'name';
|
||||||
|
@ -59,12 +59,12 @@ class Units implements SupadartClass<Units> {
|
||||||
static String get c_cityId => 'city_id';
|
static String get c_cityId => 'city_id';
|
||||||
static String get c_phone => 'phone';
|
static String get c_phone => 'phone';
|
||||||
|
|
||||||
static List<Units> converter(List<Map<String, dynamic>> data) {
|
static List<UnitSupadartModel> converter(List<Map<String, dynamic>> data) {
|
||||||
return data.map(Units.fromJson).toList();
|
return data.map(UnitSupadartModel.fromJson).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
static Units converterSingle(Map<String, dynamic> data) {
|
static UnitSupadartModel converterSingle(Map<String, dynamic> data) {
|
||||||
return Units.fromJson(data);
|
return UnitSupadartModel.fromJson(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map<String, dynamic> _generateMap({
|
static Map<String, dynamic> _generateMap({
|
||||||
|
@ -169,8 +169,8 @@ class Units implements SupadartClass<Units> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory Units.fromJson(Map<String, dynamic> jsonn) {
|
factory UnitSupadartModel.fromJson(Map<String, dynamic> jsonn) {
|
||||||
return Units(
|
return UnitSupadartModel(
|
||||||
codeUnit: jsonn['code_unit'] != null ? jsonn['code_unit'].toString() : '',
|
codeUnit: jsonn['code_unit'] != null ? jsonn['code_unit'].toString() : '',
|
||||||
districtId:
|
districtId:
|
||||||
jsonn['district_id'] != null ? jsonn['district_id'].toString() : null,
|
jsonn['district_id'] != null ? jsonn['district_id'].toString() : null,
|
||||||
|
@ -207,11 +207,15 @@ class Units implements SupadartClass<Units> {
|
||||||
phone: jsonn['phone'] != null ? jsonn['phone'].toString() : null,
|
phone: jsonn['phone'] != null ? jsonn['phone'].toString() : null,
|
||||||
city:
|
city:
|
||||||
jsonn['cities'] != null
|
jsonn['cities'] != null
|
||||||
? Cities.fromJson(jsonn['cities'] as Map<String, dynamic>)
|
? CitySupadartModel.fromJson(
|
||||||
|
jsonn['cities'] as Map<String, dynamic>,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
district:
|
district:
|
||||||
jsonn['districts'] != null
|
jsonn['districts'] != null
|
||||||
? Districts.fromJson(jsonn['districts'] as Map<String, dynamic>)
|
? DistrictSupadartModel.fromJson(
|
||||||
|
jsonn['districts'] as Map<String, dynamic>,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -238,7 +242,7 @@ class Units implements SupadartClass<Units> {
|
||||||
}
|
}
|
||||||
|
|
||||||
static const _unset = Object();
|
static const _unset = Object();
|
||||||
Units copyWith({
|
UnitSupadartModel copyWith({
|
||||||
Object? codeUnit = _unset,
|
Object? codeUnit = _unset,
|
||||||
Object? districtId = _unset,
|
Object? districtId = _unset,
|
||||||
Object? name = _unset,
|
Object? name = _unset,
|
||||||
|
@ -256,7 +260,7 @@ class Units implements SupadartClass<Units> {
|
||||||
Object? city = _unset,
|
Object? city = _unset,
|
||||||
Object? district = _unset,
|
Object? district = _unset,
|
||||||
}) {
|
}) {
|
||||||
return Units(
|
return UnitSupadartModel(
|
||||||
codeUnit: codeUnit == _unset ? this.codeUnit : codeUnit as String,
|
codeUnit: codeUnit == _unset ? this.codeUnit : codeUnit as String,
|
||||||
districtId:
|
districtId:
|
||||||
districtId == _unset ? this.districtId : districtId as String?,
|
districtId == _unset ? this.districtId : districtId as String?,
|
||||||
|
@ -273,8 +277,11 @@ class Units implements SupadartClass<Units> {
|
||||||
location: location == _unset ? this.location : location as String,
|
location: location == _unset ? this.location : location as String,
|
||||||
cityId: cityId == _unset ? this.cityId : cityId as String,
|
cityId: cityId == _unset ? this.cityId : cityId as String,
|
||||||
phone: phone == _unset ? this.phone : phone as String?,
|
phone: phone == _unset ? this.phone : phone as String?,
|
||||||
city: city == _unset ? this.city : city as Cities?,
|
city: city == _unset ? this.city : city as CitySupadartModel?,
|
||||||
district: district == _unset ? this.district : district as Districts?,
|
district:
|
||||||
|
district == _unset
|
||||||
|
? this.district
|
||||||
|
: district as DistrictSupadartModel?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,31 +3,31 @@
|
||||||
// WARNING: Modifications may be overwritten. Please make changes in the Supadart configuration.
|
// WARNING: Modifications may be overwritten. Please make changes in the Supadart configuration.
|
||||||
import 'package:sigap/supadart/supadart_header.dart';
|
import 'package:sigap/supadart/supadart_header.dart';
|
||||||
|
|
||||||
class Cities implements SupadartClass<Cities> {
|
class CitySupadartModel implements SupadartClass<CitySupadartModel> {
|
||||||
final String id;
|
final String id;
|
||||||
final String name;
|
final String name;
|
||||||
final DateTime? createdAt;
|
final DateTime? createdAt;
|
||||||
final DateTime? updatedAt;
|
final DateTime? updatedAt;
|
||||||
|
|
||||||
const Cities({
|
const CitySupadartModel({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.name,
|
required this.name,
|
||||||
this.createdAt,
|
this.createdAt,
|
||||||
this.updatedAt,
|
this.updatedAt,
|
||||||
});
|
});
|
||||||
|
|
||||||
static String get table_name => 'cities';
|
static String get table_name => 'citySupadartModel';
|
||||||
static String get c_id => 'id';
|
static String get c_id => 'id';
|
||||||
static String get c_name => 'name';
|
static String get c_name => 'name';
|
||||||
static String get c_createdAt => 'created_at';
|
static String get c_createdAt => 'created_at';
|
||||||
static String get c_updatedAt => 'updated_at';
|
static String get c_updatedAt => 'updated_at';
|
||||||
|
|
||||||
static List<Cities> converter(List<Map<String, dynamic>> data) {
|
static List<CitySupadartModel> converter(List<Map<String, dynamic>> data) {
|
||||||
return data.map(Cities.fromJson).toList();
|
return data.map(CitySupadartModel.fromJson).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
static Cities converterSingle(Map<String, dynamic> data) {
|
static CitySupadartModel converterSingle(Map<String, dynamic> data) {
|
||||||
return Cities.fromJson(data);
|
return CitySupadartModel.fromJson(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map<String, dynamic> _generateMap({
|
static Map<String, dynamic> _generateMap({
|
||||||
|
@ -72,8 +72,8 @@ class Cities implements SupadartClass<Cities> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory Cities.fromJson(Map<String, dynamic> jsonn) {
|
factory CitySupadartModel.fromJson(Map<String, dynamic> jsonn) {
|
||||||
return Cities(
|
return CitySupadartModel(
|
||||||
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
||||||
name: jsonn['name'] != null ? jsonn['name'].toString() : '',
|
name: jsonn['name'] != null ? jsonn['name'].toString() : '',
|
||||||
createdAt:
|
createdAt:
|
||||||
|
@ -97,13 +97,13 @@ class Cities implements SupadartClass<Cities> {
|
||||||
}
|
}
|
||||||
|
|
||||||
static const _unset = Object();
|
static const _unset = Object();
|
||||||
Cities copyWith({
|
CitySupadartModel copyWith({
|
||||||
Object? id = _unset,
|
Object? id = _unset,
|
||||||
Object? name = _unset,
|
Object? name = _unset,
|
||||||
Object? createdAt = _unset,
|
Object? createdAt = _unset,
|
||||||
Object? updatedAt = _unset,
|
Object? updatedAt = _unset,
|
||||||
}) {
|
}) {
|
||||||
return Cities(
|
return CitySupadartModel(
|
||||||
id: id == _unset ? this.id : id as String,
|
id: id == _unset ? this.id : id as String,
|
||||||
name: name == _unset ? this.name : name as String,
|
name: name == _unset ? this.name : name as String,
|
||||||
createdAt: createdAt == _unset ? this.createdAt : createdAt as DateTime?,
|
createdAt: createdAt == _unset ? this.createdAt : createdAt as DateTime?,
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
import 'package:sigap/supadart/supadart_exports.dart';
|
import 'package:sigap/supadart/supadart_exports.dart';
|
||||||
import 'package:sigap/supadart/supadart_header.dart';
|
import 'package:sigap/supadart/supadart_header.dart';
|
||||||
|
|
||||||
class Demographics implements SupadartClass<Demographics> {
|
class DemographicSupadartModel
|
||||||
|
implements SupadartClass<DemographicSupadartModel> {
|
||||||
final String id;
|
final String id;
|
||||||
final String districtId;
|
final String districtId;
|
||||||
final int population;
|
final int population;
|
||||||
|
@ -13,9 +14,9 @@ class Demographics implements SupadartClass<Demographics> {
|
||||||
final int year;
|
final int year;
|
||||||
final DateTime? createdAt;
|
final DateTime? createdAt;
|
||||||
final DateTime? updatedAt;
|
final DateTime? updatedAt;
|
||||||
final Districts? district;
|
final DistrictSupadartModel? district;
|
||||||
|
|
||||||
const Demographics({
|
const DemographicSupadartModel({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.districtId,
|
required this.districtId,
|
||||||
required this.population,
|
required this.population,
|
||||||
|
@ -27,7 +28,7 @@ class Demographics implements SupadartClass<Demographics> {
|
||||||
this.district,
|
this.district,
|
||||||
});
|
});
|
||||||
|
|
||||||
static String get table_name => 'demographics';
|
static String get table_name => 'demographicSupadartModel';
|
||||||
static String get c_id => 'id';
|
static String get c_id => 'id';
|
||||||
static String get c_districtId => 'district_id';
|
static String get c_districtId => 'district_id';
|
||||||
static String get c_population => 'population';
|
static String get c_population => 'population';
|
||||||
|
@ -37,12 +38,14 @@ class Demographics implements SupadartClass<Demographics> {
|
||||||
static String get c_createdAt => 'created_at';
|
static String get c_createdAt => 'created_at';
|
||||||
static String get c_updatedAt => 'updated_at';
|
static String get c_updatedAt => 'updated_at';
|
||||||
|
|
||||||
static List<Demographics> converter(List<Map<String, dynamic>> data) {
|
static List<DemographicSupadartModel> converter(
|
||||||
return data.map(Demographics.fromJson).toList();
|
List<Map<String, dynamic>> data,
|
||||||
|
) {
|
||||||
|
return data.map(DemographicSupadartModel.fromJson).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
static Demographics converterSingle(Map<String, dynamic> data) {
|
static DemographicSupadartModel converterSingle(Map<String, dynamic> data) {
|
||||||
return Demographics.fromJson(data);
|
return DemographicSupadartModel.fromJson(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map<String, dynamic> _generateMap({
|
static Map<String, dynamic> _generateMap({
|
||||||
|
@ -113,8 +116,8 @@ class Demographics implements SupadartClass<Demographics> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory Demographics.fromJson(Map<String, dynamic> jsonn) {
|
factory DemographicSupadartModel.fromJson(Map<String, dynamic> jsonn) {
|
||||||
return Demographics(
|
return DemographicSupadartModel(
|
||||||
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
||||||
districtId:
|
districtId:
|
||||||
jsonn['district_id'] != null ? jsonn['district_id'].toString() : '',
|
jsonn['district_id'] != null ? jsonn['district_id'].toString() : '',
|
||||||
|
@ -141,7 +144,9 @@ class Demographics implements SupadartClass<Demographics> {
|
||||||
: null,
|
: null,
|
||||||
district:
|
district:
|
||||||
jsonn['districts'] != null
|
jsonn['districts'] != null
|
||||||
? Districts.fromJson(jsonn['districts'] as Map<String, dynamic>)
|
? DistrictSupadartModel.fromJson(
|
||||||
|
jsonn['districts'] as Map<String, dynamic>,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -161,7 +166,7 @@ class Demographics implements SupadartClass<Demographics> {
|
||||||
}
|
}
|
||||||
|
|
||||||
static const _unset = Object();
|
static const _unset = Object();
|
||||||
Demographics copyWith({
|
DemographicSupadartModel copyWith({
|
||||||
Object? id = _unset,
|
Object? id = _unset,
|
||||||
Object? districtId = _unset,
|
Object? districtId = _unset,
|
||||||
Object? population = _unset,
|
Object? population = _unset,
|
||||||
|
@ -172,7 +177,7 @@ class Demographics implements SupadartClass<Demographics> {
|
||||||
Object? updatedAt = _unset,
|
Object? updatedAt = _unset,
|
||||||
Object? district = _unset,
|
Object? district = _unset,
|
||||||
}) {
|
}) {
|
||||||
return Demographics(
|
return DemographicSupadartModel(
|
||||||
id: id == _unset ? this.id : id as String,
|
id: id == _unset ? this.id : id as String,
|
||||||
districtId: districtId == _unset ? this.districtId : districtId as String,
|
districtId: districtId == _unset ? this.districtId : districtId as String,
|
||||||
population: population == _unset ? this.population : population as int,
|
population: population == _unset ? this.population : population as int,
|
||||||
|
@ -187,7 +192,10 @@ class Demographics implements SupadartClass<Demographics> {
|
||||||
year: year == _unset ? this.year : year as int,
|
year: year == _unset ? this.year : year as int,
|
||||||
createdAt: createdAt == _unset ? this.createdAt : createdAt as DateTime?,
|
createdAt: createdAt == _unset ? this.createdAt : createdAt as DateTime?,
|
||||||
updatedAt: updatedAt == _unset ? this.updatedAt : updatedAt as DateTime?,
|
updatedAt: updatedAt == _unset ? this.updatedAt : updatedAt as DateTime?,
|
||||||
district: district == _unset ? this.district : district as Districts?,
|
district:
|
||||||
|
district == _unset
|
||||||
|
? this.district
|
||||||
|
: district as DistrictSupadartModel?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,15 +4,15 @@
|
||||||
import 'package:sigap/supadart/supadart_exports.dart';
|
import 'package:sigap/supadart/supadart_exports.dart';
|
||||||
import 'package:sigap/supadart/supadart_header.dart';
|
import 'package:sigap/supadart/supadart_header.dart';
|
||||||
|
|
||||||
class Districts implements SupadartClass<Districts> {
|
class DistrictSupadartModel implements SupadartClass<DistrictSupadartModel> {
|
||||||
final String id;
|
final String id;
|
||||||
final String cityId;
|
final String cityId;
|
||||||
final String name;
|
final String name;
|
||||||
final DateTime? createdAt;
|
final DateTime? createdAt;
|
||||||
final DateTime? updatedAt;
|
final DateTime? updatedAt;
|
||||||
final Cities? city;
|
final CitySupadartModel? city;
|
||||||
|
|
||||||
const Districts({
|
const DistrictSupadartModel({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.cityId,
|
required this.cityId,
|
||||||
required this.name,
|
required this.name,
|
||||||
|
@ -21,19 +21,21 @@ class Districts implements SupadartClass<Districts> {
|
||||||
this.city,
|
this.city,
|
||||||
});
|
});
|
||||||
|
|
||||||
static String get table_name => 'districts';
|
static String get table_name => 'districtSupadartModel';
|
||||||
static String get c_id => 'id';
|
static String get c_id => 'id';
|
||||||
static String get c_cityId => 'city_id';
|
static String get c_cityId => 'city_id';
|
||||||
static String get c_name => 'name';
|
static String get c_name => 'name';
|
||||||
static String get c_createdAt => 'created_at';
|
static String get c_createdAt => 'created_at';
|
||||||
static String get c_updatedAt => 'updated_at';
|
static String get c_updatedAt => 'updated_at';
|
||||||
|
|
||||||
static List<Districts> converter(List<Map<String, dynamic>> data) {
|
static List<DistrictSupadartModel> converter(
|
||||||
return data.map(Districts.fromJson).toList();
|
List<Map<String, dynamic>> data,
|
||||||
|
) {
|
||||||
|
return data.map(DistrictSupadartModel.fromJson).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
static Districts converterSingle(Map<String, dynamic> data) {
|
static DistrictSupadartModel converterSingle(Map<String, dynamic> data) {
|
||||||
return Districts.fromJson(data);
|
return DistrictSupadartModel.fromJson(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map<String, dynamic> _generateMap({
|
static Map<String, dynamic> _generateMap({
|
||||||
|
@ -84,8 +86,8 @@ class Districts implements SupadartClass<Districts> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory Districts.fromJson(Map<String, dynamic> jsonn) {
|
factory DistrictSupadartModel.fromJson(Map<String, dynamic> jsonn) {
|
||||||
return Districts(
|
return DistrictSupadartModel(
|
||||||
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
||||||
cityId: jsonn['city_id'] != null ? jsonn['city_id'].toString() : '',
|
cityId: jsonn['city_id'] != null ? jsonn['city_id'].toString() : '',
|
||||||
name: jsonn['name'] != null ? jsonn['name'].toString() : '',
|
name: jsonn['name'] != null ? jsonn['name'].toString() : '',
|
||||||
|
@ -99,7 +101,9 @@ class Districts implements SupadartClass<Districts> {
|
||||||
: null,
|
: null,
|
||||||
city:
|
city:
|
||||||
jsonn['cities'] != null
|
jsonn['cities'] != null
|
||||||
? Cities.fromJson(jsonn['cities'] as Map<String, dynamic>)
|
? CitySupadartModel.fromJson(
|
||||||
|
jsonn['cities'] as Map<String, dynamic>,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -116,7 +120,7 @@ class Districts implements SupadartClass<Districts> {
|
||||||
}
|
}
|
||||||
|
|
||||||
static const _unset = Object();
|
static const _unset = Object();
|
||||||
Districts copyWith({
|
DistrictSupadartModel copyWith({
|
||||||
Object? id = _unset,
|
Object? id = _unset,
|
||||||
Object? cityId = _unset,
|
Object? cityId = _unset,
|
||||||
Object? name = _unset,
|
Object? name = _unset,
|
||||||
|
@ -124,13 +128,13 @@ class Districts implements SupadartClass<Districts> {
|
||||||
Object? updatedAt = _unset,
|
Object? updatedAt = _unset,
|
||||||
Object? city = _unset,
|
Object? city = _unset,
|
||||||
}) {
|
}) {
|
||||||
return Districts(
|
return DistrictSupadartModel(
|
||||||
id: id == _unset ? this.id : id as String,
|
id: id == _unset ? this.id : id as String,
|
||||||
cityId: cityId == _unset ? this.cityId : cityId as String,
|
cityId: cityId == _unset ? this.cityId : cityId as String,
|
||||||
name: name == _unset ? this.name : name as String,
|
name: name == _unset ? this.name : name as String,
|
||||||
createdAt: createdAt == _unset ? this.createdAt : createdAt as DateTime?,
|
createdAt: createdAt == _unset ? this.createdAt : createdAt as DateTime?,
|
||||||
updatedAt: updatedAt == _unset ? this.updatedAt : updatedAt as DateTime?,
|
updatedAt: updatedAt == _unset ? this.updatedAt : updatedAt as DateTime?,
|
||||||
city: city == _unset ? this.city : city as Cities?,
|
city: city == _unset ? this.city : city as CitySupadartModel?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
import 'package:sigap/supadart/supadart_exports.dart';
|
import 'package:sigap/supadart/supadart_exports.dart';
|
||||||
import 'package:sigap/supadart/supadart_header.dart';
|
import 'package:sigap/supadart/supadart_header.dart';
|
||||||
|
|
||||||
class Geographics implements SupadartClass<Geographics> {
|
class GeographicSupadartModel
|
||||||
|
implements SupadartClass<GeographicSupadartModel> {
|
||||||
final String id;
|
final String id;
|
||||||
final String districtId;
|
final String districtId;
|
||||||
final String? address;
|
final String? address;
|
||||||
|
@ -19,9 +20,9 @@ class Geographics implements SupadartClass<Geographics> {
|
||||||
final String? type;
|
final String? type;
|
||||||
final String location;
|
final String location;
|
||||||
final int? year;
|
final int? year;
|
||||||
final Districts? district;
|
final DistrictSupadartModel? district;
|
||||||
|
|
||||||
const Geographics({
|
const GeographicSupadartModel({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.districtId,
|
required this.districtId,
|
||||||
this.address,
|
this.address,
|
||||||
|
@ -39,7 +40,7 @@ class Geographics implements SupadartClass<Geographics> {
|
||||||
this.district,
|
this.district,
|
||||||
});
|
});
|
||||||
|
|
||||||
static String get table_name => 'geographics';
|
static String get table_name => 'geographicSupadartModel';
|
||||||
static String get c_id => 'id';
|
static String get c_id => 'id';
|
||||||
static String get c_districtId => 'district_id';
|
static String get c_districtId => 'district_id';
|
||||||
static String get c_address => 'address';
|
static String get c_address => 'address';
|
||||||
|
@ -55,12 +56,14 @@ class Geographics implements SupadartClass<Geographics> {
|
||||||
static String get c_location => 'location';
|
static String get c_location => 'location';
|
||||||
static String get c_year => 'year';
|
static String get c_year => 'year';
|
||||||
|
|
||||||
static List<Geographics> converter(List<Map<String, dynamic>> data) {
|
static List<GeographicSupadartModel> converter(
|
||||||
return data.map(Geographics.fromJson).toList();
|
List<Map<String, dynamic>> data,
|
||||||
|
) {
|
||||||
|
return data.map(GeographicSupadartModel.fromJson).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
static Geographics converterSingle(Map<String, dynamic> data) {
|
static GeographicSupadartModel converterSingle(Map<String, dynamic> data) {
|
||||||
return Geographics.fromJson(data);
|
return GeographicSupadartModel.fromJson(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map<String, dynamic> _generateMap({
|
static Map<String, dynamic> _generateMap({
|
||||||
|
@ -165,8 +168,8 @@ class Geographics implements SupadartClass<Geographics> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory Geographics.fromJson(Map<String, dynamic> jsonn) {
|
factory GeographicSupadartModel.fromJson(Map<String, dynamic> jsonn) {
|
||||||
return Geographics(
|
return GeographicSupadartModel(
|
||||||
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
||||||
districtId:
|
districtId:
|
||||||
jsonn['district_id'] != null ? jsonn['district_id'].toString() : '',
|
jsonn['district_id'] != null ? jsonn['district_id'].toString() : '',
|
||||||
|
@ -200,7 +203,9 @@ class Geographics implements SupadartClass<Geographics> {
|
||||||
year: jsonn['year'] != null ? int.parse(jsonn['year'].toString()) : null,
|
year: jsonn['year'] != null ? int.parse(jsonn['year'].toString()) : null,
|
||||||
district:
|
district:
|
||||||
jsonn['districts'] != null
|
jsonn['districts'] != null
|
||||||
? Districts.fromJson(jsonn['districts'] as Map<String, dynamic>)
|
? DistrictSupadartModel.fromJson(
|
||||||
|
jsonn['districts'] as Map<String, dynamic>,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -225,7 +230,7 @@ class Geographics implements SupadartClass<Geographics> {
|
||||||
}
|
}
|
||||||
|
|
||||||
static const _unset = Object();
|
static const _unset = Object();
|
||||||
Geographics copyWith({
|
GeographicSupadartModel copyWith({
|
||||||
Object? id = _unset,
|
Object? id = _unset,
|
||||||
Object? districtId = _unset,
|
Object? districtId = _unset,
|
||||||
Object? address = _unset,
|
Object? address = _unset,
|
||||||
|
@ -242,7 +247,7 @@ class Geographics implements SupadartClass<Geographics> {
|
||||||
Object? year = _unset,
|
Object? year = _unset,
|
||||||
Object? district = _unset,
|
Object? district = _unset,
|
||||||
}) {
|
}) {
|
||||||
return Geographics(
|
return GeographicSupadartModel(
|
||||||
id: id == _unset ? this.id : id as String,
|
id: id == _unset ? this.id : id as String,
|
||||||
districtId: districtId == _unset ? this.districtId : districtId as String,
|
districtId: districtId == _unset ? this.districtId : districtId as String,
|
||||||
address: address == _unset ? this.address : address as String?,
|
address: address == _unset ? this.address : address as String?,
|
||||||
|
@ -258,7 +263,10 @@ class Geographics implements SupadartClass<Geographics> {
|
||||||
type: type == _unset ? this.type : type as String?,
|
type: type == _unset ? this.type : type as String?,
|
||||||
location: location == _unset ? this.location : location as String,
|
location: location == _unset ? this.location : location as String,
|
||||||
year: year == _unset ? this.year : year as int?,
|
year: year == _unset ? this.year : year as int?,
|
||||||
district: district == _unset ? this.district : district as Districts?,
|
district:
|
||||||
|
district == _unset
|
||||||
|
? this.district
|
||||||
|
: district as DistrictSupadartModel?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
import 'package:sigap/supadart/supadart_exports.dart';
|
import 'package:sigap/supadart/supadart_exports.dart';
|
||||||
import 'package:sigap/supadart/supadart_header.dart';
|
import 'package:sigap/supadart/supadart_header.dart';
|
||||||
|
|
||||||
class LocationLogs implements SupadartClass<LocationLogs> {
|
class LocationLogSupadartModel
|
||||||
|
implements SupadartClass<LocationLogSupadartModel> {
|
||||||
final String id;
|
final String id;
|
||||||
final String userId;
|
final String userId;
|
||||||
final double latitude;
|
final double latitude;
|
||||||
|
@ -14,9 +15,9 @@ class LocationLogs implements SupadartClass<LocationLogs> {
|
||||||
final String? description;
|
final String? description;
|
||||||
final DateTime createdAt;
|
final DateTime createdAt;
|
||||||
final DateTime updatedAt;
|
final DateTime updatedAt;
|
||||||
final Users? user;
|
final UserSupadartModel? user;
|
||||||
|
|
||||||
const LocationLogs({
|
const LocationLogSupadartModel({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.userId,
|
required this.userId,
|
||||||
required this.latitude,
|
required this.latitude,
|
||||||
|
@ -40,12 +41,14 @@ class LocationLogs implements SupadartClass<LocationLogs> {
|
||||||
static String get c_createdAt => 'created_at';
|
static String get c_createdAt => 'created_at';
|
||||||
static String get c_updatedAt => 'updated_at';
|
static String get c_updatedAt => 'updated_at';
|
||||||
|
|
||||||
static List<LocationLogs> converter(List<Map<String, dynamic>> data) {
|
static List<LocationLogSupadartModel> converter(
|
||||||
return data.map(LocationLogs.fromJson).toList();
|
List<Map<String, dynamic>> data,
|
||||||
|
) {
|
||||||
|
return data.map(LocationLogSupadartModel.fromJson).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
static LocationLogs converterSingle(Map<String, dynamic> data) {
|
static LocationLogSupadartModel converterSingle(Map<String, dynamic> data) {
|
||||||
return LocationLogs.fromJson(data);
|
return LocationLogSupadartModel.fromJson(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map<String, dynamic> _generateMap({
|
static Map<String, dynamic> _generateMap({
|
||||||
|
@ -120,8 +123,8 @@ class LocationLogs implements SupadartClass<LocationLogs> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory LocationLogs.fromJson(Map<String, dynamic> jsonn) {
|
factory LocationLogSupadartModel.fromJson(Map<String, dynamic> jsonn) {
|
||||||
return LocationLogs(
|
return LocationLogSupadartModel(
|
||||||
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
||||||
userId: jsonn['user_id'] != null ? jsonn['user_id'].toString() : '',
|
userId: jsonn['user_id'] != null ? jsonn['user_id'].toString() : '',
|
||||||
latitude:
|
latitude:
|
||||||
|
@ -149,7 +152,9 @@ class LocationLogs implements SupadartClass<LocationLogs> {
|
||||||
: DateTime.fromMillisecondsSinceEpoch(0),
|
: DateTime.fromMillisecondsSinceEpoch(0),
|
||||||
user:
|
user:
|
||||||
jsonn['users'] != null
|
jsonn['users'] != null
|
||||||
? Users.fromJson(jsonn['users'] as Map<String, dynamic>)
|
? UserSupadartModel.fromJson(
|
||||||
|
jsonn['users'] as Map<String, dynamic>,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -170,7 +175,7 @@ class LocationLogs implements SupadartClass<LocationLogs> {
|
||||||
}
|
}
|
||||||
|
|
||||||
static const _unset = Object();
|
static const _unset = Object();
|
||||||
LocationLogs copyWith({
|
LocationLogSupadartModel copyWith({
|
||||||
Object? id = _unset,
|
Object? id = _unset,
|
||||||
Object? userId = _unset,
|
Object? userId = _unset,
|
||||||
Object? latitude = _unset,
|
Object? latitude = _unset,
|
||||||
|
@ -182,7 +187,7 @@ class LocationLogs implements SupadartClass<LocationLogs> {
|
||||||
Object? updatedAt = _unset,
|
Object? updatedAt = _unset,
|
||||||
Object? user = _unset,
|
Object? user = _unset,
|
||||||
}) {
|
}) {
|
||||||
return LocationLogs(
|
return LocationLogSupadartModel(
|
||||||
id: id == _unset ? this.id : id as String,
|
id: id == _unset ? this.id : id as String,
|
||||||
userId: userId == _unset ? this.userId : userId as String,
|
userId: userId == _unset ? this.userId : userId as String,
|
||||||
latitude: latitude == _unset ? this.latitude : latitude as double,
|
latitude: latitude == _unset ? this.latitude : latitude as double,
|
||||||
|
@ -193,7 +198,7 @@ class LocationLogs implements SupadartClass<LocationLogs> {
|
||||||
description == _unset ? this.description : description as String?,
|
description == _unset ? this.description : description as String?,
|
||||||
createdAt: createdAt == _unset ? this.createdAt : createdAt as DateTime,
|
createdAt: createdAt == _unset ? this.createdAt : createdAt as DateTime,
|
||||||
updatedAt: updatedAt == _unset ? this.updatedAt : updatedAt as DateTime,
|
updatedAt: updatedAt == _unset ? this.updatedAt : updatedAt as DateTime,
|
||||||
user: user == _unset ? this.user : user as Users?,
|
user: user == _unset ? this.user : user as UserSupadartModel?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
import 'package:sigap/supadart/supadart_exports.dart';
|
import 'package:sigap/supadart/supadart_exports.dart';
|
||||||
import 'package:sigap/supadart/supadart_header.dart';
|
import 'package:sigap/supadart/supadart_header.dart';
|
||||||
|
|
||||||
class Locations implements SupadartClass<Locations> {
|
class LocationSupadartModel implements SupadartClass<LocationSupadartModel> {
|
||||||
final String id;
|
final String id;
|
||||||
final String districtId;
|
final String districtId;
|
||||||
final String eventId;
|
final String eventId;
|
||||||
|
@ -19,10 +19,10 @@ class Locations implements SupadartClass<Locations> {
|
||||||
final DateTime? updatedAt;
|
final DateTime? updatedAt;
|
||||||
final String location;
|
final String location;
|
||||||
final double? distanceToUnit;
|
final double? distanceToUnit;
|
||||||
final Districts? district;
|
final DistrictSupadartModel? district;
|
||||||
final Events? event;
|
final EventSupadartModel? event;
|
||||||
|
|
||||||
const Locations({
|
const LocationSupadartModel({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.districtId,
|
required this.districtId,
|
||||||
required this.eventId,
|
required this.eventId,
|
||||||
|
@ -41,7 +41,7 @@ class Locations implements SupadartClass<Locations> {
|
||||||
this.event,
|
this.event,
|
||||||
});
|
});
|
||||||
|
|
||||||
static String get table_name => 'locations';
|
static String get table_name => 'locationSupadartModel';
|
||||||
static String get c_id => 'id';
|
static String get c_id => 'id';
|
||||||
static String get c_districtId => 'district_id';
|
static String get c_districtId => 'district_id';
|
||||||
static String get c_eventId => 'event_id';
|
static String get c_eventId => 'event_id';
|
||||||
|
@ -57,12 +57,14 @@ class Locations implements SupadartClass<Locations> {
|
||||||
static String get c_location => 'location';
|
static String get c_location => 'location';
|
||||||
static String get c_distanceToUnit => 'distance_to_unit';
|
static String get c_distanceToUnit => 'distance_to_unit';
|
||||||
|
|
||||||
static List<Locations> converter(List<Map<String, dynamic>> data) {
|
static List<LocationSupadartModel> converter(
|
||||||
return data.map(Locations.fromJson).toList();
|
List<Map<String, dynamic>> data,
|
||||||
|
) {
|
||||||
|
return data.map(LocationSupadartModel.fromJson).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
static Locations converterSingle(Map<String, dynamic> data) {
|
static LocationSupadartModel converterSingle(Map<String, dynamic> data) {
|
||||||
return Locations.fromJson(data);
|
return LocationSupadartModel.fromJson(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map<String, dynamic> _generateMap({
|
static Map<String, dynamic> _generateMap({
|
||||||
|
@ -167,8 +169,8 @@ class Locations implements SupadartClass<Locations> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory Locations.fromJson(Map<String, dynamic> jsonn) {
|
factory LocationSupadartModel.fromJson(Map<String, dynamic> jsonn) {
|
||||||
return Locations(
|
return LocationSupadartModel(
|
||||||
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
||||||
districtId:
|
districtId:
|
||||||
jsonn['district_id'] != null ? jsonn['district_id'].toString() : '',
|
jsonn['district_id'] != null ? jsonn['district_id'].toString() : '',
|
||||||
|
@ -204,11 +206,15 @@ class Locations implements SupadartClass<Locations> {
|
||||||
: null,
|
: null,
|
||||||
district:
|
district:
|
||||||
jsonn['districts'] != null
|
jsonn['districts'] != null
|
||||||
? Districts.fromJson(jsonn['districts'] as Map<String, dynamic>)
|
? DistrictSupadartModel.fromJson(
|
||||||
|
jsonn['districts'] as Map<String, dynamic>,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
event:
|
event:
|
||||||
jsonn['events'] != null
|
jsonn['events'] != null
|
||||||
? Events.fromJson(jsonn['events'] as Map<String, dynamic>)
|
? EventSupadartModel.fromJson(
|
||||||
|
jsonn['events'] as Map<String, dynamic>,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -235,7 +241,7 @@ class Locations implements SupadartClass<Locations> {
|
||||||
}
|
}
|
||||||
|
|
||||||
static const _unset = Object();
|
static const _unset = Object();
|
||||||
Locations copyWith({
|
LocationSupadartModel copyWith({
|
||||||
Object? id = _unset,
|
Object? id = _unset,
|
||||||
Object? districtId = _unset,
|
Object? districtId = _unset,
|
||||||
Object? eventId = _unset,
|
Object? eventId = _unset,
|
||||||
|
@ -253,7 +259,7 @@ class Locations implements SupadartClass<Locations> {
|
||||||
Object? district = _unset,
|
Object? district = _unset,
|
||||||
Object? event = _unset,
|
Object? event = _unset,
|
||||||
}) {
|
}) {
|
||||||
return Locations(
|
return LocationSupadartModel(
|
||||||
id: id == _unset ? this.id : id as String,
|
id: id == _unset ? this.id : id as String,
|
||||||
districtId: districtId == _unset ? this.districtId : districtId as String,
|
districtId: districtId == _unset ? this.districtId : districtId as String,
|
||||||
eventId: eventId == _unset ? this.eventId : eventId as String,
|
eventId: eventId == _unset ? this.eventId : eventId as String,
|
||||||
|
@ -271,8 +277,11 @@ class Locations implements SupadartClass<Locations> {
|
||||||
distanceToUnit == _unset
|
distanceToUnit == _unset
|
||||||
? this.distanceToUnit
|
? this.distanceToUnit
|
||||||
: distanceToUnit as double?,
|
: distanceToUnit as double?,
|
||||||
district: district == _unset ? this.district : district as Districts?,
|
district:
|
||||||
event: event == _unset ? this.event : event as Events?,
|
district == _unset
|
||||||
|
? this.district
|
||||||
|
: district as DistrictSupadartModel?,
|
||||||
|
event: event == _unset ? this.event : event as EventSupadartModel?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
// WARNING: Modifications may be overwritten. Please make changes in the Supadart configuration.
|
// WARNING: Modifications may be overwritten. Please make changes in the Supadart configuration.
|
||||||
import 'package:sigap/supadart/supadart_header.dart';
|
import 'package:sigap/supadart/supadart_header.dart';
|
||||||
|
|
||||||
class CrimeCategories implements SupadartClass<CrimeCategories> {
|
class CrimeCategorySupadartModel
|
||||||
|
implements SupadartClass<CrimeCategorySupadartModel> {
|
||||||
final String id;
|
final String id;
|
||||||
final String name;
|
final String name;
|
||||||
final String description;
|
final String description;
|
||||||
|
@ -11,7 +12,7 @@ class CrimeCategories implements SupadartClass<CrimeCategories> {
|
||||||
final DateTime? updatedAt;
|
final DateTime? updatedAt;
|
||||||
final String? type;
|
final String? type;
|
||||||
|
|
||||||
const CrimeCategories({
|
const CrimeCategorySupadartModel({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.name,
|
required this.name,
|
||||||
required this.description,
|
required this.description,
|
||||||
|
@ -28,12 +29,14 @@ class CrimeCategories implements SupadartClass<CrimeCategories> {
|
||||||
static String get c_updatedAt => 'updated_at';
|
static String get c_updatedAt => 'updated_at';
|
||||||
static String get c_type => 'type';
|
static String get c_type => 'type';
|
||||||
|
|
||||||
static List<CrimeCategories> converter(List<Map<String, dynamic>> data) {
|
static List<CrimeCategorySupadartModel> converter(
|
||||||
return data.map(CrimeCategories.fromJson).toList();
|
List<Map<String, dynamic>> data,
|
||||||
|
) {
|
||||||
|
return data.map(CrimeCategorySupadartModel.fromJson).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
static CrimeCategories converterSingle(Map<String, dynamic> data) {
|
static CrimeCategorySupadartModel converterSingle(Map<String, dynamic> data) {
|
||||||
return CrimeCategories.fromJson(data);
|
return CrimeCategorySupadartModel.fromJson(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map<String, dynamic> _generateMap({
|
static Map<String, dynamic> _generateMap({
|
||||||
|
@ -90,8 +93,8 @@ class CrimeCategories implements SupadartClass<CrimeCategories> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory CrimeCategories.fromJson(Map<String, dynamic> jsonn) {
|
factory CrimeCategorySupadartModel.fromJson(Map<String, dynamic> jsonn) {
|
||||||
return CrimeCategories(
|
return CrimeCategorySupadartModel(
|
||||||
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
||||||
name: jsonn['name'] != null ? jsonn['name'].toString() : '',
|
name: jsonn['name'] != null ? jsonn['name'].toString() : '',
|
||||||
description:
|
description:
|
||||||
|
@ -120,7 +123,7 @@ class CrimeCategories implements SupadartClass<CrimeCategories> {
|
||||||
}
|
}
|
||||||
|
|
||||||
static const _unset = Object();
|
static const _unset = Object();
|
||||||
CrimeCategories copyWith({
|
CrimeCategorySupadartModel copyWith({
|
||||||
Object? id = _unset,
|
Object? id = _unset,
|
||||||
Object? name = _unset,
|
Object? name = _unset,
|
||||||
Object? description = _unset,
|
Object? description = _unset,
|
||||||
|
@ -128,7 +131,7 @@ class CrimeCategories implements SupadartClass<CrimeCategories> {
|
||||||
Object? updatedAt = _unset,
|
Object? updatedAt = _unset,
|
||||||
Object? type = _unset,
|
Object? type = _unset,
|
||||||
}) {
|
}) {
|
||||||
return CrimeCategories(
|
return CrimeCategorySupadartModel(
|
||||||
id: id == _unset ? this.id : id as String,
|
id: id == _unset ? this.id : id as String,
|
||||||
name: name == _unset ? this.name : name as String,
|
name: name == _unset ? this.name : name as String,
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -6,7 +6,8 @@ import 'package:sigap/supadart/supadart_header.dart';
|
||||||
|
|
||||||
enum CRIME_STATUS { closed, open, resolved, underInvestigation, unresolved }
|
enum CRIME_STATUS { closed, open, resolved, underInvestigation, unresolved }
|
||||||
|
|
||||||
class CrimeIncidents implements SupadartClass<CrimeIncidents> {
|
class CrimeIncidentSupadartModel
|
||||||
|
implements SupadartClass<CrimeIncidentSupadartModel> {
|
||||||
final String id;
|
final String id;
|
||||||
final String crimeId;
|
final String crimeId;
|
||||||
final String crimeCategoryId;
|
final String crimeCategoryId;
|
||||||
|
@ -18,11 +19,11 @@ class CrimeIncidents implements SupadartClass<CrimeIncidents> {
|
||||||
final DateTime? updatedAt;
|
final DateTime? updatedAt;
|
||||||
final DateTime timestamp;
|
final DateTime timestamp;
|
||||||
|
|
||||||
final CrimeCategories? crimeCategory;
|
final CrimeCategorySupadartModel? crimeCategory;
|
||||||
final Crimes? crime;
|
final CrimeSupadartModel? crime;
|
||||||
final Locations? location;
|
final LocationSupadartModel? location;
|
||||||
|
|
||||||
const CrimeIncidents({
|
const CrimeIncidentSupadartModel({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.crimeId,
|
required this.crimeId,
|
||||||
required this.crimeCategoryId,
|
required this.crimeCategoryId,
|
||||||
|
@ -50,12 +51,14 @@ class CrimeIncidents implements SupadartClass<CrimeIncidents> {
|
||||||
static String get c_updatedAt => 'updated_at';
|
static String get c_updatedAt => 'updated_at';
|
||||||
static String get c_timestamp => 'timestamp';
|
static String get c_timestamp => 'timestamp';
|
||||||
|
|
||||||
static List<CrimeIncidents> converter(List<Map<String, dynamic>> data) {
|
static List<CrimeIncidentSupadartModel> converter(
|
||||||
return data.map(CrimeIncidents.fromJson).toList();
|
List<Map<String, dynamic>> data,
|
||||||
|
) {
|
||||||
|
return data.map(CrimeIncidentSupadartModel.fromJson).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
static CrimeIncidents converterSingle(Map<String, dynamic> data) {
|
static CrimeIncidentSupadartModel converterSingle(Map<String, dynamic> data) {
|
||||||
return CrimeIncidents.fromJson(data);
|
return CrimeIncidentSupadartModel.fromJson(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map<String, dynamic> _generateMap({
|
static Map<String, dynamic> _generateMap({
|
||||||
|
@ -136,8 +139,8 @@ class CrimeIncidents implements SupadartClass<CrimeIncidents> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory CrimeIncidents.fromJson(Map<String, dynamic> jsonn) {
|
factory CrimeIncidentSupadartModel.fromJson(Map<String, dynamic> jsonn) {
|
||||||
return CrimeIncidents(
|
return CrimeIncidentSupadartModel(
|
||||||
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
||||||
crimeId: jsonn['crime_id'] != null ? jsonn['crime_id'].toString() : '',
|
crimeId: jsonn['crime_id'] != null ? jsonn['crime_id'].toString() : '',
|
||||||
crimeCategoryId:
|
crimeCategoryId:
|
||||||
|
@ -170,17 +173,21 @@ class CrimeIncidents implements SupadartClass<CrimeIncidents> {
|
||||||
: DateTime.fromMillisecondsSinceEpoch(0),
|
: DateTime.fromMillisecondsSinceEpoch(0),
|
||||||
crimeCategory:
|
crimeCategory:
|
||||||
jsonn['crime_categories'] != null
|
jsonn['crime_categories'] != null
|
||||||
? CrimeCategories.fromJson(
|
? CrimeCategorySupadartModel.fromJson(
|
||||||
jsonn['crime_categories'] as Map<String, dynamic>,
|
jsonn['crime_categories'] as Map<String, dynamic>,
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
crime:
|
crime:
|
||||||
jsonn['crimes'] != null
|
jsonn['crimes'] != null
|
||||||
? Crimes.fromJson(jsonn['crimes'] as Map<String, dynamic>)
|
? CrimeSupadartModel.fromJson(
|
||||||
|
jsonn['crimes'] as Map<String, dynamic>,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
location:
|
location:
|
||||||
jsonn['locations'] != null
|
jsonn['locations'] != null
|
||||||
? Locations.fromJson(jsonn['locations'] as Map<String, dynamic>)
|
? LocationSupadartModel.fromJson(
|
||||||
|
jsonn['locations'] as Map<String, dynamic>,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -201,7 +208,7 @@ class CrimeIncidents implements SupadartClass<CrimeIncidents> {
|
||||||
}
|
}
|
||||||
|
|
||||||
static const _unset = Object();
|
static const _unset = Object();
|
||||||
CrimeIncidents copyWith({
|
CrimeIncidentSupadartModel copyWith({
|
||||||
Object? id = _unset,
|
Object? id = _unset,
|
||||||
Object? crimeId = _unset,
|
Object? crimeId = _unset,
|
||||||
Object? crimeCategoryId = _unset,
|
Object? crimeCategoryId = _unset,
|
||||||
|
@ -216,7 +223,7 @@ class CrimeIncidents implements SupadartClass<CrimeIncidents> {
|
||||||
Object? crime = _unset,
|
Object? crime = _unset,
|
||||||
Object? location = _unset,
|
Object? location = _unset,
|
||||||
}) {
|
}) {
|
||||||
return CrimeIncidents(
|
return CrimeIncidentSupadartModel(
|
||||||
id: id == _unset ? this.id : id as String,
|
id: id == _unset ? this.id : id as String,
|
||||||
crimeId: crimeId == _unset ? this.crimeId : crimeId as String,
|
crimeId: crimeId == _unset ? this.crimeId : crimeId as String,
|
||||||
crimeCategoryId:
|
crimeCategoryId:
|
||||||
|
@ -235,9 +242,12 @@ class CrimeIncidents implements SupadartClass<CrimeIncidents> {
|
||||||
crimeCategory:
|
crimeCategory:
|
||||||
crimeCategory == _unset
|
crimeCategory == _unset
|
||||||
? this.crimeCategory
|
? this.crimeCategory
|
||||||
: crimeCategory as CrimeCategories?,
|
: crimeCategory as CrimeCategorySupadartModel?,
|
||||||
crime: crime == _unset ? this.crime : crime as Crimes?,
|
crime: crime == _unset ? this.crime : crime as CrimeSupadartModel?,
|
||||||
location: location == _unset ? this.location : location as Locations?,
|
location:
|
||||||
|
location == _unset
|
||||||
|
? this.location
|
||||||
|
: location as LocationSupadartModel?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ import 'package:sigap/supadart/supadart_header.dart';
|
||||||
|
|
||||||
enum CRIME_RATES { critical, high, low, medium }
|
enum CRIME_RATES { critical, high, low, medium }
|
||||||
|
|
||||||
class Crimes implements SupadartClass<Crimes> {
|
class CrimeSupadartModel implements SupadartClass<CrimeSupadartModel> {
|
||||||
final String id;
|
final String id;
|
||||||
final String districtId;
|
final String districtId;
|
||||||
final DateTime? createdAt;
|
final DateTime? createdAt;
|
||||||
|
@ -20,9 +20,9 @@ class Crimes implements SupadartClass<Crimes> {
|
||||||
final String? sourceType;
|
final String? sourceType;
|
||||||
final int crimeCleared;
|
final int crimeCleared;
|
||||||
final double avgCrime;
|
final double avgCrime;
|
||||||
final Districts? district;
|
final DistrictSupadartModel? district;
|
||||||
|
|
||||||
const Crimes({
|
const CrimeSupadartModel({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.districtId,
|
required this.districtId,
|
||||||
this.createdAt,
|
this.createdAt,
|
||||||
|
@ -39,7 +39,7 @@ class Crimes implements SupadartClass<Crimes> {
|
||||||
this.district,
|
this.district,
|
||||||
});
|
});
|
||||||
|
|
||||||
static String get table_name => 'crimes';
|
static String get table_name => 'crimeSupadartModel';
|
||||||
static String get c_id => 'id';
|
static String get c_id => 'id';
|
||||||
static String get c_districtId => 'district_id';
|
static String get c_districtId => 'district_id';
|
||||||
static String get c_createdAt => 'created_at';
|
static String get c_createdAt => 'created_at';
|
||||||
|
@ -54,12 +54,12 @@ class Crimes implements SupadartClass<Crimes> {
|
||||||
static String get c_crimeCleared => 'crime_cleared';
|
static String get c_crimeCleared => 'crime_cleared';
|
||||||
static String get c_avgCrime => 'avg_crime';
|
static String get c_avgCrime => 'avg_crime';
|
||||||
|
|
||||||
static List<Crimes> converter(List<Map<String, dynamic>> data) {
|
static List<CrimeSupadartModel> converter(List<Map<String, dynamic>> data) {
|
||||||
return data.map(Crimes.fromJson).toList();
|
return data.map(CrimeSupadartModel.fromJson).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
static Crimes converterSingle(Map<String, dynamic> data) {
|
static CrimeSupadartModel converterSingle(Map<String, dynamic> data) {
|
||||||
return Crimes.fromJson(data);
|
return CrimeSupadartModel.fromJson(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map<String, dynamic> _generateMap({
|
static Map<String, dynamic> _generateMap({
|
||||||
|
@ -158,8 +158,8 @@ class Crimes implements SupadartClass<Crimes> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory Crimes.fromJson(Map<String, dynamic> jsonn) {
|
factory CrimeSupadartModel.fromJson(Map<String, dynamic> jsonn) {
|
||||||
return Crimes(
|
return CrimeSupadartModel(
|
||||||
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
||||||
districtId:
|
districtId:
|
||||||
jsonn['district_id'] != null ? jsonn['district_id'].toString() : '',
|
jsonn['district_id'] != null ? jsonn['district_id'].toString() : '',
|
||||||
|
@ -199,7 +199,9 @@ class Crimes implements SupadartClass<Crimes> {
|
||||||
: 0.0,
|
: 0.0,
|
||||||
district:
|
district:
|
||||||
jsonn['districts'] != null
|
jsonn['districts'] != null
|
||||||
? Districts.fromJson(jsonn['districts'] as Map<String, dynamic>)
|
? DistrictSupadartModel.fromJson(
|
||||||
|
jsonn['districts'] as Map<String, dynamic>,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -224,7 +226,7 @@ class Crimes implements SupadartClass<Crimes> {
|
||||||
}
|
}
|
||||||
|
|
||||||
static const _unset = Object();
|
static const _unset = Object();
|
||||||
Crimes copyWith({
|
CrimeSupadartModel copyWith({
|
||||||
Object? id = _unset,
|
Object? id = _unset,
|
||||||
Object? districtId = _unset,
|
Object? districtId = _unset,
|
||||||
Object? createdAt = _unset,
|
Object? createdAt = _unset,
|
||||||
|
@ -240,7 +242,7 @@ class Crimes implements SupadartClass<Crimes> {
|
||||||
Object? avgCrime = _unset,
|
Object? avgCrime = _unset,
|
||||||
Object? district = _unset,
|
Object? district = _unset,
|
||||||
}) {
|
}) {
|
||||||
return Crimes(
|
return CrimeSupadartModel(
|
||||||
id: id == _unset ? this.id : id as String,
|
id: id == _unset ? this.id : id as String,
|
||||||
districtId: districtId == _unset ? this.districtId : districtId as String,
|
districtId: districtId == _unset ? this.districtId : districtId as String,
|
||||||
createdAt: createdAt == _unset ? this.createdAt : createdAt as DateTime?,
|
createdAt: createdAt == _unset ? this.createdAt : createdAt as DateTime?,
|
||||||
|
@ -257,7 +259,10 @@ class Crimes implements SupadartClass<Crimes> {
|
||||||
crimeCleared:
|
crimeCleared:
|
||||||
crimeCleared == _unset ? this.crimeCleared : crimeCleared as int,
|
crimeCleared == _unset ? this.crimeCleared : crimeCleared as int,
|
||||||
avgCrime: avgCrime == _unset ? this.avgCrime : avgCrime as double,
|
avgCrime: avgCrime == _unset ? this.avgCrime : avgCrime as double,
|
||||||
district: district == _unset ? this.district : district as Districts?,
|
district:
|
||||||
|
district == _unset
|
||||||
|
? this.district
|
||||||
|
: district as DistrictSupadartModel?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,16 +4,16 @@
|
||||||
import 'package:sigap/supadart/supadart_exports.dart';
|
import 'package:sigap/supadart/supadart_exports.dart';
|
||||||
import 'package:sigap/supadart/supadart_header.dart';
|
import 'package:sigap/supadart/supadart_header.dart';
|
||||||
|
|
||||||
class Events implements SupadartClass<Events> {
|
class EventSupadartModel implements SupadartClass<EventSupadartModel> {
|
||||||
final String id;
|
final String id;
|
||||||
final String name;
|
final String name;
|
||||||
final String? description;
|
final String? description;
|
||||||
final String code;
|
final String code;
|
||||||
final DateTime createdAt;
|
final DateTime createdAt;
|
||||||
final String userId;
|
final String userId;
|
||||||
final Users? user;
|
final UserSupadartModel? user;
|
||||||
|
|
||||||
const Events({
|
const EventSupadartModel({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.name,
|
required this.name,
|
||||||
this.description,
|
this.description,
|
||||||
|
@ -23,7 +23,7 @@ class Events implements SupadartClass<Events> {
|
||||||
this.user,
|
this.user,
|
||||||
});
|
});
|
||||||
|
|
||||||
static String get table_name => 'events';
|
static String get table_name => 'eventSupadartModel';
|
||||||
static String get c_id => 'id';
|
static String get c_id => 'id';
|
||||||
static String get c_name => 'name';
|
static String get c_name => 'name';
|
||||||
static String get c_description => 'description';
|
static String get c_description => 'description';
|
||||||
|
@ -31,12 +31,12 @@ class Events implements SupadartClass<Events> {
|
||||||
static String get c_createdAt => 'created_at';
|
static String get c_createdAt => 'created_at';
|
||||||
static String get c_userId => 'user_id';
|
static String get c_userId => 'user_id';
|
||||||
|
|
||||||
static List<Events> converter(List<Map<String, dynamic>> data) {
|
static List<EventSupadartModel> converter(List<Map<String, dynamic>> data) {
|
||||||
return data.map(Events.fromJson).toList();
|
return data.map(EventSupadartModel.fromJson).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
static Events converterSingle(Map<String, dynamic> data) {
|
static EventSupadartModel converterSingle(Map<String, dynamic> data) {
|
||||||
return Events.fromJson(data);
|
return EventSupadartModel.fromJson(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map<String, dynamic> _generateMap({
|
static Map<String, dynamic> _generateMap({
|
||||||
|
@ -93,8 +93,8 @@ class Events implements SupadartClass<Events> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory Events.fromJson(Map<String, dynamic> jsonn) {
|
factory EventSupadartModel.fromJson(Map<String, dynamic> jsonn) {
|
||||||
return Events(
|
return EventSupadartModel(
|
||||||
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
||||||
name: jsonn['name'] != null ? jsonn['name'].toString() : '',
|
name: jsonn['name'] != null ? jsonn['name'].toString() : '',
|
||||||
description:
|
description:
|
||||||
|
@ -107,7 +107,9 @@ class Events implements SupadartClass<Events> {
|
||||||
userId: jsonn['user_id'] != null ? jsonn['user_id'].toString() : '',
|
userId: jsonn['user_id'] != null ? jsonn['user_id'].toString() : '',
|
||||||
user:
|
user:
|
||||||
jsonn['users'] != null
|
jsonn['users'] != null
|
||||||
? Users.fromJson(jsonn['users'] as Map<String, dynamic>)
|
? UserSupadartModel.fromJson(
|
||||||
|
jsonn['users'] as Map<String, dynamic>,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -125,7 +127,7 @@ class Events implements SupadartClass<Events> {
|
||||||
}
|
}
|
||||||
|
|
||||||
static const _unset = Object();
|
static const _unset = Object();
|
||||||
Events copyWith({
|
EventSupadartModel copyWith({
|
||||||
Object? id = _unset,
|
Object? id = _unset,
|
||||||
Object? name = _unset,
|
Object? name = _unset,
|
||||||
Object? description = _unset,
|
Object? description = _unset,
|
||||||
|
@ -134,7 +136,7 @@ class Events implements SupadartClass<Events> {
|
||||||
Object? userId = _unset,
|
Object? userId = _unset,
|
||||||
Object? user = _unset,
|
Object? user = _unset,
|
||||||
}) {
|
}) {
|
||||||
return Events(
|
return EventSupadartModel(
|
||||||
id: id == _unset ? this.id : id as String,
|
id: id == _unset ? this.id : id as String,
|
||||||
name: name == _unset ? this.name : name as String,
|
name: name == _unset ? this.name : name as String,
|
||||||
description:
|
description:
|
||||||
|
@ -142,7 +144,7 @@ class Events implements SupadartClass<Events> {
|
||||||
code: code == _unset ? this.code : code as String,
|
code: code == _unset ? this.code : code as String,
|
||||||
createdAt: createdAt == _unset ? this.createdAt : createdAt as DateTime,
|
createdAt: createdAt == _unset ? this.createdAt : createdAt as DateTime,
|
||||||
userId: userId == _unset ? this.userId : userId as String,
|
userId: userId == _unset ? this.userId : userId as String,
|
||||||
user: user == _unset ? this.user : user as Users?,
|
user: user == _unset ? this.user : user as UserSupadartModel?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
import 'package:sigap/supadart/supadart_exports.dart';
|
import 'package:sigap/supadart/supadart_exports.dart';
|
||||||
import 'package:sigap/supadart/supadart_header.dart';
|
import 'package:sigap/supadart/supadart_header.dart';
|
||||||
|
|
||||||
class Evidence implements SupadartClass<Evidence> {
|
class EvidenceSupadartModel implements SupadartClass<EvidenceSupadartModel> {
|
||||||
final String incidentId;
|
final String incidentId;
|
||||||
final String type;
|
final String type;
|
||||||
final String url;
|
final String url;
|
||||||
|
@ -13,9 +13,9 @@ class Evidence implements SupadartClass<Evidence> {
|
||||||
final String? description;
|
final String? description;
|
||||||
final Map<String, dynamic>? metadata;
|
final Map<String, dynamic>? metadata;
|
||||||
final String id;
|
final String id;
|
||||||
final IncidentLogs? incident;
|
final IncidentLogSupadartModel? incident;
|
||||||
|
|
||||||
const Evidence({
|
const EvidenceSupadartModel({
|
||||||
required this.incidentId,
|
required this.incidentId,
|
||||||
required this.type,
|
required this.type,
|
||||||
required this.url,
|
required this.url,
|
||||||
|
@ -27,7 +27,7 @@ class Evidence implements SupadartClass<Evidence> {
|
||||||
this.incident,
|
this.incident,
|
||||||
});
|
});
|
||||||
|
|
||||||
static String get table_name => 'evidence';
|
static String get table_name => 'evidenceSupadartModel';
|
||||||
static String get c_incidentId => 'incident_id';
|
static String get c_incidentId => 'incident_id';
|
||||||
static String get c_type => 'type';
|
static String get c_type => 'type';
|
||||||
static String get c_url => 'url';
|
static String get c_url => 'url';
|
||||||
|
@ -37,12 +37,14 @@ class Evidence implements SupadartClass<Evidence> {
|
||||||
static String get c_metadata => 'metadata';
|
static String get c_metadata => 'metadata';
|
||||||
static String get c_id => 'id';
|
static String get c_id => 'id';
|
||||||
|
|
||||||
static List<Evidence> converter(List<Map<String, dynamic>> data) {
|
static List<EvidenceSupadartModel> converter(
|
||||||
return data.map(Evidence.fromJson).toList();
|
List<Map<String, dynamic>> data,
|
||||||
|
) {
|
||||||
|
return data.map(EvidenceSupadartModel.fromJson).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
static Evidence converterSingle(Map<String, dynamic> data) {
|
static EvidenceSupadartModel converterSingle(Map<String, dynamic> data) {
|
||||||
return Evidence.fromJson(data);
|
return EvidenceSupadartModel.fromJson(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map<String, dynamic> _generateMap({
|
static Map<String, dynamic> _generateMap({
|
||||||
|
@ -112,8 +114,8 @@ class Evidence implements SupadartClass<Evidence> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory Evidence.fromJson(Map<String, dynamic> jsonn) {
|
factory EvidenceSupadartModel.fromJson(Map<String, dynamic> jsonn) {
|
||||||
return Evidence(
|
return EvidenceSupadartModel(
|
||||||
incidentId:
|
incidentId:
|
||||||
jsonn['incident_id'] != null ? jsonn['incident_id'].toString() : '',
|
jsonn['incident_id'] != null ? jsonn['incident_id'].toString() : '',
|
||||||
type: jsonn['type'] != null ? jsonn['type'].toString() : '',
|
type: jsonn['type'] != null ? jsonn['type'].toString() : '',
|
||||||
|
@ -132,7 +134,7 @@ class Evidence implements SupadartClass<Evidence> {
|
||||||
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
||||||
incident:
|
incident:
|
||||||
jsonn['incident_logs'] != null
|
jsonn['incident_logs'] != null
|
||||||
? IncidentLogs.fromJson(
|
? IncidentLogSupadartModel.fromJson(
|
||||||
jsonn['incident_logs'] as Map<String, dynamic>,
|
jsonn['incident_logs'] as Map<String, dynamic>,
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
|
@ -154,7 +156,7 @@ class Evidence implements SupadartClass<Evidence> {
|
||||||
}
|
}
|
||||||
|
|
||||||
static const _unset = Object();
|
static const _unset = Object();
|
||||||
Evidence copyWith({
|
EvidenceSupadartModel copyWith({
|
||||||
Object? incidentId = _unset,
|
Object? incidentId = _unset,
|
||||||
Object? type = _unset,
|
Object? type = _unset,
|
||||||
Object? url = _unset,
|
Object? url = _unset,
|
||||||
|
@ -165,7 +167,7 @@ class Evidence implements SupadartClass<Evidence> {
|
||||||
Object? id = _unset,
|
Object? id = _unset,
|
||||||
Object? incident = _unset,
|
Object? incident = _unset,
|
||||||
}) {
|
}) {
|
||||||
return Evidence(
|
return EvidenceSupadartModel(
|
||||||
incidentId: incidentId == _unset ? this.incidentId : incidentId as String,
|
incidentId: incidentId == _unset ? this.incidentId : incidentId as String,
|
||||||
type: type == _unset ? this.type : type as String,
|
type: type == _unset ? this.type : type as String,
|
||||||
url: url == _unset ? this.url : url as String,
|
url: url == _unset ? this.url : url as String,
|
||||||
|
@ -179,7 +181,10 @@ class Evidence implements SupadartClass<Evidence> {
|
||||||
? this.metadata
|
? this.metadata
|
||||||
: metadata as Map<String, dynamic>?,
|
: metadata as Map<String, dynamic>?,
|
||||||
id: id == _unset ? this.id : id as String,
|
id: id == _unset ? this.id : id as String,
|
||||||
incident: incident == _unset ? this.incident : incident as IncidentLogs?,
|
incident:
|
||||||
|
incident == _unset
|
||||||
|
? this.incident
|
||||||
|
: incident as IncidentLogSupadartModel?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
import 'package:sigap/supadart/supadart_exports.dart';
|
import 'package:sigap/supadart/supadart_exports.dart';
|
||||||
import 'package:sigap/supadart/supadart_header.dart';
|
import 'package:sigap/supadart/supadart_header.dart';
|
||||||
|
|
||||||
class IncidentLogs implements SupadartClass<IncidentLogs> {
|
class IncidentLogSupadartModel
|
||||||
|
implements SupadartClass<IncidentLogSupadartModel> {
|
||||||
final String id;
|
final String id;
|
||||||
final String userId;
|
final String userId;
|
||||||
final String locationId;
|
final String locationId;
|
||||||
|
@ -15,11 +16,11 @@ class IncidentLogs implements SupadartClass<IncidentLogs> {
|
||||||
final bool? verified;
|
final bool? verified;
|
||||||
final DateTime? createdAt;
|
final DateTime? createdAt;
|
||||||
final DateTime? updatedAt;
|
final DateTime? updatedAt;
|
||||||
final CrimeCategories? category;
|
final CrimeCategorySupadartModel? category;
|
||||||
final Locations? locationObj;
|
final LocationSupadartModel? location;
|
||||||
final Users? user;
|
final UserSupadartModel? user;
|
||||||
|
|
||||||
const IncidentLogs({
|
const IncidentLogSupadartModel({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.userId,
|
required this.userId,
|
||||||
required this.locationId,
|
required this.locationId,
|
||||||
|
@ -31,7 +32,7 @@ class IncidentLogs implements SupadartClass<IncidentLogs> {
|
||||||
this.createdAt,
|
this.createdAt,
|
||||||
this.updatedAt,
|
this.updatedAt,
|
||||||
this.category,
|
this.category,
|
||||||
this.locationObj,
|
this.location,
|
||||||
this.user,
|
this.user,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -47,12 +48,14 @@ class IncidentLogs implements SupadartClass<IncidentLogs> {
|
||||||
static String get c_createdAt => 'created_at';
|
static String get c_createdAt => 'created_at';
|
||||||
static String get c_updatedAt => 'updated_at';
|
static String get c_updatedAt => 'updated_at';
|
||||||
|
|
||||||
static List<IncidentLogs> converter(List<Map<String, dynamic>> data) {
|
static List<IncidentLogSupadartModel> converter(
|
||||||
return data.map(IncidentLogs.fromJson).toList();
|
List<Map<String, dynamic>> data,
|
||||||
|
) {
|
||||||
|
return data.map(IncidentLogSupadartModel.fromJson).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
static IncidentLogs converterSingle(Map<String, dynamic> data) {
|
static IncidentLogSupadartModel converterSingle(Map<String, dynamic> data) {
|
||||||
return IncidentLogs.fromJson(data);
|
return IncidentLogSupadartModel.fromJson(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map<String, dynamic> _generateMap({
|
static Map<String, dynamic> _generateMap({
|
||||||
|
@ -133,8 +136,8 @@ class IncidentLogs implements SupadartClass<IncidentLogs> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory IncidentLogs.fromJson(Map<String, dynamic> jsonn) {
|
factory IncidentLogSupadartModel.fromJson(Map<String, dynamic> jsonn) {
|
||||||
return IncidentLogs(
|
return IncidentLogSupadartModel(
|
||||||
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
||||||
userId: jsonn['user_id'] != null ? jsonn['user_id'].toString() : '',
|
userId: jsonn['user_id'] != null ? jsonn['user_id'].toString() : '',
|
||||||
locationId:
|
locationId:
|
||||||
|
@ -159,17 +162,21 @@ class IncidentLogs implements SupadartClass<IncidentLogs> {
|
||||||
: null,
|
: null,
|
||||||
category:
|
category:
|
||||||
jsonn['crime_categories'] != null
|
jsonn['crime_categories'] != null
|
||||||
? CrimeCategories.fromJson(
|
? CrimeCategorySupadartModel.fromJson(
|
||||||
jsonn['crime_categories'] as Map<String, dynamic>,
|
jsonn['crime_categories'] as Map<String, dynamic>,
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
locationObj:
|
location:
|
||||||
jsonn['locations'] != null
|
jsonn['locations'] != null
|
||||||
? Locations.fromJson(jsonn['locations'] as Map<String, dynamic>)
|
? LocationSupadartModel.fromJson(
|
||||||
|
jsonn['locations'] as Map<String, dynamic>,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
user:
|
user:
|
||||||
jsonn['users'] != null
|
jsonn['users'] != null
|
||||||
? Users.fromJson(jsonn['users'] as Map<String, dynamic>)
|
? UserSupadartModel.fromJson(
|
||||||
|
jsonn['users'] as Map<String, dynamic>,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -187,13 +194,13 @@ class IncidentLogs implements SupadartClass<IncidentLogs> {
|
||||||
createdAt: createdAt,
|
createdAt: createdAt,
|
||||||
updatedAt: updatedAt,
|
updatedAt: updatedAt,
|
||||||
// 'crime_categories': category?.toJson(),
|
// 'crime_categories': category?.toJson(),
|
||||||
// 'locations': locationObj?.toJson(),
|
// 'locations': location?.toJson(),
|
||||||
// 'users': user?.toJson(),
|
// 'users': user?.toJson(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const _unset = Object();
|
static const _unset = Object();
|
||||||
IncidentLogs copyWith({
|
IncidentLogSupadartModel copyWith({
|
||||||
Object? id = _unset,
|
Object? id = _unset,
|
||||||
Object? userId = _unset,
|
Object? userId = _unset,
|
||||||
Object? locationId = _unset,
|
Object? locationId = _unset,
|
||||||
|
@ -205,10 +212,10 @@ class IncidentLogs implements SupadartClass<IncidentLogs> {
|
||||||
Object? createdAt = _unset,
|
Object? createdAt = _unset,
|
||||||
Object? updatedAt = _unset,
|
Object? updatedAt = _unset,
|
||||||
Object? category = _unset,
|
Object? category = _unset,
|
||||||
Object? locationObj = _unset,
|
Object? location = _unset,
|
||||||
Object? user = _unset,
|
Object? user = _unset,
|
||||||
}) {
|
}) {
|
||||||
return IncidentLogs(
|
return IncidentLogSupadartModel(
|
||||||
id: id == _unset ? this.id : id as String,
|
id: id == _unset ? this.id : id as String,
|
||||||
userId: userId == _unset ? this.userId : userId as String,
|
userId: userId == _unset ? this.userId : userId as String,
|
||||||
locationId: locationId == _unset ? this.locationId : locationId as String,
|
locationId: locationId == _unset ? this.locationId : locationId as String,
|
||||||
|
@ -221,10 +228,14 @@ class IncidentLogs implements SupadartClass<IncidentLogs> {
|
||||||
createdAt: createdAt == _unset ? this.createdAt : createdAt as DateTime?,
|
createdAt: createdAt == _unset ? this.createdAt : createdAt as DateTime?,
|
||||||
updatedAt: updatedAt == _unset ? this.updatedAt : updatedAt as DateTime?,
|
updatedAt: updatedAt == _unset ? this.updatedAt : updatedAt as DateTime?,
|
||||||
category:
|
category:
|
||||||
category == _unset ? this.category : category as CrimeCategories?,
|
category == _unset
|
||||||
locationObj:
|
? this.category
|
||||||
locationObj == _unset ? this.locationObj : locationObj as Locations?,
|
: category as CrimeCategorySupadartModel?,
|
||||||
user: user == _unset ? this.user : user as Users?,
|
location:
|
||||||
|
location == _unset
|
||||||
|
? this.location
|
||||||
|
: location as LocationSupadartModel?,
|
||||||
|
user: user == _unset ? this.user : user as UserSupadartModel?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,17 +4,18 @@
|
||||||
import 'package:sigap/supadart/supadart_exports.dart';
|
import 'package:sigap/supadart/supadart_exports.dart';
|
||||||
import 'package:sigap/supadart/supadart_header.dart';
|
import 'package:sigap/supadart/supadart_header.dart';
|
||||||
|
|
||||||
class PanicButtonLogs implements SupadartClass<PanicButtonLogs> {
|
class PanicButtonLogSupadartModel
|
||||||
|
implements SupadartClass<PanicButtonLogSupadartModel> {
|
||||||
final String id;
|
final String id;
|
||||||
final String userId;
|
final String userId;
|
||||||
final String? officerId;
|
final String? officerId;
|
||||||
final String incidentId;
|
final String incidentId;
|
||||||
final DateTime timestamp;
|
final DateTime timestamp;
|
||||||
final IncidentLogs? incident;
|
final IncidentLogSupadartModel? incident;
|
||||||
final Officers? officer;
|
final OfficerSupadartModel? officer;
|
||||||
final Users? userObj;
|
final UserSupadartModel? user;
|
||||||
|
|
||||||
const PanicButtonLogs({
|
const PanicButtonLogSupadartModel({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.userId,
|
required this.userId,
|
||||||
this.officerId,
|
this.officerId,
|
||||||
|
@ -22,7 +23,7 @@ class PanicButtonLogs implements SupadartClass<PanicButtonLogs> {
|
||||||
required this.timestamp,
|
required this.timestamp,
|
||||||
this.incident,
|
this.incident,
|
||||||
this.officer,
|
this.officer,
|
||||||
this.userObj,
|
this.user,
|
||||||
});
|
});
|
||||||
|
|
||||||
static String get table_name => 'panic_button_logs';
|
static String get table_name => 'panic_button_logs';
|
||||||
|
@ -32,12 +33,16 @@ class PanicButtonLogs implements SupadartClass<PanicButtonLogs> {
|
||||||
static String get c_incidentId => 'incident_id';
|
static String get c_incidentId => 'incident_id';
|
||||||
static String get c_timestamp => 'timestamp';
|
static String get c_timestamp => 'timestamp';
|
||||||
|
|
||||||
static List<PanicButtonLogs> converter(List<Map<String, dynamic>> data) {
|
static List<PanicButtonLogSupadartModel> converter(
|
||||||
return data.map(PanicButtonLogs.fromJson).toList();
|
List<Map<String, dynamic>> data,
|
||||||
|
) {
|
||||||
|
return data.map(PanicButtonLogSupadartModel.fromJson).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
static PanicButtonLogs converterSingle(Map<String, dynamic> data) {
|
static PanicButtonLogSupadartModel converterSingle(
|
||||||
return PanicButtonLogs.fromJson(data);
|
Map<String, dynamic> data,
|
||||||
|
) {
|
||||||
|
return PanicButtonLogSupadartModel.fromJson(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map<String, dynamic> _generateMap({
|
static Map<String, dynamic> _generateMap({
|
||||||
|
@ -88,8 +93,8 @@ class PanicButtonLogs implements SupadartClass<PanicButtonLogs> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory PanicButtonLogs.fromJson(Map<String, dynamic> jsonn) {
|
factory PanicButtonLogSupadartModel.fromJson(Map<String, dynamic> jsonn) {
|
||||||
return PanicButtonLogs(
|
return PanicButtonLogSupadartModel(
|
||||||
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
||||||
userId: jsonn['user_id'] != null ? jsonn['user_id'].toString() : '',
|
userId: jsonn['user_id'] != null ? jsonn['user_id'].toString() : '',
|
||||||
officerId:
|
officerId:
|
||||||
|
@ -102,17 +107,21 @@ class PanicButtonLogs implements SupadartClass<PanicButtonLogs> {
|
||||||
: DateTime.fromMillisecondsSinceEpoch(0),
|
: DateTime.fromMillisecondsSinceEpoch(0),
|
||||||
incident:
|
incident:
|
||||||
jsonn['incident_logs'] != null
|
jsonn['incident_logs'] != null
|
||||||
? IncidentLogs.fromJson(
|
? IncidentLogSupadartModel.fromJson(
|
||||||
jsonn['incident_logs'] as Map<String, dynamic>,
|
jsonn['incident_logs'] as Map<String, dynamic>,
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
officer:
|
officer:
|
||||||
jsonn['officers'] != null
|
jsonn['officers'] != null
|
||||||
? Officers.fromJson(jsonn['officers'] as Map<String, dynamic>)
|
? OfficerSupadartModel.fromJson(
|
||||||
|
jsonn['officers'] as Map<String, dynamic>,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
userObj:
|
user:
|
||||||
jsonn['users'] != null
|
jsonn['users'] != null
|
||||||
? Users.fromJson(jsonn['users'] as Map<String, dynamic>)
|
? UserSupadartModel.fromJson(
|
||||||
|
jsonn['users'] as Map<String, dynamic>,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -126,12 +135,12 @@ class PanicButtonLogs implements SupadartClass<PanicButtonLogs> {
|
||||||
timestamp: timestamp,
|
timestamp: timestamp,
|
||||||
// 'incident_logs': incident?.toJson(),
|
// 'incident_logs': incident?.toJson(),
|
||||||
// 'officers': officer?.toJson(),
|
// 'officers': officer?.toJson(),
|
||||||
// 'users': userObj?.toJson(),
|
// 'users': user?.toJson(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const _unset = Object();
|
static const _unset = Object();
|
||||||
PanicButtonLogs copyWith({
|
PanicButtonLogSupadartModel copyWith({
|
||||||
Object? id = _unset,
|
Object? id = _unset,
|
||||||
Object? userId = _unset,
|
Object? userId = _unset,
|
||||||
Object? officerId = _unset,
|
Object? officerId = _unset,
|
||||||
|
@ -139,17 +148,21 @@ class PanicButtonLogs implements SupadartClass<PanicButtonLogs> {
|
||||||
Object? timestamp = _unset,
|
Object? timestamp = _unset,
|
||||||
Object? incident = _unset,
|
Object? incident = _unset,
|
||||||
Object? officer = _unset,
|
Object? officer = _unset,
|
||||||
Object? userObj = _unset,
|
Object? user = _unset,
|
||||||
}) {
|
}) {
|
||||||
return PanicButtonLogs(
|
return PanicButtonLogSupadartModel(
|
||||||
id: id == _unset ? this.id : id as String,
|
id: id == _unset ? this.id : id as String,
|
||||||
userId: userId == _unset ? this.userId : userId as String,
|
userId: userId == _unset ? this.userId : userId as String,
|
||||||
officerId: officerId == _unset ? this.officerId : officerId as String?,
|
officerId: officerId == _unset ? this.officerId : officerId as String?,
|
||||||
incidentId: incidentId == _unset ? this.incidentId : incidentId as String,
|
incidentId: incidentId == _unset ? this.incidentId : incidentId as String,
|
||||||
timestamp: timestamp == _unset ? this.timestamp : timestamp as DateTime,
|
timestamp: timestamp == _unset ? this.timestamp : timestamp as DateTime,
|
||||||
incident: incident == _unset ? this.incident : incident as IncidentLogs?,
|
incident:
|
||||||
officer: officer == _unset ? this.officer : officer as Officers?,
|
incident == _unset
|
||||||
userObj: userObj == _unset ? this.userObj : userObj as Users?,
|
? this.incident
|
||||||
|
: incident as IncidentLogSupadartModel?,
|
||||||
|
officer:
|
||||||
|
officer == _unset ? this.officer : officer as OfficerSupadartModel?,
|
||||||
|
user: user == _unset ? this.user : user as UserSupadartModel?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,38 +6,38 @@ import 'package:sigap/supadart/supadart_header.dart';
|
||||||
|
|
||||||
enum SESSION_STATUS { active, completed }
|
enum SESSION_STATUS { active, completed }
|
||||||
|
|
||||||
class Sessions implements SupadartClass<Sessions> {
|
class SessionSupadartModel implements SupadartClass<SessionSupadartModel> {
|
||||||
final String id;
|
final String id;
|
||||||
final String userId;
|
final String userId;
|
||||||
final String eventId;
|
final String eventId;
|
||||||
final SESSION_STATUS status;
|
final SESSION_STATUS status;
|
||||||
final DateTime createdAt;
|
final DateTime createdAt;
|
||||||
final Events? eventObj;
|
final EventSupadartModel? event;
|
||||||
final Users? userObj;
|
final UserSupadartModel? user;
|
||||||
|
|
||||||
const Sessions({
|
const SessionSupadartModel({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.userId,
|
required this.userId,
|
||||||
required this.eventId,
|
required this.eventId,
|
||||||
required this.status,
|
required this.status,
|
||||||
required this.createdAt,
|
required this.createdAt,
|
||||||
this.eventObj,
|
this.event,
|
||||||
this.userObj,
|
this.user,
|
||||||
});
|
});
|
||||||
|
|
||||||
static String get table_name => 'sessions';
|
static String get table_name => 'sessionSupadartModel';
|
||||||
static String get c_id => 'id';
|
static String get c_id => 'id';
|
||||||
static String get c_userId => 'user_id';
|
static String get c_userId => 'user_id';
|
||||||
static String get c_eventId => 'event_id';
|
static String get c_eventId => 'event_id';
|
||||||
static String get c_status => 'status';
|
static String get c_status => 'status';
|
||||||
static String get c_createdAt => 'created_at';
|
static String get c_createdAt => 'created_at';
|
||||||
|
|
||||||
static List<Sessions> converter(List<Map<String, dynamic>> data) {
|
static List<SessionSupadartModel> converter(List<Map<String, dynamic>> data) {
|
||||||
return data.map(Sessions.fromJson).toList();
|
return data.map(SessionSupadartModel.fromJson).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
static Sessions converterSingle(Map<String, dynamic> data) {
|
static SessionSupadartModel converterSingle(Map<String, dynamic> data) {
|
||||||
return Sessions.fromJson(data);
|
return SessionSupadartModel.fromJson(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map<String, dynamic> _generateMap({
|
static Map<String, dynamic> _generateMap({
|
||||||
|
@ -88,8 +88,8 @@ class Sessions implements SupadartClass<Sessions> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory Sessions.fromJson(Map<String, dynamic> jsonn) {
|
factory SessionSupadartModel.fromJson(Map<String, dynamic> jsonn) {
|
||||||
return Sessions(
|
return SessionSupadartModel(
|
||||||
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
||||||
userId: jsonn['user_id'] != null ? jsonn['user_id'].toString() : '',
|
userId: jsonn['user_id'] != null ? jsonn['user_id'].toString() : '',
|
||||||
eventId: jsonn['event_id'] != null ? jsonn['event_id'].toString() : '',
|
eventId: jsonn['event_id'] != null ? jsonn['event_id'].toString() : '',
|
||||||
|
@ -101,13 +101,17 @@ class Sessions implements SupadartClass<Sessions> {
|
||||||
jsonn['created_at'] != null
|
jsonn['created_at'] != null
|
||||||
? DateTime.parse(jsonn['created_at'].toString())
|
? DateTime.parse(jsonn['created_at'].toString())
|
||||||
: DateTime.fromMillisecondsSinceEpoch(0),
|
: DateTime.fromMillisecondsSinceEpoch(0),
|
||||||
eventObj:
|
event:
|
||||||
jsonn['events'] != null
|
jsonn['events'] != null
|
||||||
? Events.fromJson(jsonn['events'] as Map<String, dynamic>)
|
? EventSupadartModel.fromJson(
|
||||||
|
jsonn['events'] as Map<String, dynamic>,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
userObj:
|
user:
|
||||||
jsonn['users'] != null
|
jsonn['users'] != null
|
||||||
? Users.fromJson(jsonn['users'] as Map<String, dynamic>)
|
? UserSupadartModel.fromJson(
|
||||||
|
jsonn['users'] as Map<String, dynamic>,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -119,29 +123,29 @@ class Sessions implements SupadartClass<Sessions> {
|
||||||
eventId: eventId,
|
eventId: eventId,
|
||||||
status: status,
|
status: status,
|
||||||
createdAt: createdAt,
|
createdAt: createdAt,
|
||||||
// 'events': eventObj?.toJson(),
|
// 'events': event?.toJson(),
|
||||||
// 'users': userObj?.toJson(),
|
// 'users': user?.toJson(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const _unset = Object();
|
static const _unset = Object();
|
||||||
Sessions copyWith({
|
SessionSupadartModel copyWith({
|
||||||
Object? id = _unset,
|
Object? id = _unset,
|
||||||
Object? userId = _unset,
|
Object? userId = _unset,
|
||||||
Object? eventId = _unset,
|
Object? eventId = _unset,
|
||||||
Object? status = _unset,
|
Object? status = _unset,
|
||||||
Object? createdAt = _unset,
|
Object? createdAt = _unset,
|
||||||
Object? eventObj = _unset,
|
Object? event = _unset,
|
||||||
Object? userObj = _unset,
|
Object? user = _unset,
|
||||||
}) {
|
}) {
|
||||||
return Sessions(
|
return SessionSupadartModel(
|
||||||
id: id == _unset ? this.id : id as String,
|
id: id == _unset ? this.id : id as String,
|
||||||
userId: userId == _unset ? this.userId : userId as String,
|
userId: userId == _unset ? this.userId : userId as String,
|
||||||
eventId: eventId == _unset ? this.eventId : eventId as String,
|
eventId: eventId == _unset ? this.eventId : eventId as String,
|
||||||
status: status == _unset ? this.status : status as SESSION_STATUS,
|
status: status == _unset ? this.status : status as SESSION_STATUS,
|
||||||
createdAt: createdAt == _unset ? this.createdAt : createdAt as DateTime,
|
createdAt: createdAt == _unset ? this.createdAt : createdAt as DateTime,
|
||||||
eventObj: eventObj == _unset ? this.eventObj : eventObj as Events?,
|
event: event == _unset ? this.event : event as EventSupadartModel?,
|
||||||
userObj: userObj == _unset ? this.userObj : userObj as Users?,
|
user: user == _unset ? this.user : user as UserSupadartModel?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,17 +4,18 @@
|
||||||
import 'package:sigap/supadart/supadart_exports.dart';
|
import 'package:sigap/supadart/supadart_exports.dart';
|
||||||
import 'package:sigap/supadart/supadart_header.dart';
|
import 'package:sigap/supadart/supadart_header.dart';
|
||||||
|
|
||||||
class Permissions implements SupadartClass<Permissions> {
|
class PermissionSupadartModel
|
||||||
|
implements SupadartClass<PermissionSupadartModel> {
|
||||||
final String id;
|
final String id;
|
||||||
final String action;
|
final String action;
|
||||||
final String resourceId;
|
final String resourceId;
|
||||||
final String roleId;
|
final String roleId;
|
||||||
final DateTime createdAt;
|
final DateTime createdAt;
|
||||||
final DateTime updatedAt;
|
final DateTime updatedAt;
|
||||||
final Resources? resource;
|
final ResourceSupadartModel? resource;
|
||||||
final Roles? roleObj;
|
final RoleSupadartModel? role;
|
||||||
|
|
||||||
const Permissions({
|
const PermissionSupadartModel({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.action,
|
required this.action,
|
||||||
required this.resourceId,
|
required this.resourceId,
|
||||||
|
@ -22,10 +23,10 @@ class Permissions implements SupadartClass<Permissions> {
|
||||||
required this.createdAt,
|
required this.createdAt,
|
||||||
required this.updatedAt,
|
required this.updatedAt,
|
||||||
this.resource,
|
this.resource,
|
||||||
this.roleObj,
|
this.role,
|
||||||
});
|
});
|
||||||
|
|
||||||
static String get table_name => 'permissions';
|
static String get table_name => 'permissionSupadartModel';
|
||||||
static String get c_id => 'id';
|
static String get c_id => 'id';
|
||||||
static String get c_action => 'action';
|
static String get c_action => 'action';
|
||||||
static String get c_resourceId => 'resource_id';
|
static String get c_resourceId => 'resource_id';
|
||||||
|
@ -33,12 +34,14 @@ class Permissions implements SupadartClass<Permissions> {
|
||||||
static String get c_createdAt => 'created_at';
|
static String get c_createdAt => 'created_at';
|
||||||
static String get c_updatedAt => 'updated_at';
|
static String get c_updatedAt => 'updated_at';
|
||||||
|
|
||||||
static List<Permissions> converter(List<Map<String, dynamic>> data) {
|
static List<PermissionSupadartModel> converter(
|
||||||
return data.map(Permissions.fromJson).toList();
|
List<Map<String, dynamic>> data,
|
||||||
|
) {
|
||||||
|
return data.map(PermissionSupadartModel.fromJson).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
static Permissions converterSingle(Map<String, dynamic> data) {
|
static PermissionSupadartModel converterSingle(Map<String, dynamic> data) {
|
||||||
return Permissions.fromJson(data);
|
return PermissionSupadartModel.fromJson(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map<String, dynamic> _generateMap({
|
static Map<String, dynamic> _generateMap({
|
||||||
|
@ -95,8 +98,8 @@ class Permissions implements SupadartClass<Permissions> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory Permissions.fromJson(Map<String, dynamic> jsonn) {
|
factory PermissionSupadartModel.fromJson(Map<String, dynamic> jsonn) {
|
||||||
return Permissions(
|
return PermissionSupadartModel(
|
||||||
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
||||||
action: jsonn['action'] != null ? jsonn['action'].toString() : '',
|
action: jsonn['action'] != null ? jsonn['action'].toString() : '',
|
||||||
resourceId:
|
resourceId:
|
||||||
|
@ -112,11 +115,15 @@ class Permissions implements SupadartClass<Permissions> {
|
||||||
: DateTime.fromMillisecondsSinceEpoch(0),
|
: DateTime.fromMillisecondsSinceEpoch(0),
|
||||||
resource:
|
resource:
|
||||||
jsonn['resources'] != null
|
jsonn['resources'] != null
|
||||||
? Resources.fromJson(jsonn['resources'] as Map<String, dynamic>)
|
? ResourceSupadartModel.fromJson(
|
||||||
|
jsonn['resources'] as Map<String, dynamic>,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
roleObj:
|
role:
|
||||||
jsonn['roles'] != null
|
jsonn['roles'] != null
|
||||||
? Roles.fromJson(jsonn['roles'] as Map<String, dynamic>)
|
? RoleSupadartModel.fromJson(
|
||||||
|
jsonn['roles'] as Map<String, dynamic>,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -130,12 +137,12 @@ class Permissions implements SupadartClass<Permissions> {
|
||||||
createdAt: createdAt,
|
createdAt: createdAt,
|
||||||
updatedAt: updatedAt,
|
updatedAt: updatedAt,
|
||||||
// 'resources': resource?.toJson(),
|
// 'resources': resource?.toJson(),
|
||||||
// 'roles': roleObj?.toJson(),
|
// 'roles': role?.toJson(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const _unset = Object();
|
static const _unset = Object();
|
||||||
Permissions copyWith({
|
PermissionSupadartModel copyWith({
|
||||||
Object? id = _unset,
|
Object? id = _unset,
|
||||||
Object? action = _unset,
|
Object? action = _unset,
|
||||||
Object? resourceId = _unset,
|
Object? resourceId = _unset,
|
||||||
|
@ -143,17 +150,20 @@ class Permissions implements SupadartClass<Permissions> {
|
||||||
Object? createdAt = _unset,
|
Object? createdAt = _unset,
|
||||||
Object? updatedAt = _unset,
|
Object? updatedAt = _unset,
|
||||||
Object? resource = _unset,
|
Object? resource = _unset,
|
||||||
Object? roleObj = _unset,
|
Object? role = _unset,
|
||||||
}) {
|
}) {
|
||||||
return Permissions(
|
return PermissionSupadartModel(
|
||||||
id: id == _unset ? this.id : id as String,
|
id: id == _unset ? this.id : id as String,
|
||||||
action: action == _unset ? this.action : action as String,
|
action: action == _unset ? this.action : action as String,
|
||||||
resourceId: resourceId == _unset ? this.resourceId : resourceId as String,
|
resourceId: resourceId == _unset ? this.resourceId : resourceId as String,
|
||||||
roleId: roleId == _unset ? this.roleId : roleId as String,
|
roleId: roleId == _unset ? this.roleId : roleId as String,
|
||||||
createdAt: createdAt == _unset ? this.createdAt : createdAt as DateTime,
|
createdAt: createdAt == _unset ? this.createdAt : createdAt as DateTime,
|
||||||
updatedAt: updatedAt == _unset ? this.updatedAt : updatedAt as DateTime,
|
updatedAt: updatedAt == _unset ? this.updatedAt : updatedAt as DateTime,
|
||||||
resource: resource == _unset ? this.resource : resource as Resources?,
|
resource:
|
||||||
roleObj: roleObj == _unset ? this.roleObj : roleObj as Roles?,
|
resource == _unset
|
||||||
|
? this.resource
|
||||||
|
: resource as ResourceSupadartModel?,
|
||||||
|
role: role == _unset ? this.role : role as RoleSupadartModel?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
import 'package:sigap/supadart/supadart_exports.dart';
|
import 'package:sigap/supadart/supadart_exports.dart';
|
||||||
import 'package:sigap/supadart/supadart_header.dart';
|
import 'package:sigap/supadart/supadart_header.dart';
|
||||||
|
|
||||||
class Profiles implements SupadartClass<Profiles> {
|
class ProfileSupadartModel implements SupadartClass<ProfileSupadartModel> {
|
||||||
final String id;
|
final String id;
|
||||||
final String userId;
|
final String userId;
|
||||||
final String? avatar;
|
final String? avatar;
|
||||||
|
@ -15,9 +15,9 @@ class Profiles implements SupadartClass<Profiles> {
|
||||||
final Map<String, dynamic>? address;
|
final Map<String, dynamic>? address;
|
||||||
final DateTime? birthDate;
|
final DateTime? birthDate;
|
||||||
final String nik;
|
final String nik;
|
||||||
final Users? user;
|
final UserSupadartModel? user;
|
||||||
|
|
||||||
const Profiles({
|
const ProfileSupadartModel({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.userId,
|
required this.userId,
|
||||||
this.avatar,
|
this.avatar,
|
||||||
|
@ -31,7 +31,7 @@ class Profiles implements SupadartClass<Profiles> {
|
||||||
this.user,
|
this.user,
|
||||||
});
|
});
|
||||||
|
|
||||||
static String get table_name => 'profiles';
|
static String get table_name => 'profileSupadartModel';
|
||||||
static String get c_id => 'id';
|
static String get c_id => 'id';
|
||||||
static String get c_userId => 'user_id';
|
static String get c_userId => 'user_id';
|
||||||
static String get c_avatar => 'avatar';
|
static String get c_avatar => 'avatar';
|
||||||
|
@ -43,12 +43,12 @@ class Profiles implements SupadartClass<Profiles> {
|
||||||
static String get c_birthDate => 'birth_date';
|
static String get c_birthDate => 'birth_date';
|
||||||
static String get c_nik => 'nik';
|
static String get c_nik => 'nik';
|
||||||
|
|
||||||
static List<Profiles> converter(List<Map<String, dynamic>> data) {
|
static List<ProfileSupadartModel> converter(List<Map<String, dynamic>> data) {
|
||||||
return data.map(Profiles.fromJson).toList();
|
return data.map(ProfileSupadartModel.fromJson).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
static Profiles converterSingle(Map<String, dynamic> data) {
|
static ProfileSupadartModel converterSingle(Map<String, dynamic> data) {
|
||||||
return Profiles.fromJson(data);
|
return ProfileSupadartModel.fromJson(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map<String, dynamic> _generateMap({
|
static Map<String, dynamic> _generateMap({
|
||||||
|
@ -129,8 +129,8 @@ class Profiles implements SupadartClass<Profiles> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory Profiles.fromJson(Map<String, dynamic> jsonn) {
|
factory ProfileSupadartModel.fromJson(Map<String, dynamic> jsonn) {
|
||||||
return Profiles(
|
return ProfileSupadartModel(
|
||||||
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
||||||
userId: jsonn['user_id'] != null ? jsonn['user_id'].toString() : '',
|
userId: jsonn['user_id'] != null ? jsonn['user_id'].toString() : '',
|
||||||
avatar: jsonn['avatar'] != null ? jsonn['avatar'].toString() : null,
|
avatar: jsonn['avatar'] != null ? jsonn['avatar'].toString() : null,
|
||||||
|
@ -151,7 +151,9 @@ class Profiles implements SupadartClass<Profiles> {
|
||||||
nik: jsonn['nik'] != null ? jsonn['nik'].toString() : '',
|
nik: jsonn['nik'] != null ? jsonn['nik'].toString() : '',
|
||||||
user:
|
user:
|
||||||
jsonn['users'] != null
|
jsonn['users'] != null
|
||||||
? Users.fromJson(jsonn['users'] as Map<String, dynamic>)
|
? UserSupadartModel.fromJson(
|
||||||
|
jsonn['users'] as Map<String, dynamic>,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -173,7 +175,7 @@ class Profiles implements SupadartClass<Profiles> {
|
||||||
}
|
}
|
||||||
|
|
||||||
static const _unset = Object();
|
static const _unset = Object();
|
||||||
Profiles copyWith({
|
ProfileSupadartModel copyWith({
|
||||||
Object? id = _unset,
|
Object? id = _unset,
|
||||||
Object? userId = _unset,
|
Object? userId = _unset,
|
||||||
Object? avatar = _unset,
|
Object? avatar = _unset,
|
||||||
|
@ -186,7 +188,7 @@ class Profiles implements SupadartClass<Profiles> {
|
||||||
Object? nik = _unset,
|
Object? nik = _unset,
|
||||||
Object? user = _unset,
|
Object? user = _unset,
|
||||||
}) {
|
}) {
|
||||||
return Profiles(
|
return ProfileSupadartModel(
|
||||||
id: id == _unset ? this.id : id as String,
|
id: id == _unset ? this.id : id as String,
|
||||||
userId: userId == _unset ? this.userId : userId as String,
|
userId: userId == _unset ? this.userId : userId as String,
|
||||||
avatar: avatar == _unset ? this.avatar : avatar as String?,
|
avatar: avatar == _unset ? this.avatar : avatar as String?,
|
||||||
|
@ -198,7 +200,7 @@ class Profiles implements SupadartClass<Profiles> {
|
||||||
address == _unset ? this.address : address as Map<String, dynamic>?,
|
address == _unset ? this.address : address as Map<String, dynamic>?,
|
||||||
birthDate: birthDate == _unset ? this.birthDate : birthDate as DateTime?,
|
birthDate: birthDate == _unset ? this.birthDate : birthDate as DateTime?,
|
||||||
nik: nik == _unset ? this.nik : nik as String,
|
nik: nik == _unset ? this.nik : nik as String,
|
||||||
user: user == _unset ? this.user : user as Users?,
|
user: user == _unset ? this.user : user as UserSupadartModel?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
// WARNING: Modifications may be overwritten. Please make changes in the Supadart configuration.
|
// WARNING: Modifications may be overwritten. Please make changes in the Supadart configuration.
|
||||||
import 'package:sigap/supadart/supadart_header.dart';
|
import 'package:sigap/supadart/supadart_header.dart';
|
||||||
|
|
||||||
class Resources implements SupadartClass<Resources> {
|
class ResourceSupadartModel implements SupadartClass<ResourceSupadartModel> {
|
||||||
final String id;
|
final String id;
|
||||||
final String name;
|
final String name;
|
||||||
final String? type;
|
final String? type;
|
||||||
|
@ -14,7 +14,7 @@ class Resources implements SupadartClass<Resources> {
|
||||||
final DateTime createdAt;
|
final DateTime createdAt;
|
||||||
final DateTime updatedAt;
|
final DateTime updatedAt;
|
||||||
|
|
||||||
const Resources({
|
const ResourceSupadartModel({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.name,
|
required this.name,
|
||||||
this.type,
|
this.type,
|
||||||
|
@ -26,7 +26,7 @@ class Resources implements SupadartClass<Resources> {
|
||||||
required this.updatedAt,
|
required this.updatedAt,
|
||||||
});
|
});
|
||||||
|
|
||||||
static String get table_name => 'resources';
|
static String get table_name => 'resourceSupadartModel';
|
||||||
static String get c_id => 'id';
|
static String get c_id => 'id';
|
||||||
static String get c_name => 'name';
|
static String get c_name => 'name';
|
||||||
static String get c_type => 'type';
|
static String get c_type => 'type';
|
||||||
|
@ -37,12 +37,12 @@ class Resources implements SupadartClass<Resources> {
|
||||||
static String get c_createdAt => 'created_at';
|
static String get c_createdAt => 'created_at';
|
||||||
static String get c_updatedAt => 'updated_at';
|
static String get c_updatedAt => 'updated_at';
|
||||||
|
|
||||||
static List<Resources> converter(List<Map<String, dynamic>> data) {
|
static List<ResourceSupadartModel> converter(List<Map<String, dynamic>> data) {
|
||||||
return data.map(Resources.fromJson).toList();
|
return data.map(ResourceSupadartModel.fromJson).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
static Resources converterSingle(Map<String, dynamic> data) {
|
static ResourceSupadartModel converterSingle(Map<String, dynamic> data) {
|
||||||
return Resources.fromJson(data);
|
return ResourceSupadartModel.fromJson(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map<String, dynamic> _generateMap({
|
static Map<String, dynamic> _generateMap({
|
||||||
|
@ -117,8 +117,8 @@ class Resources implements SupadartClass<Resources> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory Resources.fromJson(Map<String, dynamic> jsonn) {
|
factory ResourceSupadartModel.fromJson(Map<String, dynamic> jsonn) {
|
||||||
return Resources(
|
return ResourceSupadartModel(
|
||||||
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
||||||
name: jsonn['name'] != null ? jsonn['name'].toString() : '',
|
name: jsonn['name'] != null ? jsonn['name'].toString() : '',
|
||||||
type: jsonn['type'] != null ? jsonn['type'].toString() : null,
|
type: jsonn['type'] != null ? jsonn['type'].toString() : null,
|
||||||
|
@ -160,7 +160,7 @@ class Resources implements SupadartClass<Resources> {
|
||||||
}
|
}
|
||||||
|
|
||||||
static const _unset = Object();
|
static const _unset = Object();
|
||||||
Resources copyWith({
|
ResourceSupadartModel copyWith({
|
||||||
Object? id = _unset,
|
Object? id = _unset,
|
||||||
Object? name = _unset,
|
Object? name = _unset,
|
||||||
Object? type = _unset,
|
Object? type = _unset,
|
||||||
|
@ -171,7 +171,7 @@ class Resources implements SupadartClass<Resources> {
|
||||||
Object? createdAt = _unset,
|
Object? createdAt = _unset,
|
||||||
Object? updatedAt = _unset,
|
Object? updatedAt = _unset,
|
||||||
}) {
|
}) {
|
||||||
return Resources(
|
return ResourceSupadartModel(
|
||||||
id: id == _unset ? this.id : id as String,
|
id: id == _unset ? this.id : id as String,
|
||||||
name: name == _unset ? this.name : name as String,
|
name: name == _unset ? this.name : name as String,
|
||||||
type: type == _unset ? this.type : type as String?,
|
type: type == _unset ? this.type : type as String?,
|
||||||
|
|
|
@ -3,14 +3,14 @@
|
||||||
// WARNING: Modifications may be overwritten. Please make changes in the Supadart configuration.
|
// WARNING: Modifications may be overwritten. Please make changes in the Supadart configuration.
|
||||||
import 'package:sigap/supadart/supadart_header.dart';
|
import 'package:sigap/supadart/supadart_header.dart';
|
||||||
|
|
||||||
class Roles implements SupadartClass<Roles> {
|
class RoleSupadartModel implements SupadartClass<RoleSupadartModel> {
|
||||||
final String id;
|
final String id;
|
||||||
final String name;
|
final String name;
|
||||||
final String? description;
|
final String? description;
|
||||||
final DateTime createdAt;
|
final DateTime createdAt;
|
||||||
final DateTime updatedAt;
|
final DateTime updatedAt;
|
||||||
|
|
||||||
const Roles({
|
const RoleSupadartModel({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.name,
|
required this.name,
|
||||||
this.description,
|
this.description,
|
||||||
|
@ -18,19 +18,19 @@ class Roles implements SupadartClass<Roles> {
|
||||||
required this.updatedAt,
|
required this.updatedAt,
|
||||||
});
|
});
|
||||||
|
|
||||||
static String get table_name => 'roles';
|
static String get table_name => 'roleSupadartModel';
|
||||||
static String get c_id => 'id';
|
static String get c_id => 'id';
|
||||||
static String get c_name => 'name';
|
static String get c_name => 'name';
|
||||||
static String get c_description => 'description';
|
static String get c_description => 'description';
|
||||||
static String get c_createdAt => 'created_at';
|
static String get c_createdAt => 'created_at';
|
||||||
static String get c_updatedAt => 'updated_at';
|
static String get c_updatedAt => 'updated_at';
|
||||||
|
|
||||||
static List<Roles> converter(List<Map<String, dynamic>> data) {
|
static List<RoleSupadartModel> converter(List<Map<String, dynamic>> data) {
|
||||||
return data.map(Roles.fromJson).toList();
|
return data.map(RoleSupadartModel.fromJson).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
static Roles converterSingle(Map<String, dynamic> data) {
|
static RoleSupadartModel converterSingle(Map<String, dynamic> data) {
|
||||||
return Roles.fromJson(data);
|
return RoleSupadartModel.fromJson(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map<String, dynamic> _generateMap({
|
static Map<String, dynamic> _generateMap({
|
||||||
|
@ -81,8 +81,8 @@ class Roles implements SupadartClass<Roles> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory Roles.fromJson(Map<String, dynamic> jsonn) {
|
factory RoleSupadartModel.fromJson(Map<String, dynamic> jsonn) {
|
||||||
return Roles(
|
return RoleSupadartModel(
|
||||||
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
||||||
name: jsonn['name'] != null ? jsonn['name'].toString() : '',
|
name: jsonn['name'] != null ? jsonn['name'].toString() : '',
|
||||||
description:
|
description:
|
||||||
|
@ -109,14 +109,14 @@ class Roles implements SupadartClass<Roles> {
|
||||||
}
|
}
|
||||||
|
|
||||||
static const _unset = Object();
|
static const _unset = Object();
|
||||||
Roles copyWith({
|
RoleSupadartModel copyWith({
|
||||||
Object? id = _unset,
|
Object? id = _unset,
|
||||||
Object? name = _unset,
|
Object? name = _unset,
|
||||||
Object? description = _unset,
|
Object? description = _unset,
|
||||||
Object? createdAt = _unset,
|
Object? createdAt = _unset,
|
||||||
Object? updatedAt = _unset,
|
Object? updatedAt = _unset,
|
||||||
}) {
|
}) {
|
||||||
return Roles(
|
return RoleSupadartModel(
|
||||||
id: id == _unset ? this.id : id as String,
|
id: id == _unset ? this.id : id as String,
|
||||||
name: name == _unset ? this.name : name as String,
|
name: name == _unset ? this.name : name as String,
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
import 'package:sigap/supadart/supadart_exports.dart';
|
import 'package:sigap/supadart/supadart_exports.dart';
|
||||||
import 'package:sigap/supadart/supadart_header.dart';
|
import 'package:sigap/supadart/supadart_header.dart';
|
||||||
|
|
||||||
class Users implements SupadartClass<Users> {
|
class UserSupadartModel implements SupadartClass<UserSupadartModel> {
|
||||||
final String id;
|
final String id;
|
||||||
final String rolesId;
|
final String rolesId;
|
||||||
final String email;
|
final String email;
|
||||||
|
@ -25,10 +25,10 @@ class Users implements SupadartClass<Users> {
|
||||||
final bool isBanned;
|
final bool isBanned;
|
||||||
final int panicStrike;
|
final int panicStrike;
|
||||||
final int spoofingAttempts;
|
final int spoofingAttempts;
|
||||||
final Roles? role;
|
final RoleSupadartModel? role;
|
||||||
final Profiles? profile;
|
final ProfileSupadartModel? profile;
|
||||||
|
|
||||||
const Users({
|
const UserSupadartModel({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.rolesId,
|
required this.rolesId,
|
||||||
required this.email,
|
required this.email,
|
||||||
|
@ -53,7 +53,7 @@ class Users implements SupadartClass<Users> {
|
||||||
this.profile,
|
this.profile,
|
||||||
});
|
});
|
||||||
|
|
||||||
static String get table_name => 'users';
|
static String get table_name => 'userSupadartModel';
|
||||||
static String get c_id => 'id';
|
static String get c_id => 'id';
|
||||||
static String get c_rolesId => 'roles_id';
|
static String get c_rolesId => 'roles_id';
|
||||||
static String get c_email => 'email';
|
static String get c_email => 'email';
|
||||||
|
@ -75,12 +75,12 @@ class Users implements SupadartClass<Users> {
|
||||||
static String get c_panicStrike => 'panic_strike';
|
static String get c_panicStrike => 'panic_strike';
|
||||||
static String get c_spoofingAttempts => 'spoofing_attempts';
|
static String get c_spoofingAttempts => 'spoofing_attempts';
|
||||||
|
|
||||||
static List<Users> converter(List<Map<String, dynamic>> data) {
|
static List<UserSupadartModel> converter(List<Map<String, dynamic>> data) {
|
||||||
return data.map(Users.fromJson).toList();
|
return data.map(UserSupadartModel.fromJson).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
static Users converterSingle(Map<String, dynamic> data) {
|
static UserSupadartModel converterSingle(Map<String, dynamic> data) {
|
||||||
return Users.fromJson(data);
|
return UserSupadartModel.fromJson(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map<String, dynamic> _generateMap({
|
static Map<String, dynamic> _generateMap({
|
||||||
|
@ -226,8 +226,8 @@ class Users implements SupadartClass<Users> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
factory Users.fromJson(Map<String, dynamic> jsonn) {
|
factory UserSupadartModel.fromJson(Map<String, dynamic> jsonn) {
|
||||||
return Users(
|
return UserSupadartModel(
|
||||||
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
id: jsonn['id'] != null ? jsonn['id'].toString() : '',
|
||||||
rolesId: jsonn['roles_id'] != null ? jsonn['roles_id'].toString() : '',
|
rolesId: jsonn['roles_id'] != null ? jsonn['roles_id'].toString() : '',
|
||||||
email: jsonn['email'] != null ? jsonn['email'].toString() : '',
|
email: jsonn['email'] != null ? jsonn['email'].toString() : '',
|
||||||
|
@ -293,11 +293,15 @@ class Users implements SupadartClass<Users> {
|
||||||
: 0,
|
: 0,
|
||||||
role:
|
role:
|
||||||
jsonn['roles'] != null
|
jsonn['roles'] != null
|
||||||
? Roles.fromJson(jsonn['roles'] as Map<String, dynamic>)
|
? RoleSupadartModel.fromJson(
|
||||||
|
jsonn['roles'] as Map<String, dynamic>,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
profile:
|
profile:
|
||||||
jsonn['profiles'] != null
|
jsonn['profiles'] != null
|
||||||
? Profiles.fromJson(jsonn['profiles'] as Map<String, dynamic>)
|
? ProfileSupadartModel.fromJson(
|
||||||
|
jsonn['profiles'] as Map<String, dynamic>,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -330,7 +334,7 @@ class Users implements SupadartClass<Users> {
|
||||||
}
|
}
|
||||||
|
|
||||||
static const _unset = Object();
|
static const _unset = Object();
|
||||||
Users copyWith({
|
UserSupadartModel copyWith({
|
||||||
Object? id = _unset,
|
Object? id = _unset,
|
||||||
Object? rolesId = _unset,
|
Object? rolesId = _unset,
|
||||||
Object? email = _unset,
|
Object? email = _unset,
|
||||||
|
@ -354,7 +358,7 @@ class Users implements SupadartClass<Users> {
|
||||||
Object? role = _unset,
|
Object? role = _unset,
|
||||||
Object? profile = _unset,
|
Object? profile = _unset,
|
||||||
}) {
|
}) {
|
||||||
return Users(
|
return UserSupadartModel(
|
||||||
id: id == _unset ? this.id : id as String,
|
id: id == _unset ? this.id : id as String,
|
||||||
rolesId: rolesId == _unset ? this.rolesId : rolesId as String,
|
rolesId: rolesId == _unset ? this.rolesId : rolesId as String,
|
||||||
email: email == _unset ? this.email : email as String,
|
email: email == _unset ? this.email : email as String,
|
||||||
|
@ -401,8 +405,9 @@ class Users implements SupadartClass<Users> {
|
||||||
spoofingAttempts == _unset
|
spoofingAttempts == _unset
|
||||||
? this.spoofingAttempts
|
? this.spoofingAttempts
|
||||||
: spoofingAttempts as int,
|
: spoofingAttempts as int,
|
||||||
role: role == _unset ? this.role : role as Roles?,
|
role: role == _unset ? this.role : role as RoleSupadartModel?,
|
||||||
profile: profile == _unset ? this.profile : profile as Profiles?,
|
profile:
|
||||||
|
profile == _unset ? this.profile : profile as ProfileSupadartModel?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ enums:
|
||||||
unit_type: ["other", "polda", "polres", "polsek"]
|
unit_type: ["other", "polda", "polres", "polsek"]
|
||||||
|
|
||||||
# Optional, where to place the generated classes files default: ./lib/models/
|
# Optional, where to place the generated classes files default: ./lib/models/
|
||||||
output: lib/models/
|
output: lib/generated/
|
||||||
# Set to true, if you want to generate separated files for each classes
|
# Set to true, if you want to generate separated files for each classes
|
||||||
separated: true
|
separated: true
|
||||||
# Set to true, if you are not using Flutter, just normal Dart project
|
# Set to true, if you are not using Flutter, just normal Dart project
|
||||||
|
@ -24,11 +24,33 @@ dart: false
|
||||||
|
|
||||||
# Optional, used to map table names to class names(case-sensitive)
|
# Optional, used to map table names to class names(case-sensitive)
|
||||||
mappings:
|
mappings:
|
||||||
_prisma_migrations: PrismaMigrations
|
_prisma_migrations: PrismaMigrationsSupadartModel
|
||||||
# books: book
|
cities: CitySupadartModel
|
||||||
# categories: category
|
contact_messages: ContactMessageSupadartModel
|
||||||
# children: child
|
crime_categories: CrimeCategorySupadartModel
|
||||||
# people: person
|
crime_incidents: CrimeIncidentSupadartModel
|
||||||
|
crimes: CrimeSupadartModel
|
||||||
|
demographics: DemographicSupadartModel
|
||||||
|
districts: DistrictSupadartModel
|
||||||
|
events: EventSupadartModel
|
||||||
|
evidence: EvidenceSupadartModel
|
||||||
|
geographics: GeographicSupadartModel
|
||||||
|
incident_logs: IncidentLogSupadartModel
|
||||||
|
location_logs: LocationLogSupadartModel
|
||||||
|
locations: LocationSupadartModel
|
||||||
|
logs: LogSupadartModel
|
||||||
|
officers: OfficerSupadartModel
|
||||||
|
panic_button_logs: PanicButtonLogSupadartModel
|
||||||
|
patrol_units: PatrolUnitSupadartModel
|
||||||
|
permissions: PermissionSupadartModel
|
||||||
|
profiles: ProfileSupadartModel
|
||||||
|
resources: ResourceSupadartModel
|
||||||
|
roles: RoleSupadartModel
|
||||||
|
sessions: SessionSupadartModel
|
||||||
|
unit_statistics: UnitStatisticSupadartModel
|
||||||
|
units: UnitSupadartModel
|
||||||
|
users: UserSupadartModel
|
||||||
|
|
||||||
|
|
||||||
# Optional, used to exclude methods from generated classes, comment out to include them
|
# Optional, used to exclude methods from generated classes, comment out to include them
|
||||||
exclude:
|
exclude:
|
||||||
|
|
Loading…
Reference in New Issue