Compare commits

...

1 Commits

Author SHA1 Message Date
5f1e125cff Added map data and device selection 2026-02-17 12:11:50 +01:00
21 changed files with 2073 additions and 192 deletions

View File

@@ -1,13 +1,11 @@
import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:hub/src/core/data/datasource/hub_remote_datasource.dart';
import 'package:hub/src/core/data/models/get_devices_response_model.dart';
import 'package:hub/src/core/data/models/latest_positions_response_model.dart';
import 'package:hub/src/features/hub/domain/entities/device_entity.dart';
import 'package:hub/src/features/hub/domain/entities/position_entity.dart';
import 'package:hub/src/features/hub/domain/get_latest_positions_use_case.dart';
import 'package:sf_infrastructure/sf_infrastructure.dart';
class HomeRemoteDatasourceImpl implements HomeRemoteDatasource {
@@ -62,17 +60,53 @@ class HomeRemoteDatasourceImpl implements HomeRemoteDatasource {
LatestPositionsItemResponseModel(
latitude: 43.327116830678186,
longitude: -3.083269100434551,
address: 'Aparcamiento',
positionDate: DateTime.now(),
address: LatestPositionsAddressResponseModel(
street: 'street',
city: 'city',
province: 'province',
state: 'state',
country: 'country',
),
positionDate: DateTime.now().millisecondsSinceEpoch,
frequentPlace: false,
frequentPlaceName: ''),
frequentPlaceName: '',
id: '1',
deviceIdentificator: deviceId,
hpe: 0,
ncell: 65,
type: 0,
createdAt: DateTime.now().millisecondsSinceEpoch,
positionDateOriginal: null,
message: '',
networks: [LatestPositionsNetworkResponseModel(SSID: 'SSID', BSSID: 'BSSID', signal: 'signal')],
ignore: false,
suspect: false
),
LatestPositionsItemResponseModel(
latitude: 43.32729043118528,
longitude: -3.08320596406992,
address: 'Izekoren etxea',
positionDate: DateTime.now(),
address: LatestPositionsAddressResponseModel(
street: 'street',
city: 'city',
province: 'province',
state: 'state',
country: 'country',
),
positionDate: DateTime.now().millisecondsSinceEpoch,
frequentPlace: true,
frequentPlaceName: 'La cafetería'),
frequentPlaceName: 'La cafetería',
id: '2',
deviceIdentificator: deviceId,
hpe: 0,
ncell: 65,
type: 0,
createdAt: DateTime.now().millisecondsSinceEpoch,
positionDateOriginal: null,
message: '',
networks: [],
ignore: false,
suspect: false
),
]);*/
return model.toEntity();
} on DioException catch (error) {

View File

@@ -1,4 +1,6 @@
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:hub/src/features/hub/domain/entities/address_entity.dart';
import 'package:hub/src/features/hub/domain/entities/network_entity.dart';
import 'package:hub/src/features/hub/domain/entities/position_entity.dart';
part 'latest_positions_response_model.freezed.dart';
@@ -18,27 +20,99 @@ abstract class LatestPositionsResponseModel with _$LatestPositionsResponseModel
abstract class LatestPositionsItemResponseModel
with _$LatestPositionsItemResponseModel {
const factory LatestPositionsItemResponseModel({
required String id,
required String deviceIdentificator,
required double latitude,
required double longitude,
required String? address,
required DateTime positionDate,
required int hpe,
int? ncell,
required int type,
int? steps,
LatestPositionsAddressResponseModel? address,
required int createdAt,
required int positionDate,
int? positionDateOriginal,
String? frequentPlaceName,
required String message,
required List<LatestPositionsNetworkResponseModel> networks,
required bool ignore,
required bool suspect,
required bool frequentPlace,
required String frequentPlaceName,
}) = _LatestPositionsItemResponseModel;
factory LatestPositionsItemResponseModel.fromJson(Map<String, dynamic> json) =>
_$LatestPositionsItemResponseModelFromJson(json);
_$LatestPositionsItemResponseModelFromJson(json);
}
extension LatestPositionsResponseModelMapper on LatestPositionsResponseModel {
List<PositionEntity> toEntity() {
return items.map((LatestPositionsItemResponseModel item) => PositionEntity(
latitude: item.latitude,
longitude: item.longitude,
address: item.address,
positionDate: item.positionDate,
frequentPlace: item.frequentPlace,
frequentPlaceName: item.frequentPlaceName,
return items.map((LatestPositionsItemResponseModel item) => PositionEntity(
id: item.id,
deviceIdentificator: item.deviceIdentificator,
latitude: item.latitude,
longitude: item.longitude,
hpe: item.hpe,
ncell: item.ncell,
type: item.type,
steps: item.steps,
address: item.address?.toEntity(),
createdAt: item.createdAt,
positionDate: item.positionDate,
positionDateOriginal: item.positionDateOriginal,
frequentPlaceName: item.frequentPlaceName,
message: item.message,
networks: item.networks.map((n)=>n.toEntity()).toList(),
ignore: item.ignore,
suspect: item.suspect,
frequentPlace: item.frequentPlace,
)).toList();
}
}
@freezed
abstract class LatestPositionsAddressResponseModel with _$LatestPositionsAddressResponseModel {
const factory LatestPositionsAddressResponseModel({
required String street,
required String city,
required String province,
required String state,
required String country,
}) = _LatestPositionsAddressResponseModel;
factory LatestPositionsAddressResponseModel.fromJson(Map<String, dynamic> json) =>
_$LatestPositionsAddressResponseModelFromJson(json);
}
extension LatestPositionsAddressResponseModelMapper on LatestPositionsAddressResponseModel {
AddressEntity toEntity() {
return AddressEntity(
street: street,
city: city,
province: province,
state: state,
country: country,
);
}
}
@freezed
abstract class LatestPositionsNetworkResponseModel with _$LatestPositionsNetworkResponseModel {
const factory LatestPositionsNetworkResponseModel({
required String SSID,
required String BSSID,
required String signal,
}) = _LatestPositionsNetworkResponseModel;
factory LatestPositionsNetworkResponseModel.fromJson(Map<String, dynamic> json) =>
_$LatestPositionsNetworkResponseModelFromJson(json);
}
extension LatestPositionsNetworkResponseModelMapper on LatestPositionsNetworkResponseModel {
NetworkEntity toEntity() {
return NetworkEntity(
SSID: SSID,
BSSID: BSSID,
signal: signal,
);
}
}

View File

@@ -284,7 +284,7 @@ as List<LatestPositionsItemResponseModel>,
/// @nodoc
mixin _$LatestPositionsItemResponseModel {
double get latitude; double get longitude; String? get address; DateTime get positionDate; bool get frequentPlace; String get frequentPlaceName;
String get id; String get deviceIdentificator; double get latitude; double get longitude; int get hpe; int? get ncell; int get type; int? get steps; LatestPositionsAddressResponseModel? get address; int get createdAt; int get positionDate; int? get positionDateOriginal; String? get frequentPlaceName; String get message; List<LatestPositionsNetworkResponseModel> get networks; bool get ignore; bool get suspect; bool get frequentPlace;
/// Create a copy of LatestPositionsItemResponseModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@@ -297,16 +297,16 @@ $LatestPositionsItemResponseModelCopyWith<LatestPositionsItemResponseModel> get
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is LatestPositionsItemResponseModel&&(identical(other.latitude, latitude) || other.latitude == latitude)&&(identical(other.longitude, longitude) || other.longitude == longitude)&&(identical(other.address, address) || other.address == address)&&(identical(other.positionDate, positionDate) || other.positionDate == positionDate)&&(identical(other.frequentPlace, frequentPlace) || other.frequentPlace == frequentPlace)&&(identical(other.frequentPlaceName, frequentPlaceName) || other.frequentPlaceName == frequentPlaceName));
return identical(this, other) || (other.runtimeType == runtimeType&&other is LatestPositionsItemResponseModel&&(identical(other.id, id) || other.id == id)&&(identical(other.deviceIdentificator, deviceIdentificator) || other.deviceIdentificator == deviceIdentificator)&&(identical(other.latitude, latitude) || other.latitude == latitude)&&(identical(other.longitude, longitude) || other.longitude == longitude)&&(identical(other.hpe, hpe) || other.hpe == hpe)&&(identical(other.ncell, ncell) || other.ncell == ncell)&&(identical(other.type, type) || other.type == type)&&(identical(other.steps, steps) || other.steps == steps)&&(identical(other.address, address) || other.address == address)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.positionDate, positionDate) || other.positionDate == positionDate)&&(identical(other.positionDateOriginal, positionDateOriginal) || other.positionDateOriginal == positionDateOriginal)&&(identical(other.frequentPlaceName, frequentPlaceName) || other.frequentPlaceName == frequentPlaceName)&&(identical(other.message, message) || other.message == message)&&const DeepCollectionEquality().equals(other.networks, networks)&&(identical(other.ignore, ignore) || other.ignore == ignore)&&(identical(other.suspect, suspect) || other.suspect == suspect)&&(identical(other.frequentPlace, frequentPlace) || other.frequentPlace == frequentPlace));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,latitude,longitude,address,positionDate,frequentPlace,frequentPlaceName);
int get hashCode => Object.hash(runtimeType,id,deviceIdentificator,latitude,longitude,hpe,ncell,type,steps,address,createdAt,positionDate,positionDateOriginal,frequentPlaceName,message,const DeepCollectionEquality().hash(networks),ignore,suspect,frequentPlace);
@override
String toString() {
return 'LatestPositionsItemResponseModel(latitude: $latitude, longitude: $longitude, address: $address, positionDate: $positionDate, frequentPlace: $frequentPlace, frequentPlaceName: $frequentPlaceName)';
return 'LatestPositionsItemResponseModel(id: $id, deviceIdentificator: $deviceIdentificator, latitude: $latitude, longitude: $longitude, hpe: $hpe, ncell: $ncell, type: $type, steps: $steps, address: $address, createdAt: $createdAt, positionDate: $positionDate, positionDateOriginal: $positionDateOriginal, frequentPlaceName: $frequentPlaceName, message: $message, networks: $networks, ignore: $ignore, suspect: $suspect, frequentPlace: $frequentPlace)';
}
@@ -317,11 +317,11 @@ abstract mixin class $LatestPositionsItemResponseModelCopyWith<$Res> {
factory $LatestPositionsItemResponseModelCopyWith(LatestPositionsItemResponseModel value, $Res Function(LatestPositionsItemResponseModel) _then) = _$LatestPositionsItemResponseModelCopyWithImpl;
@useResult
$Res call({
double latitude, double longitude, String? address, DateTime positionDate, bool frequentPlace, String frequentPlaceName
String id, String deviceIdentificator, double latitude, double longitude, int hpe, int? ncell, int type, int? steps, LatestPositionsAddressResponseModel? address, int createdAt, int positionDate, int? positionDateOriginal, String? frequentPlaceName, String message, List<LatestPositionsNetworkResponseModel> networks, bool ignore, bool suspect, bool frequentPlace
});
$LatestPositionsAddressResponseModelCopyWith<$Res>? get address;
}
/// @nodoc
@@ -334,18 +334,42 @@ class _$LatestPositionsItemResponseModelCopyWithImpl<$Res>
/// Create a copy of LatestPositionsItemResponseModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? latitude = null,Object? longitude = null,Object? address = freezed,Object? positionDate = null,Object? frequentPlace = null,Object? frequentPlaceName = null,}) {
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? deviceIdentificator = null,Object? latitude = null,Object? longitude = null,Object? hpe = null,Object? ncell = freezed,Object? type = null,Object? steps = freezed,Object? address = freezed,Object? createdAt = null,Object? positionDate = null,Object? positionDateOriginal = freezed,Object? frequentPlaceName = freezed,Object? message = null,Object? networks = null,Object? ignore = null,Object? suspect = null,Object? frequentPlace = null,}) {
return _then(_self.copyWith(
latitude: null == latitude ? _self.latitude : latitude // ignore: cast_nullable_to_non_nullable
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String,deviceIdentificator: null == deviceIdentificator ? _self.deviceIdentificator : deviceIdentificator // ignore: cast_nullable_to_non_nullable
as String,latitude: null == latitude ? _self.latitude : latitude // ignore: cast_nullable_to_non_nullable
as double,longitude: null == longitude ? _self.longitude : longitude // ignore: cast_nullable_to_non_nullable
as double,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable
as String?,positionDate: null == positionDate ? _self.positionDate : positionDate // ignore: cast_nullable_to_non_nullable
as DateTime,frequentPlace: null == frequentPlace ? _self.frequentPlace : frequentPlace // ignore: cast_nullable_to_non_nullable
as bool,frequentPlaceName: null == frequentPlaceName ? _self.frequentPlaceName : frequentPlaceName // ignore: cast_nullable_to_non_nullable
as String,
as double,hpe: null == hpe ? _self.hpe : hpe // ignore: cast_nullable_to_non_nullable
as int,ncell: freezed == ncell ? _self.ncell : ncell // ignore: cast_nullable_to_non_nullable
as int?,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
as int,steps: freezed == steps ? _self.steps : steps // ignore: cast_nullable_to_non_nullable
as int?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable
as LatestPositionsAddressResponseModel?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
as int,positionDate: null == positionDate ? _self.positionDate : positionDate // ignore: cast_nullable_to_non_nullable
as int,positionDateOriginal: freezed == positionDateOriginal ? _self.positionDateOriginal : positionDateOriginal // ignore: cast_nullable_to_non_nullable
as int?,frequentPlaceName: freezed == frequentPlaceName ? _self.frequentPlaceName : frequentPlaceName // ignore: cast_nullable_to_non_nullable
as String?,message: null == message ? _self.message : message // ignore: cast_nullable_to_non_nullable
as String,networks: null == networks ? _self.networks : networks // ignore: cast_nullable_to_non_nullable
as List<LatestPositionsNetworkResponseModel>,ignore: null == ignore ? _self.ignore : ignore // ignore: cast_nullable_to_non_nullable
as bool,suspect: null == suspect ? _self.suspect : suspect // ignore: cast_nullable_to_non_nullable
as bool,frequentPlace: null == frequentPlace ? _self.frequentPlace : frequentPlace // ignore: cast_nullable_to_non_nullable
as bool,
));
}
/// Create a copy of LatestPositionsItemResponseModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$LatestPositionsAddressResponseModelCopyWith<$Res>? get address {
if (_self.address == null) {
return null;
}
return $LatestPositionsAddressResponseModelCopyWith<$Res>(_self.address!, (value) {
return _then(_self.copyWith(address: value));
});
}
}
@@ -427,10 +451,10 @@ return $default(_that);case _:
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( double latitude, double longitude, String? address, DateTime positionDate, bool frequentPlace, String frequentPlaceName)? $default,{required TResult orElse(),}) {final _that = this;
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, String deviceIdentificator, double latitude, double longitude, int hpe, int? ncell, int type, int? steps, LatestPositionsAddressResponseModel? address, int createdAt, int positionDate, int? positionDateOriginal, String? frequentPlaceName, String message, List<LatestPositionsNetworkResponseModel> networks, bool ignore, bool suspect, bool frequentPlace)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _LatestPositionsItemResponseModel() when $default != null:
return $default(_that.latitude,_that.longitude,_that.address,_that.positionDate,_that.frequentPlace,_that.frequentPlaceName);case _:
return $default(_that.id,_that.deviceIdentificator,_that.latitude,_that.longitude,_that.hpe,_that.ncell,_that.type,_that.steps,_that.address,_that.createdAt,_that.positionDate,_that.positionDateOriginal,_that.frequentPlaceName,_that.message,_that.networks,_that.ignore,_that.suspect,_that.frequentPlace);case _:
return orElse();
}
@@ -448,10 +472,10 @@ return $default(_that.latitude,_that.longitude,_that.address,_that.positionDate,
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( double latitude, double longitude, String? address, DateTime positionDate, bool frequentPlace, String frequentPlaceName) $default,) {final _that = this;
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, String deviceIdentificator, double latitude, double longitude, int hpe, int? ncell, int type, int? steps, LatestPositionsAddressResponseModel? address, int createdAt, int positionDate, int? positionDateOriginal, String? frequentPlaceName, String message, List<LatestPositionsNetworkResponseModel> networks, bool ignore, bool suspect, bool frequentPlace) $default,) {final _that = this;
switch (_that) {
case _LatestPositionsItemResponseModel():
return $default(_that.latitude,_that.longitude,_that.address,_that.positionDate,_that.frequentPlace,_that.frequentPlaceName);case _:
return $default(_that.id,_that.deviceIdentificator,_that.latitude,_that.longitude,_that.hpe,_that.ncell,_that.type,_that.steps,_that.address,_that.createdAt,_that.positionDate,_that.positionDateOriginal,_that.frequentPlaceName,_that.message,_that.networks,_that.ignore,_that.suspect,_that.frequentPlace);case _:
throw StateError('Unexpected subclass');
}
@@ -468,10 +492,10 @@ return $default(_that.latitude,_that.longitude,_that.address,_that.positionDate,
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( double latitude, double longitude, String? address, DateTime positionDate, bool frequentPlace, String frequentPlaceName)? $default,) {final _that = this;
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, String deviceIdentificator, double latitude, double longitude, int hpe, int? ncell, int type, int? steps, LatestPositionsAddressResponseModel? address, int createdAt, int positionDate, int? positionDateOriginal, String? frequentPlaceName, String message, List<LatestPositionsNetworkResponseModel> networks, bool ignore, bool suspect, bool frequentPlace)? $default,) {final _that = this;
switch (_that) {
case _LatestPositionsItemResponseModel() when $default != null:
return $default(_that.latitude,_that.longitude,_that.address,_that.positionDate,_that.frequentPlace,_that.frequentPlaceName);case _:
return $default(_that.id,_that.deviceIdentificator,_that.latitude,_that.longitude,_that.hpe,_that.ncell,_that.type,_that.steps,_that.address,_that.createdAt,_that.positionDate,_that.positionDateOriginal,_that.frequentPlaceName,_that.message,_that.networks,_that.ignore,_that.suspect,_that.frequentPlace);case _:
return null;
}
@@ -483,15 +507,33 @@ return $default(_that.latitude,_that.longitude,_that.address,_that.positionDate,
@JsonSerializable()
class _LatestPositionsItemResponseModel implements LatestPositionsItemResponseModel {
const _LatestPositionsItemResponseModel({required this.latitude, required this.longitude, required this.address, required this.positionDate, required this.frequentPlace, required this.frequentPlaceName});
const _LatestPositionsItemResponseModel({required this.id, required this.deviceIdentificator, required this.latitude, required this.longitude, required this.hpe, this.ncell, required this.type, this.steps, this.address, required this.createdAt, required this.positionDate, this.positionDateOriginal, this.frequentPlaceName, required this.message, required final List<LatestPositionsNetworkResponseModel> networks, required this.ignore, required this.suspect, required this.frequentPlace}): _networks = networks;
factory _LatestPositionsItemResponseModel.fromJson(Map<String, dynamic> json) => _$LatestPositionsItemResponseModelFromJson(json);
@override final String id;
@override final String deviceIdentificator;
@override final double latitude;
@override final double longitude;
@override final String? address;
@override final DateTime positionDate;
@override final int hpe;
@override final int? ncell;
@override final int type;
@override final int? steps;
@override final LatestPositionsAddressResponseModel? address;
@override final int createdAt;
@override final int positionDate;
@override final int? positionDateOriginal;
@override final String? frequentPlaceName;
@override final String message;
final List<LatestPositionsNetworkResponseModel> _networks;
@override List<LatestPositionsNetworkResponseModel> get networks {
if (_networks is EqualUnmodifiableListView) return _networks;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_networks);
}
@override final bool ignore;
@override final bool suspect;
@override final bool frequentPlace;
@override final String frequentPlaceName;
/// Create a copy of LatestPositionsItemResponseModel
/// with the given fields replaced by the non-null parameter values.
@@ -506,16 +548,16 @@ Map<String, dynamic> toJson() {
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _LatestPositionsItemResponseModel&&(identical(other.latitude, latitude) || other.latitude == latitude)&&(identical(other.longitude, longitude) || other.longitude == longitude)&&(identical(other.address, address) || other.address == address)&&(identical(other.positionDate, positionDate) || other.positionDate == positionDate)&&(identical(other.frequentPlace, frequentPlace) || other.frequentPlace == frequentPlace)&&(identical(other.frequentPlaceName, frequentPlaceName) || other.frequentPlaceName == frequentPlaceName));
return identical(this, other) || (other.runtimeType == runtimeType&&other is _LatestPositionsItemResponseModel&&(identical(other.id, id) || other.id == id)&&(identical(other.deviceIdentificator, deviceIdentificator) || other.deviceIdentificator == deviceIdentificator)&&(identical(other.latitude, latitude) || other.latitude == latitude)&&(identical(other.longitude, longitude) || other.longitude == longitude)&&(identical(other.hpe, hpe) || other.hpe == hpe)&&(identical(other.ncell, ncell) || other.ncell == ncell)&&(identical(other.type, type) || other.type == type)&&(identical(other.steps, steps) || other.steps == steps)&&(identical(other.address, address) || other.address == address)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.positionDate, positionDate) || other.positionDate == positionDate)&&(identical(other.positionDateOriginal, positionDateOriginal) || other.positionDateOriginal == positionDateOriginal)&&(identical(other.frequentPlaceName, frequentPlaceName) || other.frequentPlaceName == frequentPlaceName)&&(identical(other.message, message) || other.message == message)&&const DeepCollectionEquality().equals(other._networks, _networks)&&(identical(other.ignore, ignore) || other.ignore == ignore)&&(identical(other.suspect, suspect) || other.suspect == suspect)&&(identical(other.frequentPlace, frequentPlace) || other.frequentPlace == frequentPlace));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,latitude,longitude,address,positionDate,frequentPlace,frequentPlaceName);
int get hashCode => Object.hash(runtimeType,id,deviceIdentificator,latitude,longitude,hpe,ncell,type,steps,address,createdAt,positionDate,positionDateOriginal,frequentPlaceName,message,const DeepCollectionEquality().hash(_networks),ignore,suspect,frequentPlace);
@override
String toString() {
return 'LatestPositionsItemResponseModel(latitude: $latitude, longitude: $longitude, address: $address, positionDate: $positionDate, frequentPlace: $frequentPlace, frequentPlaceName: $frequentPlaceName)';
return 'LatestPositionsItemResponseModel(id: $id, deviceIdentificator: $deviceIdentificator, latitude: $latitude, longitude: $longitude, hpe: $hpe, ncell: $ncell, type: $type, steps: $steps, address: $address, createdAt: $createdAt, positionDate: $positionDate, positionDateOriginal: $positionDateOriginal, frequentPlaceName: $frequentPlaceName, message: $message, networks: $networks, ignore: $ignore, suspect: $suspect, frequentPlace: $frequentPlace)';
}
@@ -526,11 +568,11 @@ abstract mixin class _$LatestPositionsItemResponseModelCopyWith<$Res> implements
factory _$LatestPositionsItemResponseModelCopyWith(_LatestPositionsItemResponseModel value, $Res Function(_LatestPositionsItemResponseModel) _then) = __$LatestPositionsItemResponseModelCopyWithImpl;
@override @useResult
$Res call({
double latitude, double longitude, String? address, DateTime positionDate, bool frequentPlace, String frequentPlaceName
String id, String deviceIdentificator, double latitude, double longitude, int hpe, int? ncell, int type, int? steps, LatestPositionsAddressResponseModel? address, int createdAt, int positionDate, int? positionDateOriginal, String? frequentPlaceName, String message, List<LatestPositionsNetworkResponseModel> networks, bool ignore, bool suspect, bool frequentPlace
});
@override $LatestPositionsAddressResponseModelCopyWith<$Res>? get address;
}
/// @nodoc
@@ -543,14 +585,582 @@ class __$LatestPositionsItemResponseModelCopyWithImpl<$Res>
/// Create a copy of LatestPositionsItemResponseModel
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? latitude = null,Object? longitude = null,Object? address = freezed,Object? positionDate = null,Object? frequentPlace = null,Object? frequentPlaceName = null,}) {
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? deviceIdentificator = null,Object? latitude = null,Object? longitude = null,Object? hpe = null,Object? ncell = freezed,Object? type = null,Object? steps = freezed,Object? address = freezed,Object? createdAt = null,Object? positionDate = null,Object? positionDateOriginal = freezed,Object? frequentPlaceName = freezed,Object? message = null,Object? networks = null,Object? ignore = null,Object? suspect = null,Object? frequentPlace = null,}) {
return _then(_LatestPositionsItemResponseModel(
latitude: null == latitude ? _self.latitude : latitude // ignore: cast_nullable_to_non_nullable
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String,deviceIdentificator: null == deviceIdentificator ? _self.deviceIdentificator : deviceIdentificator // ignore: cast_nullable_to_non_nullable
as String,latitude: null == latitude ? _self.latitude : latitude // ignore: cast_nullable_to_non_nullable
as double,longitude: null == longitude ? _self.longitude : longitude // ignore: cast_nullable_to_non_nullable
as double,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable
as String?,positionDate: null == positionDate ? _self.positionDate : positionDate // ignore: cast_nullable_to_non_nullable
as DateTime,frequentPlace: null == frequentPlace ? _self.frequentPlace : frequentPlace // ignore: cast_nullable_to_non_nullable
as bool,frequentPlaceName: null == frequentPlaceName ? _self.frequentPlaceName : frequentPlaceName // ignore: cast_nullable_to_non_nullable
as double,hpe: null == hpe ? _self.hpe : hpe // ignore: cast_nullable_to_non_nullable
as int,ncell: freezed == ncell ? _self.ncell : ncell // ignore: cast_nullable_to_non_nullable
as int?,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
as int,steps: freezed == steps ? _self.steps : steps // ignore: cast_nullable_to_non_nullable
as int?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable
as LatestPositionsAddressResponseModel?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
as int,positionDate: null == positionDate ? _self.positionDate : positionDate // ignore: cast_nullable_to_non_nullable
as int,positionDateOriginal: freezed == positionDateOriginal ? _self.positionDateOriginal : positionDateOriginal // ignore: cast_nullable_to_non_nullable
as int?,frequentPlaceName: freezed == frequentPlaceName ? _self.frequentPlaceName : frequentPlaceName // ignore: cast_nullable_to_non_nullable
as String?,message: null == message ? _self.message : message // ignore: cast_nullable_to_non_nullable
as String,networks: null == networks ? _self._networks : networks // ignore: cast_nullable_to_non_nullable
as List<LatestPositionsNetworkResponseModel>,ignore: null == ignore ? _self.ignore : ignore // ignore: cast_nullable_to_non_nullable
as bool,suspect: null == suspect ? _self.suspect : suspect // ignore: cast_nullable_to_non_nullable
as bool,frequentPlace: null == frequentPlace ? _self.frequentPlace : frequentPlace // ignore: cast_nullable_to_non_nullable
as bool,
));
}
/// Create a copy of LatestPositionsItemResponseModel
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$LatestPositionsAddressResponseModelCopyWith<$Res>? get address {
if (_self.address == null) {
return null;
}
return $LatestPositionsAddressResponseModelCopyWith<$Res>(_self.address!, (value) {
return _then(_self.copyWith(address: value));
});
}
}
/// @nodoc
mixin _$LatestPositionsAddressResponseModel {
String get street; String get city; String get province; String get state; String get country;
/// Create a copy of LatestPositionsAddressResponseModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$LatestPositionsAddressResponseModelCopyWith<LatestPositionsAddressResponseModel> get copyWith => _$LatestPositionsAddressResponseModelCopyWithImpl<LatestPositionsAddressResponseModel>(this as LatestPositionsAddressResponseModel, _$identity);
/// Serializes this LatestPositionsAddressResponseModel to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is LatestPositionsAddressResponseModel&&(identical(other.street, street) || other.street == street)&&(identical(other.city, city) || other.city == city)&&(identical(other.province, province) || other.province == province)&&(identical(other.state, state) || other.state == state)&&(identical(other.country, country) || other.country == country));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,street,city,province,state,country);
@override
String toString() {
return 'LatestPositionsAddressResponseModel(street: $street, city: $city, province: $province, state: $state, country: $country)';
}
}
/// @nodoc
abstract mixin class $LatestPositionsAddressResponseModelCopyWith<$Res> {
factory $LatestPositionsAddressResponseModelCopyWith(LatestPositionsAddressResponseModel value, $Res Function(LatestPositionsAddressResponseModel) _then) = _$LatestPositionsAddressResponseModelCopyWithImpl;
@useResult
$Res call({
String street, String city, String province, String state, String country
});
}
/// @nodoc
class _$LatestPositionsAddressResponseModelCopyWithImpl<$Res>
implements $LatestPositionsAddressResponseModelCopyWith<$Res> {
_$LatestPositionsAddressResponseModelCopyWithImpl(this._self, this._then);
final LatestPositionsAddressResponseModel _self;
final $Res Function(LatestPositionsAddressResponseModel) _then;
/// Create a copy of LatestPositionsAddressResponseModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? street = null,Object? city = null,Object? province = null,Object? state = null,Object? country = null,}) {
return _then(_self.copyWith(
street: null == street ? _self.street : street // ignore: cast_nullable_to_non_nullable
as String,city: null == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
as String,province: null == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
as String,state: null == state ? _self.state : state // ignore: cast_nullable_to_non_nullable
as String,country: null == country ? _self.country : country // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// Adds pattern-matching-related methods to [LatestPositionsAddressResponseModel].
extension LatestPositionsAddressResponseModelPatterns on LatestPositionsAddressResponseModel {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _LatestPositionsAddressResponseModel value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _LatestPositionsAddressResponseModel() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _LatestPositionsAddressResponseModel value) $default,){
final _that = this;
switch (_that) {
case _LatestPositionsAddressResponseModel():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _LatestPositionsAddressResponseModel value)? $default,){
final _that = this;
switch (_that) {
case _LatestPositionsAddressResponseModel() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String street, String city, String province, String state, String country)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _LatestPositionsAddressResponseModel() when $default != null:
return $default(_that.street,_that.city,_that.province,_that.state,_that.country);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String street, String city, String province, String state, String country) $default,) {final _that = this;
switch (_that) {
case _LatestPositionsAddressResponseModel():
return $default(_that.street,_that.city,_that.province,_that.state,_that.country);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String street, String city, String province, String state, String country)? $default,) {final _that = this;
switch (_that) {
case _LatestPositionsAddressResponseModel() when $default != null:
return $default(_that.street,_that.city,_that.province,_that.state,_that.country);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _LatestPositionsAddressResponseModel implements LatestPositionsAddressResponseModel {
const _LatestPositionsAddressResponseModel({required this.street, required this.city, required this.province, required this.state, required this.country});
factory _LatestPositionsAddressResponseModel.fromJson(Map<String, dynamic> json) => _$LatestPositionsAddressResponseModelFromJson(json);
@override final String street;
@override final String city;
@override final String province;
@override final String state;
@override final String country;
/// Create a copy of LatestPositionsAddressResponseModel
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$LatestPositionsAddressResponseModelCopyWith<_LatestPositionsAddressResponseModel> get copyWith => __$LatestPositionsAddressResponseModelCopyWithImpl<_LatestPositionsAddressResponseModel>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$LatestPositionsAddressResponseModelToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _LatestPositionsAddressResponseModel&&(identical(other.street, street) || other.street == street)&&(identical(other.city, city) || other.city == city)&&(identical(other.province, province) || other.province == province)&&(identical(other.state, state) || other.state == state)&&(identical(other.country, country) || other.country == country));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,street,city,province,state,country);
@override
String toString() {
return 'LatestPositionsAddressResponseModel(street: $street, city: $city, province: $province, state: $state, country: $country)';
}
}
/// @nodoc
abstract mixin class _$LatestPositionsAddressResponseModelCopyWith<$Res> implements $LatestPositionsAddressResponseModelCopyWith<$Res> {
factory _$LatestPositionsAddressResponseModelCopyWith(_LatestPositionsAddressResponseModel value, $Res Function(_LatestPositionsAddressResponseModel) _then) = __$LatestPositionsAddressResponseModelCopyWithImpl;
@override @useResult
$Res call({
String street, String city, String province, String state, String country
});
}
/// @nodoc
class __$LatestPositionsAddressResponseModelCopyWithImpl<$Res>
implements _$LatestPositionsAddressResponseModelCopyWith<$Res> {
__$LatestPositionsAddressResponseModelCopyWithImpl(this._self, this._then);
final _LatestPositionsAddressResponseModel _self;
final $Res Function(_LatestPositionsAddressResponseModel) _then;
/// Create a copy of LatestPositionsAddressResponseModel
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? street = null,Object? city = null,Object? province = null,Object? state = null,Object? country = null,}) {
return _then(_LatestPositionsAddressResponseModel(
street: null == street ? _self.street : street // ignore: cast_nullable_to_non_nullable
as String,city: null == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
as String,province: null == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
as String,state: null == state ? _self.state : state // ignore: cast_nullable_to_non_nullable
as String,country: null == country ? _self.country : country // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// @nodoc
mixin _$LatestPositionsNetworkResponseModel {
String get SSID; String get BSSID; String get signal;
/// Create a copy of LatestPositionsNetworkResponseModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$LatestPositionsNetworkResponseModelCopyWith<LatestPositionsNetworkResponseModel> get copyWith => _$LatestPositionsNetworkResponseModelCopyWithImpl<LatestPositionsNetworkResponseModel>(this as LatestPositionsNetworkResponseModel, _$identity);
/// Serializes this LatestPositionsNetworkResponseModel to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is LatestPositionsNetworkResponseModel&&(identical(other.SSID, SSID) || other.SSID == SSID)&&(identical(other.BSSID, BSSID) || other.BSSID == BSSID)&&(identical(other.signal, signal) || other.signal == signal));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,SSID,BSSID,signal);
@override
String toString() {
return 'LatestPositionsNetworkResponseModel(SSID: $SSID, BSSID: $BSSID, signal: $signal)';
}
}
/// @nodoc
abstract mixin class $LatestPositionsNetworkResponseModelCopyWith<$Res> {
factory $LatestPositionsNetworkResponseModelCopyWith(LatestPositionsNetworkResponseModel value, $Res Function(LatestPositionsNetworkResponseModel) _then) = _$LatestPositionsNetworkResponseModelCopyWithImpl;
@useResult
$Res call({
String SSID, String BSSID, String signal
});
}
/// @nodoc
class _$LatestPositionsNetworkResponseModelCopyWithImpl<$Res>
implements $LatestPositionsNetworkResponseModelCopyWith<$Res> {
_$LatestPositionsNetworkResponseModelCopyWithImpl(this._self, this._then);
final LatestPositionsNetworkResponseModel _self;
final $Res Function(LatestPositionsNetworkResponseModel) _then;
/// Create a copy of LatestPositionsNetworkResponseModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? SSID = null,Object? BSSID = null,Object? signal = null,}) {
return _then(_self.copyWith(
SSID: null == SSID ? _self.SSID : SSID // ignore: cast_nullable_to_non_nullable
as String,BSSID: null == BSSID ? _self.BSSID : BSSID // ignore: cast_nullable_to_non_nullable
as String,signal: null == signal ? _self.signal : signal // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// Adds pattern-matching-related methods to [LatestPositionsNetworkResponseModel].
extension LatestPositionsNetworkResponseModelPatterns on LatestPositionsNetworkResponseModel {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _LatestPositionsNetworkResponseModel value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _LatestPositionsNetworkResponseModel() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _LatestPositionsNetworkResponseModel value) $default,){
final _that = this;
switch (_that) {
case _LatestPositionsNetworkResponseModel():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _LatestPositionsNetworkResponseModel value)? $default,){
final _that = this;
switch (_that) {
case _LatestPositionsNetworkResponseModel() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String SSID, String BSSID, String signal)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _LatestPositionsNetworkResponseModel() when $default != null:
return $default(_that.SSID,_that.BSSID,_that.signal);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String SSID, String BSSID, String signal) $default,) {final _that = this;
switch (_that) {
case _LatestPositionsNetworkResponseModel():
return $default(_that.SSID,_that.BSSID,_that.signal);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String SSID, String BSSID, String signal)? $default,) {final _that = this;
switch (_that) {
case _LatestPositionsNetworkResponseModel() when $default != null:
return $default(_that.SSID,_that.BSSID,_that.signal);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _LatestPositionsNetworkResponseModel implements LatestPositionsNetworkResponseModel {
const _LatestPositionsNetworkResponseModel({required this.SSID, required this.BSSID, required this.signal});
factory _LatestPositionsNetworkResponseModel.fromJson(Map<String, dynamic> json) => _$LatestPositionsNetworkResponseModelFromJson(json);
@override final String SSID;
@override final String BSSID;
@override final String signal;
/// Create a copy of LatestPositionsNetworkResponseModel
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$LatestPositionsNetworkResponseModelCopyWith<_LatestPositionsNetworkResponseModel> get copyWith => __$LatestPositionsNetworkResponseModelCopyWithImpl<_LatestPositionsNetworkResponseModel>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$LatestPositionsNetworkResponseModelToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _LatestPositionsNetworkResponseModel&&(identical(other.SSID, SSID) || other.SSID == SSID)&&(identical(other.BSSID, BSSID) || other.BSSID == BSSID)&&(identical(other.signal, signal) || other.signal == signal));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,SSID,BSSID,signal);
@override
String toString() {
return 'LatestPositionsNetworkResponseModel(SSID: $SSID, BSSID: $BSSID, signal: $signal)';
}
}
/// @nodoc
abstract mixin class _$LatestPositionsNetworkResponseModelCopyWith<$Res> implements $LatestPositionsNetworkResponseModelCopyWith<$Res> {
factory _$LatestPositionsNetworkResponseModelCopyWith(_LatestPositionsNetworkResponseModel value, $Res Function(_LatestPositionsNetworkResponseModel) _then) = __$LatestPositionsNetworkResponseModelCopyWithImpl;
@override @useResult
$Res call({
String SSID, String BSSID, String signal
});
}
/// @nodoc
class __$LatestPositionsNetworkResponseModelCopyWithImpl<$Res>
implements _$LatestPositionsNetworkResponseModelCopyWith<$Res> {
__$LatestPositionsNetworkResponseModelCopyWithImpl(this._self, this._then);
final _LatestPositionsNetworkResponseModel _self;
final $Res Function(_LatestPositionsNetworkResponseModel) _then;
/// Create a copy of LatestPositionsNetworkResponseModel
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? SSID = null,Object? BSSID = null,Object? signal = null,}) {
return _then(_LatestPositionsNetworkResponseModel(
SSID: null == SSID ? _self.SSID : SSID // ignore: cast_nullable_to_non_nullable
as String,BSSID: null == BSSID ? _self.BSSID : BSSID // ignore: cast_nullable_to_non_nullable
as String,signal: null == signal ? _self.signal : signal // ignore: cast_nullable_to_non_nullable
as String,
));
}

View File

@@ -25,21 +25,91 @@ Map<String, dynamic> _$LatestPositionsResponseModelToJson(
_LatestPositionsItemResponseModel _$LatestPositionsItemResponseModelFromJson(
Map<String, dynamic> json,
) => _LatestPositionsItemResponseModel(
id: json['id'] as String,
deviceIdentificator: json['deviceIdentificator'] as String,
latitude: (json['latitude'] as num).toDouble(),
longitude: (json['longitude'] as num).toDouble(),
address: json['address'] as String?,
positionDate: DateTime.parse(json['positionDate'] as String),
hpe: (json['hpe'] as num).toInt(),
ncell: (json['ncell'] as num?)?.toInt(),
type: (json['type'] as num).toInt(),
steps: (json['steps'] as num?)?.toInt(),
address: json['address'] == null
? null
: LatestPositionsAddressResponseModel.fromJson(
json['address'] as Map<String, dynamic>,
),
createdAt: (json['createdAt'] as num).toInt(),
positionDate: (json['positionDate'] as num).toInt(),
positionDateOriginal: (json['positionDateOriginal'] as num?)?.toInt(),
frequentPlaceName: json['frequentPlaceName'] as String?,
message: json['message'] as String,
networks: (json['networks'] as List<dynamic>)
.map(
(e) => LatestPositionsNetworkResponseModel.fromJson(
e as Map<String, dynamic>,
),
)
.toList(),
ignore: json['ignore'] as bool,
suspect: json['suspect'] as bool,
frequentPlace: json['frequentPlace'] as bool,
frequentPlaceName: json['frequentPlaceName'] as String,
);
Map<String, dynamic> _$LatestPositionsItemResponseModelToJson(
_LatestPositionsItemResponseModel instance,
) => <String, dynamic>{
'id': instance.id,
'deviceIdentificator': instance.deviceIdentificator,
'latitude': instance.latitude,
'longitude': instance.longitude,
'hpe': instance.hpe,
'ncell': instance.ncell,
'type': instance.type,
'steps': instance.steps,
'address': instance.address,
'positionDate': instance.positionDate.toIso8601String(),
'frequentPlace': instance.frequentPlace,
'createdAt': instance.createdAt,
'positionDate': instance.positionDate,
'positionDateOriginal': instance.positionDateOriginal,
'frequentPlaceName': instance.frequentPlaceName,
'message': instance.message,
'networks': instance.networks,
'ignore': instance.ignore,
'suspect': instance.suspect,
'frequentPlace': instance.frequentPlace,
};
_LatestPositionsAddressResponseModel
_$LatestPositionsAddressResponseModelFromJson(Map<String, dynamic> json) =>
_LatestPositionsAddressResponseModel(
street: json['street'] as String,
city: json['city'] as String,
province: json['province'] as String,
state: json['state'] as String,
country: json['country'] as String,
);
Map<String, dynamic> _$LatestPositionsAddressResponseModelToJson(
_LatestPositionsAddressResponseModel instance,
) => <String, dynamic>{
'street': instance.street,
'city': instance.city,
'province': instance.province,
'state': instance.state,
'country': instance.country,
};
_LatestPositionsNetworkResponseModel
_$LatestPositionsNetworkResponseModelFromJson(Map<String, dynamic> json) =>
_LatestPositionsNetworkResponseModel(
SSID: json['SSID'] as String,
BSSID: json['BSSID'] as String,
signal: json['signal'] as String,
);
Map<String, dynamic> _$LatestPositionsNetworkResponseModelToJson(
_LatestPositionsNetworkResponseModel instance,
) => <String, dynamic>{
'SSID': instance.SSID,
'BSSID': instance.BSSID,
'signal': instance.signal,
};

View File

@@ -0,0 +1,14 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'address_entity.freezed.dart';
@freezed
abstract class AddressEntity with _$AddressEntity {
const factory AddressEntity({
required String? street,
required String? city,
required String? province,
required String? state,
required String? country,
}) = _AddressEntity;
}

View File

@@ -0,0 +1,283 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'address_entity.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$AddressEntity {
String? get street; String? get city; String? get province; String? get state; String? get country;
/// Create a copy of AddressEntity
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$AddressEntityCopyWith<AddressEntity> get copyWith => _$AddressEntityCopyWithImpl<AddressEntity>(this as AddressEntity, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is AddressEntity&&(identical(other.street, street) || other.street == street)&&(identical(other.city, city) || other.city == city)&&(identical(other.province, province) || other.province == province)&&(identical(other.state, state) || other.state == state)&&(identical(other.country, country) || other.country == country));
}
@override
int get hashCode => Object.hash(runtimeType,street,city,province,state,country);
@override
String toString() {
return 'AddressEntity(street: $street, city: $city, province: $province, state: $state, country: $country)';
}
}
/// @nodoc
abstract mixin class $AddressEntityCopyWith<$Res> {
factory $AddressEntityCopyWith(AddressEntity value, $Res Function(AddressEntity) _then) = _$AddressEntityCopyWithImpl;
@useResult
$Res call({
String? street, String? city, String? province, String? state, String? country
});
}
/// @nodoc
class _$AddressEntityCopyWithImpl<$Res>
implements $AddressEntityCopyWith<$Res> {
_$AddressEntityCopyWithImpl(this._self, this._then);
final AddressEntity _self;
final $Res Function(AddressEntity) _then;
/// Create a copy of AddressEntity
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? street = freezed,Object? city = freezed,Object? province = freezed,Object? state = freezed,Object? country = freezed,}) {
return _then(_self.copyWith(
street: freezed == street ? _self.street : street // ignore: cast_nullable_to_non_nullable
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable
as String?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// Adds pattern-matching-related methods to [AddressEntity].
extension AddressEntityPatterns on AddressEntity {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _AddressEntity value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _AddressEntity() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _AddressEntity value) $default,){
final _that = this;
switch (_that) {
case _AddressEntity():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _AddressEntity value)? $default,){
final _that = this;
switch (_that) {
case _AddressEntity() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String? street, String? city, String? province, String? state, String? country)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _AddressEntity() when $default != null:
return $default(_that.street,_that.city,_that.province,_that.state,_that.country);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String? street, String? city, String? province, String? state, String? country) $default,) {final _that = this;
switch (_that) {
case _AddressEntity():
return $default(_that.street,_that.city,_that.province,_that.state,_that.country);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String? street, String? city, String? province, String? state, String? country)? $default,) {final _that = this;
switch (_that) {
case _AddressEntity() when $default != null:
return $default(_that.street,_that.city,_that.province,_that.state,_that.country);case _:
return null;
}
}
}
/// @nodoc
class _AddressEntity implements AddressEntity {
const _AddressEntity({required this.street, required this.city, required this.province, required this.state, required this.country});
@override final String? street;
@override final String? city;
@override final String? province;
@override final String? state;
@override final String? country;
/// Create a copy of AddressEntity
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$AddressEntityCopyWith<_AddressEntity> get copyWith => __$AddressEntityCopyWithImpl<_AddressEntity>(this, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _AddressEntity&&(identical(other.street, street) || other.street == street)&&(identical(other.city, city) || other.city == city)&&(identical(other.province, province) || other.province == province)&&(identical(other.state, state) || other.state == state)&&(identical(other.country, country) || other.country == country));
}
@override
int get hashCode => Object.hash(runtimeType,street,city,province,state,country);
@override
String toString() {
return 'AddressEntity(street: $street, city: $city, province: $province, state: $state, country: $country)';
}
}
/// @nodoc
abstract mixin class _$AddressEntityCopyWith<$Res> implements $AddressEntityCopyWith<$Res> {
factory _$AddressEntityCopyWith(_AddressEntity value, $Res Function(_AddressEntity) _then) = __$AddressEntityCopyWithImpl;
@override @useResult
$Res call({
String? street, String? city, String? province, String? state, String? country
});
}
/// @nodoc
class __$AddressEntityCopyWithImpl<$Res>
implements _$AddressEntityCopyWith<$Res> {
__$AddressEntityCopyWithImpl(this._self, this._then);
final _AddressEntity _self;
final $Res Function(_AddressEntity) _then;
/// Create a copy of AddressEntity
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? street = freezed,Object? city = freezed,Object? province = freezed,Object? state = freezed,Object? country = freezed,}) {
return _then(_AddressEntity(
street: freezed == street ? _self.street : street // ignore: cast_nullable_to_non_nullable
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable
as String?,country: freezed == country ? _self.country : country // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
// dart format on

View File

@@ -0,0 +1,12 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'network_entity.freezed.dart';
@freezed
abstract class NetworkEntity with _$NetworkEntity {
const factory NetworkEntity({
required String SSID,
required String BSSID,
required String signal,
}) = _NetworkEntity;
}

View File

@@ -0,0 +1,277 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'network_entity.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$NetworkEntity {
String get SSID; String get BSSID; String get signal;
/// Create a copy of NetworkEntity
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$NetworkEntityCopyWith<NetworkEntity> get copyWith => _$NetworkEntityCopyWithImpl<NetworkEntity>(this as NetworkEntity, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is NetworkEntity&&(identical(other.SSID, SSID) || other.SSID == SSID)&&(identical(other.BSSID, BSSID) || other.BSSID == BSSID)&&(identical(other.signal, signal) || other.signal == signal));
}
@override
int get hashCode => Object.hash(runtimeType,SSID,BSSID,signal);
@override
String toString() {
return 'NetworkEntity(SSID: $SSID, BSSID: $BSSID, signal: $signal)';
}
}
/// @nodoc
abstract mixin class $NetworkEntityCopyWith<$Res> {
factory $NetworkEntityCopyWith(NetworkEntity value, $Res Function(NetworkEntity) _then) = _$NetworkEntityCopyWithImpl;
@useResult
$Res call({
String SSID, String BSSID, String signal
});
}
/// @nodoc
class _$NetworkEntityCopyWithImpl<$Res>
implements $NetworkEntityCopyWith<$Res> {
_$NetworkEntityCopyWithImpl(this._self, this._then);
final NetworkEntity _self;
final $Res Function(NetworkEntity) _then;
/// Create a copy of NetworkEntity
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? SSID = null,Object? BSSID = null,Object? signal = null,}) {
return _then(_self.copyWith(
SSID: null == SSID ? _self.SSID : SSID // ignore: cast_nullable_to_non_nullable
as String,BSSID: null == BSSID ? _self.BSSID : BSSID // ignore: cast_nullable_to_non_nullable
as String,signal: null == signal ? _self.signal : signal // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// Adds pattern-matching-related methods to [NetworkEntity].
extension NetworkEntityPatterns on NetworkEntity {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _NetworkEntity value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _NetworkEntity() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _NetworkEntity value) $default,){
final _that = this;
switch (_that) {
case _NetworkEntity():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _NetworkEntity value)? $default,){
final _that = this;
switch (_that) {
case _NetworkEntity() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String SSID, String BSSID, String signal)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _NetworkEntity() when $default != null:
return $default(_that.SSID,_that.BSSID,_that.signal);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String SSID, String BSSID, String signal) $default,) {final _that = this;
switch (_that) {
case _NetworkEntity():
return $default(_that.SSID,_that.BSSID,_that.signal);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String SSID, String BSSID, String signal)? $default,) {final _that = this;
switch (_that) {
case _NetworkEntity() when $default != null:
return $default(_that.SSID,_that.BSSID,_that.signal);case _:
return null;
}
}
}
/// @nodoc
class _NetworkEntity implements NetworkEntity {
const _NetworkEntity({required this.SSID, required this.BSSID, required this.signal});
@override final String SSID;
@override final String BSSID;
@override final String signal;
/// Create a copy of NetworkEntity
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$NetworkEntityCopyWith<_NetworkEntity> get copyWith => __$NetworkEntityCopyWithImpl<_NetworkEntity>(this, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _NetworkEntity&&(identical(other.SSID, SSID) || other.SSID == SSID)&&(identical(other.BSSID, BSSID) || other.BSSID == BSSID)&&(identical(other.signal, signal) || other.signal == signal));
}
@override
int get hashCode => Object.hash(runtimeType,SSID,BSSID,signal);
@override
String toString() {
return 'NetworkEntity(SSID: $SSID, BSSID: $BSSID, signal: $signal)';
}
}
/// @nodoc
abstract mixin class _$NetworkEntityCopyWith<$Res> implements $NetworkEntityCopyWith<$Res> {
factory _$NetworkEntityCopyWith(_NetworkEntity value, $Res Function(_NetworkEntity) _then) = __$NetworkEntityCopyWithImpl;
@override @useResult
$Res call({
String SSID, String BSSID, String signal
});
}
/// @nodoc
class __$NetworkEntityCopyWithImpl<$Res>
implements _$NetworkEntityCopyWith<$Res> {
__$NetworkEntityCopyWithImpl(this._self, this._then);
final _NetworkEntity _self;
final $Res Function(_NetworkEntity) _then;
/// Create a copy of NetworkEntity
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? SSID = null,Object? BSSID = null,Object? signal = null,}) {
return _then(_NetworkEntity(
SSID: null == SSID ? _self.SSID : SSID // ignore: cast_nullable_to_non_nullable
as String,BSSID: null == BSSID ? _self.BSSID : BSSID // ignore: cast_nullable_to_non_nullable
as String,signal: null == signal ? _self.signal : signal // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
// dart format on

View File

@@ -1,17 +1,29 @@
class PositionEntity {
final double latitude;
final double longitude;
final String? address;
final bool frequentPlace;
final String frequentPlaceName;
final DateTime positionDate;
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:hub/src/features/hub/domain/entities/address_entity.dart';
import 'package:hub/src/features/hub/domain/entities/network_entity.dart';
const PositionEntity({
required this.latitude,
required this.longitude,
required this.address,
required this.positionDate,
required this.frequentPlace,
required this.frequentPlaceName,
});
}
part 'position_entity.freezed.dart';
@freezed
abstract class PositionEntity with _$PositionEntity {
const factory PositionEntity({
required String id,
required String deviceIdentificator,
required double latitude,
required double longitude,
required int hpe,
int? ncell,
required int type,
int? steps,
AddressEntity? address,
required int createdAt,
required int positionDate,
int? positionDateOriginal,
String? frequentPlaceName,
required String message,
required List<NetworkEntity> networks,
required bool ignore,
required bool suspect,
required bool frequentPlace,
}) = _PositionEntity;
}

View File

@@ -0,0 +1,352 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'position_entity.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$PositionEntity {
String get id; String get deviceIdentificator; double get latitude; double get longitude; int get hpe; int? get ncell; int get type; int? get steps; AddressEntity? get address; int get createdAt; int get positionDate; int? get positionDateOriginal; String? get frequentPlaceName; String get message; List<NetworkEntity> get networks; bool get ignore; bool get suspect; bool get frequentPlace;
/// Create a copy of PositionEntity
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$PositionEntityCopyWith<PositionEntity> get copyWith => _$PositionEntityCopyWithImpl<PositionEntity>(this as PositionEntity, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is PositionEntity&&(identical(other.id, id) || other.id == id)&&(identical(other.deviceIdentificator, deviceIdentificator) || other.deviceIdentificator == deviceIdentificator)&&(identical(other.latitude, latitude) || other.latitude == latitude)&&(identical(other.longitude, longitude) || other.longitude == longitude)&&(identical(other.hpe, hpe) || other.hpe == hpe)&&(identical(other.ncell, ncell) || other.ncell == ncell)&&(identical(other.type, type) || other.type == type)&&(identical(other.steps, steps) || other.steps == steps)&&(identical(other.address, address) || other.address == address)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.positionDate, positionDate) || other.positionDate == positionDate)&&(identical(other.positionDateOriginal, positionDateOriginal) || other.positionDateOriginal == positionDateOriginal)&&(identical(other.frequentPlaceName, frequentPlaceName) || other.frequentPlaceName == frequentPlaceName)&&(identical(other.message, message) || other.message == message)&&const DeepCollectionEquality().equals(other.networks, networks)&&(identical(other.ignore, ignore) || other.ignore == ignore)&&(identical(other.suspect, suspect) || other.suspect == suspect)&&(identical(other.frequentPlace, frequentPlace) || other.frequentPlace == frequentPlace));
}
@override
int get hashCode => Object.hash(runtimeType,id,deviceIdentificator,latitude,longitude,hpe,ncell,type,steps,address,createdAt,positionDate,positionDateOriginal,frequentPlaceName,message,const DeepCollectionEquality().hash(networks),ignore,suspect,frequentPlace);
@override
String toString() {
return 'PositionEntity(id: $id, deviceIdentificator: $deviceIdentificator, latitude: $latitude, longitude: $longitude, hpe: $hpe, ncell: $ncell, type: $type, steps: $steps, address: $address, createdAt: $createdAt, positionDate: $positionDate, positionDateOriginal: $positionDateOriginal, frequentPlaceName: $frequentPlaceName, message: $message, networks: $networks, ignore: $ignore, suspect: $suspect, frequentPlace: $frequentPlace)';
}
}
/// @nodoc
abstract mixin class $PositionEntityCopyWith<$Res> {
factory $PositionEntityCopyWith(PositionEntity value, $Res Function(PositionEntity) _then) = _$PositionEntityCopyWithImpl;
@useResult
$Res call({
String id, String deviceIdentificator, double latitude, double longitude, int hpe, int? ncell, int type, int? steps, AddressEntity? address, int createdAt, int positionDate, int? positionDateOriginal, String? frequentPlaceName, String message, List<NetworkEntity> networks, bool ignore, bool suspect, bool frequentPlace
});
$AddressEntityCopyWith<$Res>? get address;
}
/// @nodoc
class _$PositionEntityCopyWithImpl<$Res>
implements $PositionEntityCopyWith<$Res> {
_$PositionEntityCopyWithImpl(this._self, this._then);
final PositionEntity _self;
final $Res Function(PositionEntity) _then;
/// Create a copy of PositionEntity
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? deviceIdentificator = null,Object? latitude = null,Object? longitude = null,Object? hpe = null,Object? ncell = freezed,Object? type = null,Object? steps = freezed,Object? address = freezed,Object? createdAt = null,Object? positionDate = null,Object? positionDateOriginal = freezed,Object? frequentPlaceName = freezed,Object? message = null,Object? networks = null,Object? ignore = null,Object? suspect = null,Object? frequentPlace = null,}) {
return _then(_self.copyWith(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String,deviceIdentificator: null == deviceIdentificator ? _self.deviceIdentificator : deviceIdentificator // ignore: cast_nullable_to_non_nullable
as String,latitude: null == latitude ? _self.latitude : latitude // ignore: cast_nullable_to_non_nullable
as double,longitude: null == longitude ? _self.longitude : longitude // ignore: cast_nullable_to_non_nullable
as double,hpe: null == hpe ? _self.hpe : hpe // ignore: cast_nullable_to_non_nullable
as int,ncell: freezed == ncell ? _self.ncell : ncell // ignore: cast_nullable_to_non_nullable
as int?,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
as int,steps: freezed == steps ? _self.steps : steps // ignore: cast_nullable_to_non_nullable
as int?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable
as AddressEntity?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
as int,positionDate: null == positionDate ? _self.positionDate : positionDate // ignore: cast_nullable_to_non_nullable
as int,positionDateOriginal: freezed == positionDateOriginal ? _self.positionDateOriginal : positionDateOriginal // ignore: cast_nullable_to_non_nullable
as int?,frequentPlaceName: freezed == frequentPlaceName ? _self.frequentPlaceName : frequentPlaceName // ignore: cast_nullable_to_non_nullable
as String?,message: null == message ? _self.message : message // ignore: cast_nullable_to_non_nullable
as String,networks: null == networks ? _self.networks : networks // ignore: cast_nullable_to_non_nullable
as List<NetworkEntity>,ignore: null == ignore ? _self.ignore : ignore // ignore: cast_nullable_to_non_nullable
as bool,suspect: null == suspect ? _self.suspect : suspect // ignore: cast_nullable_to_non_nullable
as bool,frequentPlace: null == frequentPlace ? _self.frequentPlace : frequentPlace // ignore: cast_nullable_to_non_nullable
as bool,
));
}
/// Create a copy of PositionEntity
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$AddressEntityCopyWith<$Res>? get address {
if (_self.address == null) {
return null;
}
return $AddressEntityCopyWith<$Res>(_self.address!, (value) {
return _then(_self.copyWith(address: value));
});
}
}
/// Adds pattern-matching-related methods to [PositionEntity].
extension PositionEntityPatterns on PositionEntity {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _PositionEntity value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _PositionEntity() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _PositionEntity value) $default,){
final _that = this;
switch (_that) {
case _PositionEntity():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _PositionEntity value)? $default,){
final _that = this;
switch (_that) {
case _PositionEntity() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, String deviceIdentificator, double latitude, double longitude, int hpe, int? ncell, int type, int? steps, AddressEntity? address, int createdAt, int positionDate, int? positionDateOriginal, String? frequentPlaceName, String message, List<NetworkEntity> networks, bool ignore, bool suspect, bool frequentPlace)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _PositionEntity() when $default != null:
return $default(_that.id,_that.deviceIdentificator,_that.latitude,_that.longitude,_that.hpe,_that.ncell,_that.type,_that.steps,_that.address,_that.createdAt,_that.positionDate,_that.positionDateOriginal,_that.frequentPlaceName,_that.message,_that.networks,_that.ignore,_that.suspect,_that.frequentPlace);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, String deviceIdentificator, double latitude, double longitude, int hpe, int? ncell, int type, int? steps, AddressEntity? address, int createdAt, int positionDate, int? positionDateOriginal, String? frequentPlaceName, String message, List<NetworkEntity> networks, bool ignore, bool suspect, bool frequentPlace) $default,) {final _that = this;
switch (_that) {
case _PositionEntity():
return $default(_that.id,_that.deviceIdentificator,_that.latitude,_that.longitude,_that.hpe,_that.ncell,_that.type,_that.steps,_that.address,_that.createdAt,_that.positionDate,_that.positionDateOriginal,_that.frequentPlaceName,_that.message,_that.networks,_that.ignore,_that.suspect,_that.frequentPlace);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, String deviceIdentificator, double latitude, double longitude, int hpe, int? ncell, int type, int? steps, AddressEntity? address, int createdAt, int positionDate, int? positionDateOriginal, String? frequentPlaceName, String message, List<NetworkEntity> networks, bool ignore, bool suspect, bool frequentPlace)? $default,) {final _that = this;
switch (_that) {
case _PositionEntity() when $default != null:
return $default(_that.id,_that.deviceIdentificator,_that.latitude,_that.longitude,_that.hpe,_that.ncell,_that.type,_that.steps,_that.address,_that.createdAt,_that.positionDate,_that.positionDateOriginal,_that.frequentPlaceName,_that.message,_that.networks,_that.ignore,_that.suspect,_that.frequentPlace);case _:
return null;
}
}
}
/// @nodoc
class _PositionEntity implements PositionEntity {
const _PositionEntity({required this.id, required this.deviceIdentificator, required this.latitude, required this.longitude, required this.hpe, this.ncell, required this.type, this.steps, this.address, required this.createdAt, required this.positionDate, this.positionDateOriginal, this.frequentPlaceName, required this.message, required final List<NetworkEntity> networks, required this.ignore, required this.suspect, required this.frequentPlace}): _networks = networks;
@override final String id;
@override final String deviceIdentificator;
@override final double latitude;
@override final double longitude;
@override final int hpe;
@override final int? ncell;
@override final int type;
@override final int? steps;
@override final AddressEntity? address;
@override final int createdAt;
@override final int positionDate;
@override final int? positionDateOriginal;
@override final String? frequentPlaceName;
@override final String message;
final List<NetworkEntity> _networks;
@override List<NetworkEntity> get networks {
if (_networks is EqualUnmodifiableListView) return _networks;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_networks);
}
@override final bool ignore;
@override final bool suspect;
@override final bool frequentPlace;
/// Create a copy of PositionEntity
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$PositionEntityCopyWith<_PositionEntity> get copyWith => __$PositionEntityCopyWithImpl<_PositionEntity>(this, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _PositionEntity&&(identical(other.id, id) || other.id == id)&&(identical(other.deviceIdentificator, deviceIdentificator) || other.deviceIdentificator == deviceIdentificator)&&(identical(other.latitude, latitude) || other.latitude == latitude)&&(identical(other.longitude, longitude) || other.longitude == longitude)&&(identical(other.hpe, hpe) || other.hpe == hpe)&&(identical(other.ncell, ncell) || other.ncell == ncell)&&(identical(other.type, type) || other.type == type)&&(identical(other.steps, steps) || other.steps == steps)&&(identical(other.address, address) || other.address == address)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.positionDate, positionDate) || other.positionDate == positionDate)&&(identical(other.positionDateOriginal, positionDateOriginal) || other.positionDateOriginal == positionDateOriginal)&&(identical(other.frequentPlaceName, frequentPlaceName) || other.frequentPlaceName == frequentPlaceName)&&(identical(other.message, message) || other.message == message)&&const DeepCollectionEquality().equals(other._networks, _networks)&&(identical(other.ignore, ignore) || other.ignore == ignore)&&(identical(other.suspect, suspect) || other.suspect == suspect)&&(identical(other.frequentPlace, frequentPlace) || other.frequentPlace == frequentPlace));
}
@override
int get hashCode => Object.hash(runtimeType,id,deviceIdentificator,latitude,longitude,hpe,ncell,type,steps,address,createdAt,positionDate,positionDateOriginal,frequentPlaceName,message,const DeepCollectionEquality().hash(_networks),ignore,suspect,frequentPlace);
@override
String toString() {
return 'PositionEntity(id: $id, deviceIdentificator: $deviceIdentificator, latitude: $latitude, longitude: $longitude, hpe: $hpe, ncell: $ncell, type: $type, steps: $steps, address: $address, createdAt: $createdAt, positionDate: $positionDate, positionDateOriginal: $positionDateOriginal, frequentPlaceName: $frequentPlaceName, message: $message, networks: $networks, ignore: $ignore, suspect: $suspect, frequentPlace: $frequentPlace)';
}
}
/// @nodoc
abstract mixin class _$PositionEntityCopyWith<$Res> implements $PositionEntityCopyWith<$Res> {
factory _$PositionEntityCopyWith(_PositionEntity value, $Res Function(_PositionEntity) _then) = __$PositionEntityCopyWithImpl;
@override @useResult
$Res call({
String id, String deviceIdentificator, double latitude, double longitude, int hpe, int? ncell, int type, int? steps, AddressEntity? address, int createdAt, int positionDate, int? positionDateOriginal, String? frequentPlaceName, String message, List<NetworkEntity> networks, bool ignore, bool suspect, bool frequentPlace
});
@override $AddressEntityCopyWith<$Res>? get address;
}
/// @nodoc
class __$PositionEntityCopyWithImpl<$Res>
implements _$PositionEntityCopyWith<$Res> {
__$PositionEntityCopyWithImpl(this._self, this._then);
final _PositionEntity _self;
final $Res Function(_PositionEntity) _then;
/// Create a copy of PositionEntity
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? deviceIdentificator = null,Object? latitude = null,Object? longitude = null,Object? hpe = null,Object? ncell = freezed,Object? type = null,Object? steps = freezed,Object? address = freezed,Object? createdAt = null,Object? positionDate = null,Object? positionDateOriginal = freezed,Object? frequentPlaceName = freezed,Object? message = null,Object? networks = null,Object? ignore = null,Object? suspect = null,Object? frequentPlace = null,}) {
return _then(_PositionEntity(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as String,deviceIdentificator: null == deviceIdentificator ? _self.deviceIdentificator : deviceIdentificator // ignore: cast_nullable_to_non_nullable
as String,latitude: null == latitude ? _self.latitude : latitude // ignore: cast_nullable_to_non_nullable
as double,longitude: null == longitude ? _self.longitude : longitude // ignore: cast_nullable_to_non_nullable
as double,hpe: null == hpe ? _self.hpe : hpe // ignore: cast_nullable_to_non_nullable
as int,ncell: freezed == ncell ? _self.ncell : ncell // ignore: cast_nullable_to_non_nullable
as int?,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
as int,steps: freezed == steps ? _self.steps : steps // ignore: cast_nullable_to_non_nullable
as int?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable
as AddressEntity?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
as int,positionDate: null == positionDate ? _self.positionDate : positionDate // ignore: cast_nullable_to_non_nullable
as int,positionDateOriginal: freezed == positionDateOriginal ? _self.positionDateOriginal : positionDateOriginal // ignore: cast_nullable_to_non_nullable
as int?,frequentPlaceName: freezed == frequentPlaceName ? _self.frequentPlaceName : frequentPlaceName // ignore: cast_nullable_to_non_nullable
as String?,message: null == message ? _self.message : message // ignore: cast_nullable_to_non_nullable
as String,networks: null == networks ? _self._networks : networks // ignore: cast_nullable_to_non_nullable
as List<NetworkEntity>,ignore: null == ignore ? _self.ignore : ignore // ignore: cast_nullable_to_non_nullable
as bool,suspect: null == suspect ? _self.suspect : suspect // ignore: cast_nullable_to_non_nullable
as bool,frequentPlace: null == frequentPlace ? _self.frequentPlace : frequentPlace // ignore: cast_nullable_to_non_nullable
as bool,
));
}
/// Create a copy of PositionEntity
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$AddressEntityCopyWith<$Res>? get address {
if (_self.address == null) {
return null;
}
return $AddressEntityCopyWith<$Res>(_self.address!, (value) {
return _then(_self.copyWith(address: value));
});
}
}
// dart format on

View File

@@ -12,7 +12,7 @@ class HubBuilder {
return MaterialPage<void>(
key: state.pageKey,
child: HubScreen(navigationContract: navigationContract),
child: HubScreen(navigationContract: navigationContract, routerState: state),
);
}
}

View File

@@ -1,4 +1,5 @@
import 'package:flutter_svg/svg.dart';
import 'package:go_router/go_router.dart';
import 'package:hub/src/features/hub/presentation/state/hub_view_model.dart';
import 'package:design_system/design_system.dart';
import 'package:flutter/material.dart';
@@ -11,8 +12,13 @@ import 'package:utils/utils.dart';
class HubScreen extends ConsumerWidget {
final NavigationContract navigationContract;
final GoRouterState routerState;
const HubScreen({super.key, required this.navigationContract});
const HubScreen({
super.key,
required this.navigationContract,
required this.routerState
});
@override
Widget build(BuildContext context, WidgetRef ref) {
@@ -24,8 +30,8 @@ class HubScreen extends ConsumerWidget {
return Scaffold(
backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary),
body: SafeArea(
child: Container(
padding: EdgeInsets.symmetric(horizontal: 14),
child: Container(
padding: EdgeInsets.symmetric(horizontal: 14),
child: Column(
children: [
SizedBox(height: SizeUtils.getByScreen(small: 8, big: 4)),
@@ -33,10 +39,28 @@ class HubScreen extends ConsumerWidget {
children: [
SizedBox(
height: SizeUtils.getByScreen(small: 36, big: 36),
child: Align(
alignment: Alignment.centerLeft,
child: Image.asset('assets/images/ui/iso_sf.png',
height: SizeUtils.getByScreen(small: 18, big: 18)),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Image.asset('assets/images/ui/iso_sf.png',
height: SizeUtils.getByScreen(small: 18, big: 18)),
SizedBox(width: SizeUtils.getByScreen(small: 8, big: 4)),
SizedBox(
width: SizeUtils.getByScreen(small: 104, big: 100),
height: 32,
child: CustomDropdown(
items: viewState.devices.map((device)=>
Text(device.carrierName)
).toList(),
values: viewState.devices,
value: viewState.selectedDevice,
onChanged: (device){viewModel.setSelectedDevice(device);},
height: 32,
color: Colors.transparent,
padding: EdgeInsets.zero,
),
),
]
)
),
Center(
@@ -51,29 +75,29 @@ class HubScreen extends ConsumerWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppSectionButton(
onPressed: (){navigationContract.pushTo(AppRoutes.customerService);},
icon: SFIcons.customerService,
text: I18n.customerService),
onPressed: (){navigationContract.pushTo(AppRoutes.customerService);},
icon: SFIcons.customerService,
text: I18n.customerService),
SizedBox(height: SizeUtils.getByScreen(small: 8, big: 7)),
AppSectionButton(
onPressed: (){navigationContract.pushTo(AppRoutes.dashboardHome);},
icon: SFIcons.payments,
text: I18n.sfPay),
onPressed: (){navigationContract.pushTo(AppRoutes.dashboardHome);},
icon: SFIcons.payments,
text: I18n.sfPay),
SizedBox(height: SizeUtils.getByScreen(small: 8, big: 7)),
AppSectionButton(
onPressed: (){navigationContract.pushTo(AppRoutes.dashboardFunctions);},
icon: SFIcons.functions,
text: I18n.functions),
onPressed: (){navigationContract.pushTo(AppRoutes.dashboardFunctions);},
icon: SFIcons.functions,
text: I18n.functions),
SizedBox(height: SizeUtils.getByScreen(small: 8, big: 7)),
AppSectionButton(
onPressed: (){navigationContract.pushTo(AppRoutes.accountSettings);},
icon: Icons.manage_accounts_outlined,
text: I18n.accountSettings),
onPressed: (){navigationContract.pushTo(AppRoutes.accountSettings);},
icon: Icons.manage_accounts_outlined,
text: I18n.accountSettings),
SizedBox(height: SizeUtils.getByScreen(small: 8, big: 7)),
AppSectionButton(
onPressed: (){},
icon: Icons.settings_outlined,
text: I18n.deviceSettings),
onPressed: (){},
icon: Icons.settings_outlined,
text: I18n.deviceSettings),
SizedBox(height: SizeUtils.getByScreen(small: 16, big: 22)),
Text(context.translate(I18n.watchesOnMap),
@@ -86,32 +110,7 @@ class HubScreen extends ConsumerWidget {
SizedBox(height: SizeUtils.getByScreen(small: 4, big: 8)),
SizedBox(
height: SizeUtils.getByScreen(small: 200, big: 300),
child: FlutterMap(
mapController: viewModel.mapController,
options: MapOptions(
initialCenter: LatLng(45.32833189648895, -3.0830872665435085), // Center the map over London, UK
initialZoom: 15,
keepAlive: true,
),
children: [
TileLayer(
urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
userAgentPackageName: 'com.savefamily.sf_platform',
),
MarkerLayer(markers: viewState.positions.map((position)=>
Marker(
point: LatLng(position.latitude, position.longitude),
width: 200,
height: 145,
child: Align(
alignment: Alignment.topCenter,
child: SvgPicture.asset('assets/images/ui/location.svg',
height: 80)),
rotate: true,
)
).toList())
],
)
child: Minimap(),
),
SizedBox(height: SizeUtils.getByScreen(small: 14, big: 13)),
],
@@ -181,4 +180,118 @@ class AppSectionButton extends ConsumerWidget {
);
}
}
class Minimap extends ConsumerWidget {
IconData batteryToIcon(int battery) {
if (battery < 15) return Icons.battery_0_bar;
if (battery < 30) return Icons.battery_1_bar;
if (battery < 45) return Icons.battery_2_bar;
if (battery < 60) return Icons.battery_3_bar;
if (battery < 75) return Icons.battery_4_bar;
if (battery < 90) return Icons.battery_5_bar;
return Icons.battery_6_bar;
}
@override
Widget build(BuildContext context, WidgetRef ref) {
final theme = ref.watch(themePortProvider);
final viewState = ref.watch(hubViewModelProvider);
final viewModel = ref.read(hubViewModelProvider.notifier);
final battery = viewState.selectedPosition?.ncell ?? 0;
final IconData batteryIcon = batteryToIcon(battery);
final positionDate = DateTime.fromMillisecondsSinceEpoch(viewState.selectedPosition?.positionDate ?? 0);
return FlutterMap(
mapController: viewModel.mapController,
options: MapOptions(
initialCenter: LatLng(45.32833189648895, -3.0830872665435085),
initialZoom: 15,
keepAlive: true,
),
children: [
TileLayer(
urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
userAgentPackageName: 'com.savefamily.sf_platform',
),
MarkerLayer(markers: [if (viewState.selectedPosition != null)
Marker(
point: LatLng(viewState.selectedPosition!.latitude, viewState.selectedPosition!.longitude),
width: 200,
height: 145,
child: Align(
alignment: Alignment.topCenter,
child: SvgPicture.asset('assets/images/ui/location.svg',
height: 80)
),
rotate: true,
)
]),
if (viewState.selectedPosition != null)
Align(
alignment: Alignment.bottomCenter,
child: Container(
height: SizeUtils.getByScreen(small: 60, big: 58),
width: SizeUtils.getByScreen(small: 300, big: 298),
margin: EdgeInsets.only(bottom: SizeUtils.getByScreen(small: 20, big: 16)),
decoration: BoxDecoration(
color: theme.getColorFor(ThemeCode.backgroundPrimary),
borderRadius: BorderRadius.all(Radius.circular(SizeUtils.getByScreen(small: 9, big: 8)))
),
child: Row(
children: [
Icon(SFIcons.location,
size: SizeUtils.getByScreen(small: 40, big: 38),
color: Color(0xFF588EA5),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
width: SizeUtils.getByScreen(small: 250, big: 248),
child: Text('${viewState.selectedPosition!.address?.street}, '
'${viewState.selectedPosition!.address?.province}, '
'${viewState.selectedPosition!.address?.country}',
overflow: TextOverflow.ellipsis,
)
),
Row(
children: [
Text('${positionDate.month.toString().padLeft(2, '0')}-'
'${positionDate.day.toString().padLeft(2, '0')} '
'${positionDate.hour.toString().padLeft(2, '0')}:'
'${positionDate.minute.toString().padLeft(2, '0')}:'
'${positionDate.second.toString().padLeft(2, '0')}',
style: TextStyle(
fontSize: SizeUtils.getByScreen(small: 12, big: 11)
),
),
if (viewState.selectedPosition!.networks.isNotEmpty)
Text(' | ${viewState.selectedPosition!.networks.first.signal}',
style: TextStyle(
fontSize: SizeUtils.getByScreen(small: 12, big: 11)
),
),
Icon(batteryIcon),
Text('${viewState.selectedPosition!.ncell ?? 0}%',
style: TextStyle(
fontSize: SizeUtils.getByScreen(small: 12, big: 11)
),
)
],
)
],
)
],
),
),
)
],
);
}
}

View File

@@ -2,18 +2,14 @@ import 'dart:async';
import 'package:flutter_map/flutter_map.dart';
import 'package:hub/src/features/hub/domain/entities/device_entity.dart';
import 'package:hub/src/features/hub/domain/entities/get_devices_request_entity.dart';
import 'package:hub/src/features/hub/domain/entities/position_entity.dart';
import 'package:hub/src/features/hub/domain/get_devices_use_case.dart';
import 'package:hub/src/features/hub/domain/get_latest_positions_use_case.dart';
import 'package:hub/src/features/hub/presentation/providers/get_devices_use_case_provider.dart';
import 'package:hub/src/features/hub/presentation/providers/get_latest_positions_use_case_provider.dart';
import 'package:hub/src/features/hub/presentation/state/hub_view_state.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:latlong2/latlong.dart';
import 'package:sf_localizations/sf_localizations.dart';
import 'package:uuid/uuid.dart';
final hubViewModelProvider =
NotifierProvider.autoDispose<HubViewModel, HubViewState>(
@@ -36,11 +32,14 @@ class HubViewModel extends Notifier<HubViewState> {
_getDevicesUseCase.getDevices(
userId: ''
).then((List<DeviceEntity> res){
state = state.copyWith(devices: res);
state = state.copyWith(
devices: res,
selectedDevice: res.first
);
return Future.wait(res.map((device) =>
_getLatestPositionsUseCase.getLatestPositions(
deviceId: device.identificator
)
_getLatestPositionsUseCase.getLatestPositions(
deviceId: device.identificator
)
));
}).then(
(List<List<PositionEntity>> res) {
@@ -55,31 +54,28 @@ class HubViewModel extends Notifier<HubViewState> {
void setPositions(List<List<PositionEntity>> positions) {
final devicePositions = positions.map((List<PositionEntity> devicePositions)=>devicePositions[0]).toList();
final selectedPosition = devicePositions.where((p)=>
p.deviceIdentificator == state.selectedDevice!.identificator).firstOrNull;
state = state.copyWith(
positions: devicePositions,
selectedPosition: selectedPosition,
);
mapController.move(LatLng(
devicePositions.fold(0.0, (double x, PositionEntity position)=>x+position.latitude)/positions.length,
devicePositions.fold(0.0, (double x, PositionEntity position)=>x+position.longitude)/positions.length,
), 15);
if (selectedPosition != null) {
mapController.move(LatLng(
selectedPosition.latitude,
selectedPosition.longitude,
), 15);
}
}
GetDevicesRequestEntity _toDevicesRequest() {
final userId = '';
if (userId == null) throw Exception('userId is required');
return GetDevicesRequestEntity(userId: userId);
}
/*void _startLoadingForSignUp() {
void setSelectedDevice(DeviceEntity device) {
final selectedPosition = state.positions.where((p)=>
p.deviceIdentificator == device.identificator).firstOrNull;
state = state.copyWith(
isLoading: true,
errorMessage: '',
twoFASecret: null,
showSecretCode: false,
showAccountCreated: false,
selectedDevice: device,
selectedPosition: selectedPosition,
);
}*/
}
void disposeControllers(){
mapController.dispose();

View File

@@ -8,6 +8,8 @@ part 'hub_view_state.freezed.dart';
abstract class HubViewState with _$HubViewState {
const factory HubViewState({
@Default([]) List<DeviceEntity> devices,
@Default([]) List<PositionEntity> positions
DeviceEntity? selectedDevice,
@Default([]) List<PositionEntity> positions,
PositionEntity? selectedPosition
}) = _HubViewState;
}

View File

@@ -14,7 +14,7 @@ T _$identity<T>(T value) => value;
/// @nodoc
mixin _$HubViewState {
List<DeviceEntity> get devices; List<PositionEntity> get positions;
List<DeviceEntity> get devices; DeviceEntity? get selectedDevice; List<PositionEntity> get positions; PositionEntity? get selectedPosition;
/// Create a copy of HubViewState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@@ -25,16 +25,16 @@ $HubViewStateCopyWith<HubViewState> get copyWith => _$HubViewStateCopyWithImpl<H
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is HubViewState&&const DeepCollectionEquality().equals(other.devices, devices)&&const DeepCollectionEquality().equals(other.positions, positions));
return identical(this, other) || (other.runtimeType == runtimeType&&other is HubViewState&&const DeepCollectionEquality().equals(other.devices, devices)&&(identical(other.selectedDevice, selectedDevice) || other.selectedDevice == selectedDevice)&&const DeepCollectionEquality().equals(other.positions, positions)&&(identical(other.selectedPosition, selectedPosition) || other.selectedPosition == selectedPosition));
}
@override
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(devices),const DeepCollectionEquality().hash(positions));
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(devices),selectedDevice,const DeepCollectionEquality().hash(positions),selectedPosition);
@override
String toString() {
return 'HubViewState(devices: $devices, positions: $positions)';
return 'HubViewState(devices: $devices, selectedDevice: $selectedDevice, positions: $positions, selectedPosition: $selectedPosition)';
}
@@ -45,11 +45,11 @@ abstract mixin class $HubViewStateCopyWith<$Res> {
factory $HubViewStateCopyWith(HubViewState value, $Res Function(HubViewState) _then) = _$HubViewStateCopyWithImpl;
@useResult
$Res call({
List<DeviceEntity> devices, List<PositionEntity> positions
List<DeviceEntity> devices, DeviceEntity? selectedDevice, List<PositionEntity> positions, PositionEntity? selectedPosition
});
$PositionEntityCopyWith<$Res>? get selectedPosition;
}
/// @nodoc
@@ -62,14 +62,28 @@ class _$HubViewStateCopyWithImpl<$Res>
/// Create a copy of HubViewState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? devices = null,Object? positions = null,}) {
@pragma('vm:prefer-inline') @override $Res call({Object? devices = null,Object? selectedDevice = freezed,Object? positions = null,Object? selectedPosition = freezed,}) {
return _then(_self.copyWith(
devices: null == devices ? _self.devices : devices // ignore: cast_nullable_to_non_nullable
as List<DeviceEntity>,positions: null == positions ? _self.positions : positions // ignore: cast_nullable_to_non_nullable
as List<PositionEntity>,
as List<DeviceEntity>,selectedDevice: freezed == selectedDevice ? _self.selectedDevice : selectedDevice // ignore: cast_nullable_to_non_nullable
as DeviceEntity?,positions: null == positions ? _self.positions : positions // ignore: cast_nullable_to_non_nullable
as List<PositionEntity>,selectedPosition: freezed == selectedPosition ? _self.selectedPosition : selectedPosition // ignore: cast_nullable_to_non_nullable
as PositionEntity?,
));
}
/// Create a copy of HubViewState
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$PositionEntityCopyWith<$Res>? get selectedPosition {
if (_self.selectedPosition == null) {
return null;
}
return $PositionEntityCopyWith<$Res>(_self.selectedPosition!, (value) {
return _then(_self.copyWith(selectedPosition: value));
});
}
}
@@ -151,10 +165,10 @@ return $default(_that);case _:
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( List<DeviceEntity> devices, List<PositionEntity> positions)? $default,{required TResult orElse(),}) {final _that = this;
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( List<DeviceEntity> devices, DeviceEntity? selectedDevice, List<PositionEntity> positions, PositionEntity? selectedPosition)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _HubViewState() when $default != null:
return $default(_that.devices,_that.positions);case _:
return $default(_that.devices,_that.selectedDevice,_that.positions,_that.selectedPosition);case _:
return orElse();
}
@@ -172,10 +186,10 @@ return $default(_that.devices,_that.positions);case _:
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( List<DeviceEntity> devices, List<PositionEntity> positions) $default,) {final _that = this;
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( List<DeviceEntity> devices, DeviceEntity? selectedDevice, List<PositionEntity> positions, PositionEntity? selectedPosition) $default,) {final _that = this;
switch (_that) {
case _HubViewState():
return $default(_that.devices,_that.positions);case _:
return $default(_that.devices,_that.selectedDevice,_that.positions,_that.selectedPosition);case _:
throw StateError('Unexpected subclass');
}
@@ -192,10 +206,10 @@ return $default(_that.devices,_that.positions);case _:
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( List<DeviceEntity> devices, List<PositionEntity> positions)? $default,) {final _that = this;
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( List<DeviceEntity> devices, DeviceEntity? selectedDevice, List<PositionEntity> positions, PositionEntity? selectedPosition)? $default,) {final _that = this;
switch (_that) {
case _HubViewState() when $default != null:
return $default(_that.devices,_that.positions);case _:
return $default(_that.devices,_that.selectedDevice,_that.positions,_that.selectedPosition);case _:
return null;
}
@@ -207,7 +221,7 @@ return $default(_that.devices,_that.positions);case _:
class _HubViewState implements HubViewState {
const _HubViewState({final List<DeviceEntity> devices = const [], final List<PositionEntity> positions = const []}): _devices = devices,_positions = positions;
const _HubViewState({final List<DeviceEntity> devices = const [], this.selectedDevice, final List<PositionEntity> positions = const [], this.selectedPosition}): _devices = devices,_positions = positions;
final List<DeviceEntity> _devices;
@@ -217,6 +231,7 @@ class _HubViewState implements HubViewState {
return EqualUnmodifiableListView(_devices);
}
@override final DeviceEntity? selectedDevice;
final List<PositionEntity> _positions;
@override@JsonKey() List<PositionEntity> get positions {
if (_positions is EqualUnmodifiableListView) return _positions;
@@ -224,6 +239,7 @@ class _HubViewState implements HubViewState {
return EqualUnmodifiableListView(_positions);
}
@override final PositionEntity? selectedPosition;
/// Create a copy of HubViewState
/// with the given fields replaced by the non-null parameter values.
@@ -235,16 +251,16 @@ _$HubViewStateCopyWith<_HubViewState> get copyWith => __$HubViewStateCopyWithImp
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _HubViewState&&const DeepCollectionEquality().equals(other._devices, _devices)&&const DeepCollectionEquality().equals(other._positions, _positions));
return identical(this, other) || (other.runtimeType == runtimeType&&other is _HubViewState&&const DeepCollectionEquality().equals(other._devices, _devices)&&(identical(other.selectedDevice, selectedDevice) || other.selectedDevice == selectedDevice)&&const DeepCollectionEquality().equals(other._positions, _positions)&&(identical(other.selectedPosition, selectedPosition) || other.selectedPosition == selectedPosition));
}
@override
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(_devices),const DeepCollectionEquality().hash(_positions));
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(_devices),selectedDevice,const DeepCollectionEquality().hash(_positions),selectedPosition);
@override
String toString() {
return 'HubViewState(devices: $devices, positions: $positions)';
return 'HubViewState(devices: $devices, selectedDevice: $selectedDevice, positions: $positions, selectedPosition: $selectedPosition)';
}
@@ -255,11 +271,11 @@ abstract mixin class _$HubViewStateCopyWith<$Res> implements $HubViewStateCopyWi
factory _$HubViewStateCopyWith(_HubViewState value, $Res Function(_HubViewState) _then) = __$HubViewStateCopyWithImpl;
@override @useResult
$Res call({
List<DeviceEntity> devices, List<PositionEntity> positions
List<DeviceEntity> devices, DeviceEntity? selectedDevice, List<PositionEntity> positions, PositionEntity? selectedPosition
});
@override $PositionEntityCopyWith<$Res>? get selectedPosition;
}
/// @nodoc
@@ -272,15 +288,29 @@ class __$HubViewStateCopyWithImpl<$Res>
/// Create a copy of HubViewState
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? devices = null,Object? positions = null,}) {
@override @pragma('vm:prefer-inline') $Res call({Object? devices = null,Object? selectedDevice = freezed,Object? positions = null,Object? selectedPosition = freezed,}) {
return _then(_HubViewState(
devices: null == devices ? _self._devices : devices // ignore: cast_nullable_to_non_nullable
as List<DeviceEntity>,positions: null == positions ? _self._positions : positions // ignore: cast_nullable_to_non_nullable
as List<PositionEntity>,
as List<DeviceEntity>,selectedDevice: freezed == selectedDevice ? _self.selectedDevice : selectedDevice // ignore: cast_nullable_to_non_nullable
as DeviceEntity?,positions: null == positions ? _self._positions : positions // ignore: cast_nullable_to_non_nullable
as List<PositionEntity>,selectedPosition: freezed == selectedPosition ? _self.selectedPosition : selectedPosition // ignore: cast_nullable_to_non_nullable
as PositionEntity?,
));
}
/// Create a copy of HubViewState
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$PositionEntityCopyWith<$Res>? get selectedPosition {
if (_self.selectedPosition == null) {
return null;
}
return $PositionEntityCopyWith<$Res>(_self.selectedPosition!, (value) {
return _then(_self.copyWith(selectedPosition: value));
});
}
}
// dart format on

View File

@@ -1104,20 +1104,6 @@
"icon"
]
},
{
"uid": "aca7aa7439ff0bf2ee30da8c7e056628",
"css": "chat",
"code": 59530,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M320.5 450C330.4 450 339.8 453.9 346.8 460.9 353.8 467.9 357.7 477.3 357.7 487.2 357.7 494.5 355.5 501.7 351.4 507.8 347.3 514 341.5 518.7 334.7 521.5 327.9 524.3 320.5 525.1 313.2 523.6 306 522.2 299.4 518.7 294.2 513.5 289 508.3 285.5 501.6 284 494.4 282.6 487.2 283.4 479.7 286.2 472.9 289 466.2 293.8 460.3 299.9 456.3 306 452.2 313.2 450 320.5 450ZM479.9 30.4C543.4 27.7 606.8 37.9 666.3 60.4 725.8 82.9 780.2 117.2 826 161.4 871.8 205.5 908.2 258.4 933 317H933C970.9 406.7 979.9 505.9 959 601 938 696.1 888 782.3 816 847.8 743.9 913.3 653.3 954.8 556.6 966.5 460.4 978.3 362.9 959.9 277.5 914.1L93.1 949.9C90.3 950.6 87.5 951 84.7 951V951C79.6 951 74.7 949.9 70.1 947.7 65.6 945.4 61.7 942.2 58.6 938.2 55.6 934.2 53.4 929.6 52.4 924.6 51.5 919.7 51.6 914.7 52.9 909.9L85.9 722.5C56 666.8 37.7 605.7 31.9 542.7 26.2 479.4 33.3 415.5 53 355 72.6 294.5 104.3 238.6 146.2 190.7 188.1 142.8 239.3 103.9 296.6 76.3 354 48.8 416.3 33.2 479.9 30.4ZM500 95.6C277.1 95.6 95.7 277.1 95.7 500 95.7 570.8 114.2 640.3 149.4 701.7 153.8 709.2 155 718.1 152.7 726.5L152.8 726.5 115 868.8C112.4 878.7 121.4 887.7 131.3 885.1L273.5 847.3C276.3 846.6 279.1 846.2 282 846.2 287.7 846.2 293.4 847.7 298.3 850.6 359.7 885.9 429.2 904.4 500 904.4 722.9 904.4 904.3 723 904.3 500 904.3 277.1 722.9 95.6 500 95.6ZM559 487.2C559 497.8 555.8 508.2 549.9 517.1 544 526 535.6 532.9 525.7 536.9 515.9 541 505.1 542.1 494.6 540 484.2 537.9 474.6 532.8 467.1 525.3 459.5 517.7 454.4 508.1 452.3 497.7 450.2 487.2 451.3 476.4 455.4 466.6 459.5 456.7 466.4 448.3 475.2 442.4 484.1 436.5 494.5 433.3 505.1 433.3 519.4 433.3 533.1 439 543.2 449.1 553.3 459.2 559 472.9 559 487.2ZM525.6 487.2C525.6 491.2 524.4 495.2 522.2 498.6L577.6 535.6C587.2 521.3 592.3 504.4 592.3 487.2H525.6ZM522.2 498.6C519.9 502 516.7 504.6 513 506.1L538.5 567.7C554.4 561.1 568 550 577.6 535.6L522.2 498.6ZM513 506.1C509.2 507.7 505.1 508.1 501.1 507.3L488.1 572.7C505 576 522.6 574.3 538.5 567.7L513 506.1ZM501.1 507.3C497.1 506.5 493.5 504.6 490.6 501.7L443.5 548.8C455.7 561 471.2 569.3 488.1 572.7L501.1 507.3ZM490.6 501.7C487.8 498.8 485.8 495.2 485 491.2L419.6 504.2C423 521.1 431.3 536.6 443.5 548.8L490.6 501.7ZM485 491.2C484.2 487.2 484.6 483.1 486.2 479.3L424.6 453.8C418 469.7 416.3 487.3 419.6 504.2L485 491.2ZM486.2 479.3C487.7 475.6 490.4 472.4 493.7 470.1L456.7 414.7C442.4 424.3 431.2 437.9 424.6 453.8L486.2 479.3ZM493.7 470.1C497.1 467.9 501.1 466.7 505.1 466.7V400C487.9 400 471 405.1 456.7 414.7L493.7 470.1ZM505.1 466.7C510.6 466.7 515.8 468.8 519.6 472.7L566.8 425.5C550.4 409.2 528.3 400 505.1 400V466.7ZM519.6 472.7C523.5 476.5 525.6 481.7 525.6 487.2H592.3C592.3 464.1 583.1 441.9 566.8 425.5L519.6 472.7ZM759 487.2C759 497.8 755.8 508.2 749.9 517.1 744 526 735.6 532.9 725.7 536.9 715.9 541 705.1 542.1 694.6 540 684.2 537.9 674.6 532.8 667.1 525.3 659.5 517.7 654.4 508.1 652.3 497.7 650.2 487.2 651.3 476.4 655.4 466.6 659.5 456.7 666.4 448.3 675.2 442.4 684.1 436.5 694.5 433.3 705.1 433.3 719.4 433.3 733.1 439 743.2 449.1 753.3 459.2 759 472.9 759 487.2ZM725.6 487.2C725.6 491.2 724.4 495.2 722.2 498.6L777.6 535.6C787.2 521.3 792.3 504.4 792.3 487.2H725.6ZM722.2 498.6C719.9 502 716.7 504.6 713 506.1L738.5 567.7C754.4 561.1 768 550 777.6 535.6L722.2 498.6ZM713 506.1C709.2 507.7 705.1 508.1 701.1 507.3L688.1 572.7C705 576 722.6 574.3 738.5 567.7L713 506.1ZM701.1 507.3C697.1 506.5 693.5 504.6 690.6 501.7L643.5 548.8C655.7 561 671.2 569.3 688.1 572.7L701.1 507.3ZM690.6 501.7C687.8 498.8 685.8 495.2 685 491.2L619.6 504.2C623 521.1 631.3 536.6 643.5 548.8L690.6 501.7ZM685 491.2C684.2 487.2 684.6 483.1 686.2 479.3L624.6 453.8C618 469.7 616.3 487.3 619.6 504.2L685 491.2ZM686.2 479.3C687.7 475.6 690.4 472.4 693.7 470.1L656.7 414.7C642.4 424.3 631.2 437.9 624.6 453.8L686.2 479.3ZM693.7 470.1C697.1 467.9 701.1 466.7 705.1 466.7V400C687.9 400 671 405.1 656.7 414.7L693.7 470.1ZM705.1 466.7C710.6 466.7 715.8 468.8 719.6 472.7L766.8 425.5C750.4 409.2 728.3 400 705.1 400V466.7ZM719.6 472.7C723.5 476.5 725.6 481.7 725.6 487.2H792.3C792.3 464.1 783.1 441.9 766.8 425.5L719.6 472.7Z",
"width": 1000
},
"search": [
"icon"
]
},
{
"uid": "c2dafca4f49d11a68d647573fb4b3c0c",
"css": "listen",
@@ -1201,6 +1187,20 @@
"search": [
"icon"
]
},
{
"uid": "ec2a0c653e4ea9982cbdf60ea596704c",
"css": "chat",
"code": 59477,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M320.5 450C330.4 450 339.8 453.9 346.8 460.9 353.8 467.9 357.7 477.3 357.7 487.2 357.7 494.5 355.5 501.7 351.4 507.8 347.3 514 341.5 518.7 334.7 521.5 327.9 524.3 320.5 525.1 313.2 523.6 306 522.2 299.4 518.7 294.2 513.5 289 508.3 285.5 501.6 284 494.4 282.6 487.2 283.4 479.7 286.2 472.9 289 466.2 293.8 460.3 299.9 456.3 306 452.2 313.2 450 320.5 450ZM479.9 30.4C543.4 27.7 606.8 37.9 666.3 60.4 725.8 82.9 780.2 117.2 826 161.4 871.8 205.5 908.2 258.4 933 317H933C970.9 406.7 979.9 505.9 959 601 938 696.1 888 782.3 816 847.8 743.9 913.3 653.3 954.8 556.6 966.5 460.4 978.3 362.9 959.9 277.5 914.1L93.1 949.9C90.3 950.6 87.5 951 84.7 951V951C79.6 951 74.7 949.9 70.1 947.7 65.6 945.4 61.7 942.2 58.6 938.2 55.6 934.2 53.4 929.6 52.4 924.6 51.5 919.7 51.6 914.7 52.9 909.9L85.9 722.5C56 666.8 37.7 605.7 31.9 542.7 26.2 479.4 33.3 415.5 53 355 72.6 294.5 104.3 238.6 146.2 190.7 188.1 142.8 239.3 103.9 296.6 76.3 354 48.8 416.3 33.2 479.9 30.4ZM500 95.6C277.1 95.6 95.7 277.1 95.7 500 95.7 570.8 114.2 640.3 149.4 701.7 153.8 709.2 155 718.1 152.7 726.5L152.8 726.5 115 868.8C112.4 878.7 121.4 887.7 131.3 885.1L273.5 847.3C276.3 846.6 279.1 846.2 282 846.2 287.7 846.2 293.4 847.7 298.3 850.6 359.7 885.9 429.2 904.4 500 904.4 722.9 904.4 904.3 723 904.3 500 904.3 277.1 722.9 95.6 500 95.6ZM559 487.2C559 497.8 555.8 508.2 549.9 517.1 544 526 535.6 532.9 525.7 536.9 515.9 541 505.1 542.1 494.6 540 484.2 537.9 474.6 532.8 467.1 525.3 459.5 517.7 454.4 508.1 452.3 497.7 450.2 487.2 451.3 476.4 455.4 466.6 459.5 456.7 466.4 448.3 475.2 442.4 484.1 436.5 494.5 433.3 505.1 433.3 519.4 433.3 533.1 439 543.2 449.1 553.3 459.2 559 472.9 559 487.2ZM759 487.2C759 497.8 755.8 508.2 749.9 517.1 744 526 735.6 532.9 725.7 536.9 715.9 541 705.1 542.1 694.6 540 684.2 537.9 674.6 532.8 667.1 525.3 659.5 517.7 654.4 508.1 652.3 497.7 650.2 487.2 651.3 476.4 655.4 466.6 659.5 456.7 666.4 448.3 675.2 442.4 684.1 436.5 694.5 433.3 705.1 433.3 719.4 433.3 733.1 439 743.2 449.1 753.3 459.2 759 472.9 759 487.2Z",
"width": 1000
},
"search": [
"icon"
]
}
]
}

View File

@@ -13,6 +13,7 @@ class CustomDropdown extends StatelessWidget {
final double height;
final double width;
final Color? color;
final EdgeInsets? padding;
const CustomDropdown({
super.key,
@@ -26,6 +27,7 @@ class CustomDropdown extends StatelessWidget {
this.width = double.infinity,
this.height = 70,
this.color,
this.padding,
});
@override
@@ -60,7 +62,7 @@ class CustomDropdown extends StatelessWidget {
disabledBorder: border(borderColor),
errorBorder: border(borderColor),
focusedErrorBorder: border(borderColor),
contentPadding: const EdgeInsets.symmetric(
contentPadding: padding ?? const EdgeInsets.symmetric(
horizontal: 12,
vertical: 16,
),

View File

@@ -90,6 +90,7 @@ class SFIcons {
static const IconData screenTime = IconData(0xe851, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData friendsCircle = IconData(0xe852, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData temperature = IconData(0xe853, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData chat = IconData(0xe855, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData locationOutlined = IconData(0xe856, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData share = IconData(0xe858, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData favoriteOutlined = IconData(0xe859, fontFamily: _kFontFam, fontPackage: _kFontPkg);
@@ -109,6 +110,5 @@ class SFIcons {
static const IconData healthCircle = IconData(0xe887, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData rewardsCircle = IconData(0xe888, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData locateSfCircle = IconData(0xe889, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData chat = IconData(0xe88a, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData lightbulbOutline = IconData(0xe8a8, fontFamily: _kFontFam, fontPackage: _kFontPkg);
}

View File

@@ -136,7 +136,7 @@
"functions": "Functions",
"accountSettings": "Account Settings",
"deviceSettings": "Device Settings",
"watchesOnMap": "Smartwatch on the map",
"watchesOnMap": "Smartwatch on the map:",
"home": "Home",
"location": "Location",
"chat": "Chat",

View File

@@ -136,7 +136,7 @@
"functions": "Funciones",
"accountSettings": "Perfil de cuenta",
"deviceSettings": "Ajustes",
"watchesOnMap": "Reloj inteligente en el mapa",
"watchesOnMap": "Reloj inteligente en el mapa:",
"home": "Inicio",
"location": "Mapa",
"chat": "Chat",