diff --git a/android/app/build.gradle b/android/app/build.gradle index 292f1e8..ecb18fe 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -30,6 +30,7 @@ if (flutterVersionName == null) { apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" +apply plugin: 'com.google.gms.google-services' android { compileSdkVersion 33 @@ -38,13 +39,20 @@ android { main.java.srcDirs += 'src/main/kotlin' } + packagingOptions { + pickFirst 'lib/x86/libc++_shared.so' + pickFirst 'lib/x86_64/libc++_shared.so' + pickFirst 'lib/armeabi-v7a/libc++_shared.so' + pickFirst 'lib/arm64-v8a/libc++_shared.so' + } + lintOptions { disable 'InvalidPackage' } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "be.unov.tablet_app" + applicationId "be.unov.mymuseum.tablet_app" minSdkVersion 20 targetSdkVersion 34 versionCode flutterVersionCode.toInteger() @@ -79,4 +87,8 @@ flutter { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + + implementation platform('com.google.firebase:firebase-bom:32.7.0') + implementation 'com.google.firebase:firebase-analytics' + } diff --git a/android/app/google-services.json b/android/app/google-services.json new file mode 100644 index 0000000..de6dcdd --- /dev/null +++ b/android/app/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "1034665398515", + "project_id": "mymuseum-3b97f", + "storage_bucket": "mymuseum-3b97f.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:1034665398515:android:b7475582b41ed32dd6a786", + "android_client_info": { + "package_name": "be.unov.mymuseum.tablet_app" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyBVCpwP5Uxh_nDUV2b6s4TybUqPJ-lvXm0" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index 2c5c4dd..526e555 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.9.0' repositories { google() jcenter() @@ -8,6 +8,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:7.2.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath 'com.google.gms:google-services:4.3.15' } } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index cc5527d..6b66533 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/lib/Components/video_viewer.dart b/lib/Components/video_viewer.dart new file mode 100644 index 0000000..02f2333 --- /dev/null +++ b/lib/Components/video_viewer.dart @@ -0,0 +1,83 @@ +import 'package:flutter/material.dart'; +import 'package:tablet_app/Components/loading_common.dart'; +import 'package:video_player/video_player.dart'; +import '../../constants.dart'; + +class VideoViewer extends StatefulWidget { + final String videoUrl; + VideoViewer({required this.videoUrl}); + + @override + _VideoViewer createState() => _VideoViewer(); +} + +class _VideoViewer extends State { + late VideoPlayerController _controller; + + @override + void initState() { + super.initState(); + _controller = VideoPlayerController.networkUrl(Uri.parse( + widget.videoUrl)) + ..initialize().then((_) { + // Ensure the first frame is shown after the video is initialized, even before the play button has been pressed. + setState(() {}); + }); + } + + @override + void dispose() { + super.dispose(); + _controller.dispose(); + } + + @override + Widget build(BuildContext context) { + return Stack( + children: [ + Center( + child: InkWell( + onTap: () { + setState(() { + if(_controller.value.isInitialized) { + if(_controller.value.isPlaying) { + _controller.pause(); + } else { + _controller.play(); + } + } + }); + }, + child: _controller.value.isInitialized + ? AspectRatio( + aspectRatio: _controller.value.aspectRatio, + child: VideoPlayer(_controller), + ) + : Center( + child: Container( + child: LoadingCommon() + ) + ), + ), + ), + if(!_controller.value.isPlaying && _controller.value.isInitialized) + Center( + child: FloatingActionButton( + backgroundColor: kTestSecondColor.withOpacity(0.8), + onPressed: () { + setState(() { + _controller.value.isPlaying + ? _controller.pause() + : _controller.play(); + }); + }, + child: Icon( + _controller.value.isPlaying ? Icons.pause : Icons.play_arrow, + color: Colors.white), + ), + ) + ], + ); + } +} + diff --git a/lib/Screens/PDF/pdf_view.dart b/lib/Screens/PDF/pdf_view.dart new file mode 100644 index 0000000..e97b2fb --- /dev/null +++ b/lib/Screens/PDF/pdf_view.dart @@ -0,0 +1,125 @@ +import 'dart:async'; +import 'dart:convert'; +import 'dart:io'; +//import 'dart:html'; +import 'dart:ui' as ui; + +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_pdfview/flutter_pdfview.dart'; +import 'package:manager_api/api.dart'; +import 'package:path_provider/path_provider.dart'; +import 'package:tablet_app/Components/loading_common.dart'; + + +class PDFViewWidget extends StatefulWidget { + final SectionDTO? section; + PDFViewWidget({this.section}); + + @override + _PDFViewWidget createState() => _PDFViewWidget(); +} + +class _PDFViewWidget extends State { + PdfDTO pdfDTO = PdfDTO(); + String remotePDFpath = ""; + final Completer _controller = Completer(); + int? pages = 0; + int? currentPage = 0; + bool isReady = false; + String errorMessage = ''; + + @override + void initState() { + print(widget.section!.data); + pdfDTO = PdfDTO.fromJson(jsonDecode(widget.section!.data!))!; + pdfDTO.source_ = "todo"; + print(pdfDTO); + super.initState(); + + /*createFileOfPdfUrl(pdfDTO.source_!).then((f) { + setState(() { + remotePDFpath = f.path; + print("paaath"); + print(remotePDFpath); + }); + });*/ + } + + Future createFileOfPdfUrl(String source_) async { + Completer completer = Completer(); + print("Start download file from internet!"); + try { + // "https://berlin2017.droidcon.cod.newthinking.net/sites/global.droidcon.cod.newthinking.net/files/media/documents/Flutter%20-%2060FPS%20UI%20of%20the%20future%20%20-%20DroidconDE%2017.pdf"; + // final url = "https://pdfkit.org/docs/guide.pdf"; + final url = "http://www.pdf995.com/samples/pdf.pdf"; + // TODO replace by source_ + final filename = url.substring(url.lastIndexOf("/") + 1); + var request = await HttpClient().getUrl(Uri.parse(url)); + var response = await request.close(); + var bytes = await consolidateHttpClientResponseBytes(response); + var dir = await getApplicationDocumentsDirectory(); + print("Download files"); + print("${dir.path}/$filename"); + File file = File("${dir.path}/$filename"); + + await file.writeAsBytes(bytes, flush: true); + completer.complete(file); + } catch (e) { + throw Exception('Error parsing asset file!'); + } + + return completer.future; + } + + @override + void dispose() { + //_webView = null; + super.dispose(); + } + + + @override + Widget build(BuildContext context) => pdfDTO.source_ != null && pdfDTO.source_!.length > 0 ? + FutureBuilder( + future: createFileOfPdfUrl(""), + builder: (context, AsyncSnapshot snapshot) { + print("snapshot.data"); + print(snapshot.data); + if (snapshot.connectionState == ConnectionState.done) { + return PDFView( + filePath: snapshot.data.path, + enableSwipe: true, + swipeHorizontal: true, + autoSpacing: true, + pageFling: true, + onRender: (_pages) { + //setState(() { + pages = _pages; + isReady = true; + //}); + }, + onError: (error) { + print(error.toString()); + }, + onPageError: (page, error) { + print('$page: ${error.toString()}'); + }, + onViewCreated: (PDFViewController pdfViewController) { + //_controller.complete(pdfViewController); + }, + onPageChanged: (int? page, int? total) { + print('page change: $page/$total'); + }, + ); + } else { + return Center( + child: Container( + child: LoadingCommon() + ) + ); + } + } + ) : + Center(child: Text("Le PDF ne peut pas ĂȘtre affichĂ©, il n'existe pas")); +} //_webView \ No newline at end of file diff --git a/lib/api/swagger.yaml b/lib/api/swagger.yaml index c746371..d02d0b9 100644 --- a/lib/api/swagger.yaml +++ b/lib/api/swagger.yaml @@ -1463,6 +1463,48 @@ paths: $ref: '#/components/schemas/ArticleDTO' security: - bearer: [] + /api/Section/PdfDTO: + get: + tags: + - Section + operationId: Section_GetPdfDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/PdfDTO' + security: + - bearer: [] + /api/Section/PuzzleDTO: + get: + tags: + - Section + operationId: Section_GetPuzzleDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/PuzzleDTO' + security: + - bearer: [] + /api/Section/AgendaDTO: + get: + tags: + - Section + operationId: Section_GetAgendaDTO + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/AgendaDTO' + security: + - bearer: [] /api/User: get: tags: @@ -1866,6 +1908,9 @@ components: 4 = Menu 5 = Quizz 6 = Article + 7 = PDF + 8 = Puzzle + 9 = Agenda x-enumNames: - Map - Slider @@ -1874,6 +1919,9 @@ components: - Menu - Quizz - Article + - PDF + - Puzzle + - Agenda enum: - 0 - 1 @@ -1882,6 +1930,9 @@ components: - 4 - 5 - 6 + - 7 + - 8 + - 9 ResourceDTO: type: object additionalProperties: false @@ -1911,18 +1962,24 @@ components: 2 = ImageUrl 3 = VideoUrl 4 = Audio + 5 = PDF + 6 = JSON x-enumNames: - Image - Video - ImageUrl - VideoUrl - Audio + - PDF + - JSON enum: - 0 - 1 - 2 - 3 - 4 + - 5 + - 6 DeviceDTO: type: object additionalProperties: false @@ -2252,6 +2309,38 @@ components: nullable: true items: $ref: '#/components/schemas/ImageDTO' + PdfDTO: + type: object + additionalProperties: false + properties: + source: + type: string + nullable: true + PuzzleDTO: + type: object + additionalProperties: false + properties: + messageDebut: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + messageFin: + type: array + nullable: true + items: + $ref: '#/components/schemas/TranslationDTO' + image: + nullable: true + oneOf: + - $ref: '#/components/schemas/ImageDTO' + AgendaDTO: + type: object + additionalProperties: false + properties: + source: + type: string + nullable: true User: type: object additionalProperties: false diff --git a/lib/main.dart b/lib/main.dart index 7ec994f..cc70db4 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,5 +1,6 @@ import 'dart:io'; +import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:manager_api/api.dart'; @@ -61,6 +62,9 @@ void main() async { initialRoute: initialRoute, tabletAppContext: localContext, ); + + await Firebase.initializeApp(); + runApp(myApp); } diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index eeaefbd..49dd2ec 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 path_provider_foundation @@ -16,6 +18,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")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) diff --git a/manager_api/.openapi-generator/FILES b/manager_api/.openapi-generator/FILES index ca166c6..df15d92 100644 --- a/manager_api/.openapi-generator/FILES +++ b/manager_api/.openapi-generator/FILES @@ -2,6 +2,7 @@ .travis.yml README.md analysis_options.yaml +doc/AgendaDTO.md doc/ArticleDTO.md doc/AuthenticationApi.md doc/ConfigurationApi.md @@ -23,7 +24,10 @@ doc/LoginDTO.md doc/MapDTO.md doc/MapTypeApp.md doc/MenuDTO.md +doc/PdfDTO.md doc/PlayerMessageDTO.md +doc/PuzzleDTO.md +doc/PuzzleDTOImage.md doc/QuestionDTO.md doc/QuizzDTO.md doc/QuizzDTOBadLevel.md @@ -59,6 +63,7 @@ lib/auth/authentication.dart lib/auth/http_basic_auth.dart lib/auth/http_bearer_auth.dart lib/auth/oauth.dart +lib/model/agenda_dto.dart lib/model/article_dto.dart lib/model/configuration_dto.dart lib/model/device_detail_dto.dart @@ -76,7 +81,10 @@ lib/model/login_dto.dart lib/model/map_dto.dart lib/model/map_type_app.dart lib/model/menu_dto.dart +lib/model/pdf_dto.dart lib/model/player_message_dto.dart +lib/model/puzzle_dto.dart +lib/model/puzzle_dto_image.dart lib/model/question_dto.dart lib/model/quizz_dto.dart lib/model/quizz_dto_bad_level.dart @@ -93,3 +101,7 @@ lib/model/user_detail_dto.dart lib/model/video_dto.dart lib/model/web_dto.dart pubspec.yaml +test/agenda_dto_test.dart +test/pdf_dto_test.dart +test/puzzle_dto_image_test.dart +test/puzzle_dto_test.dart diff --git a/manager_api/README.md b/manager_api/README.md index b7c0cc0..a50ecac 100644 --- a/manager_api/README.md +++ b/manager_api/README.md @@ -97,6 +97,7 @@ Class | Method | HTTP request | Description *SectionApi* | [**sectionDelete**](doc\/SectionApi.md#sectiondelete) | **DELETE** /api/Section/{id} | *SectionApi* | [**sectionDeleteAllForConfiguration**](doc\/SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} | *SectionApi* | [**sectionGet**](doc\/SectionApi.md#sectionget) | **GET** /api/Section | +*SectionApi* | [**sectionGetAgendaDTO**](doc\/SectionApi.md#sectiongetagendadto) | **GET** /api/Section/AgendaDTO | *SectionApi* | [**sectionGetAllBeaconsForInstance**](doc\/SectionApi.md#sectiongetallbeaconsforinstance) | **GET** /api/Section/beacons/{instanceId} | *SectionApi* | [**sectionGetAllSectionSubSections**](doc\/SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections | *SectionApi* | [**sectionGetArticleDTO**](doc\/SectionApi.md#sectiongetarticledto) | **GET** /api/Section/ArticleDTO | @@ -104,6 +105,8 @@ Class | Method | HTTP request | Description *SectionApi* | [**sectionGetFromConfiguration**](doc\/SectionApi.md#sectiongetfromconfiguration) | **GET** /api/Section/configuration/{id} | *SectionApi* | [**sectionGetMapDTO**](doc\/SectionApi.md#sectiongetmapdto) | **GET** /api/Section/MapDTO | *SectionApi* | [**sectionGetMenuDTO**](doc\/SectionApi.md#sectiongetmenudto) | **GET** /api/Section/MenuDTO | +*SectionApi* | [**sectionGetPdfDTO**](doc\/SectionApi.md#sectiongetpdfdto) | **GET** /api/Section/PdfDTO | +*SectionApi* | [**sectionGetPuzzleDTO**](doc\/SectionApi.md#sectiongetpuzzledto) | **GET** /api/Section/PuzzleDTO | *SectionApi* | [**sectionGetQuizzDTO**](doc\/SectionApi.md#sectiongetquizzdto) | **GET** /api/Section/QuizzDTO | *SectionApi* | [**sectionGetSliderDTO**](doc\/SectionApi.md#sectiongetsliderdto) | **GET** /api/Section/SliderDTO | *SectionApi* | [**sectionGetVideoDTO**](doc\/SectionApi.md#sectiongetvideodto) | **GET** /api/Section/VideoDTO | @@ -120,6 +123,7 @@ Class | Method | HTTP request | Description ## Documentation For Models + - [AgendaDTO](doc\/AgendaDTO.md) - [ArticleDTO](doc\/ArticleDTO.md) - [ConfigurationDTO](doc\/ConfigurationDTO.md) - [DeviceDTO](doc\/DeviceDTO.md) @@ -137,7 +141,10 @@ Class | Method | HTTP request | Description - [MapDTO](doc\/MapDTO.md) - [MapTypeApp](doc\/MapTypeApp.md) - [MenuDTO](doc\/MenuDTO.md) + - [PdfDTO](doc\/PdfDTO.md) - [PlayerMessageDTO](doc\/PlayerMessageDTO.md) + - [PuzzleDTO](doc\/PuzzleDTO.md) + - [PuzzleDTOImage](doc\/PuzzleDTOImage.md) - [QuestionDTO](doc\/QuestionDTO.md) - [QuizzDTO](doc\/QuizzDTO.md) - [QuizzDTOBadLevel](doc\/QuizzDTOBadLevel.md) diff --git a/manager_api/doc/AgendaDTO.md b/manager_api/doc/AgendaDTO.md new file mode 100644 index 0000000..2992d03 --- /dev/null +++ b/manager_api/doc/AgendaDTO.md @@ -0,0 +1,15 @@ +# manager_api.model.AgendaDTO + +## Load the model package +```dart +import 'package:manager_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**source_** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api/doc/PdfDTO.md b/manager_api/doc/PdfDTO.md new file mode 100644 index 0000000..4d4f8e0 --- /dev/null +++ b/manager_api/doc/PdfDTO.md @@ -0,0 +1,15 @@ +# manager_api.model.PdfDTO + +## Load the model package +```dart +import 'package:manager_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**source_** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api/doc/PuzzleDTO.md b/manager_api/doc/PuzzleDTO.md new file mode 100644 index 0000000..076df06 --- /dev/null +++ b/manager_api/doc/PuzzleDTO.md @@ -0,0 +1,17 @@ +# manager_api.model.PuzzleDTO + +## Load the model package +```dart +import 'package:manager_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**messageDebut** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**messageFin** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**image** | [**PuzzleDTOImage**](PuzzleDTOImage.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api/doc/PuzzleDTOImage.md b/manager_api/doc/PuzzleDTOImage.md new file mode 100644 index 0000000..6df0900 --- /dev/null +++ b/manager_api/doc/PuzzleDTOImage.md @@ -0,0 +1,19 @@ +# manager_api.model.PuzzleDTOImage + +## Load the model package +```dart +import 'package:manager_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**description** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**resourceId** | **String** | | [optional] +**source_** | **String** | | [optional] +**order** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api/doc/SectionApi.md b/manager_api/doc/SectionApi.md index 46e8e00..ffdf049 100644 --- a/manager_api/doc/SectionApi.md +++ b/manager_api/doc/SectionApi.md @@ -13,6 +13,7 @@ Method | HTTP request | Description [**sectionDelete**](SectionApi.md#sectiondelete) | **DELETE** /api/Section/{id} | [**sectionDeleteAllForConfiguration**](SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} | [**sectionGet**](SectionApi.md#sectionget) | **GET** /api/Section | +[**sectionGetAgendaDTO**](SectionApi.md#sectiongetagendadto) | **GET** /api/Section/AgendaDTO | [**sectionGetAllBeaconsForInstance**](SectionApi.md#sectiongetallbeaconsforinstance) | **GET** /api/Section/beacons/{instanceId} | [**sectionGetAllSectionSubSections**](SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections | [**sectionGetArticleDTO**](SectionApi.md#sectiongetarticledto) | **GET** /api/Section/ArticleDTO | @@ -20,6 +21,8 @@ Method | HTTP request | Description [**sectionGetFromConfiguration**](SectionApi.md#sectiongetfromconfiguration) | **GET** /api/Section/configuration/{id} | [**sectionGetMapDTO**](SectionApi.md#sectiongetmapdto) | **GET** /api/Section/MapDTO | [**sectionGetMenuDTO**](SectionApi.md#sectiongetmenudto) | **GET** /api/Section/MenuDTO | +[**sectionGetPdfDTO**](SectionApi.md#sectiongetpdfdto) | **GET** /api/Section/PdfDTO | +[**sectionGetPuzzleDTO**](SectionApi.md#sectiongetpuzzledto) | **GET** /api/Section/PuzzleDTO | [**sectionGetQuizzDTO**](SectionApi.md#sectiongetquizzdto) | **GET** /api/Section/QuizzDTO | [**sectionGetSliderDTO**](SectionApi.md#sectiongetsliderdto) | **GET** /api/Section/SliderDTO | [**sectionGetVideoDTO**](SectionApi.md#sectiongetvideodto) | **GET** /api/Section/VideoDTO | @@ -201,6 +204,45 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **sectionGetAgendaDTO** +> AgendaDTO sectionGetAgendaDTO() + + + +### Example +```dart +import 'package:manager_api/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = SectionApi(); + +try { + final result = api_instance.sectionGetAgendaDTO(); + print(result); +} catch (e) { + print('Exception when calling SectionApi->sectionGetAgendaDTO: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**AgendaDTO**](AgendaDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **sectionGetAllBeaconsForInstance** > List sectionGetAllBeaconsForInstance(instanceId) @@ -490,6 +532,84 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **sectionGetPdfDTO** +> PdfDTO sectionGetPdfDTO() + + + +### Example +```dart +import 'package:manager_api/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = SectionApi(); + +try { + final result = api_instance.sectionGetPdfDTO(); + print(result); +} catch (e) { + print('Exception when calling SectionApi->sectionGetPdfDTO: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**PdfDTO**](PdfDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **sectionGetPuzzleDTO** +> PuzzleDTO sectionGetPuzzleDTO() + + + +### Example +```dart +import 'package:manager_api/api.dart'; +// TODO Configure OAuth2 access token for authorization: bearer +//defaultApiClient.getAuthentication('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; + +final api_instance = SectionApi(); + +try { + final result = api_instance.sectionGetPuzzleDTO(); + print(result); +} catch (e) { + print('Exception when calling SectionApi->sectionGetPuzzleDTO: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**PuzzleDTO**](PuzzleDTO.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **sectionGetQuizzDTO** > QuizzDTO sectionGetQuizzDTO() diff --git a/manager_api/lib/api.dart b/manager_api/lib/api.dart index 3d214e5..8d1a702 100644 --- a/manager_api/lib/api.dart +++ b/manager_api/lib/api.dart @@ -35,6 +35,7 @@ part 'api/resource_api.dart'; part 'api/section_api.dart'; part 'api/user_api.dart'; +part 'model/agenda_dto.dart'; part 'model/article_dto.dart'; part 'model/configuration_dto.dart'; part 'model/device_dto.dart'; @@ -52,7 +53,10 @@ part 'model/login_dto.dart'; part 'model/map_dto.dart'; part 'model/map_type_app.dart'; part 'model/menu_dto.dart'; +part 'model/pdf_dto.dart'; part 'model/player_message_dto.dart'; +part 'model/puzzle_dto.dart'; +part 'model/puzzle_dto_image.dart'; part 'model/question_dto.dart'; part 'model/quizz_dto.dart'; part 'model/quizz_dto_bad_level.dart'; diff --git a/manager_api/lib/api/section_api.dart b/manager_api/lib/api/section_api.dart index bc9addb..5f94765 100644 --- a/manager_api/lib/api/section_api.dart +++ b/manager_api/lib/api/section_api.dart @@ -213,6 +213,47 @@ class SectionApi { return null; } + /// Performs an HTTP 'GET /api/Section/AgendaDTO' operation and returns the [Response]. + Future sectionGetAgendaDTOWithHttpInfo() async { + // ignore: prefer_const_declarations + final path = r'/api/Section/AgendaDTO'; + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = []; + + + return apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + Future sectionGetAgendaDTO() async { + final response = await sectionGetAgendaDTOWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AgendaDTO',) as AgendaDTO; + + } + return null; + } + /// Performs an HTTP 'GET /api/Section/beacons/{instanceId}' operation and returns the [Response]. /// Parameters: /// @@ -537,6 +578,88 @@ class SectionApi { return null; } + /// Performs an HTTP 'GET /api/Section/PdfDTO' operation and returns the [Response]. + Future sectionGetPdfDTOWithHttpInfo() async { + // ignore: prefer_const_declarations + final path = r'/api/Section/PdfDTO'; + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = []; + + + return apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + Future sectionGetPdfDTO() async { + final response = await sectionGetPdfDTOWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'PdfDTO',) as PdfDTO; + + } + return null; + } + + /// Performs an HTTP 'GET /api/Section/PuzzleDTO' operation and returns the [Response]. + Future sectionGetPuzzleDTOWithHttpInfo() async { + // ignore: prefer_const_declarations + final path = r'/api/Section/PuzzleDTO'; + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = []; + + + return apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + Future sectionGetPuzzleDTO() async { + final response = await sectionGetPuzzleDTOWithHttpInfo(); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'PuzzleDTO',) as PuzzleDTO; + + } + return null; + } + /// Performs an HTTP 'GET /api/Section/QuizzDTO' operation and returns the [Response]. Future sectionGetQuizzDTOWithHttpInfo() async { // ignore: prefer_const_declarations diff --git a/manager_api/lib/api_client.dart b/manager_api/lib/api_client.dart index 007b008..7274129 100644 --- a/manager_api/lib/api_client.dart +++ b/manager_api/lib/api_client.dart @@ -181,6 +181,8 @@ class ApiClient { return valueString == 'true' || valueString == '1'; case 'DateTime': return value is DateTime ? value : DateTime.tryParse(value); + case 'AgendaDTO': + return AgendaDTO.fromJson(value); case 'ArticleDTO': return ArticleDTO.fromJson(value); case 'ConfigurationDTO': @@ -215,8 +217,14 @@ class ApiClient { return MapTypeAppTypeTransformer().decode(value); case 'MenuDTO': return MenuDTO.fromJson(value); + case 'PdfDTO': + return PdfDTO.fromJson(value); case 'PlayerMessageDTO': return PlayerMessageDTO.fromJson(value); + case 'PuzzleDTO': + return PuzzleDTO.fromJson(value); + case 'PuzzleDTOImage': + return PuzzleDTOImage.fromJson(value); case 'QuestionDTO': return QuestionDTO.fromJson(value); case 'QuizzDTO': diff --git a/manager_api/lib/model/agenda_dto.dart b/manager_api/lib/model/agenda_dto.dart new file mode 100644 index 0000000..a5de819 --- /dev/null +++ b/manager_api/lib/model/agenda_dto.dart @@ -0,0 +1,112 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class AgendaDTO { + /// Returns a new [AgendaDTO] instance. + AgendaDTO({ + this.source_, + }); + + String? source_; + + @override + bool operator ==(Object other) => identical(this, other) || other is AgendaDTO && + other.source_ == source_; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (source_ == null ? 0 : source_!.hashCode); + + @override + String toString() => 'AgendaDTO[source_=$source_]'; + + Map toJson() { + final json = {}; + if (this.source_ != null) { + json[r'source'] = this.source_; + } else { + json[r'source'] = null; + } + return json; + } + + /// Returns a new [AgendaDTO] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static AgendaDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "AgendaDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "AgendaDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return AgendaDTO( + source_: mapValueOfType(json, r'source'), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = AgendaDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = AgendaDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of AgendaDTO-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = AgendaDTO.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} + diff --git a/manager_api/lib/model/pdf_dto.dart b/manager_api/lib/model/pdf_dto.dart new file mode 100644 index 0000000..505e5ff --- /dev/null +++ b/manager_api/lib/model/pdf_dto.dart @@ -0,0 +1,112 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class PdfDTO { + /// Returns a new [PdfDTO] instance. + PdfDTO({ + this.source_, + }); + + String? source_; + + @override + bool operator ==(Object other) => identical(this, other) || other is PdfDTO && + other.source_ == source_; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (source_ == null ? 0 : source_!.hashCode); + + @override + String toString() => 'PdfDTO[source_=$source_]'; + + Map toJson() { + final json = {}; + if (this.source_ != null) { + json[r'source'] = this.source_; + } else { + json[r'source'] = null; + } + return json; + } + + /// Returns a new [PdfDTO] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static PdfDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "PdfDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "PdfDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return PdfDTO( + source_: mapValueOfType(json, r'source'), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = PdfDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = PdfDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of PdfDTO-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = PdfDTO.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} + diff --git a/manager_api/lib/model/puzzle_dto.dart b/manager_api/lib/model/puzzle_dto.dart new file mode 100644 index 0000000..4b89f15 --- /dev/null +++ b/manager_api/lib/model/puzzle_dto.dart @@ -0,0 +1,134 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class PuzzleDTO { + /// Returns a new [PuzzleDTO] instance. + PuzzleDTO({ + this.messageDebut = const [], + this.messageFin = const [], + this.image, + }); + + List? messageDebut; + + List? messageFin; + + PuzzleDTOImage? image; + + @override + bool operator ==(Object other) => identical(this, other) || other is PuzzleDTO && + other.messageDebut == messageDebut && + other.messageFin == messageFin && + other.image == image; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (messageDebut == null ? 0 : messageDebut!.hashCode) + + (messageFin == null ? 0 : messageFin!.hashCode) + + (image == null ? 0 : image!.hashCode); + + @override + String toString() => 'PuzzleDTO[messageDebut=$messageDebut, messageFin=$messageFin, image=$image]'; + + Map toJson() { + final json = {}; + if (this.messageDebut != null) { + json[r'messageDebut'] = this.messageDebut; + } else { + json[r'messageDebut'] = null; + } + if (this.messageFin != null) { + json[r'messageFin'] = this.messageFin; + } else { + json[r'messageFin'] = null; + } + if (this.image != null) { + json[r'image'] = this.image; + } else { + json[r'image'] = null; + } + return json; + } + + /// Returns a new [PuzzleDTO] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static PuzzleDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "PuzzleDTO[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "PuzzleDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return PuzzleDTO( + messageDebut: TranslationDTO.listFromJson(json[r'messageDebut']), + messageFin: TranslationDTO.listFromJson(json[r'messageFin']), + image: PuzzleDTOImage.fromJson(json[r'image']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = PuzzleDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = PuzzleDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of PuzzleDTO-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = PuzzleDTO.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} + diff --git a/manager_api/lib/model/puzzle_dto_image.dart b/manager_api/lib/model/puzzle_dto_image.dart new file mode 100644 index 0000000..cdd7d4c --- /dev/null +++ b/manager_api/lib/model/puzzle_dto_image.dart @@ -0,0 +1,162 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class PuzzleDTOImage { + /// Returns a new [PuzzleDTOImage] instance. + PuzzleDTOImage({ + this.title = const [], + this.description = const [], + this.resourceId, + this.source_, + this.order, + }); + + List? title; + + List? description; + + String? resourceId; + + String? source_; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + int? order; + + @override + bool operator ==(Object other) => identical(this, other) || other is PuzzleDTOImage && + other.title == title && + other.description == description && + other.resourceId == resourceId && + other.source_ == source_ && + other.order == order; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (title == null ? 0 : title!.hashCode) + + (description == null ? 0 : description!.hashCode) + + (resourceId == null ? 0 : resourceId!.hashCode) + + (source_ == null ? 0 : source_!.hashCode) + + (order == null ? 0 : order!.hashCode); + + @override + String toString() => 'PuzzleDTOImage[title=$title, description=$description, resourceId=$resourceId, source_=$source_, order=$order]'; + + Map toJson() { + final json = {}; + if (this.title != null) { + json[r'title'] = this.title; + } else { + json[r'title'] = null; + } + if (this.description != null) { + json[r'description'] = this.description; + } else { + json[r'description'] = null; + } + if (this.resourceId != null) { + json[r'resourceId'] = this.resourceId; + } else { + json[r'resourceId'] = null; + } + if (this.source_ != null) { + json[r'source'] = this.source_; + } else { + json[r'source'] = null; + } + if (this.order != null) { + json[r'order'] = this.order; + } else { + json[r'order'] = null; + } + return json; + } + + /// Returns a new [PuzzleDTOImage] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static PuzzleDTOImage? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "PuzzleDTOImage[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "PuzzleDTOImage[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return PuzzleDTOImage( + title: TranslationDTO.listFromJson(json[r'title']), + description: TranslationDTO.listFromJson(json[r'description']), + resourceId: mapValueOfType(json, r'resourceId'), + source_: mapValueOfType(json, r'source'), + order: mapValueOfType(json, r'order'), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = PuzzleDTOImage.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = PuzzleDTOImage.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of PuzzleDTOImage-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = PuzzleDTOImage.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} + diff --git a/manager_api/lib/model/resource_type.dart b/manager_api/lib/model/resource_type.dart index 0d18dcf..14ee7c1 100644 --- a/manager_api/lib/model/resource_type.dart +++ b/manager_api/lib/model/resource_type.dart @@ -10,7 +10,7 @@ part of openapi.api; -/// 0 = Image 1 = Video 2 = ImageUrl 3 = VideoUrl 4 = Audio +/// 0 = Image 1 = Video 2 = ImageUrl 3 = VideoUrl 4 = Audio 5 = PDF 6 = JSON class ResourceType { /// Instantiate a new enum with the provided [value]. const ResourceType._(this.value); @@ -28,6 +28,8 @@ class ResourceType { static const imageUrl = ResourceType._(2); static const videoUrl = ResourceType._(3); static const audio = ResourceType._(4); + static const PDF = ResourceType._(5); + static const JSON = ResourceType._(6); /// List of all possible values in this [enum][ResourceType]. static const values = [ @@ -36,6 +38,8 @@ class ResourceType { imageUrl, videoUrl, audio, + PDF, + JSON ]; static ResourceType? fromJson(dynamic value) => ResourceTypeTypeTransformer().decode(value); @@ -79,6 +83,8 @@ class ResourceTypeTypeTransformer { case r'ImageUrl': return ResourceType.imageUrl; case r'VideoUrl': return ResourceType.videoUrl; case r'Audio': return ResourceType.audio; + case r'PDF': return ResourceType.PDF; + case r'JSON': return ResourceType.JSON; default: if (!allowNull) { throw ArgumentError('Unknown enum value to decode: $data'); diff --git a/manager_api/lib/model/section_type.dart b/manager_api/lib/model/section_type.dart index d8e3733..e29b2c6 100644 --- a/manager_api/lib/model/section_type.dart +++ b/manager_api/lib/model/section_type.dart @@ -10,7 +10,7 @@ part of openapi.api; -/// 0 = Map 1 = Slider 2 = Video 3 = Web 4 = Menu 5 = Quizz 6 = Article +/// 0 = Map 1 = Slider 2 = Video 3 = Web 4 = Menu 5 = Quizz 6 = Article 7 = PDF 8 = Puzzle 9 = Agenda class SectionType { /// Instantiate a new enum with the provided [value]. const SectionType._(this.value); @@ -30,6 +30,9 @@ class SectionType { static const menu = SectionType._(4); static const quizz = SectionType._(5); static const article = SectionType._(6); + static const pdf = SectionType._(7); + static const puzzle = SectionType._(8); + static const agenda = SectionType._(9); /// List of all possible values in this [enum][SectionType]. static const values = [ @@ -40,6 +43,9 @@ class SectionType { menu, quizz, article, + pdf, + puzzle, + agenda ]; static SectionType? fromJson(dynamic value) => SectionTypeTypeTransformer().decode(value); @@ -89,6 +95,9 @@ class SectionTypeTypeTransformer { case r'Menu': return SectionType.menu; case r'Quizz': return SectionType.quizz; case r'Article': return SectionType.article; + case r'PDF': return SectionType.pdf; + case r'Puzzle': return SectionType.puzzle; + case r'Agenda': return SectionType.agenda; default: if (!allowNull) { throw ArgumentError('Unknown enum value to decode: $data'); @@ -107,6 +116,9 @@ class SectionTypeTypeTransformer { case 4: return SectionType.menu; case 5: return SectionType.quizz; case 6: return SectionType.article; + case 7: return SectionType.pdf; + case 8: return SectionType.puzzle; + case 9: return SectionType.agenda; default: if (!allowNull) { throw ArgumentError('Unknown enum value to decode: $data'); diff --git a/manager_api/test/agenda_dto_test.dart b/manager_api/test/agenda_dto_test.dart new file mode 100644 index 0000000..60aa589 --- /dev/null +++ b/manager_api/test/agenda_dto_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api/api.dart'; +import 'package:test/test.dart'; + +// tests for AgendaDTO +void main() { + // final instance = AgendaDTO(); + + group('test AgendaDTO', () { + // String source_ + test('to test the property `source_`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api/test/pdf_dto_test.dart b/manager_api/test/pdf_dto_test.dart new file mode 100644 index 0000000..4165d35 --- /dev/null +++ b/manager_api/test/pdf_dto_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api/api.dart'; +import 'package:test/test.dart'; + +// tests for PdfDTO +void main() { + // final instance = PdfDTO(); + + group('test PdfDTO', () { + // String source_ + test('to test the property `source_`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api/test/puzzle_dto_image_test.dart b/manager_api/test/puzzle_dto_image_test.dart new file mode 100644 index 0000000..5695e08 --- /dev/null +++ b/manager_api/test/puzzle_dto_image_test.dart @@ -0,0 +1,47 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api/api.dart'; +import 'package:test/test.dart'; + +// tests for PuzzleDTOImage +void main() { + // final instance = PuzzleDTOImage(); + + group('test PuzzleDTOImage', () { + // List title (default value: const []) + test('to test the property `title`', () async { + // TODO + }); + + // List description (default value: const []) + test('to test the property `description`', () async { + // TODO + }); + + // String resourceId + test('to test the property `resourceId`', () async { + // TODO + }); + + // String source_ + test('to test the property `source_`', () async { + // TODO + }); + + // int order + test('to test the property `order`', () async { + // TODO + }); + + + }); + +} diff --git a/manager_api/test/puzzle_dto_test.dart b/manager_api/test/puzzle_dto_test.dart new file mode 100644 index 0000000..f6a83f9 --- /dev/null +++ b/manager_api/test/puzzle_dto_test.dart @@ -0,0 +1,37 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.12 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:manager_api/api.dart'; +import 'package:test/test.dart'; + +// tests for PuzzleDTO +void main() { + // final instance = PuzzleDTO(); + + group('test PuzzleDTO', () { + // List messageDebut (default value: const []) + test('to test the property `messageDebut`', () async { + // TODO + }); + + // List messageFin (default value: const []) + test('to test the property `messageFin`', () async { + // TODO + }); + + // PuzzleDTOImage image + test('to test the property `image`', () async { + // TODO + }); + + + }); + +} diff --git a/pubspec.yaml b/pubspec.yaml index 45eff3b..d07dbc3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -48,6 +48,10 @@ dependencies: flutter_launcher_icons: ^0.13.1 # All but web #flutter_svg_provider: ^1.0.6 flutter_widget_from_html: ^0.10.1 + flutter_pdfview: ^1.3.2 + firebase_storage: ^11.5.6 + firebase_core: ^2.24.2 + video_player: ^2.8.1 openapi_generator_cli: ^4.13.1 openapi_generator: ^4.13.1 diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 4f78848..8a0ad35 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -6,9 +6,15 @@ #include "generated_plugin_registrant.h" +#include +#include #include void RegisterPlugins(flutter::PluginRegistry* registry) { + FirebaseCorePluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); + FirebaseStoragePluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FirebaseStoragePluginCApi")); UrlLauncherWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 88b22e5..bd4f3fb 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 url_launcher_windows )