Skip to content
Merged

main #59

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ PODS:
- nanopb (~> 3.30910.0)
- PromisesSwift (~> 2.1)
- Flutter (1.0.0)
- flutter_inappwebview_ios (0.0.1):
- Flutter
- flutter_inappwebview_ios/Core (= 0.0.1)
- OrderedSet (~> 6.0.3)
- flutter_inappwebview_ios/Core (0.0.1):
- Flutter
- OrderedSet (~> 6.0.3)
- GoogleDataTransport (10.1.0):
- nanopb (~> 3.30910.0)
- PromisesObjC (~> 2.4)
Expand Down Expand Up @@ -95,6 +102,7 @@ PODS:
- nanopb/encode (= 3.30910.0)
- nanopb/decode (3.30910.0)
- nanopb/encode (3.30910.0)
- OrderedSet (6.0.3)
- package_info_plus (0.4.5):
- Flutter
- path_provider_foundation (0.0.1):
Expand All @@ -119,6 +127,7 @@ DEPENDENCIES:
- firebase_crashlytics (from `.symlinks/plugins/firebase_crashlytics/ios`)
- firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`)
- Flutter (from `Flutter`)
- flutter_inappwebview_ios (from `.symlinks/plugins/flutter_inappwebview_ios/ios`)
- local_auth_darwin (from `.symlinks/plugins/local_auth_darwin/darwin`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
Expand All @@ -141,6 +150,7 @@ SPEC REPOS:
- GoogleDataTransport
- GoogleUtilities
- nanopb
- OrderedSet
- PromisesObjC
- PromisesSwift

Expand All @@ -153,6 +163,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/firebase_messaging/ios"
Flutter:
:path: Flutter
flutter_inappwebview_ios:
:path: ".symlinks/plugins/flutter_inappwebview_ios/ios"
local_auth_darwin:
:path: ".symlinks/plugins/local_auth_darwin/darwin"
package_info_plus:
Expand Down Expand Up @@ -182,10 +194,12 @@ SPEC CHECKSUMS:
FirebaseRemoteConfigInterop: 1e31ec72b89c9924367c59bfb5ec9ab60d1d6766
FirebaseSessions: ba7c7a7ca8696a8d540eb3fe3800fbe98c79786d
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
flutter_inappwebview_ios: b89ba3482b96fb25e00c967aae065701b66e9b99
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1
local_auth_darwin: c3ee6cce0a8d56be34c8ccb66ba31f7f180aaebb
nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94
package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499
path_provider_foundation: bb55f6dbba17d0dccd6737fe6f7f34fbd0376880
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
Expand Down
1 change: 1 addition & 0 deletions ios/ci_scripts/ci_post_clone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ export PATH="$PATH:$HOME/flutter/bin"

# Install Flutter artifacts for iOS (--ios), or macOS (--macos) platforms.
flutter precache --ios
flutter config --no-enable-swift-package-manager
./build.sh "ios --config-only --no-codesign"
exit 0
35 changes: 34 additions & 1 deletion lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,31 @@
"description": "Block command action button label"
},

"unblock": "Unblock",
"@unblock": {
"description": "Unblock command action button label"
},

"unblockCommandConfirmTitle": "Unblock vehicle?",
"@unblockCommandConfirmTitle": {
"description": "Title for unblock command confirmation dialog"
},

"unblockCommandConfirmMessage": "This will resume the engine remotely. Are you sure?",
"@unblockCommandConfirmMessage": {
"description": "Body text for unblock command confirmation dialog"
},

"unblockCommandSent": "Unblock command sent",
"@unblockCommandSent": {
"description": "Snackbar message when unblock command is sent"
},

"unblockCommandFailed": "Failed to send unblock command",
"@unblockCommandFailed": {
"description": "Snackbar message when unblock command fails"
},

"locationCopied": "Location copied to clipboard",
"@locationCopied": {
"description": "Snackbar message when location is copied"
Expand Down Expand Up @@ -410,5 +435,13 @@
"duration": "Duration",
"@duration": { "description": "Duration column header" },
"reportExported": "Report exported",
"@reportExported": { "description": "Export success message" }
"@reportExported": { "description": "Export success message" },
"myLocation": "My location",
"@myLocation": { "description": "Map control for showing the user's current location" },
"locationServicesDisabled": "Location services are disabled",
"@locationServicesDisabled": { "description": "Message shown when device location services are off" },
"locationPermissionDenied": "Location permission was denied",
"@locationPermissionDenied": { "description": "Message shown when location access is denied" },
"locationUnavailable": "Your location is currently unavailable",
"@locationUnavailable": { "description": "Message shown when the current location cannot be obtained" }
}
14 changes: 14 additions & 0 deletions lib/l10n/app_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@

"block": "Bloquer",

"unblock": "Débloquer",

"unblockCommandConfirmTitle": "Débloquer le véhicule ?",

"unblockCommandConfirmMessage": "Cela relancera le moteur à distance. Êtes-vous sûr ?",

"unblockCommandSent": "Commande de déblocage envoyée",

"unblockCommandFailed": "Échec de l'envoi de la commande de déblocage",

"locationCopied": "Emplacement copié dans le presse-papiers",

"blockCommandConfirmTitle": "Bloquer le véhicule ?",
Expand Down Expand Up @@ -174,4 +184,8 @@
"device": "Appareil",
"duration": "Durée",
"reportExported": "Rapport exporté"
,"myLocation": "Ma position",
"locationServicesDisabled": "Les services de localisation sont désactivés",
"locationPermissionDenied": "L’autorisation de localisation a été refusée",
"locationUnavailable": "Votre position est actuellement indisponible"
}
16 changes: 15 additions & 1 deletion lib/l10n/app_pt.arb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

"emailOrUsername": "Email ou Nome de Utilizador",

"password": "Palavra-passe",
"password": "Senha",

"required": "Obrigatório",

Expand Down Expand Up @@ -77,6 +77,16 @@

"block": "Bloquear",

"unblock": "Desbloquear",

"unblockCommandConfirmTitle": "Desbloquear veículo?",

"unblockCommandConfirmMessage": "Isto irá retomar o motor remotamente. Tem a certeza?",

"unblockCommandSent": "Comando de desbloqueio enviado",

"unblockCommandFailed": "Falha ao enviar comando de desbloqueio",

"locationCopied": "Localização copiada para a área de transferência",

"blockCommandConfirmTitle": "Bloquear veículo?",
Expand Down Expand Up @@ -174,4 +184,8 @@
"device": "Dispositivo",
"duration": "Duração",
"reportExported": "Relatório exportado"
,"myLocation": "A minha localização",
"locationServicesDisabled": "Os serviços de localização estão desativados",
"locationPermissionDenied": "A permissão de localização foi recusada",
"locationUnavailable": "A sua localização não está disponível neste momento"
}
13 changes: 9 additions & 4 deletions lib/map/styles.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@ class MapStyles {
static const List<MapStyleConfig> configs = [
MapStyleConfig(
nameKey: 'roads',
urlTemplate: 'https://mt{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}&scale=2',
urlTemplate: 'https://mt{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}&gl=MA&hl={lang}',
subdomains: ['0', '1', '2', '3'],
attribution: '© Google Maps',
),
MapStyleConfig(
nameKey: 'satellite',
urlTemplate: 'https://mt{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}&scale=2',
urlTemplate: 'https://mt{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}&gl=MA&hl={lang}',
subdomains: ['0', '1', '2', '3'],
attribution: '© Google Maps',
isDark: true,
),
MapStyleConfig(
nameKey: 'hybrid',
urlTemplate: 'https://mt{s}.google.com/vt/lyrs=y&x={x}&y={y}&z={z}&scale=2',
urlTemplate: 'https://mt{s}.google.com/vt/lyrs=y&x={x}&y={y}&z={z}&gl=MA&hl={lang}',
subdomains: ['0', '1', '2', '3'],
attribution: '© Google Maps',
isDark: true,
),
MapStyleConfig(
nameKey: 'traffic',
urlTemplate: 'https://mt{s}.google.com/vt/lyrs=m,traffic&x={x}&y={y}&z={z}&scale=2',
urlTemplate: 'https://mt{s}.google.com/vt/lyrs=m,traffic&x={x}&y={y}&z={z}&gl=MA&hl={lang}',
subdomains: ['0', '1', '2', '3'],
attribution: '© Google Maps',
),
Expand All @@ -47,6 +47,11 @@ class MapStyleConfig {
this.isDark = false,
});

String urlTemplateFor(BuildContext context) {
final lang = Localizations.localeOf(context).languageCode;
return urlTemplate.replaceAll('{lang}', lang);
}

String getLocalizedName(BuildContext context) {
final l10n = AppLocalizations.of(context)!;
switch (nameKey) {
Expand Down
18 changes: 18 additions & 0 deletions lib/models/device.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@ class Device {
);
}

Device copyWith({String? status}) {
return Device(
id: id,
name: name,
uniqueId: uniqueId,
status: status ?? this.status,
disabled: disabled,
lastUpdate: lastUpdate,
positionId: positionId,
groupId: groupId,
phone: phone,
model: model,
contact: contact,
category: category,
attributes: attributes,
);
}

Map<String, dynamic> toJson() {
return {
'id': id,
Expand Down
9 changes: 9 additions & 0 deletions lib/pages/login_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ class _LoginPageState extends State<LoginPage> {
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
ClipRRect(
borderRadius: BorderRadius.circular(20),
child: Image.asset(
'assets/app_icon.png',
width: 96,
height: 96,
),
),
const SizedBox(height: 16),
Text(l10n.signIn, style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold)),
const SizedBox(height: 16),
if (_error != null)
Expand Down
Loading
Loading