Compare commits
17 Commits
feature/no
...
main
Author | SHA1 | Date | |
---|---|---|---|
5ee053272e | |||
1bb2612de3 | |||
86f81ff009 | |||
9989aebc32 | |||
35fc1cfa25 | |||
692d55858c | |||
59b16e5131 | |||
89c5e1aa6c | |||
f4fb846855 | |||
9a9287bd20 | |||
210da71d50 | |||
63ea3091e8 | |||
3310bd572e | |||
6d504139b0 | |||
6169483839 | |||
2f74f5ed78 | |||
70545052c2 |
10
covas_mobile_new/.gitignore
vendored
@@ -5,11 +5,9 @@
|
||||
*.swp
|
||||
.DS_Store
|
||||
.atom/
|
||||
.build/
|
||||
.buildlog/
|
||||
.history
|
||||
.svn/
|
||||
.swiftpm/
|
||||
migrate_working_dir/
|
||||
|
||||
# IntelliJ related
|
||||
@@ -27,11 +25,15 @@ migrate_working_dir/
|
||||
**/doc/api/
|
||||
**/ios/Flutter/.last_build_id
|
||||
.dart_tool/
|
||||
.flutter-plugins
|
||||
.flutter-plugins-dependencies
|
||||
.packages
|
||||
.pub-cache/
|
||||
.pub/
|
||||
/build/
|
||||
/coverage/
|
||||
|
||||
# Web related
|
||||
lib/generated_plugin_registrant.dart
|
||||
|
||||
# Symbolication related
|
||||
app.*.symbols
|
||||
@@ -43,3 +45,5 @@ app.*.map.json
|
||||
/android/app/debug
|
||||
/android/app/profile
|
||||
/android/app/release
|
||||
|
||||
.env
|
@@ -13,6 +13,7 @@ android {
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
isCoreLibraryDesugaringEnabled = true
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
@@ -39,6 +40,10 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4")
|
||||
}
|
||||
|
||||
flutter {
|
||||
source = "../.."
|
||||
}
|
||||
|
@@ -1,8 +1,15 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<application
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
||||
|
||||
<application
|
||||
android:label="covas_mobile_new"
|
||||
android:name="${applicationName}"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
<meta-data
|
||||
android:name="com.google.android.gms.ads.APPLICATION_ID"
|
||||
android:value="ca-app-pub-4855855675386260~3438207239"/>
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
@@ -11,12 +18,13 @@
|
||||
android:theme="@style/LaunchTheme"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:hardwareAccelerated="true"
|
||||
android:enableOnBackInvokedCallback="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
|
||||
<meta-data
|
||||
android:name="io.flutter.embedding.android.NormalTheme"
|
||||
android:resource="@style/NormalTheme"
|
||||
/>
|
||||
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
5
covas_mobile_new/l10n.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
arb-dir: lib/l10n
|
||||
template-arb-file: app_en.arb
|
||||
output-localization-file: app_localizations.dart
|
||||
output-class: AppLocalizations
|
||||
output-dir: lib/gen_l10n
|
@@ -15,7 +15,7 @@ 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';
|
||||
import 'package:covas_mobile/gen_l10n/app_localizations.dart';
|
||||
|
||||
class MyDrawer extends StatelessWidget with ShowAlertDialog {
|
||||
Future<void> logout(BuildContext context) async {
|
||||
|
@@ -3,7 +3,7 @@ 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:covas_mobile/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class NotificationService {
|
||||
@@ -78,8 +78,6 @@ class NotificationService {
|
||||
),
|
||||
androidScheduleMode: AndroidScheduleMode
|
||||
.inexactAllowWhileIdle, // évite l'erreur Exact Alarm
|
||||
uiLocalNotificationDateInterpretation:
|
||||
UILocalNotificationDateInterpretation.absoluteTime,
|
||||
matchDateTimeComponents: DateTimeComponents.dateAndTime,
|
||||
);
|
||||
}
|
||||
|
977
covas_mobile_new/lib/gen_l10n/app_localizations.dart
Normal file
@@ -0,0 +1,977 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:intl/intl.dart' as intl;
|
||||
|
||||
import 'app_localizations_de.dart';
|
||||
import 'app_localizations_en.dart';
|
||||
import 'app_localizations_fr.dart';
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
/// Callers can lookup localized strings with an instance of AppLocalizations
|
||||
/// returned by `AppLocalizations.of(context)`.
|
||||
///
|
||||
/// Applications need to include `AppLocalizations.delegate()` in their app's
|
||||
/// `localizationDelegates` list, and the locales they support in the app's
|
||||
/// `supportedLocales` list. For example:
|
||||
///
|
||||
/// ```dart
|
||||
/// import 'gen_l10n/app_localizations.dart';
|
||||
///
|
||||
/// return MaterialApp(
|
||||
/// localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
/// supportedLocales: AppLocalizations.supportedLocales,
|
||||
/// home: MyApplicationHome(),
|
||||
/// );
|
||||
/// ```
|
||||
///
|
||||
/// ## Update pubspec.yaml
|
||||
///
|
||||
/// Please make sure to update your pubspec.yaml to include the following
|
||||
/// packages:
|
||||
///
|
||||
/// ```yaml
|
||||
/// dependencies:
|
||||
/// # Internationalization support.
|
||||
/// flutter_localizations:
|
||||
/// sdk: flutter
|
||||
/// intl: any # Use the pinned version from flutter_localizations
|
||||
///
|
||||
/// # Rest of dependencies
|
||||
/// ```
|
||||
///
|
||||
/// ## iOS Applications
|
||||
///
|
||||
/// iOS applications define key application metadata, including supported
|
||||
/// locales, in an Info.plist file that is built into the application bundle.
|
||||
/// To configure the locales supported by your app, you’ll need to edit this
|
||||
/// file.
|
||||
///
|
||||
/// First, open your project’s ios/Runner.xcworkspace Xcode workspace file.
|
||||
/// Then, in the Project Navigator, open the Info.plist file under the Runner
|
||||
/// project’s Runner folder.
|
||||
///
|
||||
/// Next, select the Information Property List item, select Add Item from the
|
||||
/// Editor menu, then select Localizations from the pop-up menu.
|
||||
///
|
||||
/// Select and expand the newly-created Localizations item then, for each
|
||||
/// locale your application supports, add a new item and select the locale
|
||||
/// you wish to add from the pop-up menu in the Value field. This list should
|
||||
/// be consistent with the languages listed in the AppLocalizations.supportedLocales
|
||||
/// property.
|
||||
abstract class AppLocalizations {
|
||||
AppLocalizations(String locale)
|
||||
: localeName = intl.Intl.canonicalizedLocale(locale.toString());
|
||||
|
||||
final String localeName;
|
||||
|
||||
static AppLocalizations? of(BuildContext context) {
|
||||
return Localizations.of<AppLocalizations>(context, AppLocalizations);
|
||||
}
|
||||
|
||||
static const LocalizationsDelegate<AppLocalizations> delegate =
|
||||
_AppLocalizationsDelegate();
|
||||
|
||||
/// A list of this localizations delegate along with the default localizations
|
||||
/// delegates.
|
||||
///
|
||||
/// Returns a list of localizations delegates containing this delegate along with
|
||||
/// GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate,
|
||||
/// and GlobalWidgetsLocalizations.delegate.
|
||||
///
|
||||
/// Additional delegates can be added by appending to this list in
|
||||
/// MaterialApp. This list does not have to be used at all if a custom list
|
||||
/// of delegates is preferred or required.
|
||||
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates =
|
||||
<LocalizationsDelegate<dynamic>>[
|
||||
delegate,
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
];
|
||||
|
||||
/// A list of this localizations delegate's supported locales.
|
||||
static const List<Locale> supportedLocales = <Locale>[
|
||||
Locale('de'),
|
||||
Locale('en'),
|
||||
Locale('fr')
|
||||
];
|
||||
|
||||
/// No description provided for @menu_list.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Event list menu'**
|
||||
String get menu_list;
|
||||
|
||||
/// No description provided for @language.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Language'**
|
||||
String get language;
|
||||
|
||||
/// No description provided for @home.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Home'**
|
||||
String get home;
|
||||
|
||||
/// No description provided for @settings.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Settings'**
|
||||
String get settings;
|
||||
|
||||
/// No description provided for @update_profile.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Update profile'**
|
||||
String get update_profile;
|
||||
|
||||
/// No description provided for @about.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'About'**
|
||||
String get about;
|
||||
|
||||
/// No description provided for @log_out.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Log out'**
|
||||
String get log_out;
|
||||
|
||||
/// No description provided for @french.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'French'**
|
||||
String get french;
|
||||
|
||||
/// No description provided for @english.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'English'**
|
||||
String get english;
|
||||
|
||||
/// No description provided for @german.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'German'**
|
||||
String get german;
|
||||
|
||||
/// No description provided for @select_language.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Select language'**
|
||||
String get select_language;
|
||||
|
||||
/// No description provided for @search_item.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Search by item'**
|
||||
String get search_item;
|
||||
|
||||
/// No description provided for @search_tag.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Search by tags'**
|
||||
String get search_tag;
|
||||
|
||||
/// No description provided for @search_geographical.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Search by geographical zone'**
|
||||
String get search_geographical;
|
||||
|
||||
/// No description provided for @show_date_field.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Show Date Fields'**
|
||||
String get show_date_field;
|
||||
|
||||
/// No description provided for @hide_date_field.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Hide Date Fields'**
|
||||
String get hide_date_field;
|
||||
|
||||
/// No description provided for @no_data.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'No data available'**
|
||||
String get no_data;
|
||||
|
||||
/// No description provided for @search.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Search'**
|
||||
String get search;
|
||||
|
||||
/// No description provided for @no_events.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'No events available for this location.'**
|
||||
String get no_events;
|
||||
|
||||
/// No description provided for @start_date.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Start date'**
|
||||
String get start_date;
|
||||
|
||||
/// No description provided for @end_date.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'End date'**
|
||||
String get end_date;
|
||||
|
||||
/// No description provided for @failed_suggestions.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Failed to load suggestions'**
|
||||
String get failed_suggestions;
|
||||
|
||||
/// No description provided for @error.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Error'**
|
||||
String get error;
|
||||
|
||||
/// No description provided for @password_different.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Must write a different password'**
|
||||
String get password_different;
|
||||
|
||||
/// No description provided for @create.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Creation'**
|
||||
String get create;
|
||||
|
||||
/// No description provided for @user_create.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Your user created'**
|
||||
String get user_create;
|
||||
|
||||
/// No description provided for @user_update.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Your user updated'**
|
||||
String get user_update;
|
||||
|
||||
/// No description provided for @request_error.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Poorly constructed query'**
|
||||
String get request_error;
|
||||
|
||||
/// No description provided for @incorrect_password.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Incorrect password'**
|
||||
String get incorrect_password;
|
||||
|
||||
/// No description provided for @unknown_user.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Unknown user'**
|
||||
String get unknown_user;
|
||||
|
||||
/// No description provided for @disabled_user.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'User disabled'**
|
||||
String get disabled_user;
|
||||
|
||||
/// No description provided for @invalid_token.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Invalid token'**
|
||||
String get invalid_token;
|
||||
|
||||
/// No description provided for @internal_error_server.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Internal error server'**
|
||||
String get internal_error_server;
|
||||
|
||||
/// No description provided for @unknown_error_auth.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Unknown error authentification'**
|
||||
String get unknown_error_auth;
|
||||
|
||||
/// No description provided for @required_input.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Required input'**
|
||||
String get required_input;
|
||||
|
||||
/// No description provided for @create_profile.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Create profile'**
|
||||
String get create_profile;
|
||||
|
||||
/// No description provided for @edit_pseudo.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Edit pseudo'**
|
||||
String get edit_pseudo;
|
||||
|
||||
/// No description provided for @password.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Password'**
|
||||
String get password;
|
||||
|
||||
/// No description provided for @enter_password.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Enter the passord'**
|
||||
String get enter_password;
|
||||
|
||||
/// No description provided for @password_confirmed.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Password confirmed'**
|
||||
String get password_confirmed;
|
||||
|
||||
/// No description provided for @last_name.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Last name'**
|
||||
String get last_name;
|
||||
|
||||
/// No description provided for @first_name.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'First name'**
|
||||
String get first_name;
|
||||
|
||||
/// No description provided for @email.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Mail'**
|
||||
String get email;
|
||||
|
||||
/// No description provided for @edit_last_name.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Edit name'**
|
||||
String get edit_last_name;
|
||||
|
||||
/// No description provided for @edit_first_name.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Edit first name'**
|
||||
String get edit_first_name;
|
||||
|
||||
/// No description provided for @edit_email.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Edit email address'**
|
||||
String get edit_email;
|
||||
|
||||
/// No description provided for @birth_date.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Birth date'**
|
||||
String get birth_date;
|
||||
|
||||
/// No description provided for @edit_birth.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Edit birth date'**
|
||||
String get edit_birth;
|
||||
|
||||
/// No description provided for @create_profile_button.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Create profile'**
|
||||
String get create_profile_button;
|
||||
|
||||
/// No description provided for @take_picture.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Take a picture'**
|
||||
String get take_picture;
|
||||
|
||||
/// No description provided for @error_ia.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Google AI failed to analyze picture. Retry with another one'**
|
||||
String get error_ia;
|
||||
|
||||
/// No description provided for @no_data_geo.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'No geographical data'**
|
||||
String get no_data_geo;
|
||||
|
||||
/// No description provided for @response_status_update.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'response status code update'**
|
||||
String get response_status_update;
|
||||
|
||||
/// No description provided for @error_token.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Token error'**
|
||||
String get error_token;
|
||||
|
||||
/// No description provided for @error_format.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Data format error given by AI'**
|
||||
String get error_format;
|
||||
|
||||
/// No description provided for @display_picture.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Display the Picture'**
|
||||
String get display_picture;
|
||||
|
||||
/// No description provided for @analyze_image.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Image Analyze in progress'**
|
||||
String get analyze_image;
|
||||
|
||||
/// No description provided for @loading_progress.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Loading progress'**
|
||||
String get loading_progress;
|
||||
|
||||
/// No description provided for @error_event.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Event error'**
|
||||
String get error_event;
|
||||
|
||||
/// No description provided for @no_future_event.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'No future event'**
|
||||
String get no_future_event;
|
||||
|
||||
/// No description provided for @error_user.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Error user'**
|
||||
String get error_user;
|
||||
|
||||
/// No description provided for @empty_input.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Empty input'**
|
||||
String get empty_input;
|
||||
|
||||
/// No description provided for @info_event.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Event info'**
|
||||
String get info_event;
|
||||
|
||||
/// No description provided for @event_already.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Event already exists'**
|
||||
String get event_already;
|
||||
|
||||
/// No description provided for @picture_error.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Picture error'**
|
||||
String get picture_error;
|
||||
|
||||
/// No description provided for @no_picture_published.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'No picture published'**
|
||||
String get no_picture_published;
|
||||
|
||||
/// No description provided for @event_update.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Event updated'**
|
||||
String get event_update;
|
||||
|
||||
/// No description provided for @location.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Location'**
|
||||
String get location;
|
||||
|
||||
/// No description provided for @add_event.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Add or Update a event'**
|
||||
String get add_event;
|
||||
|
||||
/// No description provided for @edit_image.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Edit pictures'**
|
||||
String get edit_image;
|
||||
|
||||
/// No description provided for @name.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Name'**
|
||||
String get name;
|
||||
|
||||
/// No description provided for @edit_event_name.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Edit event name'**
|
||||
String get edit_event_name;
|
||||
|
||||
/// No description provided for @start_time.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Start time'**
|
||||
String get start_time;
|
||||
|
||||
/// No description provided for @end_time.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'End time'**
|
||||
String get end_time;
|
||||
|
||||
/// No description provided for @select_date.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Click to select a date'**
|
||||
String get select_date;
|
||||
|
||||
/// No description provided for @select_time.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Click to select a time'**
|
||||
String get select_time;
|
||||
|
||||
/// No description provided for @tag.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Tags'**
|
||||
String get tag;
|
||||
|
||||
/// No description provided for @already_tag.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'You have already this tags'**
|
||||
String get already_tag;
|
||||
|
||||
/// No description provided for @enter_tag.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Enter a tag'**
|
||||
String get enter_tag;
|
||||
|
||||
/// No description provided for @organizer.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Organizer'**
|
||||
String get organizer;
|
||||
|
||||
/// No description provided for @already_organiser.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'You have already a organizer'**
|
||||
String get already_organiser;
|
||||
|
||||
/// No description provided for @enter_organizer.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Enter a organizer'**
|
||||
String get enter_organizer;
|
||||
|
||||
/// No description provided for @description.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Description'**
|
||||
String get description;
|
||||
|
||||
/// No description provided for @describe_event.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Describe event'**
|
||||
String get describe_event;
|
||||
|
||||
/// No description provided for @add.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Add'**
|
||||
String get add;
|
||||
|
||||
/// No description provided for @different_password_error.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Different password'**
|
||||
String get different_password_error;
|
||||
|
||||
/// No description provided for @update.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Update'**
|
||||
String get update;
|
||||
|
||||
/// No description provided for @updated.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Updated'**
|
||||
String get updated;
|
||||
|
||||
/// No description provided for @settings_updated.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Settings updated'**
|
||||
String get settings_updated;
|
||||
|
||||
/// No description provided for @define_kilometer.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Define Kilometer'**
|
||||
String get define_kilometer;
|
||||
|
||||
/// No description provided for @email_sent.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Email has been sent'**
|
||||
String get email_sent;
|
||||
|
||||
/// No description provided for @forgot_password.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Forgot password'**
|
||||
String get forgot_password;
|
||||
|
||||
/// No description provided for @enter_email.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Enter the email'**
|
||||
String get enter_email;
|
||||
|
||||
/// No description provided for @send_email.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Send email'**
|
||||
String get send_email;
|
||||
|
||||
/// No description provided for @invalid_cache.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Invalid cache'**
|
||||
String get invalid_cache;
|
||||
|
||||
/// No description provided for @item_date.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Date : '**
|
||||
String get item_date;
|
||||
|
||||
/// No description provided for @item_maps.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Maps : '**
|
||||
String get item_maps;
|
||||
|
||||
/// No description provided for @item_organizer.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Organizer : '**
|
||||
String get item_organizer;
|
||||
|
||||
/// No description provided for @item_description.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Description : '**
|
||||
String get item_description;
|
||||
|
||||
/// No description provided for @item_tags.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Tags : '**
|
||||
String get item_tags;
|
||||
|
||||
/// No description provided for @failed_auth.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Authentification failed'**
|
||||
String get failed_auth;
|
||||
|
||||
/// No description provided for @login_page.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Login page'**
|
||||
String get login_page;
|
||||
|
||||
/// No description provided for @pseudo.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Pseudo'**
|
||||
String get pseudo;
|
||||
|
||||
/// No description provided for @enter_existing_pseudo.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Enter a existing pseudo'**
|
||||
String get enter_existing_pseudo;
|
||||
|
||||
/// No description provided for @remembr_me.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Remember me'**
|
||||
String get remembr_me;
|
||||
|
||||
/// No description provided for @new_user.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'New User? Create Account'**
|
||||
String get new_user;
|
||||
|
||||
/// No description provided for @sign_in.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Sign in'**
|
||||
String get sign_in;
|
||||
|
||||
/// No description provided for @map_token.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Mapbox Access Token is not available'**
|
||||
String get map_token;
|
||||
|
||||
/// No description provided for @geo_disabled.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Location services are disabled.'**
|
||||
String get geo_disabled;
|
||||
|
||||
/// No description provided for @permission_denied.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Location permissions are denied.'**
|
||||
String get permission_denied;
|
||||
|
||||
/// No description provided for @enable_permission.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Location permissions are permanently denied. Enable them in settings.'**
|
||||
String get enable_permission;
|
||||
|
||||
/// No description provided for @no_last_position.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'No last known position available.'**
|
||||
String get no_last_position;
|
||||
|
||||
/// No description provided for @failed_location.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Failed to get user location'**
|
||||
String get failed_location;
|
||||
|
||||
/// No description provided for @failed_fetch.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Failed to fetch the route'**
|
||||
String get failed_fetch;
|
||||
|
||||
/// No description provided for @invalid_coordinates_symbol.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Invalid coordinates, cannot add symbol.'**
|
||||
String get invalid_coordinates_symbol;
|
||||
|
||||
/// No description provided for @error_symbol.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Error when adding symbol.'**
|
||||
String get error_symbol;
|
||||
|
||||
/// No description provided for @position_not_init.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'User position is not yet initialized. Try again.'**
|
||||
String get position_not_init;
|
||||
|
||||
/// No description provided for @invalid_coordinates.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Invalid coordinates.'**
|
||||
String get invalid_coordinates;
|
||||
|
||||
/// No description provided for @walking.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Walking'**
|
||||
String get walking;
|
||||
|
||||
/// No description provided for @cycling.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Cycling'**
|
||||
String get cycling;
|
||||
|
||||
/// No description provided for @driving.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Driving'**
|
||||
String get driving;
|
||||
|
||||
/// No description provided for @get_direction.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Get Directions and Markers'**
|
||||
String get get_direction;
|
||||
|
||||
/// No description provided for @missing_token.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Missing access token'**
|
||||
String get missing_token;
|
||||
|
||||
/// No description provided for @geocoding_error.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Error when geocoding'**
|
||||
String get geocoding_error;
|
||||
|
||||
/// No description provided for @no_found_place.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'No found place'**
|
||||
String get no_found_place;
|
||||
|
||||
/// No description provided for @upload_error.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Error when image uploading'**
|
||||
String get upload_error;
|
||||
|
||||
/// No description provided for @event_added.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Event added'**
|
||||
String get event_added;
|
||||
|
||||
/// No description provided for @unknown_error.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Unknown error'**
|
||||
String get unknown_error;
|
||||
|
||||
/// No description provided for @app_error.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Application error'**
|
||||
String get app_error;
|
||||
|
||||
/// No description provided for @at.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'at'**
|
||||
String get at;
|
||||
|
||||
/// No description provided for @to_date.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'to'**
|
||||
String get to_date;
|
||||
|
||||
/// No description provided for @item_link.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Link : '**
|
||||
String get item_link;
|
||||
|
||||
/// No description provided for @item_ticket.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Ticket : '**
|
||||
String get item_ticket;
|
||||
|
||||
/// No description provided for @link.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Link'**
|
||||
String get link;
|
||||
|
||||
/// No description provided for @edit_link.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Edit link name'**
|
||||
String get edit_link;
|
||||
|
||||
/// No description provided for @ticket.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Ticket'**
|
||||
String get ticket;
|
||||
|
||||
/// No description provided for @edit_ticket.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Edit ticket link'**
|
||||
String get edit_ticket;
|
||||
|
||||
/// No description provided for @toogle_interest.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Error toggle interest'**
|
||||
String get toogle_interest;
|
||||
|
||||
/// No description provided for @error_update.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Error when updating'**
|
||||
String get error_update;
|
||||
|
||||
/// No description provided for @count_interested.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Interested people number'**
|
||||
String get count_interested;
|
||||
}
|
||||
|
||||
class _AppLocalizationsDelegate
|
||||
extends LocalizationsDelegate<AppLocalizations> {
|
||||
const _AppLocalizationsDelegate();
|
||||
|
||||
@override
|
||||
Future<AppLocalizations> load(Locale locale) {
|
||||
return SynchronousFuture<AppLocalizations>(lookupAppLocalizations(locale));
|
||||
}
|
||||
|
||||
@override
|
||||
bool isSupported(Locale locale) =>
|
||||
<String>['de', 'en', 'fr'].contains(locale.languageCode);
|
||||
|
||||
@override
|
||||
bool shouldReload(_AppLocalizationsDelegate old) => false;
|
||||
}
|
||||
|
||||
AppLocalizations lookupAppLocalizations(Locale locale) {
|
||||
// Lookup logic when only language code is specified.
|
||||
switch (locale.languageCode) {
|
||||
case 'de':
|
||||
return AppLocalizationsDe();
|
||||
case 'en':
|
||||
return AppLocalizationsEn();
|
||||
case 'fr':
|
||||
return AppLocalizationsFr();
|
||||
}
|
||||
|
||||
throw FlutterError(
|
||||
'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely '
|
||||
'an issue with the localizations generation tool. Please file an issue '
|
||||
'on GitHub with a reproducible sample app and the gen-l10n configuration '
|
||||
'that was used.');
|
||||
}
|
@@ -4,23 +4,30 @@ 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 'package:covas_mobile/gen_l10n/app_localizations.dart';
|
||||
import 'classes/notification_service.dart';
|
||||
import 'classes/auth_service.dart';
|
||||
import 'pages/ListItemMenu.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await MobileAds.instance.initialize();
|
||||
await NotificationService.initialize();
|
||||
final AuthService _authService = AuthService();
|
||||
|
||||
final loggedIn = await _authService.isLoggedIn();
|
||||
|
||||
runApp(
|
||||
ChangeNotifierProvider(
|
||||
create: (_) => LocaleProvider(),
|
||||
child: MyApp(),
|
||||
child: MyApp(isLoggedIn: loggedIn),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
final bool isLoggedIn;
|
||||
const MyApp({Key? key, required this.isLoggedIn}) : super(key: key);
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final localeProvider = Provider.of<LocaleProvider>(
|
||||
@@ -30,7 +37,7 @@ class MyApp extends StatelessWidget {
|
||||
locale: localeProvider.locale, // <-- utilise la locale courante
|
||||
supportedLocales: L10n.all,
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
home: LoginDemo(),
|
||||
home: isLoggedIn ? ListItemMenu() : LoginDemo(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@ 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:covas_mobile/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; // Créé plus loin
|
||||
|
||||
|
@@ -8,7 +8,7 @@ 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:covas_mobile/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; // Créé plus loin
|
||||
|
||||
|
@@ -9,7 +9,7 @@ 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:covas_mobile/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; // Créé
|
||||
|
||||
|
@@ -18,7 +18,7 @@ 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:covas_mobile/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; // Créé
|
||||
|
||||
@@ -221,15 +221,13 @@ class DisplayPictureScreenState extends State<DisplayPictureScreen>
|
||||
|
||||
final file = File(widget.imagePath);
|
||||
|
||||
gemini
|
||||
.textAndImage(
|
||||
text:
|
||||
"Peux-tu donner le nom, la date (si l'année n'est pas précisé, mettez l'année actuelle ou future) et le lieu de l'évènement sous format JSON (sans le caratère json au début de la chaine de caractère) avec les valeurs suivantes : name, place, description, tags (tableau sans espace), organizers (tableau), start_date et end_date (si le end_date est vide, alors donnez une valeur de six de plus par rapport à start_date) sous le format en YYYY-MM-DD HH:mm:ssZ",
|
||||
images: [file.readAsBytesSync()],
|
||||
modelName: "models/gemini-1.5-pro-latest")
|
||||
.then((value) => searchEvents(
|
||||
value?.content?.parts?.last.text ?? '', widget.imagePath))
|
||||
.catchError((e) => displayError);
|
||||
gemini.prompt(parts: [
|
||||
Part.text(
|
||||
"Peux-tu donner le nom, la date (si l'année n'est pas précisé, mettez l'année actuelle ou future) et le lieu de l'évènement sous format JSON (sans le caratère json au début de la chaine de caractère) avec les valeurs suivantes : name, place, description, tags (tableau sans espace), organizers (tableau), start_date et end_date (si le end_date est vide, alors donnez une valeur de six de plus par rapport à start_date) sous le format en YYYY-MM-DD HH:mm:ssZ"),
|
||||
Part.bytes(file.readAsBytesSync())
|
||||
], model: "models/gemini-1.5-pro-latest").then((value) {
|
||||
searchEvents(value?.output ?? '', widget.imagePath);
|
||||
}).catchError((e) => displayError);
|
||||
}
|
||||
|
||||
@override
|
||||
|
@@ -23,7 +23,7 @@ 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:covas_mobile/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; // Créé
|
||||
|
||||
@@ -380,8 +380,8 @@ class _EditEventState extends State<EditEvent>
|
||||
|
||||
imgUrl = widget.events!.imgUrl ?? "";
|
||||
inputDesc.text = widget.events!.description ?? "";
|
||||
initialTags = List<String>.from(widget.events!.tags as List);
|
||||
initialOrga = List<String>.from(widget.events!.organizers as List);
|
||||
initialTags = List<String>.from((widget.events?.tags as List?) ?? []);
|
||||
initialOrga = List<String>.from((widget.events?.organizers as List?) ?? []);
|
||||
}
|
||||
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
|
@@ -19,7 +19,7 @@ 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:covas_mobile/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; // Créé
|
||||
|
||||
|
@@ -15,7 +15,7 @@ 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:covas_mobile/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; // Créé
|
||||
|
||||
|
@@ -12,7 +12,7 @@ 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:covas_mobile/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; //
|
||||
|
||||
|
@@ -26,7 +26,7 @@ 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:covas_mobile/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; //
|
||||
|
||||
|
@@ -15,7 +15,7 @@ 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:covas_mobile/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; //
|
||||
import '../classes/notification_service.dart';
|
||||
|
@@ -16,7 +16,7 @@ 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:covas_mobile/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; //
|
||||
import '../classes/notification_service.dart';
|
||||
|
@@ -20,7 +20,7 @@ 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:covas_mobile/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; // Créé plus loin
|
||||
import '../classes/notification_service.dart';
|
||||
|
@@ -9,7 +9,7 @@ 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:covas_mobile/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; //
|
||||
|
||||
|
@@ -1,25 +1,31 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart'; // For environment variables
|
||||
import 'package:flutter/services.dart'; // For loading assets
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:mapbox_gl/mapbox_gl.dart';
|
||||
import 'package:mapbox_maps_flutter/mapbox_maps_flutter.dart' as mapbox;
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:geolocator/geolocator.dart'; // For getting the user's location
|
||||
import 'package:geolocator/geolocator.dart' as geo;
|
||||
|
||||
import '../classes/alert.dart'; // Assuming this contains your error dialog code.
|
||||
import '../classes/alert.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_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:covas_mobile/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; //
|
||||
import '../locale_provider.dart';
|
||||
|
||||
void main() async {
|
||||
await dotenv.load(fileName: ".env"); // Load .env file
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await dotenv.load(fileName: ".env");
|
||||
|
||||
// Set the access token globally
|
||||
mapbox.MapboxOptions.setAccessToken(dotenv.env['MAPBOX_ACCESS_TOKEN'] ?? '');
|
||||
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
@@ -30,9 +36,7 @@ class MyApp extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
title: 'Flutter Directions Example',
|
||||
theme: ThemeData(
|
||||
primarySwatch: Colors.blue,
|
||||
),
|
||||
theme: ThemeData(primarySwatch: Colors.blue),
|
||||
home: const MapboxPages(title: 'Event Location', place: "Flutter"),
|
||||
);
|
||||
}
|
||||
@@ -52,36 +56,26 @@ class MapboxPages extends StatefulWidget {
|
||||
class _MapboxPagesState extends State<MapboxPages> with ShowAlertDialog {
|
||||
final AuthService _authService = AuthService();
|
||||
|
||||
late MapboxMapController mapController;
|
||||
late String mapboxAccessToken;
|
||||
List<LatLng> routeCoordinates = [];
|
||||
String selectedMode = 'driving';
|
||||
mapbox.MapboxMap? mapboxMap;
|
||||
mapbox.PointAnnotationManager? pointAnnotationManager;
|
||||
mapbox.PolylineAnnotationManager? polylineAnnotationManager;
|
||||
|
||||
double longitude = 0.0;
|
||||
double latitude = 0.0;
|
||||
bool isLoading = true;
|
||||
late LatLng userPosition;
|
||||
mapbox.Point? userPosition;
|
||||
bool isUserPositionInitialized = false;
|
||||
Line? currentRouteLine;
|
||||
|
||||
String selectedMode = 'driving';
|
||||
List<List<double>> routeCoordinates = [];
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_authService.checkTokenStatus(context);
|
||||
|
||||
_getUserLocation();
|
||||
}
|
||||
|
||||
void _initToken() {
|
||||
mapboxAccessToken = dotenv.env['MAPBOX_ACCESS_TOKEN'] ?? '';
|
||||
if (mapboxAccessToken.isEmpty) {
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.map_token ??
|
||||
"Map Access Token is not available.");
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _getEventInfo() async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
var accessToken = prefs.getString("access_token") ?? "";
|
||||
@@ -96,276 +90,170 @@ class _MapboxPagesState extends State<MapboxPages> with ShowAlertDialog {
|
||||
latitude = events["latitude"];
|
||||
longitude = events["longitude"];
|
||||
|
||||
setState(() {
|
||||
isLoading = false;
|
||||
});
|
||||
setState(() => isLoading = false);
|
||||
} else {
|
||||
_handleErrorResponse(responseGet.statusCode);
|
||||
}
|
||||
} else {
|
||||
showAlertDialog(context, AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.invalid_cache ?? "Invalid cache.");
|
||||
showAlertDialog(context, "Error", "Invalid cache.");
|
||||
}
|
||||
}
|
||||
|
||||
void _handleErrorResponse(int statusCode) {
|
||||
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);
|
||||
final errorMessage = "Error $statusCode fetching event";
|
||||
showAlertDialog(context, "Error", errorMessage);
|
||||
}
|
||||
|
||||
Future<void> _getUserLocation() async {
|
||||
await dotenv.load(fileName: ".env");
|
||||
|
||||
// Set the access token globally
|
||||
mapbox.MapboxOptions.setAccessToken(
|
||||
dotenv.env['MAPBOX_ACCESS_TOKEN'] ?? '');
|
||||
try {
|
||||
bool serviceEnabled = await Geolocator.isLocationServiceEnabled();
|
||||
if (!serviceEnabled) {
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.geo_disabled ??
|
||||
"Location services are disabled.");
|
||||
return;
|
||||
bool serviceEnabled = await geo.Geolocator.isLocationServiceEnabled();
|
||||
if (!serviceEnabled) return;
|
||||
|
||||
geo.LocationPermission permission =
|
||||
await geo.Geolocator.checkPermission();
|
||||
if (permission == geo.LocationPermission.denied) {
|
||||
permission = await geo.Geolocator.requestPermission();
|
||||
}
|
||||
|
||||
LocationPermission permission = await Geolocator.checkPermission();
|
||||
if (permission == LocationPermission.denied) {
|
||||
permission = await Geolocator.requestPermission();
|
||||
if (permission == LocationPermission.denied) {
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.permission_denied ??
|
||||
"Location permissions are denied.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (permission == geo.LocationPermission.deniedForever) return;
|
||||
|
||||
geo.Position position = await geo.Geolocator.getCurrentPosition();
|
||||
setState(() {
|
||||
userPosition = mapbox.Point(
|
||||
coordinates:
|
||||
mapbox.Position(position.longitude, position.latitude));
|
||||
isUserPositionInitialized = true;
|
||||
});
|
||||
|
||||
if (permission == LocationPermission.deniedForever) {
|
||||
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(
|
||||
accuracy: LocationAccuracy.medium, timeLimit: Duration(seconds: 5));
|
||||
Position? position;
|
||||
try {
|
||||
position = await Geolocator.getCurrentPosition(
|
||||
locationSettings: locationSettings);
|
||||
} on LocationServiceDisabledException {
|
||||
// Handle location services disabled
|
||||
position = await Geolocator.getLastKnownPosition();
|
||||
if (position == null) {
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.no_last_position ??
|
||||
"No last known position available..");
|
||||
}
|
||||
} catch (e) {
|
||||
// Handle other errors
|
||||
position = await Geolocator.getLastKnownPosition();
|
||||
if (position == null) {
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.no_last_position ??
|
||||
"No last known position available");
|
||||
}
|
||||
}
|
||||
if (position != null) {
|
||||
setState(() {
|
||||
userPosition = LatLng(position!.latitude, position!.longitude);
|
||||
isUserPositionInitialized = true;
|
||||
});
|
||||
}
|
||||
_initToken();
|
||||
_getEventInfo();
|
||||
} catch (e) {
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.failed_location ??
|
||||
"Failed to get user location");
|
||||
showAlertDialog(context, "Error", "Failed to get location");
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _fetchRoute(
|
||||
LatLng origin, LatLng destination, String mode) async {
|
||||
mapbox.Point origin, mapbox.Point destination, String mode) async {
|
||||
final url = Uri.parse(
|
||||
'https://api.mapbox.com/directions/v5/mapbox/$mode/${origin.longitude},${origin.latitude};${destination.longitude},${destination.latitude}?geometries=geojson&access_token=$mapboxAccessToken',
|
||||
'https://api.mapbox.com/directions/v5/mapbox/$mode/'
|
||||
'${origin.coordinates.lng},${origin.coordinates.lat};'
|
||||
'${destination.coordinates.lng},${destination.coordinates.lat}'
|
||||
'?geometries=geojson&access_token=${dotenv.env['MAPBOX_ACCESS_TOKEN']}',
|
||||
);
|
||||
|
||||
final response = await http.get(url);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
final data = jsonDecode(response.body);
|
||||
final geometry = data['routes'][0]['geometry']['coordinates'];
|
||||
setState(() {
|
||||
routeCoordinates = geometry.map<LatLng>((coord) {
|
||||
return LatLng(coord[1], coord[0]);
|
||||
}).toList();
|
||||
});
|
||||
} else {
|
||||
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
|
||||
// Vérifie si 'routes' existe et contient au moins 1 élément
|
||||
if (data['routes'] != null && (data['routes'] as List).isNotEmpty) {
|
||||
final geometry = data['routes'][0]['geometry']['coordinates'];
|
||||
|
||||
// Check if the mapController is really initialized
|
||||
if (mapController != null) {
|
||||
try {
|
||||
// Ensure the coordinates are valid
|
||||
if (latitude != 0.0 && longitude != 0.0) {
|
||||
// Load marker image as Uint8List
|
||||
final userMarkerImage = await _loadMarkerImage('images/marker.png');
|
||||
|
||||
// Register the image with Mapbox
|
||||
await mapController.addImage('event-marker', userMarkerImage);
|
||||
|
||||
final symbolOptions = SymbolOptions(
|
||||
geometry: LatLng(latitude, longitude),
|
||||
iconImage: "event-marker", // Use the registered custom marker
|
||||
iconSize: 0.4, // Optional: Adjust size
|
||||
);
|
||||
|
||||
// Debugging symbol options
|
||||
|
||||
// Add symbol to map
|
||||
mapController!.addSymbol(symbolOptions);
|
||||
} else {
|
||||
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
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.error_symbol ??
|
||||
"Error when adding symbol.");
|
||||
setState(() {
|
||||
routeCoordinates = (geometry as List)
|
||||
.map<List<double>>((coord) => [coord[0], coord[1]])
|
||||
.toList();
|
||||
});
|
||||
} else {
|
||||
debugPrint("⚠️ Aucune route trouvée entre ${origin} et $destination.");
|
||||
// Optionnel : afficher un snackbar/toast à l’utilisateur
|
||||
}
|
||||
} else {
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.error_symbol ??
|
||||
"Error when adding symbol.");
|
||||
debugPrint("❌ Erreur API Mapbox: ${response.statusCode}");
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _drawRouteAndMarkers() async {
|
||||
// Remove previous route line if it exists
|
||||
if (currentRouteLine != null) {
|
||||
await mapController.removeLine(currentRouteLine!);
|
||||
currentRouteLine = null;
|
||||
}
|
||||
if (!isUserPositionInitialized) {
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.position_not_init ??
|
||||
"User position is not yet initialized. Try again.");
|
||||
return;
|
||||
Future<void> _zoomToFitRoute(List<List<double>> coordinates) async {
|
||||
if (mapboxMap == null || coordinates.isEmpty) return;
|
||||
|
||||
double minLat = coordinates.first[1];
|
||||
double maxLat = coordinates.first[1];
|
||||
double minLng = coordinates.first[0];
|
||||
double maxLng = coordinates.first[0];
|
||||
|
||||
for (var coord in coordinates) {
|
||||
if (coord[1] < minLat) minLat = coord[1];
|
||||
if (coord[1] > maxLat) maxLat = coord[1];
|
||||
if (coord[0] < minLng) minLng = coord[0];
|
||||
if (coord[0] > maxLng) maxLng = coord[0];
|
||||
}
|
||||
|
||||
if (mapController != null &&
|
||||
userPosition != null &&
|
||||
latitude != 0.0 &&
|
||||
longitude != 0.0) {
|
||||
final destination = LatLng(latitude, longitude);
|
||||
final bounds = mapbox.CoordinateBounds(
|
||||
southwest: mapbox.Point(coordinates: mapbox.Position(minLng, minLat)),
|
||||
northeast: mapbox.Point(coordinates: mapbox.Position(maxLng, maxLat)),
|
||||
infiniteBounds: true);
|
||||
|
||||
// Register the custom images
|
||||
// Add event marker
|
||||
// Calculer une CameraOptions automatiquement à partir des bounds
|
||||
final cameraOptions = await mapboxMap!.cameraForCoordinateBounds(
|
||||
bounds,
|
||||
mapbox.MbxEdgeInsets(
|
||||
top: 50, left: 50, right: 50, bottom: 50), // marges
|
||||
0.0,
|
||||
0.0,
|
||||
null,
|
||||
null);
|
||||
|
||||
final eventMarkerImage = await _loadMarkerImage('images/marker-red.png');
|
||||
|
||||
// Register the image with Mapbox
|
||||
await mapController.addImage('user-marker', eventMarkerImage);
|
||||
await mapController.addSymbol(SymbolOptions(
|
||||
geometry: userPosition,
|
||||
iconImage: 'user-marker', // Custom icon for event
|
||||
iconSize: 0.2,
|
||||
));
|
||||
|
||||
// Fetch and draw route
|
||||
await _fetchRoute(userPosition, destination, selectedMode);
|
||||
|
||||
if (routeCoordinates.isNotEmpty) {
|
||||
currentRouteLine = await mapController.addLine(
|
||||
LineOptions(
|
||||
geometry: routeCoordinates,
|
||||
lineColor: '#3b9ddd',
|
||||
lineWidth: 5.0,
|
||||
lineOpacity: 0.8,
|
||||
),
|
||||
);
|
||||
|
||||
_zoomToFitRoute(routeCoordinates);
|
||||
}
|
||||
} else {
|
||||
showAlertDialog(
|
||||
context,
|
||||
AppLocalizations.of(context)?.error ?? "Error",
|
||||
AppLocalizations.of(context)?.invalid_coordinates ??
|
||||
"Invalid coordinates or user position.");
|
||||
}
|
||||
}
|
||||
|
||||
void _zoomToFitRoute(List<LatLng> coordinates) {
|
||||
// Calculate the bounding box
|
||||
double minLat = coordinates.first.latitude;
|
||||
double maxLat = coordinates.first.latitude;
|
||||
double minLng = coordinates.first.longitude;
|
||||
double maxLng = coordinates.first.longitude;
|
||||
|
||||
for (LatLng coord in coordinates) {
|
||||
if (coord.latitude < minLat) minLat = coord.latitude;
|
||||
if (coord.latitude > maxLat) maxLat = coord.latitude;
|
||||
if (coord.longitude < minLng) minLng = coord.longitude;
|
||||
if (coord.longitude > maxLng) maxLng = coord.longitude;
|
||||
}
|
||||
|
||||
// Define the bounds
|
||||
LatLng southwest = LatLng(minLat, minLng);
|
||||
LatLng northeast = LatLng(maxLat, maxLng);
|
||||
|
||||
mapController.moveCamera(
|
||||
CameraUpdate.newLatLngBounds(
|
||||
LatLngBounds(southwest: southwest, northeast: northeast),
|
||||
left: 50, // Padding on the left
|
||||
top: 50, // Padding on the top
|
||||
right: 50, // Padding on the right
|
||||
bottom: 50, // Padding on the bottom
|
||||
),
|
||||
// Appliquer la caméra avec animation
|
||||
await mapboxMap!.flyTo(
|
||||
cameraOptions,
|
||||
mapbox.MapAnimationOptions(duration: 1000),
|
||||
);
|
||||
}
|
||||
|
||||
// Load image from assets
|
||||
Future<void> _drawRouteAndMarkers() async {
|
||||
if (mapboxMap == null || !isUserPositionInitialized) return;
|
||||
|
||||
// Managers
|
||||
pointAnnotationManager ??=
|
||||
await mapboxMap!.annotations.createPointAnnotationManager();
|
||||
polylineAnnotationManager ??=
|
||||
await mapboxMap!.annotations.createPolylineAnnotationManager();
|
||||
|
||||
// Clear old annotations
|
||||
await pointAnnotationManager!.deleteAll();
|
||||
await polylineAnnotationManager!.deleteAll();
|
||||
|
||||
final destination =
|
||||
mapbox.Point(coordinates: mapbox.Position(longitude, latitude));
|
||||
|
||||
// Add user marker
|
||||
final userIcon = await _loadMarkerImage('images/marker.png');
|
||||
await pointAnnotationManager!.create(mapbox.PointAnnotationOptions(
|
||||
geometry: mapbox.Point(
|
||||
coordinates: mapbox.Position(
|
||||
userPosition!.coordinates.lng, userPosition!.coordinates.lat)),
|
||||
image: userIcon,
|
||||
iconSize: 0.4,
|
||||
));
|
||||
|
||||
// Ajoute directement la flèche rouge à la position de l’événement
|
||||
final eventIcon = await _loadMarkerImage('images/marker-red.png');
|
||||
await pointAnnotationManager!.create(mapbox.PointAnnotationOptions(
|
||||
geometry: mapbox.Point(coordinates: mapbox.Position(longitude, latitude)),
|
||||
image: eventIcon,
|
||||
iconSize: 0.2,
|
||||
));
|
||||
|
||||
// Fetch and draw route
|
||||
await _fetchRoute(userPosition!, destination, selectedMode);
|
||||
if (routeCoordinates.isNotEmpty) {
|
||||
await polylineAnnotationManager!.create(mapbox.PolylineAnnotationOptions(
|
||||
geometry: mapbox.LineString(
|
||||
coordinates:
|
||||
routeCoordinates.map((c) => mapbox.Position(c[0], c[1])).toList(),
|
||||
),
|
||||
lineColor: Colors.blue.value,
|
||||
lineWidth: 4.0,
|
||||
));
|
||||
await _zoomToFitRoute(routeCoordinates);
|
||||
}
|
||||
}
|
||||
|
||||
Future<Uint8List> _loadMarkerImage(String assetPath) async {
|
||||
final ByteData data = await rootBundle.load(assetPath);
|
||||
return data.buffer.asUint8List();
|
||||
@@ -374,78 +262,68 @@ class _MapboxPagesState extends State<MapboxPages> with ShowAlertDialog {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(widget.place),
|
||||
actions: [
|
||||
DropdownButton<String>(
|
||||
value: selectedMode,
|
||||
items: [
|
||||
DropdownMenuItem(
|
||||
value: 'walking',
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Icons.directions_walk, color: Colors.blue),
|
||||
SizedBox(width: 8),
|
||||
Text(AppLocalizations.of(context)?.walking ?? 'Walking'),
|
||||
],
|
||||
),
|
||||
),
|
||||
DropdownMenuItem(
|
||||
value: 'cycling',
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Icons.directions_bike, color: Colors.green),
|
||||
SizedBox(width: 8),
|
||||
Text(AppLocalizations.of(context)?.cycling ?? 'Cycling'),
|
||||
],
|
||||
),
|
||||
),
|
||||
DropdownMenuItem(
|
||||
value: 'driving',
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Icons.directions_car, color: Colors.red),
|
||||
SizedBox(width: 8),
|
||||
Text(AppLocalizations.of(context)?.driving ?? 'Driving'),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
onChanged: (mode) {
|
||||
setState(() {
|
||||
selectedMode = mode!;
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
appBar: AppBar(title: Text(widget.place)),
|
||||
drawer: MyDrawer(),
|
||||
body: Stack(
|
||||
children: [
|
||||
isLoading
|
||||
? Center(child: CircularProgressIndicator())
|
||||
: MapboxMap(
|
||||
accessToken: mapboxAccessToken,
|
||||
onMapCreated: (controller) {
|
||||
mapController = controller;
|
||||
},
|
||||
onStyleLoadedCallback: _onStyleLoaded,
|
||||
initialCameraPosition: CameraPosition(
|
||||
target: LatLng(latitude, longitude),
|
||||
zoom: 14.0,
|
||||
body: isLoading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Text("Mode : "),
|
||||
DropdownButton<String>(
|
||||
value: selectedMode,
|
||||
items: const [
|
||||
DropdownMenuItem(
|
||||
value: 'driving', child: Text("🚗 Voiture")),
|
||||
DropdownMenuItem(
|
||||
value: 'walking', child: Text("🚶 Marche")),
|
||||
DropdownMenuItem(
|
||||
value: 'cycling', child: Text("🚴 Vélo")),
|
||||
],
|
||||
onChanged: (value) {
|
||||
if (value != null) {
|
||||
setState(() {
|
||||
selectedMode = value;
|
||||
});
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
Expanded(
|
||||
child: mapbox.MapWidget(
|
||||
onMapCreated: (controller) async {
|
||||
mapboxMap = controller;
|
||||
|
||||
// Crée un manager si nécessaire
|
||||
pointAnnotationManager ??= await mapboxMap!.annotations
|
||||
.createPointAnnotationManager();
|
||||
|
||||
// Ajoute directement la flèche rouge à la position de l’événement
|
||||
final eventIcon =
|
||||
await _loadMarkerImage('images/marker-red.png');
|
||||
await pointAnnotationManager!
|
||||
.create(mapbox.PointAnnotationOptions(
|
||||
geometry: mapbox.Point(
|
||||
coordinates: mapbox.Position(longitude, latitude)),
|
||||
image: eventIcon,
|
||||
iconSize: 0.2,
|
||||
));
|
||||
},
|
||||
cameraOptions: mapbox.CameraOptions(
|
||||
center: mapbox.Point(
|
||||
coordinates: mapbox.Position(longitude, latitude)),
|
||||
zoom: 14.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 20,
|
||||
right: 20,
|
||||
child: FloatingActionButton(
|
||||
onPressed: _drawRouteAndMarkers,
|
||||
child: Icon(Icons.directions),
|
||||
tooltip: AppLocalizations.of(context)?.get_direction ??
|
||||
'Get Directions and Markers',
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: _drawRouteAndMarkers,
|
||||
child: const Icon(Icons.directions),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@ 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:covas_mobile/gen_l10n/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../locale_provider.dart'; //
|
||||
|
||||
|
@@ -8,6 +8,7 @@ import Foundation
|
||||
import file_selector_macos
|
||||
import flutter_local_notifications
|
||||
import geolocator_apple
|
||||
import package_info_plus
|
||||
import path_provider_foundation
|
||||
import shared_preferences_foundation
|
||||
import url_launcher_macos
|
||||
@@ -17,6 +18,7 @@ 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"))
|
||||
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
|
||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
|
||||
|
@@ -25,6 +25,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.13.0"
|
||||
benchmark:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: benchmark
|
||||
sha256: cb3eeea01e3f054df76ee9775ca680f3afa5f19f39b2bb426ba78ba27654493b
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.3.0"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -129,6 +137,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.8"
|
||||
dart_sort_queue:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: dart_sort_queue
|
||||
sha256: f3353ba8b4850e072d3368757f62edb79af34a9703c3e3df9c59342721f5f5b1
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.0.2+3"
|
||||
date_format_field:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -189,10 +205,10 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: encrypt_shared_preferences
|
||||
sha256: "9be57e1f224d6f4353bdfa79de16b364ec7dddf38840c3288c547f262e50bbad"
|
||||
sha256: f864d44f8e2cc87685ae6fd649a63e1e97dbdbe411fa134786122e2925d9ec7c
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.8.9"
|
||||
version: "0.9.10"
|
||||
extension_discovery:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -274,50 +290,58 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_dotenv
|
||||
sha256: b7c7be5cd9f6ef7a78429cabd2774d3c4af50e79cb2b7593e3d5d763ef95c61b
|
||||
sha256: d4130c4a43e0b13fefc593bc3961f2cb46e30cb79e253d4a526b1b5d24ae1ce4
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.2.1"
|
||||
version: "6.0.0"
|
||||
flutter_gemini:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_gemini
|
||||
sha256: "993765fafb595e5d32153f393b9c5e71f853caa5bef123d292c21f672d2b9675"
|
||||
sha256: b7264b1d19acc4b1a5628a0e26c0976aa1fb948f0d3243bc3510ff51e09476b7
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.5"
|
||||
version: "3.0.0"
|
||||
flutter_lints:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: flutter_lints
|
||||
sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c"
|
||||
sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.0"
|
||||
version: "6.0.0"
|
||||
flutter_local_notifications:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_local_notifications
|
||||
sha256: "674173fd3c9eda9d4c8528da2ce0ea69f161577495a9cc835a2a4ecd7eadeb35"
|
||||
sha256: a9966c850de5e445331b854fa42df96a8020066d67f125a5964cbc6556643f68
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "17.2.4"
|
||||
version: "19.4.1"
|
||||
flutter_local_notifications_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_local_notifications_linux
|
||||
sha256: c49bd06165cad9beeb79090b18cd1eb0296f4bf4b23b84426e37dd7c027fc3af
|
||||
sha256: e3c277b2daab8e36ac5a6820536668d07e83851aeeb79c446e525a70710770a5
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.1"
|
||||
version: "6.0.0"
|
||||
flutter_local_notifications_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_local_notifications_platform_interface
|
||||
sha256: "85f8d07fe708c1bdcf45037f2c0109753b26ae077e9d9e899d55971711a4ea66"
|
||||
sha256: "277d25d960c15674ce78ca97f57d0bae2ee401c844b6ac80fcd972a9c99d09fe"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "7.2.0"
|
||||
version: "9.1.0"
|
||||
flutter_local_notifications_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_local_notifications_windows
|
||||
sha256: ed46d7ae4ec9d19e4c8fa2badac5fe27ba87a3fe387343ce726f927af074ec98
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.2"
|
||||
flutter_localizations:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@@ -341,30 +365,30 @@ packages:
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
freezed_annotation:
|
||||
geoclue:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: freezed_annotation
|
||||
sha256: c2e2d632dd9b8a2b7751117abcfc2b4888ecfe181bd9fca7170d9ef02e595fe2
|
||||
name: geoclue
|
||||
sha256: c2a998c77474fc57aa00c6baa2928e58f4b267649057a1c76738656e9dbd2a7f
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.4.4"
|
||||
version: "0.1.1"
|
||||
geolocator:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: geolocator
|
||||
sha256: f62bcd90459e63210bbf9c35deb6a51c521f992a78de19a1fe5c11704f9530e2
|
||||
sha256: "79939537046c9025be47ec645f35c8090ecadb6fe98eba146a0d25e8c1357516"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "13.0.4"
|
||||
version: "14.0.2"
|
||||
geolocator_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: geolocator_android
|
||||
sha256: fcb1760a50d7500deca37c9a666785c047139b5f9ee15aa5469fae7dbbe3170d
|
||||
sha256: "179c3cb66dfa674fc9ccbf2be872a02658724d1c067634e2c427cf6df7df901a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.6.2"
|
||||
version: "5.0.2"
|
||||
geolocator_apple:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -373,6 +397,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.13"
|
||||
geolocator_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: geolocator_linux
|
||||
sha256: c4e966f0a7a87e70049eac7a2617f9e16fd4c585a26e4330bdfc3a71e6a721f3
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.2.3"
|
||||
geolocator_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -397,14 +429,30 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.2.5"
|
||||
geotypes:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: geotypes
|
||||
sha256: "5bedf57de92283133dd221e363812ef50eaaba414f0823b1974ef7d84b86991f"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.0.2"
|
||||
google_mobile_ads:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: google_mobile_ads
|
||||
sha256: "0d4a3744b5e8ed1b8be6a1b452d309f811688855a497c6113fc4400f922db603"
|
||||
sha256: a4f59019f2c32769fb6c60ed8aa321e9c21a36297e2c4f23452b3e779a3e7a26
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.3.1"
|
||||
version: "6.0.0"
|
||||
gsettings:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: gsettings
|
||||
sha256: "1b0ce661f5436d2db1e51f3c4295a49849f03d304003a7ba177d01e3a858249c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.2.8"
|
||||
http:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -497,10 +545,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: js
|
||||
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
|
||||
sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.6.7"
|
||||
version: "0.7.2"
|
||||
json_annotation:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -545,10 +593,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: lints
|
||||
sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235"
|
||||
sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.0"
|
||||
version: "6.0.0"
|
||||
logging:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -557,6 +605,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
mapbox_maps_flutter:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: mapbox_maps_flutter
|
||||
sha256: "9afe65d06230c6fe368859329ec76f0f9b31558c210a6711c1e0644b2109c525"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.10.0"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -585,10 +641,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: mime
|
||||
sha256: "801fd0b26f14a4a58ccb09d5892c3fbdeff209594300a542492cf13fba9d247a"
|
||||
sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.6"
|
||||
version: "2.0.0"
|
||||
nested:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -597,6 +653,22 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
package_info_plus:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: package_info_plus
|
||||
sha256: "16eee997588c60225bda0488b6dcfac69280a6b7a3cf02c741895dd370a02968"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "8.3.1"
|
||||
package_info_plus_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: package_info_plus_platform_interface
|
||||
sha256: "202a487f08836a592a6bd4f901ac69b3a8f146af552bbd14407b6b41e1c3f086"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.2.1"
|
||||
path:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -657,18 +729,18 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: permission_handler
|
||||
sha256: "59adad729136f01ea9e35a48f5d1395e25cba6cea552249ddbe9cf950f5d7849"
|
||||
sha256: bc917da36261b00137bbc8896bf1482169cd76f866282368948f032c8c1caae1
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "11.4.0"
|
||||
version: "12.0.1"
|
||||
permission_handler_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_android
|
||||
sha256: d3971dcdd76182a0c198c096b5db2f0884b0d4196723d21a866fc4cdea057ebc
|
||||
sha256: "1e3bc410ca1bf84662104b100eb126e066cb55791b7451307f9708d4007350e6"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "12.1.0"
|
||||
version: "13.0.1"
|
||||
permission_handler_apple:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -749,6 +821,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.1.5+1"
|
||||
rbush:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: rbush
|
||||
sha256: "48b683421b4afb43a642f82c6aa31911e54f3069143d31c7d33cbe329df13403"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.1"
|
||||
shared_preferences:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -874,6 +954,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.4.1"
|
||||
sweepline_intersections:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: sweepline_intersections
|
||||
sha256: a665c707200a4f07140a4029b41a7c4883beb3f04322cd8e08ebf650f69e1176
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.0.4"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -902,10 +990,34 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: timezone
|
||||
sha256: "2236ec079a174ce07434e89fcd3fcda430025eb7692244139a9cf54fdcf1fc7d"
|
||||
sha256: dd14a3b83cfd7cb19e7888f1cbc20f258b8d71b54c06f79ac585f14093a287d1
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.9.4"
|
||||
version: "0.10.1"
|
||||
turf:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: turf
|
||||
sha256: "75347c45a5c1de805db7cb182286f05a3770e01546626c4dc292709d15cbe436"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.0.10"
|
||||
turf_equality:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: turf_equality
|
||||
sha256: f0f44ffe389547941358e0d3d4a747db2bd56115b32ff1cede5e5bdf3126a3e2
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.1.0"
|
||||
turf_pip:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: turf_pip
|
||||
sha256: ba4fd414baffd5d7b30880658ad6db82461c49ec023f8ffd0c23d398ad8b14be
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.0.2"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1074,6 +1186,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.23.0"
|
||||
win32:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: win32
|
||||
sha256: "66814138c3562338d05613a6e368ed8cfb237ad6d64a9e9334be3f309acfca03"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.14.0"
|
||||
xdg_directories:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@@ -18,7 +18,8 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
version: 1.0.0+1
|
||||
|
||||
environment:
|
||||
sdk: ">=2.17.6 <3.0.0"
|
||||
#sdk: ">=2.17.6 <3.0.0"
|
||||
sdk: ">=3.0.0 <4.0.0"
|
||||
|
||||
# Dependencies specify other packages that your package needs in order to work.
|
||||
# To automatically upgrade your package dependencies to the latest versions
|
||||
@@ -36,8 +37,7 @@ 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
|
||||
timezone: ^0.10.1
|
||||
cupertino_icons: ^1.0.2
|
||||
http: ^1.2.1
|
||||
shared_preferences: ^2.2.3
|
||||
@@ -46,17 +46,19 @@ dependencies:
|
||||
camera_web: ^0.3.3
|
||||
path_provider: ^2.1.3
|
||||
path: ^1.9.0
|
||||
flutter_gemini: ^2.0.4
|
||||
flutter_dotenv: ^5.1.0
|
||||
flutter_gemini: ^3.0.0
|
||||
flutter_dotenv: ^6.0.0
|
||||
image_picker: ^1.1.2
|
||||
date_format_field: ^0.1.0
|
||||
textfield_tags: ^3.0.1
|
||||
geolocator: ^13.0.1
|
||||
permission_handler: ^11.3.1
|
||||
geolocator: ^14.0.2
|
||||
permission_handler: ^12.0.1
|
||||
url_launcher: ^6.3.1
|
||||
google_mobile_ads: ^5.3.1
|
||||
encrypt_shared_preferences: ^0.8.8
|
||||
google_mobile_ads: ^6.0.0
|
||||
encrypt_shared_preferences: ^0.9.10
|
||||
provider: ^6.1.2 # ou la dernière version
|
||||
mapbox_maps_flutter: ^2.10.0
|
||||
flutter_local_notifications: ^19.4.1
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
@@ -67,7 +69,7 @@ dev_dependencies:
|
||||
# activated in the `analysis_options.yaml` file located at the root of your
|
||||
# package. See that file for information about deactivating specific lint
|
||||
# rules and activating additional ones.
|
||||
flutter_lints: ^4.0.0
|
||||
flutter_lints: ^6.0.0
|
||||
|
||||
# For information on the generic Dart part of this file, see the
|
||||
# following page: https://dart.dev/tools/pub/pubspec
|
||||
@@ -75,7 +77,6 @@ dev_dependencies:
|
||||
# The following section is specific to Flutter packages.
|
||||
flutter:
|
||||
generate: true
|
||||
|
||||
# The following line ensures that the Material Icons font is
|
||||
# included with your application, so that you can use the icons in
|
||||
# the material Icons class.
|
||||
|
@@ -10,6 +10,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
|
||||
)
|
||||
|
||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||
flutter_local_notifications_windows
|
||||
)
|
||||
|
||||
set(PLUGIN_BUNDLED_LIBRARIES)
|
||||
|
50
covas_mobile_old/android/app/build.gradle
Normal file
@@ -0,0 +1,50 @@
|
||||
def localProperties = new Properties()
|
||||
def localPropertiesFile = rootProject.file('local.properties')
|
||||
if (localPropertiesFile.exists()) {
|
||||
localPropertiesFile.withReader('UTF-8') { reader ->
|
||||
localProperties.load(reader)
|
||||
}
|
||||
}
|
||||
|
||||
def flutterRoot = localProperties.getProperty('flutter.sdk')
|
||||
if (flutterRoot == null) {
|
||||
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
|
||||
android {
|
||||
compileSdkVersion 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.example.covas_mobile"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 34
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
signingConfig signingConfigs.debug
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main.java.srcDirs += 'src/main/kotlin'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
}
|
Before Width: | Height: | Size: 544 B After Width: | Height: | Size: 544 B |
Before Width: | Height: | Size: 442 B After Width: | Height: | Size: 442 B |
Before Width: | Height: | Size: 721 B After Width: | Height: | Size: 721 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
11
covas_mobile_old/android/settings.gradle
Normal file
@@ -0,0 +1,11 @@
|
||||
include ':app'
|
||||
|
||||
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
|
||||
def properties = new Properties()
|
||||
|
||||
assert localPropertiesFile.exists()
|
||||
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
|
||||
|
||||
def flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
||||
|
BIN
covas_mobile_old/images/flutter.png
Normal file
After Width: | Height: | Size: 45 KiB |
BIN
covas_mobile_old/images/marker-red.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
covas_mobile_old/images/marker.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
covas_mobile_old/images/search.png
Normal file
After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 564 B After Width: | Height: | Size: 564 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 68 B After Width: | Height: | Size: 68 B |
Before Width: | Height: | Size: 68 B After Width: | Height: | Size: 68 B |
Before Width: | Height: | Size: 68 B After Width: | Height: | Size: 68 B |