Compare commits
62 Commits
909b321158
...
feature/no
Author | SHA1 | Date | |
---|---|---|---|
b6134c5506 | |||
6e0b54a925 | |||
5d9802d56e | |||
8a7515aaf6 | |||
f9934a0d5d | |||
09c82da57f | |||
75b42dd091 | |||
dfe21960be | |||
4a936cc267 | |||
bd5bfa94ca | |||
f30aa8f630 | |||
924794e8a0 | |||
7528e55dca | |||
02ba067615 | |||
9eafb30374 | |||
24cb90959d | |||
1620d84137 | |||
6e8ba642a2 | |||
0113fcc382 | |||
e4571cabe7 | |||
76db2f8254 | |||
0a62011b3a | |||
cbc75bbc7b | |||
7a418d82a7 | |||
e310197aa7 | |||
5d02f2b1fb | |||
119dfcbdfe | |||
9e50b6d6f6 | |||
dcc2ec25de | |||
2c2eedb7ce | |||
089aa58f4a | |||
b4b0199fc2 | |||
b48483c9f0 | |||
22d0581da3 | |||
337fab4a08 | |||
a99986813e | |||
199000035e | |||
f143036ca8 | |||
271c3ba118 | |||
f8b5c24efd | |||
1df36987d9 | |||
b4dc29aff6 | |||
79563e829c | |||
413807f039 | |||
26372368b2 | |||
f81a8c264c | |||
c5985f2954 | |||
1f8d18343c | |||
c3b8b0df14 | |||
ec8ce404ab | |||
1208982b15 | |||
479ab76fb7 | |||
1646a0b6e3 | |||
e21b03d13c | |||
45cdb253e4 | |||
75b443758a | |||
e2195e6500 | |||
4f41aff572 | |||
1c21f59420 | |||
7441af6f13 | |||
4f4b0b609c | |||
2e6814c33d |
4
covas_mobile/l10n.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
arb-dir: lib/l10n
|
||||
template-arb-file: app_en.arb
|
||||
output-localization-file: app_localizations.dart
|
||||
output-class: AppLocalizations
|
@@ -13,6 +13,10 @@ import '../pages/LoginDemo.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart'; // Import dotenv
|
||||
import 'package:encrypt_shared_preferences/provider.dart';
|
||||
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
class MyDrawer extends StatelessWidget with ShowAlertDialog {
|
||||
Future<void> logout(BuildContext context) async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
@@ -87,6 +91,8 @@ class MyDrawer extends StatelessWidget with ShowAlertDialog {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final loc = AppLocalizations.of(context);
|
||||
final localeProvider = Provider.of<LocaleProvider>(context);
|
||||
return Drawer(
|
||||
child: ListView(
|
||||
padding: EdgeInsets.zero,
|
||||
@@ -107,7 +113,7 @@ class MyDrawer extends StatelessWidget with ShowAlertDialog {
|
||||
// Drawer Items
|
||||
ListTile(
|
||||
leading: Icon(Icons.home),
|
||||
title: Text('Home'),
|
||||
title: Text(loc?.home ?? "Home"),
|
||||
onTap: () {
|
||||
Navigator.pushReplacement(
|
||||
context, MaterialPageRoute(builder: (_) => ListItemMenu()));
|
||||
@@ -117,7 +123,7 @@ class MyDrawer extends StatelessWidget with ShowAlertDialog {
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(Icons.settings),
|
||||
title: Text('Settings'),
|
||||
title: Text(loc?.settings ?? 'Settings'),
|
||||
onTap: () {
|
||||
Navigator.pushReplacement(
|
||||
context,
|
||||
@@ -127,7 +133,7 @@ class MyDrawer extends StatelessWidget with ShowAlertDialog {
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(Icons.account_circle),
|
||||
title: Text('Update profile'),
|
||||
title: Text(loc?.update_profile ?? 'Update profile'),
|
||||
onTap: () {
|
||||
Navigator.pushReplacement(
|
||||
context,
|
||||
@@ -136,16 +142,61 @@ class MyDrawer extends StatelessWidget with ShowAlertDialog {
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(Icons.info),
|
||||
title: Text('About'),
|
||||
leading: Icon(Icons.language),
|
||||
title: Text(loc?.language ?? 'Language'),
|
||||
onTap: () {
|
||||
showAlertDialog(
|
||||
context, 'About', "Version 0.0.1"); // Close the drawer
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (_) => AlertDialog(
|
||||
title: Text(loc?.select_language ?? 'Select Language'),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
ListTile(
|
||||
leading: Icon(Icons.flag),
|
||||
title: Text(loc?.french ?? 'Français'),
|
||||
onTap: () {
|
||||
Provider.of<LocaleProvider>(context, listen: false)
|
||||
.setLocale(const Locale('fr'));
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(Icons.flag_outlined),
|
||||
title: Text(loc?.english ?? 'English'),
|
||||
onTap: () {
|
||||
Provider.of<LocaleProvider>(context, listen: false)
|
||||
.setLocale(const Locale('en'));
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(Icons.flag_outlined),
|
||||
title: Text(loc?.german ?? 'German'),
|
||||
onTap: () {
|
||||
Provider.of<LocaleProvider>(context, listen: false)
|
||||
.setLocale(const Locale('de'));
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
ListTile(
|
||||
leading: Icon(Icons.info),
|
||||
title: Text(loc?.about ?? 'About'),
|
||||
onTap: () {
|
||||
showAlertDialog(context, loc?.about ?? 'About',
|
||||
"Version 0.0.1"); // Close the drawer
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(Icons.logout),
|
||||
title: Text('Log out'),
|
||||
title: Text(loc?.log_out ?? 'Log out'),
|
||||
onTap: () async {
|
||||
logout(context);
|
||||
// Close the drawer
|
||||
|
@@ -5,11 +5,15 @@ class Events {
|
||||
String? startDate;
|
||||
String? endDate;
|
||||
String? description;
|
||||
String? link;
|
||||
String? ticket;
|
||||
double? latitude;
|
||||
double? longitude;
|
||||
List<String>? tags;
|
||||
List<String>? organizers;
|
||||
String? imgUrl;
|
||||
int? interestedCount;
|
||||
bool? interested;
|
||||
Events(
|
||||
{this.place,
|
||||
this.id,
|
||||
@@ -21,7 +25,11 @@ class Events {
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
this.organizers,
|
||||
this.imgUrl});
|
||||
this.link,
|
||||
this.ticket,
|
||||
this.imgUrl,
|
||||
this.interestedCount,
|
||||
this.interested});
|
||||
|
||||
Events.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'] as String?;
|
||||
@@ -38,5 +46,9 @@ class Events {
|
||||
organizers = (json['organizers'] as List<dynamic>?)
|
||||
?.cast<String>(); // Convert List<dynamic> to List<String>
|
||||
imgUrl = json['imgUrl'] as String?;
|
||||
link = json['link'] as String?;
|
||||
ticket = json['ticket'] as String?;
|
||||
interested = json['interested'] as bool?;
|
||||
interestedCount = json['interested_count'] as int?;
|
||||
}
|
||||
}
|
||||
|
91
covas_mobile/lib/classes/notification_service.dart
Normal file
@@ -0,0 +1,91 @@
|
||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||
import 'package:timezone/timezone.dart' as tz;
|
||||
import 'package:timezone/data/latest_all.dart' as tz;
|
||||
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class NotificationService {
|
||||
static final FlutterLocalNotificationsPlugin _notificationsPlugin =
|
||||
FlutterLocalNotificationsPlugin();
|
||||
|
||||
/// Initialisation (à appeler dans main())
|
||||
static Future<void> initialize() async {
|
||||
tz.initializeTimeZones();
|
||||
|
||||
const AndroidInitializationSettings androidInitSettings =
|
||||
AndroidInitializationSettings('@mipmap/ic_launcher');
|
||||
|
||||
const InitializationSettings initSettings = InitializationSettings(
|
||||
android: androidInitSettings,
|
||||
iOS: DarwinInitializationSettings(),
|
||||
);
|
||||
|
||||
await _notificationsPlugin.initialize(initSettings);
|
||||
|
||||
// Demande les permissions au lancement
|
||||
await requestPermissions();
|
||||
}
|
||||
|
||||
/// Demander les permissions (Android 13+ et iOS)
|
||||
static Future<void> requestPermissions() async {
|
||||
// Android 13+
|
||||
final androidImplementation =
|
||||
_notificationsPlugin.resolvePlatformSpecificImplementation<
|
||||
AndroidFlutterLocalNotificationsPlugin>();
|
||||
await androidImplementation?.requestNotificationsPermission();
|
||||
|
||||
// iOS
|
||||
final iosImplementation =
|
||||
_notificationsPlugin.resolvePlatformSpecificImplementation<
|
||||
IOSFlutterLocalNotificationsPlugin>();
|
||||
await iosImplementation?.requestPermissions(
|
||||
alert: true,
|
||||
badge: true,
|
||||
sound: true,
|
||||
);
|
||||
}
|
||||
|
||||
/// Planifie une notification 1h avant l’évènement
|
||||
static Future<void> scheduleEventNotification({
|
||||
required String eventId,
|
||||
required String title,
|
||||
required String body,
|
||||
required DateTime eventDate,
|
||||
}) async {
|
||||
final scheduledDate = eventDate.subtract(const Duration(hours: 1));
|
||||
|
||||
if (scheduledDate.isBefore(DateTime.now())) {
|
||||
// Trop tard pour notifier
|
||||
return;
|
||||
}
|
||||
|
||||
await _notificationsPlugin.zonedSchedule(
|
||||
eventId.hashCode, // identifiant unique pour l’évènement
|
||||
title,
|
||||
body,
|
||||
tz.TZDateTime.from(scheduledDate, tz.local),
|
||||
const NotificationDetails(
|
||||
android: AndroidNotificationDetails(
|
||||
'events_channel',
|
||||
'Events',
|
||||
channelDescription: 'Favorite event notifications',
|
||||
importance: Importance.high,
|
||||
priority: Priority.high,
|
||||
),
|
||||
iOS: DarwinNotificationDetails(),
|
||||
),
|
||||
androidScheduleMode: AndroidScheduleMode
|
||||
.inexactAllowWhileIdle, // évite l'erreur Exact Alarm
|
||||
uiLocalNotificationDateInterpretation:
|
||||
UILocalNotificationDateInterpretation.absoluteTime,
|
||||
matchDateTimeComponents: DateTimeComponents.dateAndTime,
|
||||
);
|
||||
}
|
||||
|
||||
/// Annule une notification planifiée
|
||||
static Future<void> cancel(String eventId) async {
|
||||
await _notificationsPlugin.cancel(eventId.hashCode);
|
||||
}
|
||||
}
|
143
covas_mobile/lib/l10n/app_de.arb
Normal file
@@ -0,0 +1,143 @@
|
||||
{
|
||||
"@@locale": "de",
|
||||
"menu_list": "Veranstaltungsmenü",
|
||||
"language": "Sprache",
|
||||
"home": "Startseite",
|
||||
"settings": "Einstellungen",
|
||||
"update_profile": "Profil aktualisieren",
|
||||
"about": "Über",
|
||||
"log_out": "Abmelden",
|
||||
"french": "Französisch",
|
||||
"english": "Englisch",
|
||||
"german": "Deutsch",
|
||||
"select_language": "Sprache auswählen",
|
||||
"search_item": "Nach Element suchen",
|
||||
"search_tag": "Nach Schlagwörtern suchen",
|
||||
"search_geographical": "Nach geografischer Zone suchen",
|
||||
"show_date_field": "Datumsfelder anzeigen",
|
||||
"hide_date_field": "Datumsfelder ausblenden",
|
||||
"no_data": "Keine Daten verfügbar",
|
||||
"search": "Suchen",
|
||||
"no_events": "Keine Veranstaltungen für diesen Ort verfügbar.",
|
||||
"start_date": "Anfangsdatum",
|
||||
"end_date": "Enddatum",
|
||||
"failed_suggestions": "Vorschläge konnten nicht geladen werden",
|
||||
"error": "Fehler",
|
||||
"password_different": "Ein anderes Passwort eingeben",
|
||||
"create": "Erstellung",
|
||||
"user_create": "Benutzer wurde erstellt",
|
||||
"user_update": "Benutzer wurde aktualisiert",
|
||||
"request_error": "Fehlerhafte Anfrage",
|
||||
"incorrect_password": "Falsches Passwort",
|
||||
"unknown_user": "Unbekannter Benutzer",
|
||||
"disabled_user": "Benutzer deaktiviert",
|
||||
"invalid_token": "Ungültiger Token",
|
||||
"internal_error_server": "Interner Serverfehler",
|
||||
"unknown_error_auth": "Unbekannter Authentifizierungsfehler",
|
||||
"required_input": "Pflichtfeld",
|
||||
"create_profile": "Profil erstellen",
|
||||
"edit_pseudo": "Benutzernamen bearbeiten",
|
||||
"password": "Passwort",
|
||||
"enter_password": "Passwort eingeben",
|
||||
"password_confirmed": "Passwort bestätigt",
|
||||
"last_name": "Nachname",
|
||||
"first_name": "Vorname",
|
||||
"email": "E-Mail",
|
||||
"edit_last_name": "Nachnamen bearbeiten",
|
||||
"edit_first_name": "Vornamen bearbeiten",
|
||||
"edit_email": "E-Mail-Adresse bearbeiten",
|
||||
"birth_date": "Geburtsdatum",
|
||||
"edit_birth": "Geburtsdatum bearbeiten",
|
||||
"create_profile_button": "Profil erstellen",
|
||||
"take_picture": "Foto aufnehmen",
|
||||
"error_ia": "Google KI konnte das Bild nicht analysieren. Bitte ein anderes versuchen.",
|
||||
"no_data_geo": "Keine geografischen Daten",
|
||||
"response_status_update": "Statuscode-Antwort aktualisieren",
|
||||
"error_token": "Token-Fehler",
|
||||
"error_format": "Vom KI geliefertes Datenformat ist fehlerhaft",
|
||||
"display_picture": "Bild anzeigen",
|
||||
"analyze_image": "Bildanalyse läuft",
|
||||
"loading_progress": "Ladefortschritt",
|
||||
"error_event": "Veranstaltungsfehler",
|
||||
"no_future_event": "Keine zukünftigen Veranstaltungen",
|
||||
"error_user": "Benutzerfehler",
|
||||
"empty_input": "Eingabefeld leer",
|
||||
"info_event": "Veranstaltungsinfo",
|
||||
"event_already": "Veranstaltung existiert bereits",
|
||||
"picture_error": "Bildfehler",
|
||||
"no_picture_published": "Kein Bild veröffentlicht",
|
||||
"event_update": "Veranstaltung aktualisiert",
|
||||
"location": "Ort",
|
||||
"add_event": "Veranstaltung hinzufügen oder aktualisieren",
|
||||
"edit_image": "Bilder bearbeiten",
|
||||
"name": "Name",
|
||||
"edit_event_name": "Veranstaltungsname bearbeiten",
|
||||
"start_time": "Startzeit",
|
||||
"end_time": "Endzeit",
|
||||
"select_date": "Zum Auswählen eines Datums klicken",
|
||||
"select_time": "Zum Auswählen einer Uhrzeit klicken",
|
||||
"tag": "Schlagwörter",
|
||||
"already_tag": "Dieses Schlagwort ist bereits vorhanden",
|
||||
"enter_tag": "Ein Schlagwort eingeben",
|
||||
"organizer": "Veranstalter",
|
||||
"already_organiser": "Veranstalter bereits vorhanden",
|
||||
"enter_organizer": "Veranstalter eingeben",
|
||||
"description": "Beschreibung",
|
||||
"describe_event": "Veranstaltung beschreiben",
|
||||
"add": "Hinzufügen",
|
||||
"different_password_error": "Passwörter stimmen nicht überein",
|
||||
"update": "Aktualisieren",
|
||||
"updated": "Aktualisiert",
|
||||
"settings_updated": "Einstellungen aktualisiert",
|
||||
"define_kilometer": "Kilometer definieren",
|
||||
"email_sent": "E-Mail wurde gesendet",
|
||||
"forgot_password": "Passwort vergessen",
|
||||
"enter_email": "E-Mail eingeben",
|
||||
"send_email": "E-Mail senden",
|
||||
"invalid_cache": "Ungültiger Cache",
|
||||
"item_date": "Datum : ",
|
||||
"item_maps": "Karte : ",
|
||||
"item_organizer": "Veranstalter : ",
|
||||
"item_description": "Beschreibung : ",
|
||||
"item_tags": "Schlagwörter : ",
|
||||
"failed_auth": "Authentifizierung fehlgeschlagen",
|
||||
"login_page": "Anmeldeseite",
|
||||
"pseudo": "Benutzername",
|
||||
"enter_existing_pseudo": "Vorhandenen Benutzernamen eingeben",
|
||||
"remembr_me": "Angemeldet bleiben",
|
||||
"new_user": "Neuer Benutzer? Konto erstellen",
|
||||
"sign_in": "Anmelden",
|
||||
"map_token": "Mapbox-Zugangstoken ist nicht verfügbar",
|
||||
"geo_disabled": "Standortdienste sind deaktiviert.",
|
||||
"permission_denied": "Standortberechtigungen wurden verweigert.",
|
||||
"enable_permission": "Standortberechtigungen dauerhaft verweigert. Bitte in den Einstellungen aktivieren.",
|
||||
"no_last_position": "Keine letzte bekannte Position verfügbar.",
|
||||
"failed_location": "Standort konnte nicht ermittelt werden",
|
||||
"failed_fetch": "Route konnte nicht abgerufen werden",
|
||||
"invalid_coordinates_symbol": "Ungültige Koordinaten, Symbol kann nicht hinzugefügt werden.",
|
||||
"error_symbol": "Fehler beim Hinzufügen des Symbols.",
|
||||
"position_not_init": "Benutzerposition noch nicht initialisiert. Erneut versuchen.",
|
||||
"invalid_coordinates": "Ungültige Koordinaten.",
|
||||
"walking": "Zu Fuß",
|
||||
"cycling": "Mit dem Fahrrad",
|
||||
"driving": "Mit dem Auto",
|
||||
"get_direction": "Wegbeschreibung und Markierungen anzeigen",
|
||||
"missing_token": "Zugangstoken fehlt",
|
||||
"geocoding_error": "Fehler bei der Geokodierung",
|
||||
"no_found_place": "Kein Ort gefunden",
|
||||
"upload_error": "Fehler beim Hochladen des Bildes",
|
||||
"event_added": "Veranstaltung hinzugefügt",
|
||||
"unknown_error": "Unbekannter Fehler",
|
||||
"app_error": "Anwendungsfehler",
|
||||
"at": "um",
|
||||
"to_date": "bis",
|
||||
"item_link": "Link : ",
|
||||
"item_ticket": "Abendkarte : ",
|
||||
"link": "Link",
|
||||
"edit_link": "Linkereignis bearbeiten",
|
||||
"ticket": "Abendkarte",
|
||||
"edit_ticket": "Ticketlink bearbeiten",
|
||||
"toogle_interest": "Fehler beim Umschalten des Interesses",
|
||||
"error_update": "Fehler beim Update",
|
||||
"count_interested": "Anzahl der Interessenten"
|
||||
}
|
145
covas_mobile/lib/l10n/app_en.arb
Normal file
@@ -0,0 +1,145 @@
|
||||
{
|
||||
"@@locale": "en",
|
||||
"menu_list": "Event list menu",
|
||||
"language": "Language",
|
||||
"home": "Home",
|
||||
"settings": "Settings",
|
||||
"update_profile": "Update profile",
|
||||
"about": "About",
|
||||
"log_out": "Log out",
|
||||
"french": "French",
|
||||
"english": "English",
|
||||
"german": "German",
|
||||
"select_language": "Select language",
|
||||
"search_item": "Search by item",
|
||||
"search_tag": "Search by tags",
|
||||
"search_geographical": "Search by geographical zone",
|
||||
"show_date_field": "Show Date Fields",
|
||||
"hide_date_field": "Hide Date Fields",
|
||||
"no_data": "No data available",
|
||||
"search": "Search",
|
||||
"no_events": "No events available for this location.",
|
||||
"start_date": "Start date",
|
||||
"end_date": "End date",
|
||||
"failed_suggestions": "Failed to load suggestions",
|
||||
"error":"Error",
|
||||
"password_different":"Must write a different password",
|
||||
"create": "Creation",
|
||||
"user_create": "Your user created",
|
||||
"user_update": "Your user updated",
|
||||
"request_error": "Poorly constructed query",
|
||||
"incorrect_password": "Incorrect password",
|
||||
"unknown_user": "Unknown user",
|
||||
"disabled_user": "User disabled",
|
||||
"invalid_token": "Invalid token",
|
||||
"internal_error_server": "Internal error server",
|
||||
"unknown_error_auth": "Unknown error authentification",
|
||||
"required_input": "Required input",
|
||||
"create_profile": "Create profile",
|
||||
"edit_pseudo": "Edit pseudo",
|
||||
"password":"Password",
|
||||
"enter_password": "Enter the passord",
|
||||
"password_confirmed": "Password confirmed",
|
||||
"last_name": "Last name",
|
||||
"first_name": "First name",
|
||||
"email": "Mail",
|
||||
"edit_last_name": "Edit name",
|
||||
"edit_first_name": "Edit first name",
|
||||
"edit_email": "Edit email address",
|
||||
"birth_date": "Birth date",
|
||||
"edit_birth": "Edit birth date",
|
||||
"create_profile_button": "Create profile",
|
||||
"take_picture": "Take a picture",
|
||||
"error_ia": "Google AI failed to analyze picture. Retry with another one",
|
||||
"no_data_geo": "No geographical data",
|
||||
"response_status_update": "response status code update",
|
||||
"error_token": "Token error",
|
||||
"error_format": "Data format error given by AI",
|
||||
"display_picture": "Display the Picture",
|
||||
"analyze_image": "Image Analyze in progress",
|
||||
"loading_progress": "Loading progress",
|
||||
"error_event": "Event error",
|
||||
"no_future_event": "No future event",
|
||||
"error_user": "Error user",
|
||||
"empty_input": "Empty input",
|
||||
"info_event": "Event info",
|
||||
"event_already": "Event already exists",
|
||||
"picture_error": "Picture error",
|
||||
"no_picture_published": "No picture published",
|
||||
"event_update": "Event updated",
|
||||
"location": "Location",
|
||||
"add_event": "Add or Update a event",
|
||||
"edit_image": "Edit pictures",
|
||||
"name": "Name",
|
||||
"edit_event_name": "Edit event name",
|
||||
"start_time": "Start time",
|
||||
"end_time": "End time",
|
||||
"select_date": "Click to select a date",
|
||||
"select_time": "Click to select a time",
|
||||
"tag": "Tags",
|
||||
"already_tag": "You have already this tags",
|
||||
"enter_tag": "Enter a tag",
|
||||
"organizer": "Organizer",
|
||||
"already_organiser": "You have already a organizer",
|
||||
"enter_organizer": "Enter a organizer",
|
||||
"description": "Description",
|
||||
"describe_event": "Describe event",
|
||||
"add": "Add",
|
||||
"update_profile": "Update profile",
|
||||
"different_password_error": "Different password",
|
||||
"update": "Update",
|
||||
"updated": "Updated",
|
||||
"settings_updated": "Settings updated",
|
||||
"define_kilometer": "Define Kilometer",
|
||||
"settings": "Settings",
|
||||
"email_sent": "Email has been sent",
|
||||
"forgot_password": "Forgot password",
|
||||
"enter_email": "Enter the email",
|
||||
"send_email": "Send email",
|
||||
"invalid_cache": "Invalid cache",
|
||||
"item_date": "Date : ",
|
||||
"item_maps": "Maps : ",
|
||||
"item_organizer": "Organizer : ",
|
||||
"item_description": "Description : ",
|
||||
"item_tags": "Tags : ",
|
||||
"failed_auth": "Authentification failed",
|
||||
"login_page": "Login page",
|
||||
"pseudo": "Pseudo",
|
||||
"enter_existing_pseudo": "Enter a existing pseudo",
|
||||
"remembr_me": "Remember me",
|
||||
"new_user": "New User? Create Account",
|
||||
"sign_in": "Sign in",
|
||||
"map_token": "Mapbox Access Token is not available",
|
||||
"geo_disabled": "Location services are disabled.",
|
||||
"permission_denied":"Location permissions are denied.",
|
||||
"enable_permission": "Location permissions are permanently denied. Enable them in settings.",
|
||||
"no_last_position": "No last known position available.",
|
||||
"failed_location": "Failed to get user location",
|
||||
"failed_fetch": "Failed to fetch the route",
|
||||
"invalid_coordinates_symbol": "Invalid coordinates, cannot add symbol.",
|
||||
"error_symbol": "Error when adding symbol.",
|
||||
"position_not_init": "User position is not yet initialized. Try again.",
|
||||
"invalid_coordinates": "Invalid coordinates.",
|
||||
"walking": "Walking",
|
||||
"cycling": "Cycling",
|
||||
"driving": "Driving",
|
||||
"get_direction": "Get Directions and Markers",
|
||||
"missing_token": "Missing access token",
|
||||
"geocoding_error": "Error when geocoding",
|
||||
"no_found_place": "No found place",
|
||||
"upload_error": "Error when image uploading",
|
||||
"event_added": "Event added",
|
||||
"unknown_error": "Unknown error",
|
||||
"app_error": "Application error",
|
||||
"at": "at",
|
||||
"to_date": "to",
|
||||
"item_link": "Link : ",
|
||||
"item_ticket": "Ticket : ",
|
||||
"link": "Link",
|
||||
"edit_link": "Edit link name",
|
||||
"ticket": "Ticket",
|
||||
"edit_ticket": "Edit ticket link",
|
||||
"toogle_interest": "Error toggle interest",
|
||||
"error_update": "Error when updating",
|
||||
"count_interested": "Interested people number"
|
||||
}
|
146
covas_mobile/lib/l10n/app_fr.arb
Normal file
@@ -0,0 +1,146 @@
|
||||
{
|
||||
"@@locale": "fr",
|
||||
"menu_list": "Liste d'évènement",
|
||||
"language": "Langue",
|
||||
"home": "Accueil",
|
||||
"settings": "Paramètres",
|
||||
"update_profile": "Modifier profil",
|
||||
"about": "À propos",
|
||||
"log_out": "Se déconnecter",
|
||||
"french": "Français",
|
||||
"english": "Anglais",
|
||||
"german": "Allemand",
|
||||
"select_language": "Selectionne la langue",
|
||||
"search_item": "Recherche par item",
|
||||
"search_tag": "Recherche par tags",
|
||||
"search_geographical": "Recherche par zone géographique",
|
||||
"show_date_field": "Afficher champ date",
|
||||
"hide_date_field": "Cacher Date Fields",
|
||||
"no_data": "Aucune donnée disponible",
|
||||
"search": "Recherche",
|
||||
"no_events": "Pas d'évènements dans cette localisation",
|
||||
"start_date": "Date de début",
|
||||
"end_date": "Date de fin",
|
||||
"failed_suggestions": "Echec de chargement des suggestions",
|
||||
"error":"Erreur",
|
||||
"password_different":"Tu dois écrire un mot de passe different",
|
||||
"create": "Création",
|
||||
"user_create": "Votre utilisateur a été créé",
|
||||
"user_update": "Votre utilisateur a été modifié",
|
||||
"request_error": "Requête mal construite",
|
||||
"incorrect_password": "Mot de passe incorrect",
|
||||
"unknown_user": "Utilisateur inconnu",
|
||||
"disabled_user": "Utilisateur désactivé",
|
||||
"invalid_token": "Token invalide",
|
||||
"internal_error_server": "Erreur interne de serveur",
|
||||
"unknown_error_auth": "Problème d'authentification inconnu",
|
||||
"required_input": "Champ requis",
|
||||
"create_profile": "Creation profil",
|
||||
"edit_pseudo": "Modifier le pseudo",
|
||||
"password":"Mot de passe",
|
||||
"enter_password": "Entrez le password",
|
||||
"password_confirmed": "Confirmez le mot de passe",
|
||||
"last_name": "Nom",
|
||||
"first_name": "Prénom",
|
||||
"email": "Email",
|
||||
"edit_last_name": "Modifier le nom",
|
||||
"edit_first_name": "Modifier le prénom",
|
||||
"edit_email": "Modifier l'email",
|
||||
"birth_date": "Date de naissance",
|
||||
"edit_birth": "Modifier la date de naissance",
|
||||
"create_profile_button": "Créer le profil",
|
||||
"take_picture": "Take a picture",
|
||||
"error_ia": "L'IA de Google n'a pas su analyser l'image. Recommencer avec une autre",
|
||||
"no_data_geo": "Aucune donnée géographique",
|
||||
"response_status_update": "Code du statut de réponse de la modification",
|
||||
"error_token": "Erreur de token",
|
||||
"error_format": "Erreur de format de donnée fourni par l'IA",
|
||||
"display_picture": "Display the Picture",
|
||||
"analyze_image": "Analyse de l'image en cours",
|
||||
"loading_progress": "Chargement en cours",
|
||||
"error_event": "Erreur de l'évènement",
|
||||
"no_future_event": "Évènement non futur",
|
||||
"error_user": "Erreur de l'utilisateur",
|
||||
"empty_input": "Champ vide",
|
||||
"info_event": "Event info",
|
||||
"event_already": "Event already exists",
|
||||
"picture_error": "Erreur image",
|
||||
"no_picture_published": "Image non publiée",
|
||||
"event_update": "Évènement modifié",
|
||||
"location": "Lieu",
|
||||
"add_event": "Ajouter ou modifier un évènement",
|
||||
"edit_image": "Changer la photo",
|
||||
"name": "Nom",
|
||||
"edit_event_name": "Changer le nom de l'évènement",
|
||||
"start_time": "Heure de début",
|
||||
"end_time": "Heure de fin",
|
||||
"select_date": "Cliquer pour selectionner une date",
|
||||
"select_time": "Cliquer pour selectionner une heure",
|
||||
"tag": "Tags",
|
||||
"already_tag": "Tu as déjà entré ce tag",
|
||||
"enter_tag": "Entrer un tag",
|
||||
"organizer": "Organisateur",
|
||||
"already_organiser": "Tu as déjà rentré cet organisateur",
|
||||
"enter_organizer": "Entrer un organisateur",
|
||||
"description": "Description",
|
||||
"describe_event": "Décrire l'évènement",
|
||||
"add": "Ajouter",
|
||||
"update_profile": "Modifier le profil",
|
||||
"different_password_error": "Mot de passe différent",
|
||||
"update": "Mettre à jour",
|
||||
"updated": "Mis à jour",
|
||||
"settings_updated": "Paramètre mis à jour",
|
||||
"define_kilometer": "Definir un kilomètre",
|
||||
"settings": "Paramètres",
|
||||
"email_sent": "Email a été envoyé",
|
||||
"forgot_password": "Mot de passe oublié",
|
||||
"enter_email": "Entrez l'email",
|
||||
"send_email": "Send email",
|
||||
"invalid_cache": "Cache invalide",
|
||||
"item_date": "Date : ",
|
||||
"item_maps": "Carte : ",
|
||||
"item_organizer": "Organisateurs : ",
|
||||
"item_description": "Description : ",
|
||||
"item_tags": "Tags : ",
|
||||
"failed_auth": "Échec de l'authenticaton",
|
||||
"login_page": "Page d'authentification",
|
||||
"pseudo": "Pseudo",
|
||||
"enter_existing_pseudo": "Entrez un pseudo existant",
|
||||
"remembr_me": "Se souvenir de moi",
|
||||
"new_user": "Nouvel utilisateur ? Créer un compte",
|
||||
"sign_in": "Se connecter",
|
||||
"map_token": "Token d'accès de Mapbox n'est pas disponible",
|
||||
"geo_disabled": "Les services de localisation sont désactivés.",
|
||||
"permission_denied":"Les permissions de localisation sont refusées.",
|
||||
"enable_permission": "Les permissions de localisation sont toujours désactivés. Il faut les désactiver",
|
||||
"no_last_position": "Aucune position n'est pas disponible.",
|
||||
"failed_location": "Échec de récupération des données geographique",
|
||||
"failed_fetch": "Échec de récupération des routes",
|
||||
"invalid_coordinates_symbol": "Coordonnées invalides. On ne peut pas ajouter le symbole",
|
||||
"error_symbol": "Erreur lors de l'ajout du symbole",
|
||||
"position_not_init": "Coordonnées non initialisées. Essaye encore.",
|
||||
"invalid_coordinates": "Coordonnées invalides",
|
||||
"walking": "Marche",
|
||||
"cycling": "Vélo",
|
||||
"driving": "Voiture",
|
||||
"get_direction": "Get Directions and Markers",
|
||||
"missing_token": "Token d'accès manquant",
|
||||
"geocoding_error": "Erreur lors du geocodage",
|
||||
"no_found_place": "Lieu introuvable",
|
||||
"upload_error": "Erreur lors de l'upload d'image",
|
||||
"event_added": "Évènement ajouté",
|
||||
"unknown_error": "Erreur inconnue",
|
||||
"app_error": "Erreur d'application",
|
||||
"at": "à",
|
||||
"to_date": "jusqu'à",
|
||||
"item_link": "Lien : ",
|
||||
"item_ticket": "Billet : ",
|
||||
"link": "Lien",
|
||||
"edit_link": "Editer le lien",
|
||||
"ticket": "Billet",
|
||||
"edit_ticket": "Editer le lien du billet",
|
||||
"toogle_interest": "Erreur de bouton de changement",
|
||||
"error_update": "Erreur lors de la mise à jour",
|
||||
"count_interested": "Nombre de personne interessé"
|
||||
|
||||
}
|
41
covas_mobile/lib/locale_provider.dart
Normal file
@@ -0,0 +1,41 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
class LocaleProvider with ChangeNotifier {
|
||||
static const _localeKey = 'locale_code';
|
||||
|
||||
Locale _locale = const Locale('en');
|
||||
|
||||
Locale get locale => _locale;
|
||||
|
||||
LocaleProvider() {
|
||||
_loadLocale();
|
||||
}
|
||||
|
||||
Future<void> _loadLocale() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
final code = prefs.getString(_localeKey);
|
||||
if (code != null && L10n.all.contains(Locale(code))) {
|
||||
_locale = Locale(code);
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
void setLocale(Locale locale) async {
|
||||
if (!L10n.all.contains(locale)) return;
|
||||
|
||||
_locale = locale;
|
||||
notifyListeners();
|
||||
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
await prefs.setString(_localeKey, locale.languageCode);
|
||||
}
|
||||
}
|
||||
|
||||
class L10n {
|
||||
static final all = [
|
||||
const Locale('en'),
|
||||
const Locale('fr'),
|
||||
const Locale('de')
|
||||
];
|
||||
}
|
@@ -1,19 +1,35 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_mobile_ads/google_mobile_ads.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'pages/LoginDemo.dart';
|
||||
import 'locale_provider.dart'; // <-- à adapter selon ton arborescence
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'classes/notification_service.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await MobileAds.instance.initialize();
|
||||
await NotificationService.initialize();
|
||||
|
||||
runApp(MyApp());
|
||||
runApp(
|
||||
ChangeNotifierProvider(
|
||||
create: (_) => LocaleProvider(),
|
||||
child: MyApp(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final localeProvider = Provider.of<LocaleProvider>(
|
||||
context); // écoute les changements de langue
|
||||
return MaterialApp(
|
||||
debugShowCheckedModeBanner: false,
|
||||
locale: localeProvider.locale, // <-- utilise la locale courante
|
||||
supportedLocales: L10n.all,
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
home: LoginDemo(),
|
||||
);
|
||||
}
|
||||
|
@@ -13,6 +13,10 @@ import '../variable/globals.dart' as globals;
|
||||
|
||||
import '../classes/ad_helper.dart';
|
||||
import 'package:google_mobile_ads/google_mobile_ads.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; // Créé plus loin
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
@@ -95,7 +99,11 @@ class _AddProfileState extends State<AddProfile> with ShowAlertDialog {
|
||||
|
||||
if ((password.isNotEmpty) && (confirmedPassword.isNotEmpty)) {
|
||||
if (password != confirmedPassword) {
|
||||
showAlertDialog(context, "Erreur", "Mot de passe different");
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.password_different ??
|
||||
"Must write a different password");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -117,24 +125,32 @@ class _AddProfileState extends State<AddProfile> with ShowAlertDialog {
|
||||
}));
|
||||
print(responsePost.statusCode);
|
||||
if (responsePost.statusCode == 200) {
|
||||
showAlertDialog(context, "Creation", "Votre utilisateur a été créé");
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.create ?? "Creation",
|
||||
AppLocalizations.of(context)?.user_create ?? "Your user created");
|
||||
Navigator.pushReplacement(
|
||||
context, MaterialPageRoute(builder: (_) => LoginDemo()));
|
||||
return;
|
||||
}
|
||||
|
||||
final errorMessages = {
|
||||
400: "Requête mal construite",
|
||||
406: "Mot de passe incorrect",
|
||||
404: "Utilisateur inconnu",
|
||||
403: "Utilisateur désactivé",
|
||||
410: "Token invalide",
|
||||
500: "Problème interne du serveur",
|
||||
400: AppLocalizations.of(context)?.request_error ??
|
||||
"Poorly constructed query",
|
||||
406: AppLocalizations.of(context)?.incorrect_password ??
|
||||
"Incorrect password",
|
||||
404: AppLocalizations.of(context)?.unknown_user ?? "Unknown user",
|
||||
403: AppLocalizations.of(context)?.disabled_user ?? "Disabled user",
|
||||
410: AppLocalizations.of(context)?.invalid_token ?? "Invalid token",
|
||||
500: AppLocalizations.of(context)?.internal_error_server ??
|
||||
"Internal error server"
|
||||
};
|
||||
|
||||
final text = errorMessages[responsePost.statusCode] ??
|
||||
"Problème d'authentification inconnu";
|
||||
showAlertDialog(context, "Erreur serveur", text);
|
||||
AppLocalizations.of(context)?.unknown_error_auth ??
|
||||
"Unknown error auth";
|
||||
showAlertDialog(
|
||||
context, AppLocalizations.of(context)?.error ?? "Error", text);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -150,7 +166,9 @@ class _AddProfileState extends State<AddProfile> with ShowAlertDialog {
|
||||
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
String? _validateField(String? value) {
|
||||
return value!.isEmpty ? 'Champ requis' : null;
|
||||
return value!.isEmpty
|
||||
? AppLocalizations.of(context)?.required_input ?? 'Required input'
|
||||
: null;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -158,7 +176,8 @@ class _AddProfileState extends State<AddProfile> with ShowAlertDialog {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
appBar: AppBar(
|
||||
title: Text("Create profile"),
|
||||
title: Text(
|
||||
AppLocalizations.of(context)?.create_profile ?? "Create profile"),
|
||||
backgroundColor: Colors.blue,
|
||||
foregroundColor: Colors.white,
|
||||
),
|
||||
@@ -183,7 +202,8 @@ class _AddProfileState extends State<AddProfile> with ShowAlertDialog {
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Pseudo',
|
||||
hintText: 'Modifier le pseudo'),
|
||||
hintText: AppLocalizations.of(context)?.edit_pseudo ??
|
||||
'Edit pseudo'),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
@@ -196,8 +216,11 @@ class _AddProfileState extends State<AddProfile> with ShowAlertDialog {
|
||||
obscureText: true,
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Mot de passe',
|
||||
hintText: 'Entrez le mot de passe'),
|
||||
labelText: AppLocalizations.of(context)?.password ??
|
||||
'Password',
|
||||
hintText:
|
||||
AppLocalizations.of(context)?.enter_password ??
|
||||
'Enter the password'),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
@@ -209,9 +232,14 @@ class _AddProfileState extends State<AddProfile> with ShowAlertDialog {
|
||||
validator: (value) => _validateField(value),
|
||||
obscureText: true,
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Confirmez le mot de passe',
|
||||
hintText: 'Confirmez le mot de passe'),
|
||||
border: OutlineInputBorder(),
|
||||
labelText:
|
||||
AppLocalizations.of(context)?.password_confirmed ??
|
||||
'Password confirmed',
|
||||
hintText:
|
||||
AppLocalizations.of(context)?.password_confirmed ??
|
||||
'Password confirmed',
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
@@ -223,8 +251,11 @@ class _AddProfileState extends State<AddProfile> with ShowAlertDialog {
|
||||
validator: (value) => _validateField(value),
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Nom',
|
||||
hintText: 'Modifier le nom'),
|
||||
labelText: AppLocalizations.of(context)?.last_name ??
|
||||
'Last name',
|
||||
hintText:
|
||||
AppLocalizations.of(context)?.edit_last_name ??
|
||||
'Edit last name'),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
@@ -236,8 +267,11 @@ class _AddProfileState extends State<AddProfile> with ShowAlertDialog {
|
||||
validator: (value) => _validateField(value),
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Prénom',
|
||||
hintText: 'Modifier le prénom'),
|
||||
labelText: AppLocalizations.of(context)?.first_name ??
|
||||
'First name',
|
||||
hintText:
|
||||
AppLocalizations.of(context)?.edit_first_name ??
|
||||
'Edit first name'),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
@@ -249,8 +283,10 @@ class _AddProfileState extends State<AddProfile> with ShowAlertDialog {
|
||||
validator: (value) => _validateField(value),
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Email',
|
||||
hintText: 'Modifier l\'adresse mail'),
|
||||
labelText:
|
||||
AppLocalizations.of(context)?.email ?? 'Email',
|
||||
hintText: AppLocalizations.of(context)?.edit_email ??
|
||||
'Edit email'),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
@@ -263,8 +299,10 @@ class _AddProfileState extends State<AddProfile> with ShowAlertDialog {
|
||||
validator: (value) => _validateField(value),
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Date de naissance',
|
||||
hintText: 'Cliquez ici pour selectionner une date'),
|
||||
labelText: AppLocalizations.of(context)?.birth_date ??
|
||||
'Birth date',
|
||||
hintText: AppLocalizations.of(context)?.edit_birth ??
|
||||
'Edit birth date'),
|
||||
onTap: () => onTapFunctionDatePicker(context: context)),
|
||||
),
|
||||
SizedBox(
|
||||
@@ -283,7 +321,8 @@ class _AddProfileState extends State<AddProfile> with ShowAlertDialog {
|
||||
}
|
||||
},
|
||||
child: Text(
|
||||
'Créer le profil',
|
||||
AppLocalizations.of(context)?.create_profile_button ??
|
||||
"Create profile",
|
||||
style: TextStyle(color: Colors.white, fontSize: 25),
|
||||
),
|
||||
),
|
||||
|
@@ -7,6 +7,10 @@ import 'DisplayPictureScreen.dart';
|
||||
import 'package:camera/camera.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../classes/auth_service.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; // Créé plus loin
|
||||
|
||||
Future<void> main() async {
|
||||
// Ensure that plugin services are initialized so that `availableCameras()`
|
||||
@@ -92,7 +96,9 @@ class CameraState extends State<Camera> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: const Text('Take a picture')),
|
||||
appBar: AppBar(
|
||||
title: Text(AppLocalizations.of(context)?.take_picture ??
|
||||
"Take a picture")),
|
||||
// You must wait until the controller is initialized before displaying the
|
||||
// camera preview. Use a FutureBuilder to display a loading spinner until the
|
||||
// controller has finished initializing.
|
||||
|
@@ -8,6 +8,10 @@ import 'EditEvent.dart';
|
||||
import 'package:camera/camera.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../classes/auth_service.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; // Créé
|
||||
|
||||
Future<void> main() async {
|
||||
// Ensure that plugin services are initialized so that `availableCameras()`
|
||||
@@ -94,7 +98,9 @@ class CameraEditState extends State<CameraEdit> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: const Text('Take a picture')),
|
||||
appBar: AppBar(
|
||||
title: Text(AppLocalizations.of(context)?.take_picture ??
|
||||
'Take a picture')),
|
||||
// You must wait until the controller is initialized before displaying the
|
||||
// camera preview. Use a FutureBuilder to display a loading spinner until the
|
||||
// controller has finished initializing.
|
||||
|
@@ -17,6 +17,10 @@ import '../classes/MyDrawer.dart';
|
||||
import '../classes/ad_helper.dart';
|
||||
import 'package:google_mobile_ads/google_mobile_ads.dart';
|
||||
import '../classes/auth_service.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; // Créé
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
@@ -98,8 +102,11 @@ class DisplayPictureScreenState extends State<DisplayPictureScreen>
|
||||
|
||||
Future<void> displayError(String e) async {
|
||||
print("problem gemini : ${e}");
|
||||
showAlertDialog(context, 'Error IA',
|
||||
"L'IA de Google n'a pas su analyser l'image. Recommecer avec une autre");
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? 'Error',
|
||||
AppLocalizations.of(context)?.error_ia ??
|
||||
'Google AI failed to analyze picture. Retry with another one');
|
||||
}
|
||||
|
||||
void _showErrorDialog(BuildContext context, String title, String message) {
|
||||
@@ -154,7 +161,10 @@ class DisplayPictureScreenState extends State<DisplayPictureScreen>
|
||||
final location = await _fetchGeolocation(place);
|
||||
if (location == null) {
|
||||
_showErrorDialog(
|
||||
context, "Erreur serveur", "Aucune donnée geographique");
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? 'Error',
|
||||
AppLocalizations.of(context)?.no_data_geo ??
|
||||
'No geographical data');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -181,15 +191,23 @@ class DisplayPictureScreenState extends State<DisplayPictureScreen>
|
||||
builder: (_) => ItemMenu(title: events[0]["id"])));
|
||||
}
|
||||
} else {
|
||||
showAlertDialog(context, 'Erreur de reponse',
|
||||
"response status code update : ${response.statusCode}");
|
||||
String error = AppLocalizations.of(context)?.response_status_update ??
|
||||
'Response status update : ${response.statusCode}';
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? 'Error',
|
||||
"${error} : ${response.statusCode}");
|
||||
}
|
||||
} else {
|
||||
showAlertDialog(context, "Erreur de reponse", "Erreur de token");
|
||||
showAlertDialog(context, AppLocalizations.of(context)?.error ?? 'Error',
|
||||
AppLocalizations.of(context)?.error_token ?? "Token error");
|
||||
}
|
||||
} catch (e) {
|
||||
showAlertDialog(
|
||||
context, "Erreur IA", "Erreur de format de donnée fourni par l'IA");
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.error_format ??
|
||||
"Data format error given by AI");
|
||||
}
|
||||
|
||||
//showDescImageAddDialog(context, message);
|
||||
@@ -217,7 +235,9 @@ class DisplayPictureScreenState extends State<DisplayPictureScreen>
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: const Text('Display the Picture')),
|
||||
appBar: AppBar(
|
||||
title: Text(AppLocalizations.of(context)?.display_picture ??
|
||||
"Display The Picture")),
|
||||
// The image is stored as a file on the device. Use the `Image.file`
|
||||
// constructor with the given path to display the image.
|
||||
drawer: MyDrawer(),
|
||||
@@ -233,12 +253,15 @@ class DisplayPictureScreenState extends State<DisplayPictureScreen>
|
||||
width: _bannerAd!.size.width.toDouble(),
|
||||
child: AdWidget(ad: _bannerAd!)),
|
||||
Text(
|
||||
'Analyse de l\'image en cours',
|
||||
AppLocalizations.of(context)?.analyze_image ??
|
||||
'Image analyze in progress',
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
),
|
||||
CircularProgressIndicator(
|
||||
value: controller.value,
|
||||
semanticsLabel: 'Loading progress',
|
||||
semanticsLabel:
|
||||
AppLocalizations.of(context)?.loading_progress ??
|
||||
'Loading progress',
|
||||
),
|
||||
])));
|
||||
}
|
||||
|
@@ -22,6 +22,10 @@ import '../variable/globals.dart' as globals;
|
||||
import '../classes/ad_helper.dart';
|
||||
import 'package:google_mobile_ads/google_mobile_ads.dart';
|
||||
import '../classes/auth_service.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; // Créé
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
@@ -62,6 +66,8 @@ class _EditEventState extends State<EditEvent>
|
||||
|
||||
TextEditingController inputName = TextEditingController();
|
||||
|
||||
TextEditingController inputTicket = TextEditingController();
|
||||
TextEditingController inputLink = TextEditingController();
|
||||
TextEditingController inputDate = TextEditingController();
|
||||
TextEditingController inputDesc = TextEditingController();
|
||||
|
||||
@@ -166,13 +172,19 @@ class _EditEventState extends State<EditEvent>
|
||||
|
||||
Future<void> _updateEvent(BuildContext context) async {
|
||||
if (!_isEventInFuture()) {
|
||||
_showErrorDialog(context, "Erreur evenement", "Evenement non futur");
|
||||
_showErrorDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error_event ?? "Event error",
|
||||
AppLocalizations.of(context)?.no_future_event ?? "No future event");
|
||||
return;
|
||||
}
|
||||
|
||||
final accessToken = await _getAccessToken();
|
||||
if (accessToken.isEmpty) {
|
||||
_showErrorDialog(context, "Erreur utilisateur", "Champ vide");
|
||||
_showErrorDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error_user ?? "User error",
|
||||
AppLocalizations.of(context)?.empty_input ?? "Empty input");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -181,27 +193,41 @@ class _EditEventState extends State<EditEvent>
|
||||
final geolocation = await _fetchGeolocation();
|
||||
if (geolocation == null) {
|
||||
_showErrorDialog(
|
||||
context, "Erreur serveur", "Aucune donnée geographique");
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.no_data_geo ??
|
||||
"No geographical data");
|
||||
return;
|
||||
}
|
||||
|
||||
if (await _isDuplicateEvent(accessToken, geolocation)) {
|
||||
_showErrorDialog(context, "Info evenement", "Evenement deja existant");
|
||||
_showErrorDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.info_event ?? "Event info",
|
||||
AppLocalizations.of(context)?.event_already ??
|
||||
"Event already exists");
|
||||
return;
|
||||
}
|
||||
|
||||
if (widget.imgPath.isNotEmpty) {
|
||||
imgUrl = await _uploadImage(widget.imgPath);
|
||||
if (imgUrl.isEmpty) {
|
||||
_showErrorDialog(context, "Erreur image", "Image non postée");
|
||||
_showErrorDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.picture_error ?? "Error picture",
|
||||
AppLocalizations.of(context)?.no_picture_published ??
|
||||
"No picture published");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
await _updateEventData(accessToken, geolocation);
|
||||
showEventDialog(context, "Evenement ${inputName.text} modifie");
|
||||
String message =
|
||||
AppLocalizations.of(context)?.event_update ?? "Event updated";
|
||||
showEventDialog(context, "${message} : ${inputName.text}");
|
||||
} catch (e) {
|
||||
_showErrorDialog(context, "Erreur serveur", "$e");
|
||||
_showErrorDialog(
|
||||
context, AppLocalizations.of(context)?.error ?? "Error", "$e");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,6 +313,8 @@ class _EditEventState extends State<EditEvent>
|
||||
'longitude': location['lng'],
|
||||
'description': inputDesc.text,
|
||||
"imgUrl": imgUrl,
|
||||
'link': inputLink.text,
|
||||
'ticket': inputTicket.text,
|
||||
"tags": List<String>.from(_stringTagController.getTags as List)
|
||||
}));
|
||||
|
||||
@@ -297,15 +325,22 @@ class _EditEventState extends State<EditEvent>
|
||||
|
||||
void _handleErrorResponse(BuildContext context, int statusCode) {
|
||||
final messages = {
|
||||
400: "Requête mal construite",
|
||||
406: "Mot de passe incorrect",
|
||||
404: "Utilisateur inconnu",
|
||||
403: "Utilisateur désactivé",
|
||||
410: "Token invalide",
|
||||
500: "Problème interne du serveur"
|
||||
400: AppLocalizations.of(context)?.request_error ??
|
||||
"Poorly constructed query",
|
||||
406: AppLocalizations.of(context)?.incorrect_password ??
|
||||
"Incorrect password",
|
||||
404: AppLocalizations.of(context)?.unknown_user ?? "Unknown user",
|
||||
403: AppLocalizations.of(context)?.disabled_user ?? "Disabled user",
|
||||
410: AppLocalizations.of(context)?.invalid_token ?? "Invalid token",
|
||||
500: AppLocalizations.of(context)?.internal_error_server ??
|
||||
"Internal error server"
|
||||
};
|
||||
_showErrorDialog(context, "Erreur serveur",
|
||||
messages[statusCode] ?? "Problème d'authentification inconnu");
|
||||
_showErrorDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
messages[statusCode] ??
|
||||
AppLocalizations.of(context)?.unknown_error_auth ??
|
||||
"Unknown error auth");
|
||||
}
|
||||
|
||||
void _showErrorDialog(BuildContext context, String title, String message) {
|
||||
@@ -323,6 +358,8 @@ class _EditEventState extends State<EditEvent>
|
||||
});
|
||||
});
|
||||
inputName.text = widget.events!.name ?? "";
|
||||
inputTicket.text = widget.events!.ticket ?? "";
|
||||
inputLink.text = widget.events!.link ?? "";
|
||||
startDatepicker.text = DateFormat("dd/MM/yyyy")
|
||||
.format(DateTime.parse(
|
||||
widget.events!.startDate ?? DateTime.now().toString()))
|
||||
@@ -349,7 +386,9 @@ class _EditEventState extends State<EditEvent>
|
||||
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
String? _validateField(String? value) {
|
||||
return value!.isEmpty ? 'Champ requis' : null;
|
||||
return value!.isEmpty
|
||||
? AppLocalizations.of(context)?.required_input ?? "Required input"
|
||||
: null;
|
||||
}
|
||||
|
||||
Future<void> searchSuggestions(String input) async {
|
||||
@@ -360,11 +399,9 @@ class _EditEventState extends State<EditEvent>
|
||||
'https://api.mapbox.com/geocoding/v5/mapbox.places/${input}.json?access_token=${mapboxAccessToken}&types=poi,address,place';
|
||||
var encoded = Uri.encodeFull(url);
|
||||
final response = await http.get(Uri.parse(encoded));
|
||||
print("response code suggesttion : ${response.statusCode}");
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
final data = json.decode(response.body);
|
||||
print("data suggestion : ${data}");
|
||||
setState(() {
|
||||
suggestions = (data['features'] as List)
|
||||
.map((feature) => {
|
||||
@@ -389,7 +426,7 @@ class _EditEventState extends State<EditEvent>
|
||||
TextField(
|
||||
controller: inputGeo,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Lieu',
|
||||
labelText: AppLocalizations.of(context)?.location ?? "Location",
|
||||
border: OutlineInputBorder(),
|
||||
suffixIcon: IconButton(
|
||||
icon: const Icon(Icons.clear),
|
||||
@@ -459,7 +496,8 @@ class _EditEventState extends State<EditEvent>
|
||||
backgroundColor: Colors.white,
|
||||
drawer: MyDrawer(),
|
||||
appBar: AppBar(
|
||||
title: Text("Add or Update a event"),
|
||||
title: Text(AppLocalizations.of(context)?.add_event ??
|
||||
"Add or Update a event"),
|
||||
backgroundColor: Colors.blue,
|
||||
foregroundColor: Colors.white,
|
||||
),
|
||||
@@ -516,7 +554,8 @@ class _EditEventState extends State<EditEvent>
|
||||
child: ElevatedButton.icon(
|
||||
onPressed: popCamera,
|
||||
icon: Icon(Icons.edit, size: 16), // Edit icon
|
||||
label: Text("Edit Image"), // Button text
|
||||
label: Text(AppLocalizations.of(context)?.edit_image ??
|
||||
"Edit pictures"), // Button text
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.blue, // Button color
|
||||
foregroundColor: Colors.white, // Text color
|
||||
@@ -533,8 +572,10 @@ class _EditEventState extends State<EditEvent>
|
||||
validator: (value) => _validateField(value),
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Nom',
|
||||
hintText: 'Modifier le nom de l\'évènement'),
|
||||
labelText: AppLocalizations.of(context)?.name ?? "Name",
|
||||
hintText:
|
||||
AppLocalizations.of(context)?.edit_event_name ??
|
||||
"Edit event name"),
|
||||
),
|
||||
),
|
||||
_buildGeographicalZoneSearchField(),
|
||||
@@ -548,8 +589,10 @@ class _EditEventState extends State<EditEvent>
|
||||
validator: (value) => _validateField(value),
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Date de debut',
|
||||
hintText: 'Cliquez ici pour selectionner une date'),
|
||||
labelText: AppLocalizations.of(context)?.start_date ??
|
||||
"Start date",
|
||||
hintText: AppLocalizations.of(context)?.select_date ??
|
||||
"Click to select a date"),
|
||||
onTap: () => onTapFunctionDatePicker(
|
||||
context: context, position: "start")),
|
||||
),
|
||||
@@ -563,8 +606,10 @@ class _EditEventState extends State<EditEvent>
|
||||
validator: (value) => _validateField(value),
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Heure de debut',
|
||||
hintText: 'Cliquez ici pour selectionner une heure'),
|
||||
labelText: AppLocalizations.of(context)?.start_time ??
|
||||
"Start time",
|
||||
hintText: AppLocalizations.of(context)?.select_time ??
|
||||
"Click to select a time"),
|
||||
onTap: () => onTapFunctionTimePicker(
|
||||
context: context, position: "start")),
|
||||
),
|
||||
@@ -578,8 +623,10 @@ class _EditEventState extends State<EditEvent>
|
||||
validator: (value) => _validateField(value),
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Date de fin',
|
||||
hintText: 'Cliquez ici pour selectionner une date'),
|
||||
labelText: AppLocalizations.of(context)?.end_date ??
|
||||
"End date",
|
||||
hintText: AppLocalizations.of(context)?.select_time ??
|
||||
"Click to select a date"),
|
||||
onTap: () => onTapFunctionDatePicker(
|
||||
context: context, position: "end")),
|
||||
),
|
||||
@@ -593,18 +640,50 @@ class _EditEventState extends State<EditEvent>
|
||||
validator: (value) => _validateField(value),
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Heure de fin',
|
||||
hintText: 'Cliquez ici pour selectionner une heure'),
|
||||
labelText: AppLocalizations.of(context)?.end_time ??
|
||||
"End time",
|
||||
hintText: AppLocalizations.of(context)?.select_time ??
|
||||
"Click to select a time"),
|
||||
onTap: () => onTapFunctionTimePicker(
|
||||
context: context, position: "end")),
|
||||
),
|
||||
Padding(
|
||||
//padding: const EdgeInsets.only(left:15.0,right: 15.0,top:0,bottom: 0),
|
||||
padding: const EdgeInsets.only(
|
||||
left: 15.0, right: 15.0, top: 15, bottom: 0),
|
||||
child: TextFormField(
|
||||
controller: inputLink,
|
||||
validator: (value) => _validateField(value),
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: AppLocalizations.of(context)?.link ?? "Link",
|
||||
hintText: AppLocalizations.of(context)?.edit_link ??
|
||||
"Edit link event"),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
//padding: const EdgeInsets.only(left:15.0,right: 15.0,top:0,bottom: 0),
|
||||
padding: const EdgeInsets.only(
|
||||
left: 15.0, right: 15.0, top: 15, bottom: 0),
|
||||
child: TextFormField(
|
||||
controller: inputTicket,
|
||||
validator: (value) => _validateField(value),
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText:
|
||||
AppLocalizations.of(context)?.ticket ?? "Ticket",
|
||||
hintText: AppLocalizations.of(context)?.edit_ticket ??
|
||||
"Edit ticket link"),
|
||||
),
|
||||
),
|
||||
TextFieldTags<String>(
|
||||
textfieldTagsController: _stringTagController,
|
||||
initialTags: initialTags,
|
||||
textSeparators: const [' ', ','],
|
||||
validator: (String tag) {
|
||||
if (_stringTagController.getTags!.contains(tag)) {
|
||||
return 'Tu as deja rentre ce tag';
|
||||
return AppLocalizations.of(context)?.already_tag ??
|
||||
"You have already entered this tag";
|
||||
}
|
||||
return null;
|
||||
},
|
||||
@@ -619,10 +698,12 @@ class _EditEventState extends State<EditEvent>
|
||||
onSubmitted: inputFieldValues.onTagSubmitted,
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Tags',
|
||||
labelText:
|
||||
AppLocalizations.of(context)?.tag ?? 'Tags',
|
||||
hintText: inputFieldValues.tags.isNotEmpty
|
||||
? ''
|
||||
: "Enter tag...",
|
||||
: AppLocalizations.of(context)?.enter_tag ??
|
||||
"Enter tag...",
|
||||
errorText: inputFieldValues.error,
|
||||
prefixIcon: inputFieldValues.tags.isNotEmpty
|
||||
? SingleChildScrollView(
|
||||
@@ -699,7 +780,9 @@ class _EditEventState extends State<EditEvent>
|
||||
textSeparators: const [','],
|
||||
validator: (String tag) {
|
||||
if (_stringOrgaController.getTags!.contains(tag)) {
|
||||
return 'Cet organisateur est déjà rentré';
|
||||
return AppLocalizations.of(context)
|
||||
?.already_organiser ??
|
||||
"You have already entered this organizer";
|
||||
}
|
||||
return null;
|
||||
},
|
||||
@@ -714,10 +797,14 @@ class _EditEventState extends State<EditEvent>
|
||||
onSubmitted: inputFieldValues.onTagSubmitted,
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Organisateurs',
|
||||
labelText:
|
||||
AppLocalizations.of(context)?.organizer ??
|
||||
"Organizer",
|
||||
hintText: inputFieldValues.tags.isNotEmpty
|
||||
? ''
|
||||
: "Enter un organisateur...",
|
||||
: AppLocalizations.of(context)
|
||||
?.enter_organizer ??
|
||||
"Enter a organizer",
|
||||
errorText: inputFieldValues.error,
|
||||
prefixIcon: inputFieldValues.tags.isNotEmpty
|
||||
? SingleChildScrollView(
|
||||
@@ -798,8 +885,11 @@ class _EditEventState extends State<EditEvent>
|
||||
maxLines: 10,
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Description',
|
||||
hintText: 'Décrire l\'evènement'),
|
||||
labelText: AppLocalizations.of(context)?.description ??
|
||||
'Description',
|
||||
hintText:
|
||||
AppLocalizations.of(context)?.describe_event ??
|
||||
'Describe event'),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
@@ -818,7 +908,7 @@ class _EditEventState extends State<EditEvent>
|
||||
}
|
||||
},
|
||||
child: Text(
|
||||
'Ajouter',
|
||||
AppLocalizations.of(context)?.add ?? 'Add',
|
||||
style: TextStyle(color: Colors.white, fontSize: 25),
|
||||
),
|
||||
),
|
||||
|
@@ -18,6 +18,10 @@ import '../variable/globals.dart' as globals;
|
||||
import '../classes/ad_helper.dart';
|
||||
import 'package:google_mobile_ads/google_mobile_ads.dart';
|
||||
import '../classes/auth_service.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; // Créé
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
@@ -104,7 +108,11 @@ class _EditProfileState extends State<EditProfile>
|
||||
|
||||
if ((password.isNotEmpty) && (confirmedPassword.isNotEmpty)) {
|
||||
if (password != confirmedPassword) {
|
||||
showAlertDialog(context, "Erreur", "Mot de passe different");
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.different_password_error ??
|
||||
"Different password");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -131,24 +139,29 @@ class _EditProfileState extends State<EditProfile>
|
||||
}));
|
||||
print(responsePut.statusCode);
|
||||
if (responsePut.statusCode == 200) {
|
||||
showEventDialog(context, "Votre utilisateur a été modifié");
|
||||
showEventDialog(context,
|
||||
AppLocalizations.of(context)?.user_update ?? "Your user updated");
|
||||
Navigator.pushReplacement(
|
||||
context, MaterialPageRoute(builder: (_) => EditProfile()));
|
||||
return;
|
||||
}
|
||||
|
||||
final errorMessages = {
|
||||
400: "Requête mal construite",
|
||||
406: "Mot de passe incorrect",
|
||||
404: "Utilisateur inconnu",
|
||||
403: "Utilisateur désactivé",
|
||||
410: "Token invalide",
|
||||
500: "Problème interne du serveur",
|
||||
final messages = {
|
||||
400: AppLocalizations.of(context)?.request_error ??
|
||||
"Poorly constructed query",
|
||||
406: AppLocalizations.of(context)?.incorrect_password ??
|
||||
"Incorrect password",
|
||||
404: AppLocalizations.of(context)?.unknown_user ?? "Unknown user",
|
||||
403: AppLocalizations.of(context)?.disabled_user ?? "Disabled user",
|
||||
410: AppLocalizations.of(context)?.invalid_token ?? "Invalid token",
|
||||
500: AppLocalizations.of(context)?.internal_error_server ??
|
||||
"Internal error server"
|
||||
};
|
||||
|
||||
final text = errorMessages[responsePut.statusCode] ??
|
||||
"Problème d'authentification inconnu";
|
||||
showAlertDialog(context, "Erreur serveur", text);
|
||||
final text = messages[responsePut.statusCode] ??
|
||||
AppLocalizations.of(context)?.unknown_error_auth ??
|
||||
"Unknown error auth";
|
||||
showAlertDialog(
|
||||
context, AppLocalizations.of(context)?.error ?? "Error", text);
|
||||
} else {
|
||||
Navigator.pushReplacement(
|
||||
context, MaterialPageRoute(builder: (_) => LoginDemo()));
|
||||
@@ -180,18 +193,22 @@ class _EditProfileState extends State<EditProfile>
|
||||
return;
|
||||
}
|
||||
|
||||
final errorMessages = {
|
||||
400: "Requête mal construite",
|
||||
406: "Mot de passe incorrect",
|
||||
404: "Utilisateur inconnu",
|
||||
403: "Utilisateur désactivé",
|
||||
410: "Token invalide",
|
||||
500: "Problème interne du serveur",
|
||||
final messages = {
|
||||
400: AppLocalizations.of(context)?.request_error ??
|
||||
"Poorly constructed query",
|
||||
406: AppLocalizations.of(context)?.incorrect_password ??
|
||||
"Incorrect password",
|
||||
404: AppLocalizations.of(context)?.unknown_user ?? "Unknown user",
|
||||
403: AppLocalizations.of(context)?.disabled_user ?? "Disabled user",
|
||||
410: AppLocalizations.of(context)?.invalid_token ?? "Invalid token",
|
||||
500: AppLocalizations.of(context)?.internal_error_server ??
|
||||
"Internal error server"
|
||||
};
|
||||
|
||||
final text = errorMessages[responseGet.statusCode] ??
|
||||
"Problème d'authentification inconnu";
|
||||
showAlertDialog(context, "Erreur serveur", text);
|
||||
final text = messages[responseGet.statusCode] ??
|
||||
AppLocalizations.of(context)?.unknown_error_auth ??
|
||||
"Unknown error auth";
|
||||
showAlertDialog(
|
||||
context, AppLocalizations.of(context)?.error ?? "Error", text);
|
||||
} else {
|
||||
Navigator.pushReplacement(
|
||||
context, MaterialPageRoute(builder: (_) => LoginDemo()));
|
||||
@@ -213,7 +230,9 @@ class _EditProfileState extends State<EditProfile>
|
||||
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
String? _validateField(String? value) {
|
||||
return value!.isEmpty ? 'Champ requis' : null;
|
||||
return value!.isEmpty
|
||||
? AppLocalizations.of(context)?.required_input ?? "Required input"
|
||||
: null;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -221,7 +240,8 @@ class _EditProfileState extends State<EditProfile>
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
appBar: AppBar(
|
||||
title: Text("Update profile"),
|
||||
title: Text(
|
||||
AppLocalizations.of(context)?.update_profile ?? "Update profile"),
|
||||
backgroundColor: Colors.blue,
|
||||
foregroundColor: Colors.white,
|
||||
),
|
||||
@@ -246,8 +266,9 @@ class _EditProfileState extends State<EditProfile>
|
||||
validator: (value) => _validateField(value),
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Pseudo',
|
||||
hintText: 'Modifier le pseudo'),
|
||||
labelText: AppLocalizations.of(context)?.name,
|
||||
hintText: AppLocalizations.of(context)?.edit_pseudo ??
|
||||
"Edit pseudo"),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
@@ -259,8 +280,11 @@ class _EditProfileState extends State<EditProfile>
|
||||
obscureText: true,
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Mot de passe',
|
||||
hintText: 'Entrez le mot de passe'),
|
||||
labelText: AppLocalizations.of(context)?.password ??
|
||||
"Password",
|
||||
hintText:
|
||||
AppLocalizations.of(context)?.enter_password ??
|
||||
"Enter a password"),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
@@ -272,8 +296,12 @@ class _EditProfileState extends State<EditProfile>
|
||||
obscureText: true,
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Confirmez le mot de passe',
|
||||
hintText: 'Confirmez le mot de passe'),
|
||||
labelText:
|
||||
AppLocalizations.of(context)?.password_confirmed ??
|
||||
"Must confirm password",
|
||||
hintText:
|
||||
AppLocalizations.of(context)?.password_confirmed ??
|
||||
"Must confirm password"),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
@@ -285,8 +313,11 @@ class _EditProfileState extends State<EditProfile>
|
||||
validator: (value) => _validateField(value),
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Nom',
|
||||
hintText: 'Modifier le nom'),
|
||||
labelText: AppLocalizations.of(context)?.last_name ??
|
||||
"Last name",
|
||||
hintText:
|
||||
AppLocalizations.of(context)?.edit_last_name ??
|
||||
"Edit last name"),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
@@ -298,8 +329,11 @@ class _EditProfileState extends State<EditProfile>
|
||||
validator: (value) => _validateField(value),
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Prénom',
|
||||
hintText: 'Modifier le prénom'),
|
||||
labelText: AppLocalizations.of(context)?.first_name ??
|
||||
"First name",
|
||||
hintText:
|
||||
AppLocalizations.of(context)?.edit_first_name ??
|
||||
"Edit first name"),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
@@ -311,8 +345,10 @@ class _EditProfileState extends State<EditProfile>
|
||||
validator: (value) => _validateField(value),
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Email',
|
||||
hintText: 'Modifier l\'adresse mail'),
|
||||
labelText:
|
||||
AppLocalizations.of(context)?.email ?? "Email",
|
||||
hintText: AppLocalizations.of(context)?.edit_email ??
|
||||
"Edit email"),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
@@ -325,8 +361,9 @@ class _EditProfileState extends State<EditProfile>
|
||||
validator: (value) => _validateField(value),
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Date de naissance',
|
||||
hintText: 'Cliquez ici pour selectionner une date'),
|
||||
labelText: AppLocalizations.of(context)?.birth_date,
|
||||
hintText: AppLocalizations.of(context)?.edit_birth ??
|
||||
"Click to select a birth date"),
|
||||
onTap: () => onTapFunctionDatePicker(context: context)),
|
||||
),
|
||||
SizedBox(
|
||||
@@ -345,7 +382,8 @@ class _EditProfileState extends State<EditProfile>
|
||||
}
|
||||
},
|
||||
child: Text(
|
||||
'Modifier le profil',
|
||||
AppLocalizations.of(context)?.update_profile ??
|
||||
"Update profile ",
|
||||
style: TextStyle(color: Colors.white, fontSize: 25),
|
||||
),
|
||||
),
|
||||
|
@@ -14,6 +14,11 @@ import '../classes/ad_helper.dart';
|
||||
import 'package:google_mobile_ads/google_mobile_ads.dart';
|
||||
import '../classes/auth_service.dart';
|
||||
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; // Créé
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await MobileAds.instance.initialize();
|
||||
@@ -56,7 +61,10 @@ class _EditProfileState extends State<EditSettings>
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
if (kilometer != null) {
|
||||
prefs.setDouble("kilometer", kilometer?.toDouble() ?? 50);
|
||||
showAlertDialog(context, "Update", "Mise à jour des paramètres");
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.updated ?? "Updated",
|
||||
AppLocalizations.of(context)?.settings_updated ?? "Settings updated");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +86,7 @@ class _EditProfileState extends State<EditSettings>
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
appBar: AppBar(
|
||||
title: Text("Settings"),
|
||||
title: Text(AppLocalizations.of(context)?.settings ?? "Settings"),
|
||||
backgroundColor: Colors.blue,
|
||||
foregroundColor: Colors.white,
|
||||
),
|
||||
@@ -103,7 +111,9 @@ class _EditProfileState extends State<EditSettings>
|
||||
child: DropdownButtonFormField<int>(
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Define kilometer',
|
||||
labelText:
|
||||
AppLocalizations.of(context)?.define_kilometer ??
|
||||
'Define kilometer',
|
||||
),
|
||||
value:
|
||||
kilometer, // Set the initial selected value here, or leave as `null` if unselected.
|
||||
@@ -147,7 +157,7 @@ class _EditProfileState extends State<EditSettings>
|
||||
child: TextButton(
|
||||
onPressed: () {},
|
||||
child: Text(
|
||||
'Mettre à jour',
|
||||
AppLocalizations.of(context)?.update ?? "Update",
|
||||
style: TextStyle(color: Colors.white, fontSize: 25),
|
||||
),
|
||||
),
|
||||
|
@@ -11,6 +11,11 @@ import '../classes/alert.dart';
|
||||
|
||||
import '../variable/globals.dart' as globals;
|
||||
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; //
|
||||
|
||||
void main() {
|
||||
runApp(MyApp());
|
||||
}
|
||||
@@ -74,22 +79,32 @@ class _PasswordForgotState extends State<PasswordForgot> with ShowAlertDialog {
|
||||
}));
|
||||
print(responsePost.statusCode);
|
||||
if (responsePost.statusCode == 200) {
|
||||
showAlertDialog(context, "Creation", "Un email a été envoyé à ${email}");
|
||||
String message =
|
||||
AppLocalizations.of(context)?.email_sent ?? "Email has been sent";
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.create ?? "Creation",
|
||||
"${message} : ${email}");
|
||||
return;
|
||||
}
|
||||
|
||||
final errorMessages = {
|
||||
400: "Requête mal construite",
|
||||
406: "Mot de passe incorrect",
|
||||
404: "Utilisateur inconnu",
|
||||
403: "Utilisateur désactivé",
|
||||
410: "Token invalide",
|
||||
500: "Problème interne du serveur",
|
||||
final messages = {
|
||||
400: AppLocalizations.of(context)?.request_error ??
|
||||
"Poorly constructed query",
|
||||
406: AppLocalizations.of(context)?.incorrect_password ??
|
||||
"Incorrect password",
|
||||
404: AppLocalizations.of(context)?.unknown_user ?? "Unknown user",
|
||||
403: AppLocalizations.of(context)?.disabled_user ?? "Disabled user",
|
||||
410: AppLocalizations.of(context)?.invalid_token ?? "Invalid token",
|
||||
500: AppLocalizations.of(context)?.internal_error_server ??
|
||||
"Internal error server"
|
||||
};
|
||||
|
||||
final text = errorMessages[responsePost.statusCode] ??
|
||||
"Problème d'authentification inconnu";
|
||||
showAlertDialog(context, "Erreur serveur", text);
|
||||
final text = messages[responsePost.statusCode] ??
|
||||
AppLocalizations.of(context)?.unknown_error_auth ??
|
||||
"Unknown error auth";
|
||||
showAlertDialog(
|
||||
context, AppLocalizations.of(context)?.error ?? "Error", text);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -107,7 +122,8 @@ class _PasswordForgotState extends State<PasswordForgot> with ShowAlertDialog {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
appBar: AppBar(
|
||||
title: Text("Mot de passe oublie"),
|
||||
title: Text(AppLocalizations.of(context)?.forgot_password ??
|
||||
"Forgot password"),
|
||||
backgroundColor: Colors.blue,
|
||||
foregroundColor: Colors.white,
|
||||
),
|
||||
@@ -125,8 +141,10 @@ class _PasswordForgotState extends State<PasswordForgot> with ShowAlertDialog {
|
||||
validator: (value) => _validateField(value),
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Email',
|
||||
hintText: 'Modifier l\'adresse mail'),
|
||||
labelText:
|
||||
AppLocalizations.of(context)?.email ?? 'Email',
|
||||
hintText: AppLocalizations.of(context)?.enter_email ??
|
||||
'Enter the email'),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
@@ -145,7 +163,7 @@ class _PasswordForgotState extends State<PasswordForgot> with ShowAlertDialog {
|
||||
}
|
||||
},
|
||||
child: Text(
|
||||
'Envoyer le mail',
|
||||
AppLocalizations.of(context)?.send_email ?? 'Send email',
|
||||
style: TextStyle(color: Colors.white, fontSize: 25),
|
||||
),
|
||||
),
|
||||
|
@@ -25,6 +25,11 @@ import '../classes/ad_helper.dart';
|
||||
import 'package:google_mobile_ads/google_mobile_ads.dart';
|
||||
import '../classes/auth_service.dart';
|
||||
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; //
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await MobileAds.instance.initialize();
|
||||
@@ -82,6 +87,8 @@ class _ItemMenuState extends State<ItemMenu> with ShowAlertDialog {
|
||||
String eventName = "";
|
||||
String eventStartDate = "";
|
||||
String eventDescription = "";
|
||||
String eventTicket = "";
|
||||
String eventLink = "";
|
||||
String place = "";
|
||||
String imgUrl = "";
|
||||
List<String> tags = [];
|
||||
@@ -109,7 +116,8 @@ class _ItemMenuState extends State<ItemMenu> with ShowAlertDialog {
|
||||
final accessToken = prefs.getString("access_token") ?? "";
|
||||
|
||||
if (accessToken.isEmpty) {
|
||||
showAlertDialog(context, "Erreur serveur", "Cache invalide");
|
||||
showAlertDialog(context, AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.invalid_cache ?? "Invalid cache");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -119,46 +127,61 @@ class _ItemMenuState extends State<ItemMenu> with ShowAlertDialog {
|
||||
headers: {HttpHeaders.cookieHeader: 'access_token=$accessToken'},
|
||||
);
|
||||
|
||||
stderr.writeln('Response Get status: ${responseGet.statusCode}');
|
||||
|
||||
if (responseGet.statusCode == 200) {
|
||||
final responseBody = utf8.decode(responseGet.bodyBytes);
|
||||
stderr.writeln('Username : $responseBody');
|
||||
|
||||
final event = Events.fromJson(jsonDecode(responseBody));
|
||||
|
||||
events = Events.fromJson(jsonDecode(responseBody));
|
||||
final locale = Provider.of<LocaleProvider>(context, listen: false)
|
||||
.locale
|
||||
?.toString() ??
|
||||
'en_US';
|
||||
final startDate =
|
||||
DateTime.parse(event.startDate ?? DateTime.now().toString());
|
||||
DateTime.parse(events?.startDate ?? DateTime.now().toString());
|
||||
//final date = DateFormat.yMd().format(startDate);
|
||||
//final time = DateFormat.Hm().format(startDate);
|
||||
final endDate =
|
||||
DateTime.parse(event.endDate ?? DateTime.now().toString());
|
||||
|
||||
DateTime.parse(events?.endDate ?? DateTime.now().toString());
|
||||
String separator = AppLocalizations.of(context)?.at ?? "at";
|
||||
final formattedStartDate =
|
||||
"${DateFormat.yMd().format(startDate)} ${DateFormat.Hm().format(startDate)}";
|
||||
DateFormat("EEEE d MMMM y '${separator}' HH:mm", locale)
|
||||
.format(startDate);
|
||||
|
||||
final formattedEndDate =
|
||||
"${DateFormat.yMd().format(endDate)} ${DateFormat.Hm().format(endDate)}";
|
||||
DateFormat("EEEE d MMMM y '${separator}' HH:mm", locale)
|
||||
.format(endDate);
|
||||
|
||||
String link = AppLocalizations.of(context)?.to_date ?? "to";
|
||||
|
||||
setState(() {
|
||||
eventName = event.name ?? "";
|
||||
eventStartDate = "$formattedStartDate à $formattedEndDate";
|
||||
organizers = List<String>.from(event.organizers ?? []);
|
||||
place = event.place ?? "";
|
||||
imgUrl = event.imgUrl ?? "";
|
||||
eventDescription = event.description ?? "";
|
||||
tags = List<String>.from(event.tags ?? []);
|
||||
eventName = events?.name ?? "";
|
||||
|
||||
eventStartDate = "$formattedStartDate ${link} $formattedEndDate";
|
||||
organizers = List<String>.from(events?.organizers ?? []);
|
||||
place = events?.place ?? "";
|
||||
imgUrl = events?.imgUrl ?? "";
|
||||
eventLink = events?.link ?? "";
|
||||
eventTicket = events?.ticket ?? "";
|
||||
eventDescription = events?.description ?? "";
|
||||
tags = List<String>.from(events?.tags ?? []);
|
||||
});
|
||||
} else {
|
||||
final errorMessages = {
|
||||
400: "Requête mal construite",
|
||||
406: "Mot de passe incorrect",
|
||||
404: "Utilisateur inconnu",
|
||||
403: "Vous n'avez pas l'autorisation de faire cette action",
|
||||
410: "Token invalide",
|
||||
500: "Problème interne du serveur",
|
||||
final messages = {
|
||||
400: AppLocalizations.of(context)?.request_error ??
|
||||
"Poorly constructed query",
|
||||
406: AppLocalizations.of(context)?.incorrect_password ??
|
||||
"Incorrect password",
|
||||
404: AppLocalizations.of(context)?.unknown_user ?? "Unknown user",
|
||||
403: AppLocalizations.of(context)?.disabled_user ?? "Disabled user",
|
||||
410: AppLocalizations.of(context)?.invalid_token ?? "Invalid token",
|
||||
500: AppLocalizations.of(context)?.internal_error_server ??
|
||||
"Internal error server"
|
||||
};
|
||||
|
||||
final errorMessage = errorMessages[responseGet.statusCode] ??
|
||||
"Problème d'authentification inconnu";
|
||||
showAlertDialog(context, "Erreur serveur", errorMessage);
|
||||
final errorMessage = messages[responseGet.statusCode] ??
|
||||
AppLocalizations.of(context)?.unknown_error_auth ??
|
||||
"Unknown error auth";
|
||||
showAlertDialog(context, AppLocalizations.of(context)?.error ?? "Error",
|
||||
errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -223,7 +246,7 @@ class _ItemMenuState extends State<ItemMenu> with ShowAlertDialog {
|
||||
Row(children: [
|
||||
Icon(Icons.event),
|
||||
Text(
|
||||
"Date : ",
|
||||
AppLocalizations.of(context)?.item_date ?? "Date : ",
|
||||
style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold),
|
||||
)
|
||||
]),
|
||||
@@ -237,7 +260,7 @@ class _ItemMenuState extends State<ItemMenu> with ShowAlertDialog {
|
||||
Row(children: [
|
||||
Icon(Icons.explore),
|
||||
Text(
|
||||
"Carte : ",
|
||||
AppLocalizations.of(context)?.item_maps ?? "Maps : ",
|
||||
style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold),
|
||||
)
|
||||
]),
|
||||
@@ -257,10 +280,38 @@ class _ItemMenuState extends State<ItemMenu> with ShowAlertDialog {
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis)))
|
||||
]),
|
||||
Row(children: [
|
||||
Icon(Icons.link),
|
||||
Text(
|
||||
AppLocalizations.of(context)?.item_link ?? "Link : ",
|
||||
style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold),
|
||||
)
|
||||
]),
|
||||
Row(
|
||||
children: [
|
||||
Flexible(
|
||||
child:
|
||||
Text("${eventLink}", style: TextStyle(fontSize: 15.0)))
|
||||
],
|
||||
),
|
||||
Row(children: [
|
||||
Icon(Icons.add_shopping_cart),
|
||||
Text(
|
||||
AppLocalizations.of(context)?.item_ticket ?? "Ticket : ",
|
||||
style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold),
|
||||
)
|
||||
]),
|
||||
Row(
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text("${eventTicket}",
|
||||
style: TextStyle(fontSize: 15.0)))
|
||||
],
|
||||
),
|
||||
Row(children: [
|
||||
Icon(Icons.group),
|
||||
Text(
|
||||
"Organisateurs : ",
|
||||
AppLocalizations.of(context)?.item_organizer ?? "Organizers : ",
|
||||
style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold),
|
||||
)
|
||||
]),
|
||||
@@ -313,7 +364,9 @@ class _ItemMenuState extends State<ItemMenu> with ShowAlertDialog {
|
||||
]),
|
||||
Row(children: [
|
||||
Icon(Icons.description),
|
||||
Text("Description : ",
|
||||
Text(
|
||||
AppLocalizations.of(context)?.item_description ??
|
||||
"Description : ",
|
||||
style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold))
|
||||
]),
|
||||
Row(children: [
|
||||
@@ -325,7 +378,7 @@ class _ItemMenuState extends State<ItemMenu> with ShowAlertDialog {
|
||||
]),
|
||||
Row(children: [
|
||||
Icon(Icons.category),
|
||||
Text("Tags : ",
|
||||
Text(AppLocalizations.of(context)?.item_tags ?? "Tags : ",
|
||||
style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold))
|
||||
]),
|
||||
Row(
|
||||
@@ -394,7 +447,7 @@ class _ItemMenuState extends State<ItemMenu> with ShowAlertDialog {
|
||||
);
|
||||
},
|
||||
backgroundColor: Colors.blue,
|
||||
tooltip: 'Recherche',
|
||||
tooltip: AppLocalizations.of(context)?.search ?? 'Search',
|
||||
child: const Icon(Icons.edit, color: Colors.white),
|
||||
),
|
||||
);
|
||||
|
@@ -12,10 +12,21 @@ import 'package:intl/date_symbol_data_local.dart';
|
||||
import '../variable/globals.dart' as globals;
|
||||
import '../classes/MyDrawer.dart';
|
||||
import '../classes/auth_service.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; //
|
||||
import '../classes/notification_service.dart';
|
||||
|
||||
// app starting point
|
||||
void main() {
|
||||
initializeDateFormatting("fr_FR", null).then((_) => (const MyApp()));
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
await initializeDateFormatting("fr_FR", null);
|
||||
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
@@ -24,6 +35,14 @@ class MyApp extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
localizationsDelegates: [
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
],
|
||||
supportedLocales: [
|
||||
const Locale('fr', 'FR'),
|
||||
],
|
||||
home: const ListItemOrganizers(organizer: "default"),
|
||||
debugShowCheckedModeBanner: false,
|
||||
);
|
||||
@@ -63,7 +82,6 @@ class _MyHomePageState extends State<ListItemOrganizers> {
|
||||
}
|
||||
|
||||
Future<void> _fetchData() async {
|
||||
print("Counter : ${_fetchCount}");
|
||||
if (_isLoading) return;
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
@@ -77,10 +95,36 @@ class _MyHomePageState extends State<ListItemOrganizers> {
|
||||
});
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>> toggleInterested(String eventId) async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
var accessToken = prefs.getString("access_token") ?? "";
|
||||
final url = Uri.parse("${globals.api}/events/${eventId}/interest");
|
||||
if (accessToken.isNotEmpty) {
|
||||
final response = await http.post(
|
||||
url,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
HttpHeaders.cookieHeader: "access_token=$accessToken"
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode != 200) {
|
||||
throw (AppLocalizations.of(context)?.toogle_interest ??
|
||||
"Error toogle interest: ${response.statusCode}");
|
||||
}
|
||||
|
||||
var event = json.decode(response.body);
|
||||
return event;
|
||||
}
|
||||
return {"interested": false, "interested_count": 0};
|
||||
}
|
||||
|
||||
// variable to call and store future list of posts
|
||||
|
||||
// function to fetch data from api and return future list of posts
|
||||
static Future<List<Events>> getPosts(organizer, {count = 0}) async {
|
||||
await initializeDateFormatting("fr_FR", null);
|
||||
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
var accessToken = prefs.getString("access_token") ?? "";
|
||||
final List<Events> body = [];
|
||||
@@ -132,7 +176,8 @@ class _MyHomePageState extends State<ListItemOrganizers> {
|
||||
return buildPosts(posts);
|
||||
} else {
|
||||
// if no data, show simple Text
|
||||
return const Text("No data available");
|
||||
return Text(
|
||||
AppLocalizations.of(context)?.no_data ?? "No data available");
|
||||
}
|
||||
},
|
||||
),
|
||||
@@ -142,12 +187,14 @@ class _MyHomePageState extends State<ListItemOrganizers> {
|
||||
|
||||
// function to display fetched data on screen
|
||||
Widget buildPosts(List<Events> posts) {
|
||||
String organizer =
|
||||
AppLocalizations.of(context)?.item_organizer ?? "Organizer : ";
|
||||
// ListView Builder to show data in a list
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
// Here we take the value from the MyHomePage object that was created by
|
||||
// the App.build method, and use it to set our appbar title.
|
||||
title: Text("Organisateur : ${widget.organizer}",
|
||||
title: Text("${organizer}${widget.organizer}",
|
||||
overflow: TextOverflow.ellipsis),
|
||||
backgroundColor: Colors.blue,
|
||||
foregroundColor: Colors.white,
|
||||
@@ -160,12 +207,58 @@ class _MyHomePageState extends State<ListItemOrganizers> {
|
||||
itemBuilder: (context, index) {
|
||||
final post = posts[index];
|
||||
final startDate = DateTime.parse(post.startDate!);
|
||||
final date = DateFormat.yMd().format(startDate);
|
||||
final time = DateFormat.Hm().format(startDate);
|
||||
|
||||
final locale = Provider.of<LocaleProvider>(context, listen: false)
|
||||
.locale
|
||||
?.toString() ??
|
||||
'en_US';
|
||||
|
||||
final dateLongue =
|
||||
DateFormat('EEEE d MMMM y', locale).format(startDate);
|
||||
final countInterestedString =
|
||||
AppLocalizations.of(context)?.count_interested ??
|
||||
"Interested people number";
|
||||
final countInterested =
|
||||
"${countInterestedString} : ${post.interestedCount}";
|
||||
|
||||
return ListTile(
|
||||
title: Text('${post.name!}'),
|
||||
subtitle: Text('${post.place!}\n${date} ${time}'),
|
||||
subtitle:
|
||||
Text('${post.place!}\n${dateLongue}\n${countInterested}'),
|
||||
trailing: IconButton(
|
||||
onPressed: () async {
|
||||
try {
|
||||
final result = await toggleInterested(post.id!);
|
||||
setState(() {
|
||||
post.interested = result["interested"];
|
||||
post.interestedCount = result["interested_count"];
|
||||
});
|
||||
if (result["interested"] == true) {
|
||||
NotificationService.scheduleEventNotification(
|
||||
eventId: post.id!,
|
||||
title: "Rappel évènement",
|
||||
body:
|
||||
"Ton évènement '${post.name}' commence dans 1 heure !",
|
||||
eventDate: DateTime.parse(post.startDate!),
|
||||
);
|
||||
} else {
|
||||
NotificationService.cancel(post.id!);
|
||||
}
|
||||
} catch (e) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
AppLocalizations.of(context)?.error_update ??
|
||||
"Error when updating")),
|
||||
);
|
||||
}
|
||||
},
|
||||
icon: Icon(
|
||||
post.interested ?? false
|
||||
? Icons.favorite
|
||||
: Icons.favorite_border,
|
||||
color:
|
||||
post.interested ?? false ? Colors.red : Colors.grey)),
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
|
@@ -13,10 +13,21 @@ import '../variable/globals.dart' as globals;
|
||||
|
||||
import '../classes/MyDrawer.dart';
|
||||
import '../classes/auth_service.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; //
|
||||
import '../classes/notification_service.dart';
|
||||
|
||||
// app starting point
|
||||
void main() {
|
||||
initializeDateFormatting("fr_FR", null).then((_) => (const MyApp()));
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
await initializeDateFormatting("fr_FR", null);
|
||||
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
@@ -25,6 +36,14 @@ class MyApp extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
localizationsDelegates: [
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
],
|
||||
supportedLocales: [
|
||||
const Locale('fr', 'FR'),
|
||||
],
|
||||
home: const ListItemTags(tags: "default"),
|
||||
debugShowCheckedModeBanner: false,
|
||||
);
|
||||
@@ -82,6 +101,8 @@ class _MyHomePageState extends State<ListItemTags> {
|
||||
|
||||
// function to fetch data from api and return future list of posts
|
||||
static Future<List<Events>> getPosts(tags, {count = 0}) async {
|
||||
await initializeDateFormatting("fr_FR", null);
|
||||
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
var accessToken = prefs.getString("access_token") ?? "";
|
||||
final List<Events> body = [];
|
||||
@@ -101,6 +122,30 @@ class _MyHomePageState extends State<ListItemTags> {
|
||||
return body;
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>> toggleInterested(String eventId) async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
var accessToken = prefs.getString("access_token") ?? "";
|
||||
final url = Uri.parse("${globals.api}/events/${eventId}/interest");
|
||||
if (accessToken.isNotEmpty) {
|
||||
final response = await http.post(
|
||||
url,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
HttpHeaders.cookieHeader: "access_token=$accessToken"
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode != 200) {
|
||||
throw (AppLocalizations.of(context)?.toogle_interest ??
|
||||
"Error toogle interest: ${response.statusCode}");
|
||||
}
|
||||
|
||||
var event = json.decode(response.body);
|
||||
return event;
|
||||
}
|
||||
return {"interested": false, "interested_count": 0};
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@@ -135,7 +180,8 @@ class _MyHomePageState extends State<ListItemTags> {
|
||||
return buildPosts(posts);
|
||||
} else {
|
||||
// if no data, show simple Text
|
||||
return const Text("No data available");
|
||||
return Text(
|
||||
AppLocalizations.of(context)?.no_data ?? "No data available");
|
||||
}
|
||||
},
|
||||
),
|
||||
@@ -146,11 +192,13 @@ class _MyHomePageState extends State<ListItemTags> {
|
||||
// function to display fetched data on screen
|
||||
Widget buildPosts(List<Events> posts) {
|
||||
// ListView Builder to show data in a list
|
||||
String tag = AppLocalizations.of(context)?.item_tags ?? "Tags : ";
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
// Here we take the value from the MyHomePage object that was created by
|
||||
// the App.build method, and use it to set our appbar title.
|
||||
title: Text("Tags : ${widget.tags}", overflow: TextOverflow.ellipsis),
|
||||
title: Text("${tag}${widget.tags}", overflow: TextOverflow.ellipsis),
|
||||
backgroundColor: Colors.blue,
|
||||
foregroundColor: Colors.white,
|
||||
),
|
||||
@@ -162,12 +210,57 @@ class _MyHomePageState extends State<ListItemTags> {
|
||||
itemBuilder: (context, index) {
|
||||
final post = posts[index];
|
||||
final startDate = DateTime.parse(post.startDate!);
|
||||
final date = DateFormat.yMd().format(startDate);
|
||||
final time = DateFormat.Hm().format(startDate);
|
||||
final locale = Provider.of<LocaleProvider>(context, listen: false)
|
||||
.locale
|
||||
?.toString() ??
|
||||
'en_US';
|
||||
final dateLongue =
|
||||
DateFormat('EEEE d MMMM y', locale).format(startDate);
|
||||
|
||||
final countInterestedString =
|
||||
AppLocalizations.of(context)?.count_interested ??
|
||||
"Interested people number";
|
||||
final countInterested =
|
||||
"${countInterestedString} : ${post.interestedCount}";
|
||||
|
||||
return ListTile(
|
||||
title: Text('${post.name!}'),
|
||||
subtitle: Text('${post.place!}\n${date} ${time}'),
|
||||
subtitle:
|
||||
Text('${post.place!}\n${dateLongue}\n${countInterested}'),
|
||||
trailing: IconButton(
|
||||
onPressed: () async {
|
||||
try {
|
||||
final result = await toggleInterested(post.id!);
|
||||
setState(() {
|
||||
post.interested = result["interested"];
|
||||
post.interestedCount = result["interested_count"];
|
||||
});
|
||||
if (result["interested"] == true) {
|
||||
NotificationService.scheduleEventNotification(
|
||||
eventId: post.id!,
|
||||
title: "Rappel évènement",
|
||||
body:
|
||||
"Ton évènement '${post.name}' commence dans 1 heure !",
|
||||
eventDate: DateTime.parse(post.startDate!),
|
||||
);
|
||||
} else {
|
||||
NotificationService.cancel(post.id!);
|
||||
}
|
||||
} catch (e) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
AppLocalizations.of(context)?.error_update ??
|
||||
"Error when updating")),
|
||||
);
|
||||
}
|
||||
},
|
||||
icon: Icon(
|
||||
post.interested ?? false
|
||||
? Icons.favorite
|
||||
: Icons.favorite_border,
|
||||
color:
|
||||
post.interested ?? false ? Colors.red : Colors.grey)),
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
|
@@ -20,6 +20,10 @@ import '../classes/ad_helper.dart';
|
||||
import 'package:google_mobile_ads/google_mobile_ads.dart';
|
||||
import '../classes/auth_service.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; // Créé plus loin
|
||||
import '../classes/notification_service.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
@@ -27,7 +31,10 @@ void main() async {
|
||||
await MobileAds.instance.initialize();
|
||||
await initializeDateFormatting("fr_FR", null);
|
||||
|
||||
runApp(const MyApp());
|
||||
runApp(ChangeNotifierProvider(
|
||||
create: (_) => LocaleProvider(),
|
||||
child: const MyApp(),
|
||||
));
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
@@ -35,16 +42,17 @@ class MyApp extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final localeProvider = Provider.of<LocaleProvider>(context);
|
||||
return MaterialApp(
|
||||
localizationsDelegates: [
|
||||
AppLocalizations.delegate,
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
],
|
||||
supportedLocales: [
|
||||
const Locale('fr', 'FR'),
|
||||
],
|
||||
home: const ListItemMenu(),
|
||||
supportedLocales: [const Locale('fr', 'FR'), const Locale('en')],
|
||||
locale: localeProvider.locale,
|
||||
home: Builder(builder: (context) => ListItemMenu()),
|
||||
debugShowCheckedModeBanner: false,
|
||||
);
|
||||
}
|
||||
@@ -296,7 +304,6 @@ class _MyHomePageState extends State<ListItemMenu> {
|
||||
}
|
||||
} catch (e) {
|
||||
fetchPostsByLocation();
|
||||
print("Error getting city and country: $e");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -347,7 +354,8 @@ class _MyHomePageState extends State<ListItemMenu> {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
throw Exception('Failed to load suggestions');
|
||||
throw Exception(AppLocalizations.of(context)?.failed_suggestions ??
|
||||
'Failed to load suggestions');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -416,7 +424,7 @@ class _MyHomePageState extends State<ListItemMenu> {
|
||||
var url = await getUrlForEvents();
|
||||
final response = await http.get(url, headers: {
|
||||
"Content-Type": "application/json",
|
||||
HttpHeaders.cookieHeader: "acce0ss_token=$accessToken"
|
||||
HttpHeaders.cookieHeader: "access_token=$accessToken"
|
||||
});
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
@@ -445,16 +453,13 @@ class _MyHomePageState extends State<ListItemMenu> {
|
||||
"Content-Type": "application/json",
|
||||
HttpHeaders.cookieHeader: "access_token=$accessToken"
|
||||
});
|
||||
print("status code tags : ${response.statusCode}");
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
final data = json.decode(utf8.decode(response.bodyBytes));
|
||||
print("tags ${data}");
|
||||
setState(() {
|
||||
suggestionsTags = (data as List)
|
||||
.map((feature) => {'name': feature['name']})
|
||||
.toList();
|
||||
print("suggesttion tag : ${suggestionsTags}");
|
||||
if (suggestionsTags.isNotEmpty) {
|
||||
showInputGeo = false;
|
||||
showInputSearch = false;
|
||||
@@ -465,6 +470,30 @@ class _MyHomePageState extends State<ListItemMenu> {
|
||||
}
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>> toggleInterested(String eventId) async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
var accessToken = prefs.getString("access_token") ?? "";
|
||||
final url = Uri.parse("${globals.api}/events/${eventId}/interest");
|
||||
if (accessToken.isNotEmpty) {
|
||||
final response = await http.post(
|
||||
url,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
HttpHeaders.cookieHeader: "access_token=$accessToken"
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode != 200) {
|
||||
throw (AppLocalizations.of(context)?.toogle_interest ??
|
||||
"Error toogle interest: ${response.statusCode}");
|
||||
}
|
||||
|
||||
var event = json.decode(response.body);
|
||||
return event;
|
||||
}
|
||||
return {"interested": false, "interested_count": 0};
|
||||
}
|
||||
|
||||
Future<void> fetchPostsByLocation() async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
var accessToken = prefs.getString("access_token") ?? "";
|
||||
@@ -484,15 +513,13 @@ class _MyHomePageState extends State<ListItemMenu> {
|
||||
// Update state after getting the response
|
||||
|
||||
setState(() {
|
||||
if (body.isNotEmpty) {
|
||||
int counter = filteredPosts.length;
|
||||
// If we have results, map them to Events
|
||||
filteredPosts = body
|
||||
.map((e) => Events.fromJson(e as Map<String, dynamic>))
|
||||
.toList();
|
||||
if (counter == filteredPosts.length) {
|
||||
_fetchCount--;
|
||||
}
|
||||
int counter = filteredPosts.length;
|
||||
// If we have results, map them to Events
|
||||
filteredPosts = body
|
||||
.map((e) => Events.fromJson(e as Map<String, dynamic>))
|
||||
.toList();
|
||||
if (counter == filteredPosts.length) {
|
||||
_fetchCount--;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@@ -522,10 +549,10 @@ class _MyHomePageState extends State<ListItemMenu> {
|
||||
|
||||
Padding _buildDateField(String position) {
|
||||
TextEditingController datePicker = startDatepicker;
|
||||
String hintText = "Date de début";
|
||||
String hintText = AppLocalizations.of(context)?.start_date ?? "Start date";
|
||||
if (position == "end") {
|
||||
datePicker = endDatepicker;
|
||||
hintText = "Date de fin";
|
||||
hintText = AppLocalizations.of(context)?.end_date ?? "End date";
|
||||
}
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
@@ -610,9 +637,11 @@ class _MyHomePageState extends State<ListItemMenu> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final loc = AppLocalizations.of(context);
|
||||
final localeProvider = Provider.of<LocaleProvider>(context);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text("Item list menu"),
|
||||
title: Text(loc?.menu_list ?? "Item list menu"),
|
||||
backgroundColor: Colors.blue,
|
||||
foregroundColor: Colors.white,
|
||||
),
|
||||
@@ -629,7 +658,7 @@ class _MyHomePageState extends State<ListItemMenu> {
|
||||
if (showInputSearch)
|
||||
_buildSearchField(
|
||||
controller: inputItem,
|
||||
labelText: 'Search by item',
|
||||
labelText: loc?.search_item ?? "Search by item",
|
||||
onChanged: (value) {
|
||||
_fetchCount = 0;
|
||||
if (value.isNotEmpty) {
|
||||
@@ -675,7 +704,7 @@ class _MyHomePageState extends State<ListItemMenu> {
|
||||
if ((showDateFields) && (showInputTag))
|
||||
_buildSearchField(
|
||||
controller: inputTags,
|
||||
labelText: 'Search by tags',
|
||||
labelText: loc?.search_tag ?? "Search by tags",
|
||||
onChanged: (value) {
|
||||
_fetchCount = 0;
|
||||
if (value.isNotEmpty) {
|
||||
@@ -726,7 +755,8 @@ class _MyHomePageState extends State<ListItemMenu> {
|
||||
if ((showDateFields) && (showInputGeo))
|
||||
_buildSearchField(
|
||||
controller: inputGeo,
|
||||
labelText: 'Search by geographical zone',
|
||||
labelText:
|
||||
loc?.search_geographical ?? 'Search by geographical zone',
|
||||
onChanged: (value) async {
|
||||
_fetchCount = 0;
|
||||
|
||||
@@ -797,21 +827,26 @@ class _MyHomePageState extends State<ListItemMenu> {
|
||||
: Icons.keyboard_arrow_down,
|
||||
color: Colors.blue,
|
||||
),
|
||||
tooltip: showDateFields ? 'Show Date Fields' : 'Hide Date Fields',
|
||||
tooltip: showDateFields
|
||||
? loc?.show_date_field ?? 'Show Date Fields'
|
||||
: loc?.hide_date_field ?? 'Hide Date Fields',
|
||||
),
|
||||
Expanded(
|
||||
child: FutureBuilder<List<Events>>(
|
||||
future: postsFuture,
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
return Center(child: CircularProgressIndicator());
|
||||
} else if (snapshot.hasData) {
|
||||
final posts = snapshot.data!;
|
||||
final displayedPosts =
|
||||
filteredPosts.isEmpty ? posts : filteredPosts;
|
||||
return buildPosts(displayedPosts);
|
||||
} else {
|
||||
return const Text("No data available");
|
||||
return Center(
|
||||
child: Text(AppLocalizations.of(context)?.no_data ??
|
||||
"No data available"),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
@@ -821,7 +856,7 @@ class _MyHomePageState extends State<ListItemMenu> {
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: popCamera,
|
||||
backgroundColor: Colors.blue,
|
||||
tooltip: 'Recherche',
|
||||
tooltip: loc?.search ?? 'Recherche',
|
||||
child: const Icon(Icons.photo_camera, color: Colors.white),
|
||||
),
|
||||
);
|
||||
@@ -829,14 +864,13 @@ class _MyHomePageState extends State<ListItemMenu> {
|
||||
|
||||
// Function to display fetched data on screen
|
||||
Widget buildPosts(List<Events> posts) {
|
||||
print("posts : ${posts}");
|
||||
print("filteredposts : ${filteredPosts}");
|
||||
final displayedPosts = filteredPosts;
|
||||
print("results ${displayedPosts}");
|
||||
// If filteredPosts is empty, show a message saying no data is available
|
||||
if (displayedPosts.isEmpty) {
|
||||
return const Center(
|
||||
child: Text('No events available for this location.',
|
||||
return Center(
|
||||
child: Text(
|
||||
AppLocalizations.of(context)?.no_events ??
|
||||
'No events available for this location.',
|
||||
style: TextStyle(fontSize: 18, color: Colors.grey)),
|
||||
);
|
||||
}
|
||||
@@ -857,11 +891,54 @@ class _MyHomePageState extends State<ListItemMenu> {
|
||||
final startDate = DateTime.parse(post.startDate!);
|
||||
//final date = DateFormat.yMd().format(startDate);
|
||||
//final time = DateFormat.Hm().format(startDate);
|
||||
final locale =
|
||||
Provider.of<LocaleProvider>(context).locale?.toString() ??
|
||||
'en_US';
|
||||
final dateLongue =
|
||||
DateFormat('EEEE d MMMM y', 'fr_FR').format(startDate);
|
||||
DateFormat('EEEE d MMMM y', locale).format(startDate);
|
||||
final countInterestedString =
|
||||
AppLocalizations.of(context)?.count_interested ??
|
||||
"Interested people number";
|
||||
final countInterested =
|
||||
"${countInterestedString} : ${post.interestedCount}";
|
||||
return ListTile(
|
||||
title: Text('${post.name!}'),
|
||||
subtitle: Text('${post.place!}\n${dateLongue}'),
|
||||
subtitle: Text('${post.place!}\n${dateLongue}\n${countInterested}'),
|
||||
trailing: IconButton(
|
||||
onPressed: () async {
|
||||
try {
|
||||
final result = await toggleInterested(post.id!);
|
||||
setState(() {
|
||||
post.interested = result["interested"];
|
||||
post.interestedCount = result["interested_count"];
|
||||
});
|
||||
|
||||
if (result["interested"] == true) {
|
||||
NotificationService.scheduleEventNotification(
|
||||
eventId: post.id!,
|
||||
title: "Rappel évènement",
|
||||
body:
|
||||
"Ton évènement '${post.name}' commence dans 1 heure !",
|
||||
eventDate: DateTime.parse(post.startDate!),
|
||||
);
|
||||
} else {
|
||||
NotificationService.cancel(post.id!);
|
||||
}
|
||||
} catch (e) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
AppLocalizations.of(context)?.error_update ??
|
||||
"Error when updating")),
|
||||
);
|
||||
}
|
||||
},
|
||||
icon: Icon(
|
||||
post.interested ?? false
|
||||
? Icons.favorite
|
||||
: Icons.favorite_border,
|
||||
color:
|
||||
post.interested ?? false ? Colors.red : Colors.grey)),
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
|
@@ -8,6 +8,11 @@ import '../pages/ForgotPassword.dart';
|
||||
import '../classes/alert.dart';
|
||||
import '../classes/ad_helper.dart';
|
||||
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; //
|
||||
|
||||
class LoginDemo extends StatefulWidget {
|
||||
@override
|
||||
_LoginDemoState createState() => _LoginDemoState();
|
||||
@@ -25,7 +30,8 @@ class _LoginDemoState extends State<LoginDemo> with ShowAlertDialog {
|
||||
final password = inputPassword.text;
|
||||
|
||||
if (pseudo.isEmpty || password.isEmpty) {
|
||||
showAlertDialog(context, "Erreur", "Champ vide");
|
||||
showAlertDialog(context, AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.empty_input ?? "Empty input");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -36,7 +42,8 @@ class _LoginDemoState extends State<LoginDemo> with ShowAlertDialog {
|
||||
Navigator.push(
|
||||
context, MaterialPageRoute(builder: (_) => ListItemMenu()));
|
||||
} else {
|
||||
showAlertDialog(context, "Erreur", "Échec de l'authentification");
|
||||
showAlertDialog(context, AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.failed_auth ?? "Authentication failed");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +80,7 @@ class _LoginDemoState extends State<LoginDemo> with ShowAlertDialog {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
appBar: AppBar(
|
||||
title: Text("Login Page"),
|
||||
title: Text(AppLocalizations.of(context)?.login_page ?? "Login Page"),
|
||||
backgroundColor: Colors.blue,
|
||||
foregroundColor: Colors.white,
|
||||
),
|
||||
@@ -93,8 +100,10 @@ class _LoginDemoState extends State<LoginDemo> with ShowAlertDialog {
|
||||
controller: inputPseudo,
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Pseudo',
|
||||
hintText: 'Enter pseudo existant',
|
||||
labelText: AppLocalizations.of(context)?.pseudo ?? 'Pseudo',
|
||||
hintText:
|
||||
AppLocalizations.of(context)?.enter_existing_pseudo ??
|
||||
'Enter a existing pseudo',
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -105,13 +114,16 @@ class _LoginDemoState extends State<LoginDemo> with ShowAlertDialog {
|
||||
obscureText: true,
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Password',
|
||||
hintText: 'Enter secure password',
|
||||
labelText:
|
||||
AppLocalizations.of(context)?.password ?? "Password",
|
||||
hintText: AppLocalizations.of(context)?.enter_password ??
|
||||
"Enter the password",
|
||||
),
|
||||
),
|
||||
),
|
||||
CheckboxListTile(
|
||||
title: Text("Se souvenir de moi"),
|
||||
title: Text(
|
||||
AppLocalizations.of(context)?.remembr_me ?? "Remember me"),
|
||||
value: _rememberMe,
|
||||
onChanged: (newValue) {
|
||||
setState(() {
|
||||
@@ -124,7 +136,9 @@ class _LoginDemoState extends State<LoginDemo> with ShowAlertDialog {
|
||||
Navigator.push(context,
|
||||
MaterialPageRoute(builder: (_) => PasswordForgot()));
|
||||
},
|
||||
child: Text('Forgot Password',
|
||||
child: Text(
|
||||
AppLocalizations.of(context)?.forgot_password ??
|
||||
'Forgot Password',
|
||||
style: TextStyle(color: Colors.blue, fontSize: 15)),
|
||||
),
|
||||
Container(
|
||||
@@ -134,13 +148,14 @@ class _LoginDemoState extends State<LoginDemo> with ShowAlertDialog {
|
||||
color: Colors.blue, borderRadius: BorderRadius.circular(20)),
|
||||
child: TextButton(
|
||||
onPressed: () => _login(context),
|
||||
child: Text('Login',
|
||||
child: Text(AppLocalizations.of(context)?.sign_in ?? 'Sign in',
|
||||
style: TextStyle(color: Colors.white, fontSize: 25)),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 130),
|
||||
InkWell(
|
||||
child: Text('New User? Create Account'),
|
||||
child: Text(AppLocalizations.of(context)?.new_user ??
|
||||
'New User? Create Account'),
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context, MaterialPageRoute(builder: (_) => AddProfile()));
|
||||
|
@@ -13,6 +13,11 @@ import '../variable/globals.dart' as globals;
|
||||
import '../classes/MyDrawer.dart';
|
||||
import '../classes/auth_service.dart';
|
||||
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; //
|
||||
|
||||
void main() async {
|
||||
await dotenv.load(fileName: ".env"); // Load .env file
|
||||
runApp(const MyApp());
|
||||
@@ -70,7 +75,10 @@ class _MapboxPagesState extends State<MapboxPages> with ShowAlertDialog {
|
||||
mapboxAccessToken = dotenv.env['MAPBOX_ACCESS_TOKEN'] ?? '';
|
||||
if (mapboxAccessToken.isEmpty) {
|
||||
showAlertDialog(
|
||||
context, "Erreur Mapbox", "Mapbox Access Token is not available.");
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.map_token ??
|
||||
"Map Access Token is not available.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,35 +103,29 @@ class _MapboxPagesState extends State<MapboxPages> with ShowAlertDialog {
|
||||
_handleErrorResponse(responseGet.statusCode);
|
||||
}
|
||||
} else {
|
||||
showAlertDialog(context, "Erreur serveur", "Invalid cache.");
|
||||
showAlertDialog(context, AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.invalid_cache ?? "Invalid cache.");
|
||||
}
|
||||
}
|
||||
|
||||
void _handleErrorResponse(int statusCode) {
|
||||
String text;
|
||||
switch (statusCode) {
|
||||
case 400:
|
||||
text = "Bad Request.";
|
||||
break;
|
||||
case 406:
|
||||
text = "Incorrect Password.";
|
||||
break;
|
||||
case 404:
|
||||
text = "User Not Found.";
|
||||
break;
|
||||
case 403:
|
||||
text = "Action not permitted.";
|
||||
break;
|
||||
case 410:
|
||||
text = "Invalid Token.";
|
||||
break;
|
||||
case 500:
|
||||
text = "Internal Server Error.";
|
||||
break;
|
||||
default:
|
||||
text = "Unknown error.";
|
||||
}
|
||||
showAlertDialog(context, "Erreur serveur", text);
|
||||
final messages = {
|
||||
400: AppLocalizations.of(context)?.request_error ??
|
||||
"Poorly constructed query",
|
||||
406: AppLocalizations.of(context)?.incorrect_password ??
|
||||
"Incorrect password",
|
||||
404: AppLocalizations.of(context)?.unknown_user ?? "Unknown user",
|
||||
403: AppLocalizations.of(context)?.disabled_user ?? "Disabled user",
|
||||
410: AppLocalizations.of(context)?.invalid_token ?? "Invalid token",
|
||||
500: AppLocalizations.of(context)?.internal_error_server ??
|
||||
"Internal error server"
|
||||
};
|
||||
|
||||
final errorMessage = messages[statusCode] ??
|
||||
AppLocalizations.of(context)?.unknown_error_auth ??
|
||||
"Unknown error auth";
|
||||
showAlertDialog(
|
||||
context, AppLocalizations.of(context)?.error ?? "Error", errorMessage);
|
||||
}
|
||||
|
||||
Future<void> _getUserLocation() async {
|
||||
@@ -131,7 +133,10 @@ class _MapboxPagesState extends State<MapboxPages> with ShowAlertDialog {
|
||||
bool serviceEnabled = await Geolocator.isLocationServiceEnabled();
|
||||
if (!serviceEnabled) {
|
||||
showAlertDialog(
|
||||
context, "Erreur de service", "Location services are disabled.");
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.geo_disabled ??
|
||||
"Location services are disabled.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -139,15 +144,21 @@ class _MapboxPagesState extends State<MapboxPages> with ShowAlertDialog {
|
||||
if (permission == LocationPermission.denied) {
|
||||
permission = await Geolocator.requestPermission();
|
||||
if (permission == LocationPermission.denied) {
|
||||
showAlertDialog(context, "Erreur de permission",
|
||||
"Location permissions are denied.");
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.permission_denied ??
|
||||
"Location permissions are denied.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (permission == LocationPermission.deniedForever) {
|
||||
showAlertDialog(context, "Erreur de permission",
|
||||
"Location permissions are permanently denied. Enable them in settings.");
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.enable_permission ??
|
||||
"Location permissions are permanently denied. Enable them in settings.");
|
||||
return;
|
||||
}
|
||||
const LocationSettings locationSettings = LocationSettings(
|
||||
@@ -158,17 +169,23 @@ class _MapboxPagesState extends State<MapboxPages> with ShowAlertDialog {
|
||||
locationSettings: locationSettings);
|
||||
} on LocationServiceDisabledException {
|
||||
// Handle location services disabled
|
||||
print('Location services are disabled.');
|
||||
position = await Geolocator.getLastKnownPosition();
|
||||
if (position == null) {
|
||||
print('No last known position available.');
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.no_last_position ??
|
||||
"No last known position available..");
|
||||
}
|
||||
} catch (e) {
|
||||
// Handle other errors
|
||||
print('Failed to get location: $e');
|
||||
position = await Geolocator.getLastKnownPosition();
|
||||
if (position == null) {
|
||||
print('No last known position available.');
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.no_last_position ??
|
||||
"No last known position available");
|
||||
}
|
||||
}
|
||||
if (position != null) {
|
||||
@@ -180,7 +197,11 @@ class _MapboxPagesState extends State<MapboxPages> with ShowAlertDialog {
|
||||
_initToken();
|
||||
_getEventInfo();
|
||||
} catch (e) {
|
||||
showAlertDialog(context, "Erreur geo", "Failed to get user location: $e");
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.failed_location ??
|
||||
"Failed to get user location");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,16 +221,17 @@ class _MapboxPagesState extends State<MapboxPages> with ShowAlertDialog {
|
||||
}).toList();
|
||||
});
|
||||
} else {
|
||||
showAlertDialog(context, "Erreur serveur",
|
||||
"Failed to fetch the route: ${response.statusCode}");
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.failed_fetch ??
|
||||
"Failed to fetch the route");
|
||||
}
|
||||
}
|
||||
|
||||
// Called when the map is created
|
||||
void _onStyleLoaded() async {
|
||||
// Log the map controller and coordinates
|
||||
print("Mapbox controller initialized: $mapController");
|
||||
print("lat - long : $latitude - $longitude");
|
||||
|
||||
// Check if the mapController is really initialized
|
||||
if (mapController != null) {
|
||||
@@ -229,20 +251,30 @@ class _MapboxPagesState extends State<MapboxPages> with ShowAlertDialog {
|
||||
);
|
||||
|
||||
// Debugging symbol options
|
||||
print("Adding symbol with options: $symbolOptions");
|
||||
|
||||
// Add symbol to map
|
||||
mapController!.addSymbol(symbolOptions);
|
||||
} else {
|
||||
print("Error: Invalid coordinates, cannot add symbol.");
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.invalid_coordinates_symbol ??
|
||||
"Error: Invalid coordinates, cannot add symbol.");
|
||||
}
|
||||
} catch (e) {
|
||||
// Handle any exception that occurs when adding the symbol
|
||||
print("Error when adding symbol: $e");
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.error_symbol ??
|
||||
"Error when adding symbol.");
|
||||
}
|
||||
} else {
|
||||
print(
|
||||
"Error: MapboxMapController is null at the time of symbol addition");
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.error_symbol ??
|
||||
"Error when adding symbol.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -253,8 +285,11 @@ class _MapboxPagesState extends State<MapboxPages> with ShowAlertDialog {
|
||||
currentRouteLine = null;
|
||||
}
|
||||
if (!isUserPositionInitialized) {
|
||||
showAlertDialog(context, "Erreur de position",
|
||||
"User position is not yet initialized. Try again.");
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.position_not_init ??
|
||||
"User position is not yet initialized. Try again.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -293,8 +328,11 @@ class _MapboxPagesState extends State<MapboxPages> with ShowAlertDialog {
|
||||
_zoomToFitRoute(routeCoordinates);
|
||||
}
|
||||
} else {
|
||||
showAlertDialog(context, "Erreur de coordonée",
|
||||
"Invalid coordinates or user position.");
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.invalid_coordinates ??
|
||||
"Invalid coordinates or user position.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -348,7 +386,7 @@ class _MapboxPagesState extends State<MapboxPages> with ShowAlertDialog {
|
||||
children: [
|
||||
Icon(Icons.directions_walk, color: Colors.blue),
|
||||
SizedBox(width: 8),
|
||||
Text('Walking'),
|
||||
Text(AppLocalizations.of(context)?.walking ?? 'Walking'),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -358,7 +396,7 @@ class _MapboxPagesState extends State<MapboxPages> with ShowAlertDialog {
|
||||
children: [
|
||||
Icon(Icons.directions_bike, color: Colors.green),
|
||||
SizedBox(width: 8),
|
||||
Text('Cycling'),
|
||||
Text(AppLocalizations.of(context)?.cycling ?? 'Cycling'),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -368,7 +406,7 @@ class _MapboxPagesState extends State<MapboxPages> with ShowAlertDialog {
|
||||
children: [
|
||||
Icon(Icons.directions_car, color: Colors.red),
|
||||
SizedBox(width: 8),
|
||||
Text('Driving'),
|
||||
Text(AppLocalizations.of(context)?.driving ?? 'Driving'),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -403,7 +441,8 @@ class _MapboxPagesState extends State<MapboxPages> with ShowAlertDialog {
|
||||
child: FloatingActionButton(
|
||||
onPressed: _drawRouteAndMarkers,
|
||||
child: Icon(Icons.directions),
|
||||
tooltip: 'Get Directions and Markers',
|
||||
tooltip: AppLocalizations.of(context)?.get_direction ??
|
||||
'Get Directions and Markers',
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@@ -20,6 +20,11 @@ import '../classes/ad_helper.dart';
|
||||
import 'package:google_mobile_ads/google_mobile_ads.dart';
|
||||
import '../classes/auth_service.dart';
|
||||
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; //
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await MobileAds.instance.initialize();
|
||||
@@ -165,7 +170,8 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
var endDate = "${endDateFormat}T${endTimepicker.text.replaceAll('-', ':')}";
|
||||
|
||||
if (!startDateCompare.isAfter(dateNow)) {
|
||||
showAlertDialog(context, "Erreur evenement", "Evenement non futur");
|
||||
showAlertDialog(context, AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.no_future_event ?? "No future event");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -173,7 +179,11 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
var accessToken = prefs.getString("access_token") ?? "";
|
||||
|
||||
if (accessToken.isEmpty) {
|
||||
showAlertDialog(context, "Erreur token", "Token d'accès manquant");
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.missing_token ??
|
||||
"Missing access token");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -188,14 +198,18 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
final searchboxResponse = await http.get(searchboxUrl);
|
||||
|
||||
if (searchboxResponse.statusCode != 200) {
|
||||
showAlertDialog(context, "Erreur map",
|
||||
"Erreur lors de la géocodage avec Searchbox");
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.geocoding_error ??
|
||||
"Error when geocoding");
|
||||
return;
|
||||
}
|
||||
|
||||
final searchboxData = json.decode(searchboxResponse.body);
|
||||
if (searchboxData['results'].isEmpty) {
|
||||
showAlertDialog(context, "Erreur", "Lieu introuvable");
|
||||
showAlertDialog(context, AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.no_found_place ?? "No found place");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -240,7 +254,10 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
|
||||
if (imgbbResponse.statusCode != 200) {
|
||||
showAlertDialog(
|
||||
context, "Erreur serveur", "Erreur lors de l'upload d'image");
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.upload_error ??
|
||||
"Error when image uploading");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -271,27 +288,37 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
);
|
||||
|
||||
if (eventResponse.statusCode == 200 || eventResponse.statusCode == 201) {
|
||||
showEventDialog(context, "Événement $name ajouté");
|
||||
String event_message =
|
||||
AppLocalizations.of(context)?.event_added ?? "Event added";
|
||||
showEventDialog(context, "$event_message : $name");
|
||||
} else {
|
||||
handleHttpError(eventResponse.statusCode, context);
|
||||
}
|
||||
} catch (e) {
|
||||
showAlertDialog(context, "Erreur", "Erreur: ${e.toString()}");
|
||||
showAlertDialog(context, AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.app_error ?? "Error application");
|
||||
}
|
||||
}
|
||||
|
||||
// Utility function to handle HTTP errors
|
||||
void handleHttpError(int statusCode, BuildContext context) {
|
||||
final errorMessages = {
|
||||
400: "Requête mal construite",
|
||||
403: "Utilisateur désactivé",
|
||||
404: "Utilisateur inconnu",
|
||||
406: "Mot de passe incorrect",
|
||||
410: "Token invalide",
|
||||
500: "Problème interne du serveur",
|
||||
final messages = {
|
||||
400: AppLocalizations.of(context)?.request_error ??
|
||||
"Poorly constructed query",
|
||||
406: AppLocalizations.of(context)?.incorrect_password ??
|
||||
"Incorrect password",
|
||||
404: AppLocalizations.of(context)?.unknown_user ?? "Unknown user",
|
||||
403: AppLocalizations.of(context)?.disabled_user ?? "Disabled user",
|
||||
410: AppLocalizations.of(context)?.invalid_token ?? "Invalid token",
|
||||
500: AppLocalizations.of(context)?.internal_error_server ??
|
||||
"Internal error server"
|
||||
};
|
||||
showAlertDialog(context, "Erreur serveur",
|
||||
errorMessages[statusCode] ?? "Erreur inconnue");
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
messages[statusCode] ??
|
||||
AppLocalizations.of(context)?.unknown_error ??
|
||||
"Unknown error");
|
||||
}
|
||||
|
||||
void start() async {
|
||||
@@ -330,7 +357,9 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
String? _validateField(String? value) {
|
||||
return value!.isEmpty ? 'Champ requis' : null;
|
||||
return value!.isEmpty
|
||||
? AppLocalizations.of(context)?.required_input ?? 'Required input'
|
||||
: null;
|
||||
}
|
||||
|
||||
Future<void> searchSuggestions(String input) async {
|
||||
@@ -344,11 +373,9 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
|
||||
// Perform the request
|
||||
final response = await http.get(searchboxUrl);
|
||||
print("response code suggestion: ${response.statusCode}");
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
final data = json.decode(response.body);
|
||||
print("data suggestion: ${data}");
|
||||
|
||||
setState(() {
|
||||
// Map the results to extract name and full_address
|
||||
@@ -374,7 +401,7 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
TextField(
|
||||
controller: inputGeo,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Lieu',
|
||||
labelText: AppLocalizations.of(context)?.location ?? 'Location',
|
||||
border: OutlineInputBorder(),
|
||||
suffixIcon: IconButton(
|
||||
icon: const Icon(Icons.clear),
|
||||
@@ -432,7 +459,8 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
appBar: AppBar(
|
||||
title: Text("Add or Update a event"),
|
||||
title: Text(AppLocalizations.of(context)?.add_event ??
|
||||
"Add or Update a event"),
|
||||
backgroundColor: Colors.blue,
|
||||
foregroundColor: Colors.white,
|
||||
),
|
||||
@@ -467,8 +495,10 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
validator: (value) => _validateField(value),
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Nom',
|
||||
hintText: 'Modifier le nom de l\'évènement'),
|
||||
labelText: AppLocalizations.of(context)?.name ?? "Name",
|
||||
hintText:
|
||||
AppLocalizations.of(context)?.edit_event_name ??
|
||||
"Edit event name"),
|
||||
),
|
||||
),
|
||||
_buildGeographicalZoneSearchField(),
|
||||
@@ -482,8 +512,10 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
validator: (value) => _validateField(value),
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Date de debut',
|
||||
hintText: 'Cliquez ici pour selectionner une date'),
|
||||
labelText: AppLocalizations.of(context)?.start_date ??
|
||||
"Start date",
|
||||
hintText: AppLocalizations.of(context)?.select_date ??
|
||||
"Click to select a date"),
|
||||
onTap: () => onTapFunctionDatePicker(
|
||||
context: context, position: "start")),
|
||||
),
|
||||
@@ -497,8 +529,10 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
validator: (value) => _validateField(value),
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Heure de debut',
|
||||
hintText: 'Cliquez ici pour selectionner une heure'),
|
||||
labelText: AppLocalizations.of(context)?.start_time ??
|
||||
"Start time",
|
||||
hintText: AppLocalizations.of(context)?.select_time ??
|
||||
"Click to select a time"),
|
||||
onTap: () => onTapFunctionTimePicker(
|
||||
context: context, position: "start")),
|
||||
),
|
||||
@@ -512,8 +546,10 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
validator: (value) => _validateField(value),
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Date de fin',
|
||||
hintText: 'Cliquez ici pour selectionner une date'),
|
||||
labelText: AppLocalizations.of(context)?.end_date ??
|
||||
"End date",
|
||||
hintText: AppLocalizations.of(context)?.select_date ??
|
||||
"Click to select a date"),
|
||||
onTap: () => onTapFunctionDatePicker(
|
||||
context: context, position: "end")),
|
||||
),
|
||||
@@ -527,8 +563,10 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
validator: (value) => _validateField(value),
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Heure de fin',
|
||||
hintText: 'Cliquez ici pour selectionner une heure'),
|
||||
labelText: AppLocalizations.of(context)?.end_time ??
|
||||
"End time",
|
||||
hintText: AppLocalizations.of(context)?.select_time ??
|
||||
"Click to select a time"),
|
||||
onTap: () => onTapFunctionTimePicker(
|
||||
context: context, position: "end")),
|
||||
),
|
||||
@@ -538,7 +576,8 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
textSeparators: const [' ', ','],
|
||||
validator: (String tag) {
|
||||
if (_stringTagController.getTags!.contains(tag)) {
|
||||
return 'Tu as deja rentre ce tag';
|
||||
return AppLocalizations.of(context)?.already_tag ??
|
||||
'You have already entered this tag';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
@@ -553,10 +592,12 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
onSubmitted: inputFieldValues.onTagSubmitted,
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Tags',
|
||||
labelText:
|
||||
AppLocalizations.of(context)?.tag ?? 'Tags',
|
||||
hintText: inputFieldValues.tags.isNotEmpty
|
||||
? ''
|
||||
: "Enter tag...",
|
||||
: AppLocalizations.of(context)?.enter_tag ??
|
||||
"Enter tag...",
|
||||
errorText: inputFieldValues.error,
|
||||
prefixIcon: inputFieldValues.tags.isNotEmpty
|
||||
? SingleChildScrollView(
|
||||
@@ -633,7 +674,9 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
textSeparators: const [','],
|
||||
validator: (String tag) {
|
||||
if (_stringOrgaController.getTags!.contains(tag)) {
|
||||
return 'Cet organisateur est déjà rentré';
|
||||
return AppLocalizations.of(context)
|
||||
?.already_organiser ??
|
||||
'You have already entered this organizer';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
@@ -648,10 +691,14 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
onSubmitted: inputFieldValues.onTagSubmitted,
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Organisateurs',
|
||||
labelText:
|
||||
AppLocalizations.of(context)?.organizer ??
|
||||
'Organizers',
|
||||
hintText: inputFieldValues.tags.isNotEmpty
|
||||
? ''
|
||||
: "Enter un organisateur...",
|
||||
: AppLocalizations.of(context)
|
||||
?.enter_organizer ??
|
||||
"Enter un organisateur...",
|
||||
errorText: inputFieldValues.error,
|
||||
prefixIcon: inputFieldValues.tags.isNotEmpty
|
||||
? SingleChildScrollView(
|
||||
@@ -732,8 +779,11 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
maxLines: 10,
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Description',
|
||||
hintText: 'Décrire l\'evènement'),
|
||||
labelText: AppLocalizations.of(context)?.description ??
|
||||
'Description',
|
||||
hintText:
|
||||
AppLocalizations.of(context)?.describe_event ??
|
||||
'Describe the event'),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
@@ -752,7 +802,7 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
}
|
||||
},
|
||||
child: Text(
|
||||
'Ajouter',
|
||||
AppLocalizations.of(context)?.add_event ?? 'Add',
|
||||
style: TextStyle(color: Colors.white, fontSize: 25),
|
||||
),
|
||||
),
|
||||
|
@@ -6,6 +6,7 @@ import FlutterMacOS
|
||||
import Foundation
|
||||
|
||||
import file_selector_macos
|
||||
import flutter_local_notifications
|
||||
import geolocator_apple
|
||||
import path_provider_foundation
|
||||
import shared_preferences_foundation
|
||||
@@ -14,6 +15,7 @@ import webview_flutter_wkwebview
|
||||
|
||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
|
||||
FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin"))
|
||||
GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin"))
|
||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||
|
@@ -145,6 +145,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.1.0"
|
||||
dbus:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: dbus
|
||||
sha256: "79e0c23480ff85dc68de79e2cd6334add97e48f7f4865d17686dd6ea81a47e8c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.7.11"
|
||||
dio:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -270,6 +278,30 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.0"
|
||||
flutter_local_notifications:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_local_notifications
|
||||
sha256: "674173fd3c9eda9d4c8528da2ce0ea69f161577495a9cc835a2a4ecd7eadeb35"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "17.2.4"
|
||||
flutter_local_notifications_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_local_notifications_linux
|
||||
sha256: c49bd06165cad9beeb79090b18cd1eb0296f4bf4b23b84426e37dd7c027fc3af
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.1"
|
||||
flutter_local_notifications_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_local_notifications_platform_interface
|
||||
sha256: "85f8d07fe708c1bdcf45037f2c0109753b26ae077e9d9e899d55971711a4ea66"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "7.2.0"
|
||||
flutter_localizations:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@@ -565,6 +597,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.6"
|
||||
nested:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: nested
|
||||
sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
path:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -701,6 +741,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.9.1"
|
||||
provider:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: provider
|
||||
sha256: "4abbd070a04e9ddc287673bf5a030c7ca8b685ff70218720abab8b092f53dd84"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.1.5"
|
||||
shared_preferences:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -834,6 +882,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
timezone:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: timezone
|
||||
sha256: "2236ec079a174ce07434e89fcd3fcda430025eb7692244139a9cf54fdcf1fc7d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.9.4"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@@ -36,6 +36,8 @@ dependencies:
|
||||
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
flutter_local_notifications: ^17.2.0
|
||||
timezone: ^0.9.4
|
||||
cupertino_icons: ^1.0.2
|
||||
http: ^1.2.1
|
||||
shared_preferences: ^2.2.3
|
||||
@@ -55,6 +57,7 @@ dependencies:
|
||||
mapbox_gl: ^0.16.0
|
||||
google_mobile_ads: ^5.3.1
|
||||
encrypt_shared_preferences: ^0.8.8
|
||||
provider: ^6.1.2 # ou la dernière version
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
45
covas_mobile_new/.gitignore
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
# Miscellaneous
|
||||
*.class
|
||||
*.log
|
||||
*.pyc
|
||||
*.swp
|
||||
.DS_Store
|
||||
.atom/
|
||||
.build/
|
||||
.buildlog/
|
||||
.history
|
||||
.svn/
|
||||
.swiftpm/
|
||||
migrate_working_dir/
|
||||
|
||||
# IntelliJ related
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
.idea/
|
||||
|
||||
# The .vscode folder contains launch configuration and tasks you configure in
|
||||
# VS Code which you may wish to be included in version control, so this line
|
||||
# is commented out by default.
|
||||
#.vscode/
|
||||
|
||||
# Flutter/Dart/Pub related
|
||||
**/doc/api/
|
||||
**/ios/Flutter/.last_build_id
|
||||
.dart_tool/
|
||||
.flutter-plugins-dependencies
|
||||
.pub-cache/
|
||||
.pub/
|
||||
/build/
|
||||
/coverage/
|
||||
|
||||
# Symbolication related
|
||||
app.*.symbols
|
||||
|
||||
# Obfuscation related
|
||||
app.*.map.json
|
||||
|
||||
# Android Studio will place build artifacts here
|
||||
/android/app/debug
|
||||
/android/app/profile
|
||||
/android/app/release
|
45
covas_mobile_new/.metadata
Normal file
@@ -0,0 +1,45 @@
|
||||
# This file tracks properties of this Flutter project.
|
||||
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
||||
#
|
||||
# This file should be version controlled and should not be manually edited.
|
||||
|
||||
version:
|
||||
revision: "05db9689081f091050f01aed79f04dce0c750154"
|
||||
channel: "stable"
|
||||
|
||||
project_type: app
|
||||
|
||||
# Tracks metadata for the flutter migrate command
|
||||
migration:
|
||||
platforms:
|
||||
- platform: root
|
||||
create_revision: 05db9689081f091050f01aed79f04dce0c750154
|
||||
base_revision: 05db9689081f091050f01aed79f04dce0c750154
|
||||
- platform: android
|
||||
create_revision: 05db9689081f091050f01aed79f04dce0c750154
|
||||
base_revision: 05db9689081f091050f01aed79f04dce0c750154
|
||||
- platform: ios
|
||||
create_revision: 05db9689081f091050f01aed79f04dce0c750154
|
||||
base_revision: 05db9689081f091050f01aed79f04dce0c750154
|
||||
- platform: linux
|
||||
create_revision: 05db9689081f091050f01aed79f04dce0c750154
|
||||
base_revision: 05db9689081f091050f01aed79f04dce0c750154
|
||||
- platform: macos
|
||||
create_revision: 05db9689081f091050f01aed79f04dce0c750154
|
||||
base_revision: 05db9689081f091050f01aed79f04dce0c750154
|
||||
- platform: web
|
||||
create_revision: 05db9689081f091050f01aed79f04dce0c750154
|
||||
base_revision: 05db9689081f091050f01aed79f04dce0c750154
|
||||
- platform: windows
|
||||
create_revision: 05db9689081f091050f01aed79f04dce0c750154
|
||||
base_revision: 05db9689081f091050f01aed79f04dce0c750154
|
||||
|
||||
# User provided section
|
||||
|
||||
# List of Local paths (relative to this file) that should be
|
||||
# ignored by the migrate tool.
|
||||
#
|
||||
# Files that are not part of the templates will be ignored by default.
|
||||
unmanaged_files:
|
||||
- 'lib/main.dart'
|
||||
- 'ios/Runner.xcodeproj/project.pbxproj'
|
16
covas_mobile_new/README.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# covas_mobile_new
|
||||
|
||||
A new Flutter project.
|
||||
|
||||
## Getting Started
|
||||
|
||||
This project is a starting point for a Flutter application.
|
||||
|
||||
A few resources to get you started if this is your first Flutter project:
|
||||
|
||||
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
|
||||
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
|
||||
|
||||
For help getting started with Flutter development, view the
|
||||
[online documentation](https://docs.flutter.dev/), which offers tutorials,
|
||||
samples, guidance on mobile development, and a full API reference.
|
28
covas_mobile_new/analysis_options.yaml
Normal file
@@ -0,0 +1,28 @@
|
||||
# This file configures the analyzer, which statically analyzes Dart code to
|
||||
# check for errors, warnings, and lints.
|
||||
#
|
||||
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
|
||||
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
|
||||
# invoked from the command line by running `flutter analyze`.
|
||||
|
||||
# The following line activates a set of recommended lints for Flutter apps,
|
||||
# packages, and plugins designed to encourage good coding practices.
|
||||
include: package:flutter_lints/flutter.yaml
|
||||
|
||||
linter:
|
||||
# The lint rules applied to this project can be customized in the
|
||||
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
|
||||
# included above or to enable additional rules. A list of all available lints
|
||||
# and their documentation is published at https://dart.dev/lints.
|
||||
#
|
||||
# Instead of disabling a lint rule for the entire project in the
|
||||
# section below, it can also be suppressed for a single line of code
|
||||
# or a specific dart file by using the `// ignore: name_of_lint` and
|
||||
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
|
||||
# producing the lint.
|
||||
rules:
|
||||
# avoid_print: false # Uncomment to disable the `avoid_print` rule
|
||||
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
|
||||
|
||||
# Additional information about this file can be found at
|
||||
# https://dart.dev/guides/language/analysis-options
|
14
covas_mobile_new/android/.gitignore
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
gradle-wrapper.jar
|
||||
/.gradle
|
||||
/captures/
|
||||
/gradlew
|
||||
/gradlew.bat
|
||||
/local.properties
|
||||
GeneratedPluginRegistrant.java
|
||||
.cxx/
|
||||
|
||||
# Remember to never publicly share your keystore.
|
||||
# See https://flutter.dev/to/reference-keystore
|
||||
key.properties
|
||||
**/*.keystore
|
||||
**/*.jks
|
44
covas_mobile_new/android/app/build.gradle.kts
Normal file
@@ -0,0 +1,44 @@
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("kotlin-android")
|
||||
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
||||
id("dev.flutter.flutter-gradle-plugin")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.example.covas_mobile_new"
|
||||
compileSdk = flutter.compileSdkVersion
|
||||
ndkVersion = flutter.ndkVersion
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = JavaVersion.VERSION_11.toString()
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId = "com.example.covas_mobile_new"
|
||||
// You can update the following values to match your application needs.
|
||||
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
||||
minSdk = flutter.minSdkVersion
|
||||
targetSdk = flutter.targetSdkVersion
|
||||
versionCode = flutter.versionCode
|
||||
versionName = flutter.versionName
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source = "../.."
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- The INTERNET permission is required for development. Specifically,
|
||||
the Flutter tool needs it to communicate with the running application
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
-->
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
</manifest>
|
45
covas_mobile_new/android/app/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,45 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<application
|
||||
android:label="covas_mobile_new"
|
||||
android:name="${applicationName}"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTop"
|
||||
android:taskAffinity=""
|
||||
android:theme="@style/LaunchTheme"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:hardwareAccelerated="true"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<!-- Specifies an Android theme to apply to this Activity as soon as
|
||||
the Android process has started. This theme is visible to the user
|
||||
while the Flutter UI initializes. After that, this theme continues
|
||||
to determine the Window background behind the Flutter UI. -->
|
||||
<meta-data
|
||||
android:name="io.flutter.embedding.android.NormalTheme"
|
||||
android:resource="@style/NormalTheme"
|
||||
/>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<!-- Don't delete the meta-data below.
|
||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||
<meta-data
|
||||
android:name="flutterEmbedding"
|
||||
android:value="2" />
|
||||
</application>
|
||||
<!-- Required to query activities that can process text, see:
|
||||
https://developer.android.com/training/package-visibility and
|
||||
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
|
||||
|
||||
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="android.intent.action.PROCESS_TEXT"/>
|
||||
<data android:mimeType="text/plain"/>
|
||||
</intent>
|
||||
</queries>
|
||||
</manifest>
|
@@ -0,0 +1,5 @@
|
||||
package com.example.covas_mobile_new
|
||||
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
|
||||
class MainActivity : FlutterActivity()
|
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Modify this file to customize your launch splash screen -->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="?android:colorBackground" />
|
||||
|
||||
<!-- You can insert your own image assets here -->
|
||||
<!-- <item>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
android:src="@mipmap/launch_image" />
|
||||
</item> -->
|
||||
</layer-list>
|
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Modify this file to customize your launch splash screen -->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@android:color/white" />
|
||||
|
||||
<!-- You can insert your own image assets here -->
|
||||
<!-- <item>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
android:src="@mipmap/launch_image" />
|
||||
</item> -->
|
||||
</layer-list>
|
After Width: | Height: | Size: 544 B |
After Width: | Height: | Size: 442 B |
After Width: | Height: | Size: 721 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
|
||||
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<!-- Show a splash screen on the activity. Automatically removed when
|
||||
the Flutter engine draws its first frame -->
|
||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||
</style>
|
||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||
This theme determines the color of the Android Window while your
|
||||
Flutter UI initializes, as well as behind your Flutter UI while its
|
||||
running.
|
||||
|
||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<item name="android:windowBackground">?android:colorBackground</item>
|
||||
</style>
|
||||
</resources>
|
18
covas_mobile_new/android/app/src/main/res/values/styles.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
|
||||
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<!-- Show a splash screen on the activity. Automatically removed when
|
||||
the Flutter engine draws its first frame -->
|
||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||
</style>
|
||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||
This theme determines the color of the Android Window while your
|
||||
Flutter UI initializes, as well as behind your Flutter UI while its
|
||||
running.
|
||||
|
||||
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<item name="android:windowBackground">?android:colorBackground</item>
|
||||
</style>
|
||||
</resources>
|
@@ -0,0 +1,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- The INTERNET permission is required for development. Specifically,
|
||||
the Flutter tool needs it to communicate with the running application
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
-->
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
</manifest>
|
24
covas_mobile_new/android/build.gradle.kts
Normal file
@@ -0,0 +1,24 @@
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
val newBuildDir: Directory =
|
||||
rootProject.layout.buildDirectory
|
||||
.dir("../../build")
|
||||
.get()
|
||||
rootProject.layout.buildDirectory.value(newBuildDir)
|
||||
|
||||
subprojects {
|
||||
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
|
||||
project.layout.buildDirectory.value(newSubprojectBuildDir)
|
||||
}
|
||||
subprojects {
|
||||
project.evaluationDependsOn(":app")
|
||||
}
|
||||
|
||||
tasks.register<Delete>("clean") {
|
||||
delete(rootProject.layout.buildDirectory)
|
||||
}
|
3
covas_mobile_new/android/gradle.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
5
covas_mobile_new/android/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
|
26
covas_mobile_new/android/settings.gradle.kts
Normal file
@@ -0,0 +1,26 @@
|
||||
pluginManagement {
|
||||
val flutterSdkPath =
|
||||
run {
|
||||
val properties = java.util.Properties()
|
||||
file("local.properties").inputStream().use { properties.load(it) }
|
||||
val flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
|
||||
flutterSdkPath
|
||||
}
|
||||
|
||||
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
|
||||
id("com.android.application") version "8.9.1" apply false
|
||||
id("org.jetbrains.kotlin.android") version "2.1.0" apply false
|
||||
}
|
||||
|
||||
include(":app")
|
34
covas_mobile_new/ios/.gitignore
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
**/dgph
|
||||
*.mode1v3
|
||||
*.mode2v3
|
||||
*.moved-aside
|
||||
*.pbxuser
|
||||
*.perspectivev3
|
||||
**/*sync/
|
||||
.sconsign.dblite
|
||||
.tags*
|
||||
**/.vagrant/
|
||||
**/DerivedData/
|
||||
Icon?
|
||||
**/Pods/
|
||||
**/.symlinks/
|
||||
profile
|
||||
xcuserdata
|
||||
**/.generated/
|
||||
Flutter/App.framework
|
||||
Flutter/Flutter.framework
|
||||
Flutter/Flutter.podspec
|
||||
Flutter/Generated.xcconfig
|
||||
Flutter/ephemeral/
|
||||
Flutter/app.flx
|
||||
Flutter/app.zip
|
||||
Flutter/flutter_assets/
|
||||
Flutter/flutter_export_environment.sh
|
||||
ServiceDefinitions.json
|
||||
Runner/GeneratedPluginRegistrant.*
|
||||
|
||||
# Exceptions to above rules.
|
||||
!default.mode1v3
|
||||
!default.mode2v3
|
||||
!default.pbxuser
|
||||
!default.perspectivev3
|
26
covas_mobile_new/ios/Flutter/AppFrameworkInfo.plist
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>App</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>io.flutter.flutter.app</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>App</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>13.0</string>
|
||||
</dict>
|
||||
</plist>
|
1
covas_mobile_new/ios/Flutter/Debug.xcconfig
Normal file
@@ -0,0 +1 @@
|
||||
#include "Generated.xcconfig"
|
1
covas_mobile_new/ios/Flutter/Release.xcconfig
Normal file
@@ -0,0 +1 @@
|
||||
#include "Generated.xcconfig"
|
616
covas_mobile_new/ios/Runner.xcodeproj/project.pbxproj
Normal file
@@ -0,0 +1,616 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 54;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
||||
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
|
||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
||||
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
|
||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 97C146E61CF9000F007C117D /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 97C146ED1CF9000F007C117D;
|
||||
remoteInfo = Runner;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
|
||||
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
|
||||
331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
|
||||
331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
||||
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
|
||||
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
|
||||
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
|
||||
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
97C146EB1CF9000F007C117D /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
331C8082294A63A400263BE5 /* RunnerTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
331C807B294A618700263BE5 /* RunnerTests.swift */,
|
||||
);
|
||||
path = RunnerTests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9740EEB11CF90186004384FC /* Flutter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
|
||||
9740EEB21CF90195004384FC /* Debug.xcconfig */,
|
||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
|
||||
9740EEB31CF90195004384FC /* Generated.xcconfig */,
|
||||
);
|
||||
name = Flutter;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
97C146E51CF9000F007C117D = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9740EEB11CF90186004384FC /* Flutter */,
|
||||
97C146F01CF9000F007C117D /* Runner */,
|
||||
97C146EF1CF9000F007C117D /* Products */,
|
||||
331C8082294A63A400263BE5 /* RunnerTests */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
97C146EF1CF9000F007C117D /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
97C146EE1CF9000F007C117D /* Runner.app */,
|
||||
331C8081294A63A400263BE5 /* RunnerTests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
97C146F01CF9000F007C117D /* Runner */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
97C146FA1CF9000F007C117D /* Main.storyboard */,
|
||||
97C146FD1CF9000F007C117D /* Assets.xcassets */,
|
||||
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
|
||||
97C147021CF9000F007C117D /* Info.plist */,
|
||||
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
|
||||
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
|
||||
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
|
||||
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
|
||||
);
|
||||
path = Runner;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
331C8080294A63A400263BE5 /* RunnerTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
|
||||
buildPhases = (
|
||||
331C807D294A63A400263BE5 /* Sources */,
|
||||
331C807F294A63A400263BE5 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
331C8086294A63A400263BE5 /* PBXTargetDependency */,
|
||||
);
|
||||
name = RunnerTests;
|
||||
productName = RunnerTests;
|
||||
productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
97C146ED1CF9000F007C117D /* Runner */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||
buildPhases = (
|
||||
9740EEB61CF901F6004384FC /* Run Script */,
|
||||
97C146EA1CF9000F007C117D /* Sources */,
|
||||
97C146EB1CF9000F007C117D /* Frameworks */,
|
||||
97C146EC1CF9000F007C117D /* Resources */,
|
||||
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = Runner;
|
||||
productName = Runner;
|
||||
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
97C146E61CF9000F007C117D /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
BuildIndependentTargetsInParallel = YES;
|
||||
LastUpgradeCheck = 1510;
|
||||
ORGANIZATIONNAME = "";
|
||||
TargetAttributes = {
|
||||
331C8080294A63A400263BE5 = {
|
||||
CreatedOnToolsVersion = 14.0;
|
||||
TestTargetID = 97C146ED1CF9000F007C117D;
|
||||
};
|
||||
97C146ED1CF9000F007C117D = {
|
||||
CreatedOnToolsVersion = 7.3.1;
|
||||
LastSwiftMigration = 1100;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
|
||||
compatibilityVersion = "Xcode 9.3";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 97C146E51CF9000F007C117D;
|
||||
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
97C146ED1CF9000F007C117D /* Runner */,
|
||||
331C8080294A63A400263BE5 /* RunnerTests */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
331C807F294A63A400263BE5 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
97C146EC1CF9000F007C117D /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
|
||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
|
||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
|
||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
alwaysOutOfDate = 1;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
|
||||
);
|
||||
name = "Thin Binary";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
|
||||
};
|
||||
9740EEB61CF901F6004384FC /* Run Script */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
alwaysOutOfDate = 1;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Run Script";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
331C807D294A63A400263BE5 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
97C146EA1CF9000F007C117D /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
|
||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
331C8086294A63A400263BE5 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 97C146ED1CF9000F007C117D /* Runner */;
|
||||
targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
97C146FA1CF9000F007C117D /* Main.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
97C146FB1CF9000F007C117D /* Base */,
|
||||
);
|
||||
name = Main.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
97C147001CF9000F007C117D /* Base */,
|
||||
);
|
||||
name = LaunchScreen.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
249021D3217E4FDB00AE95B9 /* Profile */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SUPPORTED_PLATFORMS = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Profile;
|
||||
};
|
||||
249021D4217E4FDB00AE95B9 /* Profile */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.covasMobileNew;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
};
|
||||
name = Profile;
|
||||
};
|
||||
331C8088294A63A400263BE5 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.covasMobileNew.RunnerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
331C8089294A63A400263BE5 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.covasMobileNew.RunnerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
331C808A294A63A400263BE5 /* Profile */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
MARKETING_VERSION = 1.0;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.covasMobileNew.RunnerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
|
||||
};
|
||||
name = Profile;
|
||||
};
|
||||
97C147031CF9000F007C117D /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
97C147041CF9000F007C117D /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SUPPORTED_PLATFORMS = iphoneos;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
97C147061CF9000F007C117D /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.covasMobileNew;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
97C147071CF9000F007C117D /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.covasMobileNew;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
331C8088294A63A400263BE5 /* Debug */,
|
||||
331C8089294A63A400263BE5 /* Release */,
|
||||
331C808A294A63A400263BE5 /* Profile */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
97C147031CF9000F007C117D /* Debug */,
|
||||
97C147041CF9000F007C117D /* Release */,
|
||||
249021D3217E4FDB00AE95B9 /* Profile */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
97C147061CF9000F007C117D /* Debug */,
|
||||
97C147071CF9000F007C117D /* Release */,
|
||||
249021D4217E4FDB00AE95B9 /* Profile */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 97C146E61CF9000F007C117D /* Project object */;
|
||||
}
|
7
covas_mobile_new/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>PreviewsEnabled</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</plist>
|
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1510"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||
BuildableName = "Runner.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||
BuildableName = "Runner.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO"
|
||||
parallelizable = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "331C8080294A63A400263BE5"
|
||||
BuildableName = "RunnerTests.xctest"
|
||||
BlueprintName = "RunnerTests"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
enableGPUValidationMode = "1"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||
BuildableName = "Runner.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Profile"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||
BuildableName = "Runner.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
7
covas_mobile_new/ios/Runner.xcworkspace/contents.xcworkspacedata
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:Runner.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>PreviewsEnabled</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</plist>
|
13
covas_mobile_new/ios/Runner/AppDelegate.swift
Normal file
@@ -0,0 +1,13 @@
|
||||
import Flutter
|
||||
import UIKit
|
||||
|
||||
@main
|
||||
@objc class AppDelegate: FlutterAppDelegate {
|
||||
override func application(
|
||||
_ application: UIApplication,
|
||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||
) -> Bool {
|
||||
GeneratedPluginRegistrant.register(with: self)
|
||||
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
||||
}
|
||||
}
|
@@ -0,0 +1,122 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-20x20@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-20x20@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-40x40@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-40x40@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-60x60@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-60x60@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-20x20@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-20x20@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-29x29@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-29x29@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-40x40@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-40x40@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-76x76@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-76x76@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "83.5x83.5",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-83.5x83.5@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "1024x1024",
|
||||
"idiom" : "ios-marketing",
|
||||
"filename" : "Icon-App-1024x1024@1x.png",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 295 B |
After Width: | Height: | Size: 406 B |
After Width: | Height: | Size: 450 B |
After Width: | Height: | Size: 282 B |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 704 B |
After Width: | Height: | Size: 406 B |
After Width: | Height: | Size: 586 B |
After Width: | Height: | Size: 862 B |
After Width: | Height: | Size: 862 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 762 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.4 KiB |
23
covas_mobile_new/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "LaunchImage.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "LaunchImage@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "LaunchImage@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
BIN
covas_mobile_new/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
vendored
Normal file
After Width: | Height: | Size: 68 B |
BIN
covas_mobile_new/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
vendored
Normal file
After Width: | Height: | Size: 68 B |
BIN
covas_mobile_new/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
vendored
Normal file
After Width: | Height: | Size: 68 B |
5
covas_mobile_new/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
# Launch Screen Assets
|
||||
|
||||
You can customize the launch screen with your own desired assets by replacing the image files in this directory.
|
||||
|
||||
You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
|
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="EHf-IW-A2E">
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
|
||||
</imageView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
|
||||
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="53" y="375"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<image name="LaunchImage" width="168" height="185"/>
|
||||
</resources>
|
||||
</document>
|
26
covas_mobile_new/ios/Runner/Base.lproj/Main.storyboard
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Flutter View Controller-->
|
||||
<scene sceneID="tne-QT-ifu">
|
||||
<objects>
|
||||
<viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
49
covas_mobile_new/ios/Runner/Info.plist
Normal file
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>Covas Mobile New</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>covas_mobile_new</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>$(FLUTTER_BUILD_NAME)</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>CADisableMinimumFrameDurationOnPhone</key>
|
||||
<true/>
|
||||
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
1
covas_mobile_new/ios/Runner/Runner-Bridging-Header.h
Normal file
@@ -0,0 +1 @@
|
||||
#import "GeneratedPluginRegistrant.h"
|
12
covas_mobile_new/ios/RunnerTests/RunnerTests.swift
Normal file
@@ -0,0 +1,12 @@
|
||||
import Flutter
|
||||
import UIKit
|
||||
import XCTest
|
||||
|
||||
class RunnerTests: XCTestCase {
|
||||
|
||||
func testExample() {
|
||||
// If you add code to the Runner application, consider adding tests here.
|
||||
// See https://developer.apple.com/documentation/xctest for more information about using XCTest.
|
||||
}
|
||||
|
||||
}
|
209
covas_mobile_new/lib/classes/MyDrawer.dart
Normal file
@@ -0,0 +1,209 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'dart:io';
|
||||
import '../pages/EditProfile.dart';
|
||||
import '../pages/EditSettings.dart';
|
||||
import '../pages/ListItemMenu.dart';
|
||||
import 'alert.dart';
|
||||
|
||||
import '../variable/globals.dart' as globals;
|
||||
|
||||
import '../pages/LoginDemo.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart'; // Import dotenv
|
||||
import 'package:encrypt_shared_preferences/provider.dart';
|
||||
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
class MyDrawer extends StatelessWidget with ShowAlertDialog {
|
||||
Future<void> logout(BuildContext context) async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
var accessToken = prefs.getString("access_token") ?? "";
|
||||
|
||||
if (accessToken.isNotEmpty) {
|
||||
var url = Uri.parse("${globals.api}/token");
|
||||
|
||||
try {
|
||||
var response = await http.delete(url, headers: {
|
||||
"Content-Type": "application/json",
|
||||
HttpHeaders.cookieHeader: "access_token=${accessToken}"
|
||||
});
|
||||
|
||||
print("Status code logout ${response.statusCode}");
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
await prefs.remove("access_token");
|
||||
await dotenv.load(fileName: ".env"); // Load .env file
|
||||
|
||||
final keyEncrypt = dotenv.env['KEY_ENCRYPT'] ?? '';
|
||||
if (keyEncrypt.isNotEmpty) {
|
||||
await EncryptedSharedPreferences.initialize(keyEncrypt);
|
||||
var sharedPref = EncryptedSharedPreferences.getInstance();
|
||||
String username = sharedPref.getString("username") ?? "";
|
||||
String password = sharedPref.getString("password") ?? "";
|
||||
if ((username.isEmpty) || (password.isEmpty)) {
|
||||
sharedPref.remove("username");
|
||||
sharedPref.remove("password");
|
||||
}
|
||||
}
|
||||
Navigator.pushAndRemoveUntil(
|
||||
context,
|
||||
MaterialPageRoute(builder: (_) => LoginDemo()),
|
||||
(route) => false, // Remove all previous routes
|
||||
);
|
||||
} else {
|
||||
String errorMessage;
|
||||
switch (response.statusCode) {
|
||||
case 400:
|
||||
errorMessage = "Bad Request: Please check your input.";
|
||||
break;
|
||||
case 401:
|
||||
errorMessage = "Unauthorized: Invalid credentials.";
|
||||
break;
|
||||
case 403:
|
||||
errorMessage = "Forbidden: You don't have permission.";
|
||||
break;
|
||||
case 404:
|
||||
errorMessage = "Not Found: The resource was not found.";
|
||||
break;
|
||||
case 500:
|
||||
errorMessage =
|
||||
"Server Error: Something went wrong on the server.";
|
||||
break;
|
||||
default:
|
||||
errorMessage = "Unexpected Error: ${response.statusCode}";
|
||||
break;
|
||||
}
|
||||
print(errorMessage);
|
||||
showAlertDialog(context, "Error", errorMessage);
|
||||
}
|
||||
} catch (e) {
|
||||
print("Error: $e");
|
||||
showAlertDialog(
|
||||
context, "Error", "An error occurred. Please try again.");
|
||||
}
|
||||
} else {
|
||||
showAlertDialog(context, "Error", "Invalid token.");
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final loc = AppLocalizations.of(context);
|
||||
final localeProvider = Provider.of<LocaleProvider>(context);
|
||||
return Drawer(
|
||||
child: ListView(
|
||||
padding: EdgeInsets.zero,
|
||||
children: [
|
||||
// Drawer Header
|
||||
DrawerHeader(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.blue,
|
||||
),
|
||||
child: Text(
|
||||
'Menu',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 24,
|
||||
),
|
||||
),
|
||||
),
|
||||
// Drawer Items
|
||||
ListTile(
|
||||
leading: Icon(Icons.home),
|
||||
title: Text(loc?.home ?? "Home"),
|
||||
onTap: () {
|
||||
Navigator.pushReplacement(
|
||||
context, MaterialPageRoute(builder: (_) => ListItemMenu()));
|
||||
|
||||
/// Close the drawer
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(Icons.settings),
|
||||
title: Text(loc?.settings ?? 'Settings'),
|
||||
onTap: () {
|
||||
Navigator.pushReplacement(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (_) => EditSettings())); // Close the drawer
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(Icons.account_circle),
|
||||
title: Text(loc?.update_profile ?? 'Update profile'),
|
||||
onTap: () {
|
||||
Navigator.pushReplacement(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (_) => EditProfile())); // Close the drawer
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(Icons.language),
|
||||
title: Text(loc?.language ?? 'Language'),
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (_) => AlertDialog(
|
||||
title: Text(loc?.select_language ?? 'Select Language'),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
ListTile(
|
||||
leading: Icon(Icons.flag),
|
||||
title: Text(loc?.french ?? 'Français'),
|
||||
onTap: () {
|
||||
Provider.of<LocaleProvider>(context, listen: false)
|
||||
.setLocale(const Locale('fr'));
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(Icons.flag_outlined),
|
||||
title: Text(loc?.english ?? 'English'),
|
||||
onTap: () {
|
||||
Provider.of<LocaleProvider>(context, listen: false)
|
||||
.setLocale(const Locale('en'));
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(Icons.flag_outlined),
|
||||
title: Text(loc?.german ?? 'German'),
|
||||
onTap: () {
|
||||
Provider.of<LocaleProvider>(context, listen: false)
|
||||
.setLocale(const Locale('de'));
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
ListTile(
|
||||
leading: Icon(Icons.info),
|
||||
title: Text(loc?.about ?? 'About'),
|
||||
onTap: () {
|
||||
showAlertDialog(context, loc?.about ?? 'About',
|
||||
"Version 0.0.1"); // Close the drawer
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(Icons.logout),
|
||||
title: Text(loc?.log_out ?? 'Log out'),
|
||||
onTap: () async {
|
||||
logout(context);
|
||||
// Close the drawer
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
27
covas_mobile_new/lib/classes/ad_helper.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
import 'package:google_mobile_ads/google_mobile_ads.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
|
||||
class AdHelper {
|
||||
static Future<BannerAd> createBannerAd(Function setStateCallback) async {
|
||||
await dotenv.load(fileName: ".env");
|
||||
final adUnitId = dotenv.env['AD_UNIT_ID'] ?? '';
|
||||
|
||||
BannerAd bannerAd = BannerAd(
|
||||
adUnitId: adUnitId,
|
||||
size: AdSize.banner,
|
||||
request: AdRequest(),
|
||||
listener: BannerAdListener(
|
||||
onAdLoaded: (ad) {
|
||||
setStateCallback(() {});
|
||||
},
|
||||
onAdFailedToLoad: (ad, error) {
|
||||
print('Banner Ad failed to load: $error');
|
||||
ad.dispose();
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
bannerAd.load();
|
||||
return bannerAd;
|
||||
}
|
||||
}
|
67
covas_mobile_new/lib/classes/addEventImage.dart
Normal file
@@ -0,0 +1,67 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'events.dart';
|
||||
import '../variable/globals.dart' as globals;
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'dart:io';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
mixin ShowDescImageAdd<T extends StatefulWidget> on State<T> {
|
||||
Future<void> addEvents(var events) async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
var accessToken = prefs.getString("access_token") ?? "";
|
||||
List<String> send = ["toto"];
|
||||
|
||||
if (accessToken.isNotEmpty) {
|
||||
var urlPut = Uri.parse("${globals.api}/events");
|
||||
print("start date : ${events["start_date"]}");
|
||||
var responsePut = await http.put(urlPut,
|
||||
headers: {
|
||||
HttpHeaders.cookieHeader: 'access_token=${accessToken}',
|
||||
HttpHeaders.acceptHeader: 'application/json, text/plain, */*',
|
||||
HttpHeaders.contentTypeHeader: 'application/json'
|
||||
},
|
||||
body: jsonEncode({
|
||||
'name': events["name"],
|
||||
'place': events["place"],
|
||||
'start_date': events['date'],
|
||||
'end_date': events['date'],
|
||||
'organizers': send,
|
||||
'latitude': '0.0',
|
||||
'longitude': '0.0',
|
||||
}));
|
||||
|
||||
print("http put code status : ${responsePut.statusCode}");
|
||||
print("http put body : ${responsePut.body}");
|
||||
}
|
||||
}
|
||||
|
||||
void showDescImageAddDialog(BuildContext context, var events) {
|
||||
// Create AlertDialog
|
||||
String name = events['name'];
|
||||
AlertDialog dialog = AlertDialog(
|
||||
title: Text("Ajouter un evenement"),
|
||||
content: Text("${name} n'a pas été trouvé. Voulez-vous l'ajouter ? "),
|
||||
actions: [
|
||||
TextButton(
|
||||
child: Text("Annuler"),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop("Yes, Of course!"); // Return value
|
||||
}),
|
||||
TextButton(
|
||||
child: Text("Oui"),
|
||||
onPressed: () {
|
||||
addEvents(events); // Return value
|
||||
}),
|
||||
],
|
||||
);
|
||||
|
||||
// Call showDialog function to show dialog.
|
||||
Future futureValue = showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return dialog;
|
||||
});
|
||||
}
|
||||
}
|
29
covas_mobile_new/lib/classes/alert.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
mixin ShowAlertDialog {
|
||||
void showAlertDialog(BuildContext context, String title, String text) {
|
||||
// Create AlertDialog
|
||||
AlertDialog dialog = AlertDialog(
|
||||
title: Text(title),
|
||||
content: Text(text),
|
||||
actions: [
|
||||
ElevatedButton(
|
||||
child: Text("OK"),
|
||||
style: ElevatedButton.styleFrom(
|
||||
padding: EdgeInsets.symmetric(horizontal: 50, vertical: 20),
|
||||
textStyle:
|
||||
TextStyle(fontSize: 15, fontWeight: FontWeight.normal)),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop("Yes, Of course!"); // Return value
|
||||
}),
|
||||
],
|
||||
);
|
||||
|
||||
// Call showDialog function to show dialog.
|
||||
Future futureValue = showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return dialog;
|
||||
});
|
||||
}
|
||||
}
|
141
covas_mobile_new/lib/classes/auth_service.dart
Normal file
@@ -0,0 +1,141 @@
|
||||
import 'dart:convert';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import '../variable/globals.dart' as globals;
|
||||
import 'dart:io';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:encrypt_shared_preferences/provider.dart';
|
||||
import '../pages/LoginDemo.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart'; // Import dotenv
|
||||
|
||||
class AuthService {
|
||||
// Login with username and password
|
||||
Future<bool> login(String username, String password,
|
||||
{bool rememberMe = false}) async {
|
||||
final url = Uri.parse("${globals.api}/token");
|
||||
|
||||
try {
|
||||
final response = await http.post(
|
||||
url,
|
||||
headers: {
|
||||
'accept': 'application/json',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
body: {"username": username, "password": password},
|
||||
);
|
||||
|
||||
if (response.statusCode == 200 || response.statusCode == 201) {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
if (rememberMe) {
|
||||
await dotenv.load(fileName: ".env"); // Load .env file
|
||||
|
||||
final keyEncrypt = dotenv.env['KEY_ENCRYPT'] ?? '';
|
||||
if (keyEncrypt.isNotEmpty) {
|
||||
await EncryptedSharedPreferences.initialize(keyEncrypt);
|
||||
var sharedPref = EncryptedSharedPreferences.getInstance();
|
||||
sharedPref.setString("username", username);
|
||||
sharedPref.setString("password", password);
|
||||
}
|
||||
}
|
||||
final cookies = response.headers["set-cookie"]?.split(";") ?? [];
|
||||
|
||||
for (final cookie in cookies) {
|
||||
final cookieParts = cookie.split(",");
|
||||
for (final part in cookieParts) {
|
||||
final keyValue = part.split("=");
|
||||
if (keyValue.length == 2 && keyValue[0] == "access_token") {
|
||||
prefs.setString("access_token", keyValue[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} catch (e) {
|
||||
print("Login error: $e");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Logout
|
||||
Future<void> logout() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
await prefs.remove("access_token");
|
||||
}
|
||||
|
||||
Future<bool> isLoggedIn() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
final accessToken = prefs.getString("access_token");
|
||||
|
||||
if (accessToken == null || accessToken.isEmpty) {
|
||||
print("No access token found.");
|
||||
return false;
|
||||
}
|
||||
|
||||
print("Checking token validity...");
|
||||
var url = Uri.parse("${globals.api}/token");
|
||||
|
||||
try {
|
||||
final response = await http.get(
|
||||
url,
|
||||
headers: {
|
||||
HttpHeaders.cookieHeader: "access_token=$accessToken",
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
print("Token is valid.");
|
||||
return true;
|
||||
} else {
|
||||
print("Token is invalid. Status code: ${response.statusCode}");
|
||||
await dotenv.load(fileName: ".env"); // Load .env file
|
||||
|
||||
final keyEncrypt = dotenv.env['KEY_ENCRYPT'] ?? '';
|
||||
if (keyEncrypt.isNotEmpty) {
|
||||
await EncryptedSharedPreferences.initialize(keyEncrypt);
|
||||
var sharedPref = EncryptedSharedPreferences.getInstance();
|
||||
String username = sharedPref.getString("username") ?? "";
|
||||
String password = sharedPref.getString("password") ?? "";
|
||||
if ((username.isEmpty) || (password.isEmpty)) {
|
||||
sharedPref.remove("username");
|
||||
sharedPref.remove("password");
|
||||
await prefs.remove("access_token"); // Clear invalid token
|
||||
return false;
|
||||
} else {
|
||||
return login(username, password);
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
print("Error while checking token: $e");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> checkTokenStatus(context) async {
|
||||
bool loggedIn = await isLoggedIn();
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
|
||||
if (!loggedIn) {
|
||||
await prefs.remove("access_token"); // Correctly remove the token
|
||||
|
||||
Navigator.pushAndRemoveUntil(
|
||||
context,
|
||||
MaterialPageRoute(builder: (_) => LoginDemo()),
|
||||
(route) => false, // Remove all previous routes
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Get stored access token
|
||||
Future<String?> getAccessToken() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
return prefs.getString("access_token");
|
||||
}
|
||||
|
||||
// Login with Google
|
||||
}
|
34
covas_mobile_new/lib/classes/eventAdded.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../pages/ListItemMenu.dart';
|
||||
|
||||
mixin ShowEventDialog<T extends StatefulWidget> on State<T> {
|
||||
void showEventDialog(BuildContext context, String text) {
|
||||
// Create AlertDialog
|
||||
AlertDialog dialog = AlertDialog(
|
||||
title: Text("Evenement ajoute"),
|
||||
content: Text(text),
|
||||
actions: [
|
||||
ElevatedButton(
|
||||
child: Text("OK"),
|
||||
style: ElevatedButton.styleFrom(
|
||||
padding: EdgeInsets.symmetric(horizontal: 50, vertical: 20),
|
||||
textStyle:
|
||||
TextStyle(fontSize: 15, fontWeight: FontWeight.normal)),
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (_) => ListItemMenu())); // Return value
|
||||
}),
|
||||
],
|
||||
);
|
||||
|
||||
// Call showDialog function to show dialog.
|
||||
Future futureValue = showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return dialog;
|
||||
});
|
||||
}
|
||||
}
|
54
covas_mobile_new/lib/classes/events.dart
Normal file
@@ -0,0 +1,54 @@
|
||||
class Events {
|
||||
String? id;
|
||||
String? name;
|
||||
String? place;
|
||||
String? startDate;
|
||||
String? endDate;
|
||||
String? description;
|
||||
String? link;
|
||||
String? ticket;
|
||||
double? latitude;
|
||||
double? longitude;
|
||||
List<String>? tags;
|
||||
List<String>? organizers;
|
||||
String? imgUrl;
|
||||
int? interestedCount;
|
||||
bool? interested;
|
||||
Events(
|
||||
{this.place,
|
||||
this.id,
|
||||
this.name,
|
||||
this.startDate,
|
||||
this.description,
|
||||
this.endDate,
|
||||
this.tags,
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
this.organizers,
|
||||
this.link,
|
||||
this.ticket,
|
||||
this.imgUrl,
|
||||
this.interestedCount,
|
||||
this.interested});
|
||||
|
||||
Events.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'] as String?;
|
||||
name = json['name'] as String?;
|
||||
place = json['place'] as String?;
|
||||
startDate = json['start_date'] as String?;
|
||||
endDate = json['end_date'] as String?;
|
||||
description = json['description'] as String?;
|
||||
latitude = (json['latitude'] as num?)?.toDouble(); // Safely cast to double
|
||||
longitude =
|
||||
(json['longitude'] as num?)?.toDouble(); // Safely cast to double
|
||||
tags = (json['tags'] as List<dynamic>?)
|
||||
?.cast<String>(); // Convert List<dynamic> to List<String>
|
||||
organizers = (json['organizers'] as List<dynamic>?)
|
||||
?.cast<String>(); // Convert List<dynamic> to List<String>
|
||||
imgUrl = json['imgUrl'] as String?;
|
||||
link = json['link'] as String?;
|
||||
ticket = json['ticket'] as String?;
|
||||
interested = json['interested'] as bool?;
|
||||
interestedCount = json['interested_count'] as int?;
|
||||
}
|
||||
}
|
67
covas_mobile_new/lib/classes/getEventImage.dart
Normal file
@@ -0,0 +1,67 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'events.dart';
|
||||
import '../variable/globals.dart' as globals;
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'dart:io';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
mixin ShowDescImageGet<T extends StatefulWidget> on State<T> {
|
||||
Future<void> getEvents(var events) async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
var accessToken = prefs.getString("access_token") ?? "";
|
||||
List<String> send = ["toto"];
|
||||
|
||||
if (accessToken.isNotEmpty) {
|
||||
var urlPut = Uri.parse("${globals.api}/events");
|
||||
print("start date : ${events["start_date"]}");
|
||||
var responsePut = await http.put(urlPut,
|
||||
headers: {
|
||||
HttpHeaders.cookieHeader: 'access_token=${accessToken}',
|
||||
HttpHeaders.acceptHeader: 'application/json, text/plain, */*',
|
||||
HttpHeaders.contentTypeHeader: 'application/json'
|
||||
},
|
||||
body: jsonEncode({
|
||||
'name': events["name"],
|
||||
'place': events["place"],
|
||||
'start_date': events['date'],
|
||||
'end_date': events['date'],
|
||||
'organizers': send,
|
||||
'latitude': '0.0',
|
||||
'longitude': '0.0',
|
||||
}));
|
||||
|
||||
print("http put code status : ${responsePut.statusCode}");
|
||||
print("http put body : ${responsePut.body}");
|
||||
}
|
||||
}
|
||||
|
||||
void showDescImageGetDialog(BuildContext context, var events) {
|
||||
// Create AlertDialog
|
||||
String name = events['name'];
|
||||
AlertDialog dialog = AlertDialog(
|
||||
title: Text("Voir la description de l'evenement"),
|
||||
content: Text("${name} a été trouvé. Voulez-vous voir sa description ? "),
|
||||
actions: [
|
||||
TextButton(
|
||||
child: Text("Annuler"),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop("Yes, Of course!"); // Return value
|
||||
}),
|
||||
TextButton(
|
||||
child: Text("Oui"),
|
||||
onPressed: () {
|
||||
getEvents(events); // Return value
|
||||
}),
|
||||
],
|
||||
);
|
||||
|
||||
// Call showDialog function to show dialog.
|
||||
Future futureValue = showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return dialog;
|
||||
});
|
||||
}
|
||||
}
|
91
covas_mobile_new/lib/classes/notification_service.dart
Normal file
@@ -0,0 +1,91 @@
|
||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||
import 'package:timezone/timezone.dart' as tz;
|
||||
import 'package:timezone/data/latest_all.dart' as tz;
|
||||
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class NotificationService {
|
||||
static final FlutterLocalNotificationsPlugin _notificationsPlugin =
|
||||
FlutterLocalNotificationsPlugin();
|
||||
|
||||
/// Initialisation (à appeler dans main())
|
||||
static Future<void> initialize() async {
|
||||
tz.initializeTimeZones();
|
||||
|
||||
const AndroidInitializationSettings androidInitSettings =
|
||||
AndroidInitializationSettings('@mipmap/ic_launcher');
|
||||
|
||||
const InitializationSettings initSettings = InitializationSettings(
|
||||
android: androidInitSettings,
|
||||
iOS: DarwinInitializationSettings(),
|
||||
);
|
||||
|
||||
await _notificationsPlugin.initialize(initSettings);
|
||||
|
||||
// Demande les permissions au lancement
|
||||
await requestPermissions();
|
||||
}
|
||||
|
||||
/// Demander les permissions (Android 13+ et iOS)
|
||||
static Future<void> requestPermissions() async {
|
||||
// Android 13+
|
||||
final androidImplementation =
|
||||
_notificationsPlugin.resolvePlatformSpecificImplementation<
|
||||
AndroidFlutterLocalNotificationsPlugin>();
|
||||
await androidImplementation?.requestNotificationsPermission();
|
||||
|
||||
// iOS
|
||||
final iosImplementation =
|
||||
_notificationsPlugin.resolvePlatformSpecificImplementation<
|
||||
IOSFlutterLocalNotificationsPlugin>();
|
||||
await iosImplementation?.requestPermissions(
|
||||
alert: true,
|
||||
badge: true,
|
||||
sound: true,
|
||||
);
|
||||
}
|
||||
|
||||
/// Planifie une notification 1h avant l’évènement
|
||||
static Future<void> scheduleEventNotification({
|
||||
required String eventId,
|
||||
required String title,
|
||||
required String body,
|
||||
required DateTime eventDate,
|
||||
}) async {
|
||||
final scheduledDate = eventDate.subtract(const Duration(hours: 1));
|
||||
|
||||
if (scheduledDate.isBefore(DateTime.now())) {
|
||||
// Trop tard pour notifier
|
||||
return;
|
||||
}
|
||||
|
||||
await _notificationsPlugin.zonedSchedule(
|
||||
eventId.hashCode, // identifiant unique pour l’évènement
|
||||
title,
|
||||
body,
|
||||
tz.TZDateTime.from(scheduledDate, tz.local),
|
||||
const NotificationDetails(
|
||||
android: AndroidNotificationDetails(
|
||||
'events_channel',
|
||||
'Events',
|
||||
channelDescription: 'Favorite event notifications ',
|
||||
importance: Importance.high,
|
||||
priority: Priority.high,
|
||||
),
|
||||
iOS: DarwinNotificationDetails(),
|
||||
),
|
||||
androidScheduleMode: AndroidScheduleMode
|
||||
.inexactAllowWhileIdle, // évite l'erreur Exact Alarm
|
||||
uiLocalNotificationDateInterpretation:
|
||||
UILocalNotificationDateInterpretation.absoluteTime,
|
||||
matchDateTimeComponents: DateTimeComponents.dateAndTime,
|
||||
);
|
||||
}
|
||||
|
||||
/// Annule une notification planifiée
|
||||
static Future<void> cancel(String eventId) async {
|
||||
await _notificationsPlugin.cancel(eventId.hashCode);
|
||||
}
|
||||
}
|
143
covas_mobile_new/lib/l10n/app_de.arb
Normal file
@@ -0,0 +1,143 @@
|
||||
{
|
||||
"@@locale": "de",
|
||||
"menu_list": "Veranstaltungsmenü",
|
||||
"language": "Sprache",
|
||||
"home": "Startseite",
|
||||
"settings": "Einstellungen",
|
||||
"update_profile": "Profil aktualisieren",
|
||||
"about": "Über",
|
||||
"log_out": "Abmelden",
|
||||
"french": "Französisch",
|
||||
"english": "Englisch",
|
||||
"german": "Deutsch",
|
||||
"select_language": "Sprache auswählen",
|
||||
"search_item": "Nach Element suchen",
|
||||
"search_tag": "Nach Schlagwörtern suchen",
|
||||
"search_geographical": "Nach geografischer Zone suchen",
|
||||
"show_date_field": "Datumsfelder anzeigen",
|
||||
"hide_date_field": "Datumsfelder ausblenden",
|
||||
"no_data": "Keine Daten verfügbar",
|
||||
"search": "Suchen",
|
||||
"no_events": "Keine Veranstaltungen für diesen Ort verfügbar.",
|
||||
"start_date": "Anfangsdatum",
|
||||
"end_date": "Enddatum",
|
||||
"failed_suggestions": "Vorschläge konnten nicht geladen werden",
|
||||
"error": "Fehler",
|
||||
"password_different": "Ein anderes Passwort eingeben",
|
||||
"create": "Erstellung",
|
||||
"user_create": "Benutzer wurde erstellt",
|
||||
"user_update": "Benutzer wurde aktualisiert",
|
||||
"request_error": "Fehlerhafte Anfrage",
|
||||
"incorrect_password": "Falsches Passwort",
|
||||
"unknown_user": "Unbekannter Benutzer",
|
||||
"disabled_user": "Benutzer deaktiviert",
|
||||
"invalid_token": "Ungültiger Token",
|
||||
"internal_error_server": "Interner Serverfehler",
|
||||
"unknown_error_auth": "Unbekannter Authentifizierungsfehler",
|
||||
"required_input": "Pflichtfeld",
|
||||
"create_profile": "Profil erstellen",
|
||||
"edit_pseudo": "Benutzernamen bearbeiten",
|
||||
"password": "Passwort",
|
||||
"enter_password": "Passwort eingeben",
|
||||
"password_confirmed": "Passwort bestätigt",
|
||||
"last_name": "Nachname",
|
||||
"first_name": "Vorname",
|
||||
"email": "E-Mail",
|
||||
"edit_last_name": "Nachnamen bearbeiten",
|
||||
"edit_first_name": "Vornamen bearbeiten",
|
||||
"edit_email": "E-Mail-Adresse bearbeiten",
|
||||
"birth_date": "Geburtsdatum",
|
||||
"edit_birth": "Geburtsdatum bearbeiten",
|
||||
"create_profile_button": "Profil erstellen",
|
||||
"take_picture": "Foto aufnehmen",
|
||||
"error_ia": "Google KI konnte das Bild nicht analysieren. Bitte ein anderes versuchen.",
|
||||
"no_data_geo": "Keine geografischen Daten",
|
||||
"response_status_update": "Statuscode-Antwort aktualisieren",
|
||||
"error_token": "Token-Fehler",
|
||||
"error_format": "Vom KI geliefertes Datenformat ist fehlerhaft",
|
||||
"display_picture": "Bild anzeigen",
|
||||
"analyze_image": "Bildanalyse läuft",
|
||||
"loading_progress": "Ladefortschritt",
|
||||
"error_event": "Veranstaltungsfehler",
|
||||
"no_future_event": "Keine zukünftigen Veranstaltungen",
|
||||
"error_user": "Benutzerfehler",
|
||||
"empty_input": "Eingabefeld leer",
|
||||
"info_event": "Veranstaltungsinfo",
|
||||
"event_already": "Veranstaltung existiert bereits",
|
||||
"picture_error": "Bildfehler",
|
||||
"no_picture_published": "Kein Bild veröffentlicht",
|
||||
"event_update": "Veranstaltung aktualisiert",
|
||||
"location": "Ort",
|
||||
"add_event": "Veranstaltung hinzufügen oder aktualisieren",
|
||||
"edit_image": "Bilder bearbeiten",
|
||||
"name": "Name",
|
||||
"edit_event_name": "Veranstaltungsname bearbeiten",
|
||||
"start_time": "Startzeit",
|
||||
"end_time": "Endzeit",
|
||||
"select_date": "Zum Auswählen eines Datums klicken",
|
||||
"select_time": "Zum Auswählen einer Uhrzeit klicken",
|
||||
"tag": "Schlagwörter",
|
||||
"already_tag": "Dieses Schlagwort ist bereits vorhanden",
|
||||
"enter_tag": "Ein Schlagwort eingeben",
|
||||
"organizer": "Veranstalter",
|
||||
"already_organiser": "Veranstalter bereits vorhanden",
|
||||
"enter_organizer": "Veranstalter eingeben",
|
||||
"description": "Beschreibung",
|
||||
"describe_event": "Veranstaltung beschreiben",
|
||||
"add": "Hinzufügen",
|
||||
"different_password_error": "Passwörter stimmen nicht überein",
|
||||
"update": "Aktualisieren",
|
||||
"updated": "Aktualisiert",
|
||||
"settings_updated": "Einstellungen aktualisiert",
|
||||
"define_kilometer": "Kilometer definieren",
|
||||
"email_sent": "E-Mail wurde gesendet",
|
||||
"forgot_password": "Passwort vergessen",
|
||||
"enter_email": "E-Mail eingeben",
|
||||
"send_email": "E-Mail senden",
|
||||
"invalid_cache": "Ungültiger Cache",
|
||||
"item_date": "Datum : ",
|
||||
"item_maps": "Karte : ",
|
||||
"item_organizer": "Veranstalter : ",
|
||||
"item_description": "Beschreibung : ",
|
||||
"item_tags": "Schlagwörter : ",
|
||||
"failed_auth": "Authentifizierung fehlgeschlagen",
|
||||
"login_page": "Anmeldeseite",
|
||||
"pseudo": "Benutzername",
|
||||
"enter_existing_pseudo": "Vorhandenen Benutzernamen eingeben",
|
||||
"remembr_me": "Angemeldet bleiben",
|
||||
"new_user": "Neuer Benutzer? Konto erstellen",
|
||||
"sign_in": "Anmelden",
|
||||
"map_token": "Mapbox-Zugangstoken ist nicht verfügbar",
|
||||
"geo_disabled": "Standortdienste sind deaktiviert.",
|
||||
"permission_denied": "Standortberechtigungen wurden verweigert.",
|
||||
"enable_permission": "Standortberechtigungen dauerhaft verweigert. Bitte in den Einstellungen aktivieren.",
|
||||
"no_last_position": "Keine letzte bekannte Position verfügbar.",
|
||||
"failed_location": "Standort konnte nicht ermittelt werden",
|
||||
"failed_fetch": "Route konnte nicht abgerufen werden",
|
||||
"invalid_coordinates_symbol": "Ungültige Koordinaten, Symbol kann nicht hinzugefügt werden.",
|
||||
"error_symbol": "Fehler beim Hinzufügen des Symbols.",
|
||||
"position_not_init": "Benutzerposition noch nicht initialisiert. Erneut versuchen.",
|
||||
"invalid_coordinates": "Ungültige Koordinaten.",
|
||||
"walking": "Zu Fuß",
|
||||
"cycling": "Mit dem Fahrrad",
|
||||
"driving": "Mit dem Auto",
|
||||
"get_direction": "Wegbeschreibung und Markierungen anzeigen",
|
||||
"missing_token": "Zugangstoken fehlt",
|
||||
"geocoding_error": "Fehler bei der Geokodierung",
|
||||
"no_found_place": "Kein Ort gefunden",
|
||||
"upload_error": "Fehler beim Hochladen des Bildes",
|
||||
"event_added": "Veranstaltung hinzugefügt",
|
||||
"unknown_error": "Unbekannter Fehler",
|
||||
"app_error": "Anwendungsfehler",
|
||||
"at": "um",
|
||||
"to_date": "bis",
|
||||
"item_link": "Link : ",
|
||||
"item_ticket": "Abendkarte : ",
|
||||
"link": "Link",
|
||||
"edit_link": "Linkereignis bearbeiten",
|
||||
"ticket": "Abendkarte",
|
||||
"edit_ticket": "Ticketlink bearbeiten",
|
||||
"toogle_interest": "Fehler beim Umschalten des Interesses",
|
||||
"error_update": "Fehler beim Update",
|
||||
"count_interested": "Anzahl der Interessenten"
|
||||
}
|