diff --git a/lib/Screens/Configurations/Section/SubSection/Map/map_config.dart b/lib/Screens/Configurations/Section/SubSection/Map/map_config.dart index 0addb1b..b341a1f 100644 --- a/lib/Screens/Configurations/Section/SubSection/Map/map_config.dart +++ b/lib/Screens/Configurations/Section/SubSection/Map/map_config.dart @@ -1,5 +1,6 @@ import 'package:auto_size_text/auto_size_text.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_widget_from_html/flutter_widget_from_html.dart'; import 'package:manager_app/Components/fetch_section_icon.dart'; import 'package:manager_app/Components/image_input_container.dart'; import 'package:manager_app/Components/multi_select_container.dart'; @@ -223,11 +224,13 @@ class _MapConfigState extends State { Center( child: Padding( padding: const EdgeInsets.all(8.0), - child: AutoSizeText( - point != null ? point.title == null ? "" : point.title![0].value! : "", - style: new TextStyle(fontSize: 20), - maxLines: 2, - textAlign: TextAlign.center, + child: HtmlWidget( + point != null ? point.title == null ? "" : point.title![0].value! : "", + //textAlign: TextAlign.left, + customStylesBuilder: (element) { + return {'text-align': 'center'}; + }, + textStyle: TextStyle(fontSize: 20) ), ), ), diff --git a/lib/Screens/Devices/device_element.dart b/lib/Screens/Devices/device_element.dart index 4b429b4..541526b 100644 --- a/lib/Screens/Devices/device_element.dart +++ b/lib/Screens/Devices/device_element.dart @@ -60,7 +60,7 @@ class _DeviceElementState extends State { child: Row( children: [ AutoSizeText( - deviceDTO.name!, + deviceDTO.name != null ? deviceDTO.name! : deviceDTO.identifier!, style: new TextStyle(fontSize: 25, fontWeight: FontWeight.w300), maxLines: 1, ), @@ -94,7 +94,7 @@ class _DeviceElementState extends State { icon: Icon(Icons.edit), onPressed: () { showChangeInfo( - "Mettre à jour le device", + "Mettre à jour la tablette", deviceDTO, (DeviceDTO outputDevice) { // For refresh diff --git a/lib/Screens/Devices/devices_screen.dart b/lib/Screens/Devices/devices_screen.dart index 18e5c88..57a95df 100644 --- a/lib/Screens/Devices/devices_screen.dart +++ b/lib/Screens/Devices/devices_screen.dart @@ -32,7 +32,7 @@ class _DevicesScreenState extends State { child: Align( alignment: AlignmentDirectional.centerStart, child: AutoSizeText( - "PinCode: " + managerAppContext.pinCode.toString(), + "Code pin: " + managerAppContext.pinCode.toString(), style: TextStyle(fontSize: 25.0, fontWeight: FontWeight.w300), maxLines: 2, maxFontSize: 25.0, diff --git a/lib/Screens/Main/components/body.dart b/lib/Screens/Main/components/body.dart index 7f423d6..e86ef51 100644 --- a/lib/Screens/Main/components/body.dart +++ b/lib/Screens/Main/components/body.dart @@ -41,8 +41,8 @@ class _BodyState extends State { @override void initState() { - devices = new MenuSection(name: "Appareils", type: "devices", order: 0); - configurations = new MenuSection(name: "Visites", type: "configurations", order: widget.showDevice ? 1 : 0); + devices = new MenuSection(name: "Tablettes", type: "devices", order: 0); + configurations = new MenuSection(name: "Configurations", type: "configurations", order: widget.showDevice ? 1 : 0); // TODO Renommer spécifiquement en Visites pour St Heribert resources = new MenuSection(name: "Ressources", type: "resources", order: widget.showDevice ? 2 : 1); //tabsToShow.add(new Tab(text: "Vidéo en ligne")); diff --git a/lib/Screens/Main/main_screen.dart b/lib/Screens/Main/main_screen.dart index 9bf161e..b9d8388 100644 --- a/lib/Screens/Main/main_screen.dart +++ b/lib/Screens/Main/main_screen.dart @@ -42,8 +42,8 @@ class _MainScreenState extends State { } getMenu() { - MenuSection devices = new MenuSection(name: "Appareils", type: "devices", order: 0); - MenuSection configurations = new MenuSection(name: "Visites", type: "configurations", order: 1); + MenuSection devices = new MenuSection(name: "Tablettes", type: "devices", order: 0); + MenuSection configurations = new MenuSection(name: "Configurations", type: "configurations", order: 1); // TODO Visites pour Fort St Héribert MenuSection resources = new MenuSection(name: "Ressources", type: "resources", order: 2); Menu menu = new Menu(title: "MyMuseum"); diff --git a/lib/Screens/Resources/resources_screen.dart b/lib/Screens/Resources/resources_screen.dart index 06fec61..c0a48d4 100644 --- a/lib/Screens/Resources/resources_screen.dart +++ b/lib/Screens/Resources/resources_screen.dart @@ -1,5 +1,7 @@ import 'dart:io'; import 'package:file_picker/file_picker.dart'; +import 'package:firebase_storage/firebase_storage.dart'; + import 'package:flutter/material.dart'; import 'package:manager_app/Components/loading_common.dart'; import 'package:manager_app/Components/message_notification.dart'; @@ -13,6 +15,8 @@ import 'package:manager_api_new/api.dart'; import 'package:provider/provider.dart'; import 'package:http/http.dart' as http; import 'package:flutter/foundation.dart' show kIsWeb; +import 'package:path/path.dart' as Path; +import 'dart:html' as html; class ResourcesScreen extends StatefulWidget { final Function? onGetResult; //return ResourceDTO @@ -158,7 +162,37 @@ Future create(ResourceDTO resourceDTO, List? files, List section_types = ["Map", "Slider", "Video", "Web", "Menu", "Quizz", "Article"]; +const List section_types = ["Map", "Slider", "Video", "Web", "Menu", "Quizz", "Article", "PDF", "Puzzle", "Agenda"]; const List map_types = ["none", "normal", "satellite", "terrain", "hybrid"]; const List languages = ["FR", "NL", "EN", "DE", "IT", "ES", "CN", "PL", "AR", "UK"]; List resource_types = [ diff --git a/lib/main.dart b/lib/main.dart index 802ae82..d172fc3 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,5 +1,6 @@ import 'dart:ui'; +import 'package:firebase_core/firebase_core.dart'; import 'package:manager_app/Models/managerContext.dart'; import 'package:manager_app/Screens/Main/main_screen.dart'; import 'package:flutter/material.dart'; @@ -31,6 +32,19 @@ Future main() async { //context: localContext, ); + await Firebase.initializeApp( + // Replace with actual values + options: FirebaseOptions( + apiKey: "AIzaSyCFXuDsslqHiPpK6WTcxdIvTDP3ioaaxp4", + authDomain: "mymuseum-3b97f.firebaseapp.com", + projectId: "mymuseum-3b97f", + storageBucket: "mymuseum-3b97f.appspot.com", + messagingSenderId: "1034665398515", + appId: "1:1034665398515:web:688e2a7b3465e621d6a786", + measurementId: "G-EKKHJLJ1E9" + ), + ); + runApp(myApp); } diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index d4702a9..7d45a15 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -6,6 +6,8 @@ import FlutterMacOS import Foundation import audio_session +import firebase_core +import firebase_storage import just_audio import package_info_plus import pasteboard @@ -17,6 +19,8 @@ import wakelock_plus func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { AudioSessionPlugin.register(with: registry.registrar(forPlugin: "AudioSessionPlugin")) + FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) + FLTFirebaseStoragePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseStoragePlugin")) JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin")) FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) PasteboardPlugin.register(with: registry.registrar(forPlugin: "PasteboardPlugin")) diff --git a/pubspec.lock b/pubspec.lock index 23ff367..7089256 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -9,6 +9,14 @@ packages: url: "https://pub.dev" source: hosted version: "63.0.0" + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + sha256: f5628cd9c92ed11083f425fd1f8f1bc60ecdda458c81d73b143aeda036c35fe7 + url: "https://pub.dev" + source: hosted + version: "1.3.16" analyzer: dependency: transitive description: @@ -325,10 +333,58 @@ packages: dependency: "direct main" description: name: file_picker - sha256: "903dd4ba13eae7cef64acc480e91bf54c3ddd23b5b90b639c170f3911e489620" + sha256: "4e42aacde3b993c5947467ab640882c56947d9d27342a5b6f2895b23956954a6" url: "https://pub.dev" source: hosted - version: "6.0.0" + version: "6.1.1" + firebase_core: + dependency: "direct main" + description: + name: firebase_core + sha256: "96607c0e829a581c2a483c658f04e8b159964c3bae2730f73297070bc85d40bb" + url: "https://pub.dev" + source: hosted + version: "2.24.2" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + sha256: c437ae5d17e6b5cc7981cf6fd458a5db4d12979905f9aafd1fea930428a9fe63 + url: "https://pub.dev" + source: hosted + version: "5.0.0" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + sha256: d585bdf3c656c3f7821ba1bd44da5f13365d22fcecaf5eb75c4295246aaa83c0 + url: "https://pub.dev" + source: hosted + version: "2.10.0" + firebase_storage: + dependency: "direct main" + description: + name: firebase_storage + sha256: "8126e80210c0841a5b8204590b40d6b9e87cded3d342a92833f484a564dcddb3" + url: "https://pub.dev" + source: hosted + version: "11.5.6" + firebase_storage_platform_interface: + dependency: transitive + description: + name: firebase_storage_platform_interface + sha256: "545a3a8edf337850403bb0fa03c8074a53deb87c0107d19755c77a82ce07919e" + url: "https://pub.dev" + source: hosted + version: "5.1.3" + firebase_storage_web: + dependency: transitive + description: + name: firebase_storage_web + sha256: ee6870ff79aa304b8996ba18a4aefe1e8b3fc31fd385eab6574180267aa8d393 + url: "https://pub.dev" + source: hosted + version: "3.6.17" fixnum: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 5da4b87..2ce40d4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.0.2+3 +version: 2.0.0+4 environment: sdk: ">=3.1.0 <4.0.0" @@ -33,7 +33,7 @@ dependencies: convert: ^3.1.1 collection: any #filepicker_windows: ^2.0.0 - file_picker: ^6.0.0 + file_picker: ^6.1.1 flare_flutter: ^3.0.1 #dart_vlc: ^0.0.6 #video_player: ^2.1.1 @@ -64,6 +64,8 @@ dependencies: responsive_framework: ^1.1.1 tab_container: ^2.0.0 flutter_widget_from_html: ^0.10.1 + firebase_storage: ^11.5.6 + firebase_core: ^2.24.2 dev_dependencies: flutter_test: diff --git a/web/index.html b/web/index.html index 5ec4a97..9774a6d 100644 --- a/web/index.html +++ b/web/index.html @@ -111,5 +111,28 @@ loadMainDartJs(); } + diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 02129f5..460c590 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -6,10 +6,16 @@ #include "generated_plugin_registrant.h" +#include +#include #include #include void RegisterPlugins(flutter::PluginRegistry* registry) { + FirebaseCorePluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); + FirebaseStoragePluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FirebaseStoragePluginCApi")); PasteboardPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("PasteboardPlugin")); UrlLauncherWindowsRegisterWithRegistrar( diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 82731c9..ab4510c 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -3,6 +3,8 @@ # list(APPEND FLUTTER_PLUGIN_LIST + firebase_core + firebase_storage pasteboard url_launcher_windows )