From a69d1aa03f9b464cc9c07b5927a85c0c43c9cf8d Mon Sep 17 00:00:00 2001 From: Thomas Fransolet Date: Fri, 19 Nov 2021 18:54:52 +0100 Subject: [PATCH] WEB - WIP --- lib/Components/resource_tab.dart | 2 +- lib/Components/upload_image_container.dart | 11 +- lib/Components/vlc_viewer.dart | 7 +- lib/Helpers/FileHelper.dart | 6 +- .../Slider/listView_card_image.dart | 2 +- .../SubSection/Slider/slider_config.dart | 4 +- .../Section/section_detail_screen.dart | 4 +- .../new_configuration_popup.dart | 7 +- lib/Screens/login_screen.dart | 3 + lib/client.dart | 2 + lib/main.dart | 21 ++- linux/flutter/generated_plugin_registrant.cc | 8 - linux/flutter/generated_plugins.cmake | 2 - macos/Flutter/GeneratedPluginRegistrant.swift | 4 - pubspec.lock | 156 ------------------ pubspec.yaml | 18 +- .../flutter/generated_plugin_registrant.cc | 6 - windows/flutter/generated_plugins.cmake | 2 - 18 files changed, 53 insertions(+), 212 deletions(-) diff --git a/lib/Components/resource_tab.dart b/lib/Components/resource_tab.dart index 6aee23f..a757281 100644 --- a/lib/Components/resource_tab.dart +++ b/lib/Components/resource_tab.dart @@ -1,8 +1,8 @@ import 'dart:io'; import 'package:flutter/material.dart'; +import 'package:manager_app/Components/upload_image_container.dart'; import 'package:manager_app/Components/upload_online_resources_container.dart'; -import 'file:///C:/Users/Thomas%20Fransolet/Documents/Documents/Perso/MuseeDeLaFraise/manager-app/lib/Components/upload_image_container.dart'; import 'package:manager_app/constants.dart'; import 'package:managerapi/api.dart'; class ResourceTab extends StatefulWidget { diff --git a/lib/Components/upload_image_container.dart b/lib/Components/upload_image_container.dart index 75370be..0673b1a 100644 --- a/lib/Components/upload_image_container.dart +++ b/lib/Components/upload_image_container.dart @@ -1,8 +1,8 @@ import 'dart:io'; -import 'package:dart_vlc/dart_vlc.dart'; +//import 'package:dart_vlc/dart_vlc.dart'; import 'package:manager_app/Components/loading.dart'; import 'package:manager_app/constants.dart'; -import 'package:filepicker_windows/filepicker_windows.dart'; +//import 'package:filepicker_windows/filepicker_windows.dart'; import 'package:flutter/material.dart'; class UploadImageContainer extends StatefulWidget { @@ -40,7 +40,7 @@ class _UploadImageContainerState extends State with Single } void filePicker() { - final file = OpenFilePicker() + /*final file = OpenFilePicker() ..filterSpecification = { 'Images (*.jpg; *.png)': '*.jpg;*.png', //'Video (*.mp4)': '*.mp4', @@ -58,7 +58,7 @@ class _UploadImageContainerState extends State with Single fileToShow = result; widget.onChanged(result); }); - } + }*/ } showFile() { @@ -111,7 +111,8 @@ class _UploadImageContainerState extends State with Single } loadFile(File fileToShow) async { - return await Media.file(fileToShow); + //return await Media.file(fileToShow); + return null; } displayElement() { diff --git a/lib/Components/vlc_viewer.dart b/lib/Components/vlc_viewer.dart index 2c654ec..4e746d7 100644 --- a/lib/Components/vlc_viewer.dart +++ b/lib/Components/vlc_viewer.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:dart_vlc/dart_vlc.dart'; - +//import 'package:dart_vlc/dart_vlc.dart'; +/* class DartVLC extends StatefulWidget { final Media file; const DartVLC({ @@ -734,4 +734,5 @@ class _DartVLCState extends State { ), );*/ } -} \ No newline at end of file +} +*/ diff --git a/lib/Helpers/FileHelper.dart b/lib/Helpers/FileHelper.dart index 305e830..f1cbf4b 100644 --- a/lib/Helpers/FileHelper.dart +++ b/lib/Helpers/FileHelper.dart @@ -7,7 +7,7 @@ import 'package:manager_app/Models/session.dart'; import 'package:manager_app/client.dart'; import 'package:manager_app/constants.dart'; import 'package:managerapi/api.dart'; -import 'package:path_provider/path_provider.dart'; +//import 'package:path_provider/path_provider.dart'; class FileHelper { final key = Key.fromUtf8('aVs:ZMe3EK-ySvCGrj3T8]yG6E'); @@ -15,8 +15,8 @@ class FileHelper { Future get _localPath async { - final directory = await getApplicationDocumentsDirectory(); - + //final directory = await getApplicationDocumentsDirectory(); + var directory; return directory.path; } diff --git a/lib/Screens/Configurations/Section/SubSection/Slider/listView_card_image.dart b/lib/Screens/Configurations/Section/SubSection/Slider/listView_card_image.dart index 109f3c7..b66b736 100644 --- a/lib/Screens/Configurations/Section/SubSection/Slider/listView_card_image.dart +++ b/lib/Screens/Configurations/Section/SubSection/Slider/listView_card_image.dart @@ -1,6 +1,6 @@ import 'package:auto_size_text/auto_size_text.dart'; import 'package:flutter/material.dart'; -import 'file:///C:/Users/Thomas%20Fransolet/Documents/Documents/Perso/MuseeDeLaFraise/manager-app/lib/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart'; +import 'package:manager_app/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart'; import 'package:manager_app/app_context.dart'; import 'package:manager_app/constants.dart'; import 'package:managerapi/api.dart'; diff --git a/lib/Screens/Configurations/Section/SubSection/Slider/slider_config.dart b/lib/Screens/Configurations/Section/SubSection/Slider/slider_config.dart index 51ff1ff..6134801 100644 --- a/lib/Screens/Configurations/Section/SubSection/Slider/slider_config.dart +++ b/lib/Screens/Configurations/Section/SubSection/Slider/slider_config.dart @@ -1,7 +1,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'file:///C:/Users/Thomas%20Fransolet/Documents/Documents/Perso/MuseeDeLaFraise/manager-app/lib/Screens/Configurations/Section/SubSection/Slider/listView_card_image.dart'; -import 'file:///C:/Users/Thomas%20Fransolet/Documents/Documents/Perso/MuseeDeLaFraise/manager-app/lib/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart'; +import 'package:manager_app/Screens/Configurations/Section/SubSection/Slider/listView_card_image.dart'; +import 'package:manager_app/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart'; import 'package:manager_app/app_context.dart'; import 'package:manager_app/constants.dart'; import 'package:managerapi/api.dart'; diff --git a/lib/Screens/Configurations/Section/section_detail_screen.dart b/lib/Screens/Configurations/Section/section_detail_screen.dart index 27cf8f2..a340f27 100644 --- a/lib/Screens/Configurations/Section/section_detail_screen.dart +++ b/lib/Screens/Configurations/Section/section_detail_screen.dart @@ -8,8 +8,7 @@ import 'package:manager_app/Components/multi_string_input_container.dart'; import 'package:manager_app/Components/rounded_button.dart'; import 'package:manager_app/Components/string_input_container.dart'; import 'package:manager_app/Models/managerContext.dart'; -import 'file:///C:/Users/Thomas%20Fransolet/Documents/Documents/Perso/MuseeDeLaFraise/manager-app/lib/Screens/Configurations/Section/SubSection/Slider/slider_config.dart'; -import 'file:///C:/Users/Thomas%20Fransolet/Documents/Documents/Perso/MuseeDeLaFraise/manager-app/lib/Screens/Configurations/Section/SubSection/WebOrVideo/web_video_config.dart'; +import 'package:manager_app/Screens/Configurations/Section/SubSection/WebOrVideo/web_video_config.dart'; import 'package:manager_app/app_context.dart'; import 'package:manager_app/client.dart'; import 'package:manager_app/constants.dart'; @@ -19,6 +18,7 @@ import 'package:intl/intl.dart'; import 'SubSection/Map/map_config.dart'; import 'SubSection/Menu/menu_config.dart'; +import 'SubSection/Slider/slider_config.dart'; class SectionDetailScreen extends StatefulWidget { final String id; diff --git a/lib/Screens/Configurations/new_configuration_popup.dart b/lib/Screens/Configurations/new_configuration_popup.dart index 9cdc0b2..aa856de 100644 --- a/lib/Screens/Configurations/new_configuration_popup.dart +++ b/lib/Screens/Configurations/new_configuration_popup.dart @@ -1,4 +1,4 @@ -import 'package:filepicker_windows/filepicker_windows.dart'; +//import 'package:filepicker_windows/filepicker_windows.dart'; import 'package:flutter/material.dart'; import 'package:manager_app/Components/message_notification.dart'; import 'package:manager_app/Components/rounded_button.dart'; @@ -106,7 +106,7 @@ void showNewConfiguration(AppContext appContext, ValueChanged isImport, Bu } String filePicker() { - final file = OpenFilePicker() + /*final file = OpenFilePicker() ..filterSpecification = { 'Fichier (*.json)': '*.json', //'Video (*.mp4)': '*.mp4', @@ -115,7 +115,8 @@ String filePicker() { ..defaultFilterIndex = 0 ..title = 'Sélectionner un fichier'; - final result = file.getFile(); + final result = file.getFile();*/ + var result; return result != null ? result.path : null; } diff --git a/lib/Screens/login_screen.dart b/lib/Screens/login_screen.dart index 4e5eb52..f0e9eac 100644 --- a/lib/Screens/login_screen.dart +++ b/lib/Screens/login_screen.dart @@ -44,6 +44,9 @@ class _LoginScreenState extends State { setState(() { isLoading = true; }); + print(email); + print(password); + LoginDTO loginDTO = new LoginDTO(email: email, password: password); TokenDTO token = await clientAPI.authenticationApi.authenticationAuthenticateWithJson(loginDTO); print("Token ??"); diff --git a/lib/client.dart b/lib/client.dart index 52a6241..3f8c72b 100644 --- a/lib/client.dart +++ b/lib/client.dart @@ -26,7 +26,9 @@ class Client { Client(String path) { _apiClient = ApiClient( basePath: path); + //basePath: "https://192.168.31.140"); //basePath: "https://localhost:44339"); + _apiClient.addDefaultHeader("Access-Control_Allow_Origin", "*"); _authenticationApi = AuthenticationApi(_apiClient); _userApi = UserApi(_apiClient); _configurationApi = ConfigurationApi(_apiClient); diff --git a/lib/main.dart b/lib/main.dart index da45783..50eba52 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,4 +1,5 @@ import 'dart:io'; +import 'dart:ui'; import 'package:manager_app/Models/managerContext.dart'; import 'package:manager_app/Screens/Main/main_screen.dart'; @@ -9,17 +10,17 @@ import 'Models/session.dart'; import 'Screens/login_screen.dart'; import 'app_context.dart'; import 'constants.dart'; -import 'package:window_size/window_size.dart'; +//import 'package:window_size/window_size.dart'; Future main() async { String initialRoute; WidgetsFlutterBinding.ensureInitialized(); - if (Platform.isWindows) { - setWindowTitle("Manager"); + /*if (Platform.isWindows) { + /*setWindowTitle("Manager"); setWindowMinSize(Size(1250, 850)); - setWindowMaxSize(Size(3840, 2160)); - } + setWindowMaxSize(Size(3840, 2160));*/ + }*/ initialRoute = '/welcome'; @@ -51,6 +52,7 @@ class _MyAppState extends State { return ChangeNotifierProvider( create: (_) => AppContext(widget.managerAppContext), child: MaterialApp( + scrollBehavior: MyCustomScrollBehavior(), debugShowCheckedModeBanner: false, title: 'Manager App Demo', initialRoute: widget.initialRoute, @@ -80,3 +82,12 @@ Future loadJsonSessionFile() async { return session; } +class MyCustomScrollBehavior extends MaterialScrollBehavior { + // Override behavior methods and getters like dragDevices + @override + Set get dragDevices => { + PointerDeviceKind.touch, + PointerDeviceKind.mouse, + }; +} + diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index 08653c4..e71a16d 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -6,14 +6,6 @@ #include "generated_plugin_registrant.h" -#include -#include void fl_register_plugins(FlPluginRegistry* registry) { - g_autoptr(FlPluginRegistrar) dart_vlc_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "DartVlcPlugin"); - dart_vlc_plugin_register_with_registrar(dart_vlc_registrar); - g_autoptr(FlPluginRegistrar) window_size_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "WindowSizePlugin"); - window_size_plugin_register_with_registrar(window_size_registrar); } diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index 53f2011..51436ae 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -3,8 +3,6 @@ # list(APPEND FLUTTER_PLUGIN_LIST - dart_vlc - window_size ) set(PLUGIN_BUNDLED_LIBRARIES) diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 73ed95b..cccf817 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,10 +5,6 @@ import FlutterMacOS import Foundation -import path_provider_macos -import window_size func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { - PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) - WindowSizePlugin.register(with: registry.registrar(forPlugin: "WindowSizePlugin")) } diff --git a/pubspec.lock b/pubspec.lock index 43e7f20..97813ad 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,13 +1,6 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - ansicolor: - dependency: transitive - description: - name: ansicolor - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" args: dependency: transitive description: @@ -29,13 +22,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.8.2" - audio_video_progress_bar: - dependency: transitive - description: - name: audio_video_progress_bar - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.0" auto_size_text: dependency: "direct main" description: @@ -99,20 +85,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.3" - dart_vlc: - dependency: "direct main" - description: - name: dart_vlc - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.9" - dart_vlc_ffi: - dependency: transitive - description: - name: dart_vlc_ffi - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.9" drag_and_drop_lists: dependency: "direct main" description: @@ -134,27 +106,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.0" - ffi: - dependency: transitive - description: - name: ffi - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.2" - file: - dependency: transitive - description: - name: file - url: "https://pub.dartlang.org" - source: hosted - version: "6.1.2" - filepicker_windows: - dependency: "direct main" - description: - name: filepicker_windows - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" flare_flutter: dependency: "direct main" description: @@ -198,13 +149,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.1.4" - injector: - dependency: transitive - description: - name: injector - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" intl: dependency: transitive description: @@ -247,13 +191,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.7.0" - msix: - dependency: "direct main" - description: - name: msix - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.3" multiselect_formfield: dependency: "direct main" description: @@ -268,13 +205,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.0" - package_config: - dependency: transitive - description: - name: package_config - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" path: dependency: transitive description: @@ -282,41 +212,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.8.0" - path_provider: - dependency: "direct main" - description: - name: path_provider - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.2" - path_provider_linux: - dependency: transitive - description: - name: path_provider_linux - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.2" - path_provider_macos: - dependency: transitive - description: - name: path_provider_macos - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.2" - path_provider_platform_interface: - dependency: transitive - description: - name: path_provider_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - path_provider_windows: - dependency: transitive - description: - name: path_provider_windows - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.3" pedantic: dependency: transitive description: @@ -324,20 +219,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.11.1" - platform: - dependency: transitive - description: - name: platform - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.2" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" pointycastle: dependency: transitive description: @@ -345,13 +226,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.3.1" - process: - dependency: transitive - description: - name: process - url: "https://pub.dartlang.org" - source: hosted - version: "4.2.3" provider: dependency: "direct main" description: @@ -448,36 +322,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.3" - win32: - dependency: transitive - description: - name: win32 - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.5" - window_size: - dependency: "direct main" - description: - path: "plugins/window_size" - ref: "927f8cbc09b35d85245c095f2db8df9b186f6618" - resolved-ref: "927f8cbc09b35d85245c095f2db8df9b186f6618" - url: "git://github.com/google/flutter-desktop-embedding.git" - source: git - version: "0.1.0" - xdg_directories: - dependency: transitive - description: - name: xdg_directories - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - yaml: - dependency: transitive - description: - name: yaml - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.0" sdks: dart: ">=2.12.0 <3.0.0" flutter: ">=2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 058e4c4..c108259 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -32,19 +32,19 @@ dependencies: material_segmented_control: ^3.1.2 convert: ^3.0.0 collection: any - filepicker_windows: ^2.0.0 + #filepicker_windows: ^2.0.0 flare_flutter: ^3.0.1 - dart_vlc: ^0.0.6 + #dart_vlc: ^0.0.6 video_player: ^2.1.1 drag_and_drop_lists: ^0.3.2 - path_provider: ^2.0.2 + #path_provider: ^2.0.2 encrypt: ^5.0.0 - msix: ^2.1.3 - window_size: - git: - url: git://github.com/google/flutter-desktop-embedding.git - path: plugins/window_size - ref: 927f8cbc09b35d85245c095f2db8df9b186f6618 + #msix: ^2.1.3 + #window_size: + # git: + # url: git://github.com/google/flutter-desktop-embedding.git + # path: plugins/window_size + # ref: 927f8cbc09b35d85245c095f2db8df9b186f6618 managerapi: path: manager_api diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 36f9252..8b6d468 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -6,12 +6,6 @@ #include "generated_plugin_registrant.h" -#include -#include void RegisterPlugins(flutter::PluginRegistry* registry) { - DartVlcPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("DartVlcPlugin")); - WindowSizePluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("WindowSizePlugin")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index bb61159..4d10c25 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -3,8 +3,6 @@ # list(APPEND FLUTTER_PLUGIN_LIST - dart_vlc - window_size ) set(PLUGIN_BUNDLED_LIBRARIES)