Branding MDLF + wip test

This commit is contained in:
Thomas Fransolet 2024-07-04 21:04:24 +02:00
parent c2ec5d0c0d
commit 14ba287872
208 changed files with 7190 additions and 7968 deletions

View File

@ -32,7 +32,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android { android {
compileSdkVersion 33 compileSdkVersion 34
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8
@ -49,8 +49,8 @@ android {
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "be.unov.mymuseum.fortsaintheribert" applicationId "be.unov.myinfomate.mdlf" // Update for mdlf and other clients -- "be.unov.mymuseum.fortsaintheribert"
minSdkVersion 20 minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName

View File

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="be.unov.myvisit.mymuseum_visitapp"> package="be.unov.myinfomate.mdlf">
<!-- Flutter needs it to communicate with the running application <!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc. to allow setting breakpoints, to provide hot reload, etc.
--> -->

View File

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="be.unov.myvisit.mymuseum_visitapp"> package="be.unov.myinfomate.mdlf">
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
@ -17,8 +17,9 @@
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" /> <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" /> <uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-feature android:name="android.hardware.camera" />--> <uses-feature android:name="android.hardware.camera" />-->
<!-- android:label="Fort Saint Héribert" -->
<application <application
android:label="Fort Saint Héribert" android:label="Musée de la fraise"
android:name="${applicationName}" android:name="${applicationName}"
android:usesCleartextTraffic="true" android:usesCleartextTraffic="true"
android:icon="@mipmap/launcher_icon"> android:icon="@mipmap/launcher_icon">

View File

@ -1,4 +1,4 @@
package be.unov.myvisit.mymuseum_visitapp package be.unov.myinfomate.mdlf
import io.flutter.embedding.android.FlutterActivity import io.flutter.embedding.android.FlutterActivity

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View File

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="be.unov.myvisit.mymuseum_visitapp"> package="be.unov.myinfomate.mdlf">
<!-- Flutter needs it to communicate with the running application <!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc. to allow setting breakpoints, to provide hot reload, etc.
--> -->

View File

@ -1,5 +1,5 @@
buildscript { buildscript {
ext.kotlin_version = '1.7.10' ext.kotlin_version = '1.9.0'
repositories { repositories {
google() google()
mavenCentral() mavenCentral()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 167 KiB

BIN
assets/icon/icon_fort.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 793 KiB

After

Width:  |  Height:  |  Size: 600 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 736 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -11,14 +11,14 @@ class BuilderImageSlider extends StatelessWidget {
{Key? key, {Key? key,
required this.appContext, required this.appContext,
required this.currentIndex, required this.currentIndex,
required this.imagesDTO, required this.contentsDTO,
required this.size, required this.size,
required this.i} required this.i}
) : super(key: key); ) : super(key: key);
final AppContext appContext; final AppContext appContext;
final int currentIndex; final int currentIndex;
final List<ImageDTO?> imagesDTO; final List<ContentDTO?> contentsDTO;
final Size size; final Size size;
final ResourceModel i; final ResourceModel i;
@ -28,7 +28,7 @@ class BuilderImageSlider extends StatelessWidget {
builder: (BuildContext context) {*/ builder: (BuildContext context) {*/
return InkWell( return InkWell(
onTap: () { onTap: () {
showImagePopup(imagesDTO[currentIndex-1]!, i, appContext, context, size); showImagePopup(contentsDTO[currentIndex-1]!, i, appContext, context, size);
}, },
child: Container( child: Container(
//color: Colors.red, //color: Colors.red,

View File

@ -0,0 +1,149 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'carousel_options.dart';
import 'carousel_state.dart';
import 'utils.dart';
abstract class CarouselController {
bool get ready;
Future<Null> get onReady;
Future<void> nextPage({Duration? duration, Curve? curve});
Future<void> previousPage({Duration? duration, Curve? curve});
void jumpToPage(int page);
Future<void> animateToPage(int page, {Duration? duration, Curve? curve});
void startAutoPlay();
void stopAutoPlay();
factory CarouselController() => CarouselControllerImpl();
}
class CarouselControllerImpl implements CarouselController {
final Completer<Null> _readyCompleter = Completer<Null>();
CarouselState? _state;
set state(CarouselState? state) {
_state = state;
if (!_readyCompleter.isCompleted) {
_readyCompleter.complete();
}
}
void _setModeController() =>
_state!.changeMode(CarouselPageChangedReason.controller);
@override
bool get ready => _state != null;
@override
Future<Null> get onReady => _readyCompleter.future;
/// Animates the controlled [CarouselSlider] to the next page.
///
/// The animation lasts for the given duration and follows the given curve.
/// The returned [Future] resolves when the animation completes.
Future<void> nextPage(
{Duration? duration = const Duration(milliseconds: 300),
Curve? curve = Curves.linear}) async {
final bool isNeedResetTimer = _state!.options.pauseAutoPlayOnManualNavigate;
if (isNeedResetTimer) {
_state!.onResetTimer();
}
_setModeController();
await _state!.pageController!.nextPage(duration: duration!, curve: curve!);
if (isNeedResetTimer) {
_state!.onResumeTimer();
}
}
/// Animates the controlled [CarouselSlider] to the previous page.
///
/// The animation lasts for the given duration and follows the given curve.
/// The returned [Future] resolves when the animation completes.
Future<void> previousPage(
{Duration? duration = const Duration(milliseconds: 300),
Curve? curve = Curves.linear}) async {
final bool isNeedResetTimer = _state!.options.pauseAutoPlayOnManualNavigate;
if (isNeedResetTimer) {
_state!.onResetTimer();
}
_setModeController();
await _state!.pageController!
.previousPage(duration: duration!, curve: curve!);
if (isNeedResetTimer) {
_state!.onResumeTimer();
}
}
/// Changes which page is displayed in the controlled [CarouselSlider].
///
/// Jumps the page position from its current value to the given value,
/// without animation, and without checking if the new value is in range.
void jumpToPage(int page) {
final index = getRealIndex(_state!.pageController!.page!.toInt(),
_state!.realPage - _state!.initialPage, _state!.itemCount);
_setModeController();
final int pageToJump = _state!.pageController!.page!.toInt() + page - index;
return _state!.pageController!.jumpToPage(pageToJump);
}
/// Animates the controlled [CarouselSlider] from the current page to the given page.
///
/// The animation lasts for the given duration and follows the given curve.
/// The returned [Future] resolves when the animation completes.
Future<void> animateToPage(int page,
{Duration? duration = const Duration(milliseconds: 300),
Curve? curve = Curves.linear}) async {
final bool isNeedResetTimer = _state!.options.pauseAutoPlayOnManualNavigate;
if (isNeedResetTimer) {
_state!.onResetTimer();
}
final index = getRealIndex(_state!.pageController!.page!.toInt(),
_state!.realPage - _state!.initialPage, _state!.itemCount);
int smallestMovement = page - index;
if (_state!.options.enableInfiniteScroll &&
_state!.itemCount != null &&
_state!.options.animateToClosest) {
if ((page - index).abs() > (page + _state!.itemCount! - index).abs()) {
smallestMovement = page + _state!.itemCount! - index;
} else if ((page - index).abs() >
(page - _state!.itemCount! - index).abs()) {
smallestMovement = page - _state!.itemCount! - index;
}
}
_setModeController();
await _state!.pageController!.animateToPage(
_state!.pageController!.page!.toInt() + smallestMovement,
duration: duration!,
curve: curve!);
if (isNeedResetTimer) {
_state!.onResumeTimer();
}
}
/// Starts the controlled [CarouselSlider] autoplay.
///
/// The carousel will only autoPlay if the [autoPlay] parameter
/// in [CarouselOptions] is true.
void startAutoPlay() {
_state!.onResumeTimer();
}
/// Stops the controlled [CarouselSlider] from autoplaying.
///
/// This is a more on-demand way of doing this. Use the [autoPlay]
/// parameter in [CarouselOptions] to specify the autoPlay behaviour of the carousel.
void stopAutoPlay() {
_state!.onResetTimer();
}
}

View File

@ -0,0 +1,223 @@
import 'package:flutter/material.dart';
enum CarouselPageChangedReason { timed, manual, controller }
enum CenterPageEnlargeStrategy { scale, height, zoom }
class CarouselOptions {
/// Set carousel height and overrides any existing [aspectRatio].
final double? height;
/// Aspect ratio is used if no height have been declared.
///
/// Defaults to 16:9 aspect ratio.
final double aspectRatio;
/// The fraction of the viewport that each page should occupy.
///
/// Defaults to 0.8, which means each page fills 80% of the carousel.
final double viewportFraction;
/// The initial page to show when first creating the [CarouselSlider].
///
/// Defaults to 0.
final int initialPage;
///Determines if carousel should loop infinitely or be limited to item length.
///
///Defaults to true, i.e. infinite loop.
final bool enableInfiniteScroll;
///Determines if carousel should loop to the closest occurence of requested page.
///
///Defaults to true.
final bool animateToClosest;
/// Reverse the order of items if set to true.
///
/// Defaults to false.
final bool reverse;
/// Enables auto play, sliding one page at a time.
///
/// Use [autoPlayInterval] to determent the frequency of slides.
/// Defaults to false.
final bool autoPlay;
/// Sets Duration to determent the frequency of slides when
///
/// [autoPlay] is set to true.
/// Defaults to 4 seconds.
final Duration autoPlayInterval;
/// The animation duration between two transitioning pages while in auto playback.
///
/// Defaults to 800 ms.
final Duration autoPlayAnimationDuration;
/// Determines the animation curve physics.
///
/// Defaults to [Curves.fastOutSlowIn].
final Curve autoPlayCurve;
/// Determines if current page should be larger than the side images,
/// creating a feeling of depth in the carousel.
///
/// Defaults to false.
final bool? enlargeCenterPage;
/// The axis along which the page view scrolls.
///
/// Defaults to [Axis.horizontal].
final Axis scrollDirection;
/// Called whenever the page in the center of the viewport changes.
final Function(int index, CarouselPageChangedReason reason)? onPageChanged;
/// Called whenever the carousel is scrolled
final ValueChanged<double?>? onScrolled;
/// How the carousel should respond to user input.
///
/// For example, determines how the items continues to animate after the
/// user stops dragging the page view.
///
/// The physics are modified to snap to page boundaries using
/// [PageScrollPhysics] prior to being used.
///
/// Defaults to matching platform conventions.
final ScrollPhysics? scrollPhysics;
/// Set to false to disable page snapping, useful for custom scroll behavior.
///
/// Default to `true`.
final bool pageSnapping;
/// If `true`, the auto play function will be paused when user is interacting with
/// the carousel, and will be resumed when user finish interacting.
/// Default to `true`.
final bool pauseAutoPlayOnTouch;
/// If `true`, the auto play function will be paused when user is calling
/// pageController's `nextPage` or `previousPage` or `animateToPage` method.
/// And after the animation complete, the auto play will be resumed.
/// Default to `true`.
final bool pauseAutoPlayOnManualNavigate;
/// If `enableInfiniteScroll` is `false`, and `autoPlay` is `true`, this option
/// decide the carousel should go to the first item when it reach the last item or not.
/// If set to `true`, the auto play will be paused when it reach the last item.
/// If set to `false`, the auto play function will animate to the first item when it was
/// in the last item.
final bool pauseAutoPlayInFiniteScroll;
/// Pass a `PageStoragekey` if you want to keep the pageview's position when it was recreated.
final PageStorageKey? pageViewKey;
/// Use [enlargeStrategy] to determine which method to enlarge the center page.
final CenterPageEnlargeStrategy enlargeStrategy;
/// How much the pages next to the center page will be scaled down.
/// If `enlargeCenterPage` is false, this property has no effect.
final double enlargeFactor;
/// Whether or not to disable the `Center` widget for each slide.
final bool disableCenter;
/// Whether to add padding to both ends of the list.
/// If this is set to true and [viewportFraction] < 1.0, padding will be added such that the first and last child slivers will be in the center of the viewport when scrolled all the way to the start or end, respectively.
/// If [viewportFraction] >= 1.0, this property has no effect.
/// This property defaults to true and must not be null.
final bool padEnds;
/// Exposed clipBehavior of PageView
final Clip clipBehavior;
CarouselOptions({
this.height,
this.aspectRatio = 16 / 9,
this.viewportFraction = 0.8,
this.initialPage = 0,
this.enableInfiniteScroll = true,
this.animateToClosest = true,
this.reverse = false,
this.autoPlay = false,
this.autoPlayInterval = const Duration(seconds: 4),
this.autoPlayAnimationDuration = const Duration(milliseconds: 800),
this.autoPlayCurve = Curves.fastOutSlowIn,
this.enlargeCenterPage = false,
this.onPageChanged,
this.onScrolled,
this.scrollPhysics,
this.pageSnapping = true,
this.scrollDirection = Axis.horizontal,
this.pauseAutoPlayOnTouch = true,
this.pauseAutoPlayOnManualNavigate = true,
this.pauseAutoPlayInFiniteScroll = false,
this.pageViewKey,
this.enlargeStrategy = CenterPageEnlargeStrategy.scale,
this.enlargeFactor = 0.3,
this.disableCenter = false,
this.padEnds = true,
this.clipBehavior = Clip.hardEdge,
});
///Generate new [CarouselOptions] based on old ones.
CarouselOptions copyWith(
{double? height,
double? aspectRatio,
double? viewportFraction,
int? initialPage,
bool? enableInfiniteScroll,
bool? reverse,
bool? autoPlay,
Duration? autoPlayInterval,
Duration? autoPlayAnimationDuration,
Curve? autoPlayCurve,
bool? enlargeCenterPage,
Function(int index, CarouselPageChangedReason reason)? onPageChanged,
ValueChanged<double?>? onScrolled,
ScrollPhysics? scrollPhysics,
bool? pageSnapping,
Axis? scrollDirection,
bool? pauseAutoPlayOnTouch,
bool? pauseAutoPlayOnManualNavigate,
bool? pauseAutoPlayInFiniteScroll,
PageStorageKey? pageViewKey,
CenterPageEnlargeStrategy? enlargeStrategy,
double? enlargeFactor,
bool? disableCenter,
Clip? clipBehavior,
bool? padEnds}) =>
CarouselOptions(
height: height ?? this.height,
aspectRatio: aspectRatio ?? this.aspectRatio,
viewportFraction: viewportFraction ?? this.viewportFraction,
initialPage: initialPage ?? this.initialPage,
enableInfiniteScroll: enableInfiniteScroll ?? this.enableInfiniteScroll,
reverse: reverse ?? this.reverse,
autoPlay: autoPlay ?? this.autoPlay,
autoPlayInterval: autoPlayInterval ?? this.autoPlayInterval,
autoPlayAnimationDuration:
autoPlayAnimationDuration ?? this.autoPlayAnimationDuration,
autoPlayCurve: autoPlayCurve ?? this.autoPlayCurve,
enlargeCenterPage: enlargeCenterPage ?? this.enlargeCenterPage,
onPageChanged: onPageChanged ?? this.onPageChanged,
onScrolled: onScrolled ?? this.onScrolled,
scrollPhysics: scrollPhysics ?? this.scrollPhysics,
pageSnapping: pageSnapping ?? this.pageSnapping,
scrollDirection: scrollDirection ?? this.scrollDirection,
pauseAutoPlayOnTouch: pauseAutoPlayOnTouch ?? this.pauseAutoPlayOnTouch,
pauseAutoPlayOnManualNavigate:
pauseAutoPlayOnManualNavigate ?? this.pauseAutoPlayOnManualNavigate,
pauseAutoPlayInFiniteScroll:
pauseAutoPlayInFiniteScroll ?? this.pauseAutoPlayInFiniteScroll,
pageViewKey: pageViewKey ?? this.pageViewKey,
enlargeStrategy: enlargeStrategy ?? this.enlargeStrategy,
enlargeFactor: enlargeFactor ?? this.enlargeFactor,
disableCenter: disableCenter ?? this.disableCenter,
clipBehavior: clipBehavior ?? this.clipBehavior,
padEnds: padEnds ?? this.padEnds,
);
}

View File

@ -0,0 +1,396 @@
import 'dart:async';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'carousel_controller.dart' as cs;
import 'carousel_options.dart';
import 'carousel_state.dart';
import 'utils.dart';
export 'carousel_controller.dart';
export 'carousel_options.dart';
typedef Widget ExtendedIndexedWidgetBuilder(
BuildContext context, int index, int realIndex);
class CarouselSlider extends StatefulWidget {
/// [CarouselOptions] to create a [CarouselState] with
final CarouselOptions options;
final bool? disableGesture;
/// The widgets to be shown in the carousel of default constructor
final List<Widget>? items;
/// The widget item builder that will be used to build item on demand
/// The third argument is the PageView's real index, can be used to cooperate
/// with Hero.
final ExtendedIndexedWidgetBuilder? itemBuilder;
/// A [MapController], used to control the map.
final cs.CarouselControllerImpl _carouselController;
final int? itemCount;
CarouselSlider(
{required this.items,
required this.options,
this.disableGesture,
cs.CarouselController? carouselController,
Key? key})
: itemBuilder = null,
itemCount = items != null ? items.length : 0,
_carouselController = carouselController != null
? carouselController as cs.CarouselControllerImpl
: cs.CarouselController() as cs.CarouselControllerImpl,
super(key: key);
/// The on demand item builder constructor
CarouselSlider.builder(
{required this.itemCount,
required this.itemBuilder,
required this.options,
this.disableGesture,
cs.CarouselController? carouselController,
Key? key})
: items = null,
_carouselController = carouselController != null
? carouselController as cs.CarouselControllerImpl
: cs.CarouselController() as cs.CarouselControllerImpl,
super(key: key);
@override
CarouselSliderState createState() => CarouselSliderState(_carouselController);
}
class CarouselSliderState extends State<CarouselSlider>
with TickerProviderStateMixin {
final cs.CarouselControllerImpl carouselController;
Timer? timer;
CarouselOptions get options => widget.options;
CarouselState? carouselState;
PageController? pageController;
/// mode is related to why the page is being changed
CarouselPageChangedReason mode = CarouselPageChangedReason.controller;
CarouselSliderState(this.carouselController);
void changeMode(CarouselPageChangedReason _mode) {
mode = _mode;
}
@override
void didUpdateWidget(CarouselSlider oldWidget) {
carouselState!.options = options;
carouselState!.itemCount = widget.itemCount;
// pageController needs to be re-initialized to respond to state changes
pageController = PageController(
viewportFraction: options.viewportFraction,
initialPage: carouselState!.realPage,
);
carouselState!.pageController = pageController;
// handle autoplay when state changes
handleAutoPlay();
super.didUpdateWidget(oldWidget);
}
@override
void initState() {
super.initState();
carouselState =
CarouselState(this.options, clearTimer, resumeTimer, this.changeMode);
carouselState!.itemCount = widget.itemCount;
carouselController.state = carouselState;
carouselState!.initialPage = widget.options.initialPage;
carouselState!.realPage = options.enableInfiniteScroll
? carouselState!.realPage + carouselState!.initialPage
: carouselState!.initialPage;
handleAutoPlay();
pageController = PageController(
viewportFraction: options.viewportFraction,
initialPage: carouselState!.realPage,
);
carouselState!.pageController = pageController;
}
Timer? getTimer() {
return widget.options.autoPlay
? Timer.periodic(widget.options.autoPlayInterval, (_) {
if (!mounted) {
clearTimer();
return;
}
final route = ModalRoute.of(context);
if (route?.isCurrent == false) {
return;
}
CarouselPageChangedReason previousReason = mode;
changeMode(CarouselPageChangedReason.timed);
int nextPage = carouselState!.pageController!.page!.round() + 1;
int itemCount = widget.itemCount ?? widget.items!.length;
if (nextPage >= itemCount &&
widget.options.enableInfiniteScroll == false) {
if (widget.options.pauseAutoPlayInFiniteScroll) {
clearTimer();
return;
}
nextPage = 0;
}
carouselState!.pageController!
.animateToPage(nextPage,
duration: widget.options.autoPlayAnimationDuration,
curve: widget.options.autoPlayCurve)
.then((_) => changeMode(previousReason));
})
: null;
}
void clearTimer() {
if (timer != null) {
timer?.cancel();
timer = null;
}
}
void resumeTimer() {
if (timer == null) {
timer = getTimer();
}
}
void handleAutoPlay() {
bool autoPlayEnabled = widget.options.autoPlay;
if (autoPlayEnabled && timer != null) return;
clearTimer();
if (autoPlayEnabled) {
resumeTimer();
}
}
Widget getGestureWrapper(Widget child) {
Widget wrapper;
if (widget.options.height != null) {
wrapper = Container(height: widget.options.height, child: child);
} else {
wrapper =
AspectRatio(aspectRatio: widget.options.aspectRatio, child: child);
}
if (true == widget.disableGesture) {
return NotificationListener(
onNotification: (Notification notification) {
if (widget.options.onScrolled != null &&
notification is ScrollUpdateNotification) {
widget.options.onScrolled!(carouselState!.pageController!.page);
}
return false;
},
child: wrapper,
);
}
return RawGestureDetector(
behavior: HitTestBehavior.opaque,
gestures: {
_MultipleGestureRecognizer:
GestureRecognizerFactoryWithHandlers<_MultipleGestureRecognizer>(
() => _MultipleGestureRecognizer(),
(_MultipleGestureRecognizer instance) {
instance.onStart = (_) {
onStart();
};
instance.onDown = (_) {
onPanDown();
};
instance.onEnd = (_) {
onPanUp();
};
instance.onCancel = () {
onPanUp();
};
}),
},
child: NotificationListener(
onNotification: (Notification notification) {
if (widget.options.onScrolled != null &&
notification is ScrollUpdateNotification) {
widget.options.onScrolled!(carouselState!.pageController!.page);
}
return false;
},
child: wrapper,
),
);
}
Widget getCenterWrapper(Widget child) {
if (widget.options.disableCenter) {
return Container(
child: child,
);
}
return Center(child: child);
}
Widget getEnlargeWrapper(Widget? child,
{double? width,
double? height,
double? scale,
required double itemOffset}) {
if (widget.options.enlargeStrategy == CenterPageEnlargeStrategy.height) {
return SizedBox(child: child, width: width, height: height);
}
if (widget.options.enlargeStrategy == CenterPageEnlargeStrategy.zoom) {
late Alignment alignment;
final bool horizontal = options.scrollDirection == Axis.horizontal;
if (itemOffset > 0) {
alignment = horizontal ? Alignment.centerRight : Alignment.bottomCenter;
} else {
alignment = horizontal ? Alignment.centerLeft : Alignment.topCenter;
}
return Transform.scale(child: child, scale: scale!, alignment: alignment);
}
return Transform.scale(
scale: scale!,
child: Container(child: child, width: width, height: height));
}
void onStart() {
changeMode(CarouselPageChangedReason.manual);
}
void onPanDown() {
if (widget.options.pauseAutoPlayOnTouch) {
clearTimer();
}
changeMode(CarouselPageChangedReason.manual);
}
void onPanUp() {
if (widget.options.pauseAutoPlayOnTouch) {
resumeTimer();
}
}
@override
void dispose() {
super.dispose();
clearTimer();
}
@override
Widget build(BuildContext context) {
return getGestureWrapper(PageView.builder(
padEnds: widget.options.padEnds,
scrollBehavior: ScrollConfiguration.of(context).copyWith(
scrollbars: false,
overscroll: false,
dragDevices: {
PointerDeviceKind.touch,
PointerDeviceKind.mouse,
},
),
clipBehavior: widget.options.clipBehavior,
physics: widget.options.scrollPhysics,
scrollDirection: widget.options.scrollDirection,
pageSnapping: widget.options.pageSnapping,
controller: carouselState!.pageController,
reverse: widget.options.reverse,
itemCount: widget.options.enableInfiniteScroll ? null : widget.itemCount,
key: widget.options.pageViewKey,
onPageChanged: (int index) {
int currentPage = getRealIndex(index + carouselState!.initialPage,
carouselState!.realPage, widget.itemCount);
if (widget.options.onPageChanged != null) {
widget.options.onPageChanged!(currentPage, mode);
}
},
itemBuilder: (BuildContext context, int idx) {
final int index = getRealIndex(idx + carouselState!.initialPage,
carouselState!.realPage, widget.itemCount);
return AnimatedBuilder(
animation: carouselState!.pageController!,
child: (widget.items != null)
? (widget.items!.length > 0 ? widget.items![index] : Container())
: widget.itemBuilder!(context, index, idx),
builder: (BuildContext context, child) {
double distortionValue = 1.0;
// if `enlargeCenterPage` is true, we must calculate the carousel item's height
// to display the visual effect
double itemOffset = 0;
if (widget.options.enlargeCenterPage != null &&
widget.options.enlargeCenterPage == true) {
// pageController.page can only be accessed after the first build,
// so in the first build we calculate the itemoffset manually
var position = carouselState?.pageController?.position;
if (position != null &&
position.hasPixels &&
position.hasContentDimensions) {
var _page = carouselState?.pageController?.page;
if (_page != null) {
itemOffset = _page - idx;
}
} else {
BuildContext storageContext = carouselState!
.pageController!.position.context.storageContext;
final double? previousSavedPosition =
PageStorage.of(storageContext)?.readState(storageContext)
as double?;
if (previousSavedPosition != null) {
itemOffset = previousSavedPosition - idx.toDouble();
} else {
itemOffset =
carouselState!.realPage.toDouble() - idx.toDouble();
}
}
final double enlargeFactor =
options.enlargeFactor.clamp(0.0, 1.0);
final num distortionRatio =
(1 - (itemOffset.abs() * enlargeFactor)).clamp(0.0, 1.0);
distortionValue =
Curves.easeOut.transform(distortionRatio as double);
}
final double height = widget.options.height ??
MediaQuery.of(context).size.width *
(1 / widget.options.aspectRatio);
if (widget.options.scrollDirection == Axis.horizontal) {
return getCenterWrapper(getEnlargeWrapper(child,
height: distortionValue * height,
scale: distortionValue,
itemOffset: itemOffset));
} else {
return getCenterWrapper(getEnlargeWrapper(child,
width: distortionValue * MediaQuery.of(context).size.width,
scale: distortionValue,
itemOffset: itemOffset));
}
},
);
},
));
}
}
class _MultipleGestureRecognizer extends PanGestureRecognizer {}

View File

@ -0,0 +1,43 @@
import 'package:flutter/material.dart';
import 'carousel_options.dart';
class CarouselState {
/// The [CarouselOptions] to create this state
CarouselOptions options;
/// [pageController] is created using the properties passed to the constructor
/// and can be used to control the [PageView] it is passed to.
PageController? pageController;
/// The actual index of the [PageView].
///
/// This value can be ignored unless you know the carousel will be scrolled
/// backwards more then 10000 pages.
/// Defaults to 10000 to simulate infinite backwards scrolling.
int realPage = 10000;
/// The initial index of the [PageView] on [CarouselSlider] init.
///
int initialPage = 0;
/// The widgets count that should be shown at carousel
int? itemCount;
/// Will be called when using pageController to go to next page or
/// previous page. It will clear the autoPlay timer.
/// Internal use only
Function onResetTimer;
/// Will be called when using pageController to go to next page or
/// previous page. It will restart the autoPlay timer.
/// Internal use only
Function onResumeTimer;
/// The callback to set the Reason Carousel changed
Function(CarouselPageChangedReason) changeMode;
CarouselState(
this.options, this.onResetTimer, this.onResumeTimer, this.changeMode);
}

View File

@ -0,0 +1,23 @@
/// Converts an index of a set size to the corresponding index of a collection of another size
/// as if they were circular.
///
/// Takes a [position] from collection Foo, a [base] from where Foo's index originated
/// and the [length] of a second collection Baa, for which the correlating index is sought.
///
/// For example; We have a Carousel of 10000(simulating infinity) but only 6 images.
/// We need to repeat the images to give the illusion of a never ending stream.
/// By calling _getRealIndex with position and base we get an offset.
/// This offset modulo our length, 6, will return a number between 0 and 5, which represent the image
/// to be placed in the given position.
int getRealIndex(int position, int base, int? length) {
final int offset = position - base;
return remainder(offset, length);
}
/// Returns the remainder of the modulo operation [input] % [source], and adjust it for
/// negative values.
int remainder(int input, int? source) {
if (source == 0) return 0;
final int result = input % source!;
return result < 0 ? source + result : result;
}

View File

@ -5,6 +5,7 @@ import 'package:mymuseum_visitapp/Components/LanguageSelection.dart';
import 'package:mymuseum_visitapp/Models/visitContext.dart'; import 'package:mymuseum_visitapp/Models/visitContext.dart';
import 'package:mymuseum_visitapp/Screens/Home/home.dart'; import 'package:mymuseum_visitapp/Screens/Home/home.dart';
import 'package:mymuseum_visitapp/app_context.dart'; import 'package:mymuseum_visitapp/app_context.dart';
import 'package:mymuseum_visitapp/constants.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class CustomAppBar extends StatefulWidget implements PreferredSizeWidget { class CustomAppBar extends StatefulWidget implements PreferredSizeWidget {
@ -30,6 +31,7 @@ class _CustomAppBarState extends State<CustomAppBar> {
//final notchInset = MediaQuery.of(context).padding; //final notchInset = MediaQuery.of(context).padding;
return AppBar( return AppBar(
shadowColor: kMainColor1,
title: title:
InkWell( InkWell(
onLongPress: () { onLongPress: () {
@ -43,11 +45,11 @@ class _CustomAppBarState extends State<CustomAppBar> {
), context: context ), context: context
); );
}, },
child: HtmlWidget(widget.title), child: HtmlWidget(widget.title, textStyle: TextStyle(color: Colors.white),),
), ),
centerTitle: true, centerTitle: true,
leading: widget.isHomeButton ? IconButton( leading: widget.isHomeButton ? IconButton(
icon: const Icon(Icons.home), icon: const Icon(Icons.home, color: Colors.white),
onPressed: () { onPressed: () {
// Set new State // Set new State
setState(() { setState(() {
@ -95,9 +97,8 @@ class _CustomAppBarState extends State<CustomAppBar> {
Color(0xFF7633B8), Color(0xFF7633B8),
Color(0xFF6528B6), Color(0xFF6528B6),
Color(0xFF6025B6)*/ Color(0xFF6025B6)*/
Color(0xFF306bac), kMainColor1,
Color(0xFF308aae), kMainColor2,
Color(0xFF309cb0),
], ],
), ),
), ),

View File

@ -41,7 +41,7 @@ class _LoadingState extends State<Loading> with TickerProviderStateMixin {
return Center( return Center(
child: RotationTransition( child: RotationTransition(
turns: Tween(begin: 0.0, end: 3.0).animate(_controller), turns: Tween(begin: 0.0, end: 3.0).animate(_controller),
child: Icon(Icons.museum_outlined, color: kBlue2, size: size.height*0.05), child: Icon(Icons.museum_outlined, color: kMainColor2, size: size.height*0.05),
), ),
); );
} }

View File

@ -23,17 +23,16 @@ class _ScannerBoutonState extends State<ScannerBouton> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return InkWell(
height: 85.0, onTap: _onItemTapped,
width: 85.0, child: Container(
child: FittedBox( decoration: const BoxDecoration(
child: FloatingActionButton( shape: BoxShape.circle,
heroTag: "scanner", color: kMainColor1,
onPressed: _onItemTapped,
tooltip: 'Scanner',
backgroundColor: kBlue1,
child: const Icon(Icons.qr_code_scanner),
), ),
height: 85.0,
width: 85.0,
child: const Icon(Icons.qr_code_scanner, color: Colors.white, size: 40),
), ),
); );
} }

View File

@ -60,7 +60,7 @@ class _ScannerDialogState extends State<ScannerDialog> {
height: 45, height: 45,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
color: kBlue1, color: kMainColor1,
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(20.0),
), ),
margin: const EdgeInsets.all(8), margin: const EdgeInsets.all(8),
@ -85,7 +85,7 @@ class _ScannerDialogState extends State<ScannerDialog> {
height: 45, height: 45,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
color: kBlue1, color: kMainColor1,
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(20.0),
), ),
margin: const EdgeInsets.all(8), margin: const EdgeInsets.all(8),
@ -120,7 +120,7 @@ class _ScannerDialogState extends State<ScannerDialog> {
key: qrKey, key: qrKey,
onQRViewCreated: _onQRViewCreated, onQRViewCreated: _onQRViewCreated,
overlay: QrScannerOverlayShape( overlay: QrScannerOverlayShape(
borderColor: kBlue1, borderColor: kMainColor1,
borderRadius: 10, borderRadius: 10,
borderLength: 25, borderLength: 25,
borderWidth: 5, borderWidth: 5,
@ -140,30 +140,52 @@ class _ScannerDialogState extends State<ScannerDialog> {
controller.scannedDataStream.listen((scanData) { controller.scannedDataStream.listen((scanData) {
setState(() { setState(() {
result = scanData; result = scanData;
var code = result == null ? "" : result!.code.toString(); var code = result == null ? "" : result!.code.toString();
if(result!.format == BarcodeFormat.qrcode) { if(result!.format == BarcodeFormat.qrcode) {
controller.pauseCamera(); controller.pauseCamera();
RegExp regExp = RegExp(r'^(?:https:\/\/web\.myinfomate\.be\/([^\/]+)\/([^\/]+)\/([^\/]+)|([^\/]+))$');
var match = regExp.firstMatch(code);
String? instanceId;
String? configurationId;
String? sectionId;
if (match != null) {
instanceId = match.group(1);
configurationId = match.group(2);
sectionId = match.group(3) ?? match.group(4);
print('InstanceId: $instanceId');
print('ConfigurationId: $configurationId');
print('SectionId: $sectionId');
} else {
print('L\'URL ne correspond pas au format attendu.');
}
//print("QR CODE FOUND"); //print("QR CODE FOUND");
/*ScaffoldMessenger.of(context).showSnackBar( /*ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('QR CODE FOUND - ${code.toString()}')), SnackBar(content: Text('QR CODE FOUND - ${code.toString()}')),
);*/ );*/
VisitAppContext visitAppContext = widget.appContext!.getContext(); VisitAppContext visitAppContext = widget.appContext!.getContext();
if(!visitAppContext.sectionIds!.contains(code)) {
if(!visitAppContext.sectionIds!.contains(sectionId) || sectionId == null) {
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(TranslationHelper.getFromLocale('invalidQRCode', widget.appContext!.getContext())), backgroundColor: kBlue2), SnackBar(content: Text(TranslationHelper.getFromLocale('invalidQRCode', widget.appContext!.getContext())), backgroundColor: kMainColor2),
); );
Navigator.of(context).pop(); Navigator.of(context).pop();
} else { } else {
SectionDTO section = visitAppContext.currentSections!.firstWhere((cs) => cs!.id == code)!; SectionDTO section = visitAppContext.currentSections!.firstWhere((cs) => cs!.id == sectionId)!;
switch(section.type) { switch(section.type) {
case SectionType.Article: case SectionType.Article:
Navigator.pushReplacement( Navigator.pushReplacement(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) { builder: (context) {
return ArticlePage(visitAppContextIn: visitAppContext, articleId: code); return ArticlePage(visitAppContextIn: visitAppContext, articleId: section.id!);
}, },
), ),
); );
@ -173,7 +195,7 @@ class _ScannerDialogState extends State<ScannerDialog> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) { builder: (context) {
return QuizzPage(visitAppContextIn: visitAppContext, sectionId: code); return QuizzPage(visitAppContextIn: visitAppContext, sectionId: section.id!);
}, },
), ),
); );

View File

@ -10,7 +10,7 @@ import 'package:mymuseum_visitapp/app_context.dart';
import 'package:mymuseum_visitapp/constants.dart'; import 'package:mymuseum_visitapp/constants.dart';
import 'package:photo_view/photo_view.dart'; import 'package:photo_view/photo_view.dart';
void showImagePopup(ImageDTO imageDTO, ResourceModel resourceModel, AppContext appContext, BuildContext context, Size size) { void showImagePopup(ContentDTO contentDTO, ResourceModel resourceModel, AppContext appContext, BuildContext context, Size size) {
showDialog( showDialog(
builder: (BuildContext context) => AlertDialog( builder: (BuildContext context) => AlertDialog(
shape: const RoundedRectangleBorder( shape: const RoundedRectangleBorder(
@ -19,11 +19,11 @@ void showImagePopup(ImageDTO imageDTO, ResourceModel resourceModel, AppContext a
content: SingleChildScrollView( content: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
if(TranslationHelper.get(imageDTO.title, appContext.getContext()).isNotEmpty) if(TranslationHelper.get(contentDTO.title, appContext.getContext()).isNotEmpty)
Padding( Padding(
padding: const EdgeInsets.only(top: 8.0, left:8.0, right: 8.0), padding: const EdgeInsets.only(top: 8.0, left:8.0, right: 8.0),
child: HtmlWidget( child: HtmlWidget(
TranslationHelper.get(imageDTO.title, appContext.getContext()), TranslationHelper.get(contentDTO.title, appContext.getContext()),
textStyle: const TextStyle(fontSize: kArticleContentSize, fontWeight: FontWeight.w400)), textStyle: const TextStyle(fontSize: kArticleContentSize, fontWeight: FontWeight.w400)),
), ),
SizedBox( SizedBox(

View File

@ -1,5 +1,5 @@
import 'dart:convert'; import 'dart:convert';
import 'package:carousel_slider/carousel_slider.dart'; import 'package:mymuseum_visitapp/Components/Carousel/carousel_slider.dart' as cs;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:manager_api/api.dart'; import 'package:manager_api/api.dart';
import 'package:mymuseum_visitapp/Components/ShowImagePopup.dart'; import 'package:mymuseum_visitapp/Components/ShowImagePopup.dart';
@ -11,9 +11,9 @@ import 'package:provider/provider.dart';
class SliderImagesWidget extends StatefulWidget { class SliderImagesWidget extends StatefulWidget {
final List<ResourceModel?> resources; final List<ResourceModel?> resources;
final List<ImageDTO?> imagesDTO; final List<ContentDTO?> contentsDTO;
final double height; final double height;
SliderImagesWidget({required this.resources, required this.height, required this.imagesDTO}); SliderImagesWidget({required this.resources, required this.height, required this.contentsDTO});
@override @override
_SliderImagesWidget createState() => _SliderImagesWidget(); _SliderImagesWidget createState() => _SliderImagesWidget();
@ -21,12 +21,12 @@ class SliderImagesWidget extends StatefulWidget {
class _SliderImagesWidget extends State<SliderImagesWidget> { class _SliderImagesWidget extends State<SliderImagesWidget> {
List<ResourceModel?> resourcesInWidget = []; List<ResourceModel?> resourcesInWidget = [];
late CarouselController? sliderController; late cs.CarouselController? sliderController;
final ValueNotifier<int> currentIndex = ValueNotifier<int>(1); final ValueNotifier<int> currentIndex = ValueNotifier<int>(1);
@override @override
void initState() { void initState() {
sliderController = CarouselController(); sliderController = cs.CarouselController();
resourcesInWidget = widget.resources; resourcesInWidget = widget.resources;
super.initState(); super.initState();
} }
@ -52,10 +52,10 @@ class _SliderImagesWidget extends State<SliderImagesWidget> {
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
if(resourcesInWidget.isNotEmpty) if(resourcesInWidget.isNotEmpty)
CarouselSlider( cs.CarouselSlider(
carouselController: sliderController, carouselController: sliderController,
options: CarouselOptions( options: cs.CarouselOptions(
onPageChanged: (int index, CarouselPageChangedReason reason) { onPageChanged: (int index, cs.CarouselPageChangedReason reason) {
//setState(() { //setState(() {
//print("SET STATE"); //print("SET STATE");
currentIndex.value = index + 1; currentIndex.value = index + 1;
@ -73,7 +73,7 @@ class _SliderImagesWidget extends State<SliderImagesWidget> {
padding: const EdgeInsets.only(top: 5.0), padding: const EdgeInsets.only(top: 5.0),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
showImagePopup(widget.imagesDTO[currentIndex.value-1]!, i!, appContext, context, size); showImagePopup(widget.contentsDTO[currentIndex.value-1]!, i!, appContext, context, size);
}, },
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(15.0), borderRadius: BorderRadius.circular(15.0),
@ -88,7 +88,7 @@ class _SliderImagesWidget extends State<SliderImagesWidget> {
} }
return Center( return Center(
child: CircularProgressIndicator( child: CircularProgressIndicator(
color: kBlue1, color: kMainColor1,
value: loadingProgress.expectedTotalBytes != null value: loadingProgress.expectedTotalBytes != null
? loadingProgress.cumulativeBytesLoaded / ? loadingProgress.cumulativeBytesLoaded /
loadingProgress.expectedTotalBytes! loadingProgress.expectedTotalBytes!
@ -126,7 +126,7 @@ class _SliderImagesWidget extends State<SliderImagesWidget> {
child: const Icon( child: const Icon(
Icons.chevron_right, Icons.chevron_right,
size: 45, size: 45,
color: kBlue2, color: kMainColor2,
), ),
) )
), ),
@ -143,7 +143,7 @@ class _SliderImagesWidget extends State<SliderImagesWidget> {
child: const Icon( child: const Icon(
Icons.chevron_left, Icons.chevron_left,
size: 45, size: 45,
color: kBlue2, color: kMainColor2,
), ),
) )
), ),
@ -159,7 +159,7 @@ class _SliderImagesWidget extends State<SliderImagesWidget> {
builder: (context, value, _) { builder: (context, value, _) {
return Text( return Text(
currentIndex.value.toString()+'/'+resourcesInWidget.length.toString(), currentIndex.value.toString()+'/'+resourcesInWidget.length.toString(),
style: const TextStyle(fontSize: kArticleContentSize, fontWeight: FontWeight.w500, color: kBlue2), style: const TextStyle(fontSize: kArticleContentSize, fontWeight: FontWeight.w500, color: kMainColor2),
); );
}, },
) )

View File

@ -0,0 +1,110 @@
import 'dart:io';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:manager_api/api.dart';
import 'package:mymuseum_visitapp/Models/visitContext.dart';
import 'package:mymuseum_visitapp/app_context.dart';
import 'package:mymuseum_visitapp/constants.dart';
import 'package:path_provider/path_provider.dart';
import 'package:provider/provider.dart';
class LoadingCommon extends StatefulWidget {
const LoadingCommon({Key? key}) : super(key: key);
@override
State<LoadingCommon> createState() => _LoadingCommonState();
}
class _LoadingCommonState extends State<LoadingCommon> with TickerProviderStateMixin {
AnimationController? _controller;
@override
void initState() {
_controller = AnimationController(
duration: const Duration(milliseconds: 5000),
vsync: this,
)..repeat();
super.initState();
}
@override
void dispose() {
_controller!.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
final appContext = Provider.of<AppContext>(context);
VisitAppContext visitAppContext = appContext.getContext();
Size size = MediaQuery.of(context).size;
_controller!.forward(from: 0.0);
_controller!.addListener(() {
if (_controller!.isCompleted) {
_controller!.reverse();
}
if(_controller!.isDismissed){
_controller!.forward();
}
});
var primaryColor = visitAppContext.configuration != null ? visitAppContext.configuration!.primaryColor != null ? new Color(int.parse(visitAppContext.configuration!.primaryColor!.split('(0x')[1].split(')')[0], radix: 16)) : kMainColor1 : kMainColor1;
return Center(
child: SizedBox(
height: size.height * 0.1,
child: RotationTransition(
turns: Tween(begin: 0.0, end: 3.0).animate(_controller!),
child: visitAppContext.configuration != null && visitAppContext.configuration!.loaderImageUrl != null ?
//Image.network(tabletAppContext.configuration!.loaderImageUrl!)
// TODO Replace by CustomCacheResource..
FutureBuilder<File?>(
future: _checkIfLocalResourceExists(visitAppContext, visitAppContext.configuration!.loaderImageId!),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
// Loader ou indicateur de chargement pendant la vérification
return const CircularProgressIndicator();
} else if (snapshot.hasError || snapshot.data == null) {
// Si la ressource locale n'existe pas ou s'il y a une erreur
print("not a local loader succck");
return CachedNetworkImage(
imageUrl: visitAppContext.configuration!.loaderImageUrl!,
progressIndicatorBuilder: (context, url, downloadProgress) => CircularProgressIndicator(value: downloadProgress.progress, color: primaryColor),
errorWidget: (context, url, error) => const Icon(Icons.error),
);
} else {
print("Its a local loaaader yeah");
return Image.file(
snapshot.data!,
);
}
},
)
: Icon(Icons.museum_outlined, color: kMainColor2, size: size.height*0.1),
),
),
);
}
}
Future<File?> _checkIfLocalResourceExists(VisitAppContext visitAppContext, String resourceId) async {
try {
Directory? appDocumentsDirectory = Platform.isIOS ? await getApplicationDocumentsDirectory() : await getDownloadsDirectory();
String localPath = appDocumentsDirectory!.path;
Directory configurationDirectory = Directory('$localPath/${visitAppContext.configuration!.id}');
List<FileSystemEntity> fileList = configurationDirectory.listSync();
if(fileList.any((fileL) => fileL.uri.pathSegments.last.contains(resourceId))) {
File file = File(fileList.firstWhere((fileL) => fileL.uri.pathSegments.last.contains(resourceId)).path);
return file;
}
} catch(e) {
print("ERROR _checkIfLocalResourceExists CachedCustomResource");
print(e);
}
return null;
}

View File

@ -12,6 +12,14 @@ class TranslationHelper {
} }
} }
static String getWithResource(List<TranslationAndResourceDTO>? translationAndResourceDTO, VisitAppContext visitAppContext) {
try {
return translationAndResourceDTO!.where((element) => element.language == visitAppContext.language).first.value!;
} catch (_) {
return "";
}
}
static String getFromLocale(String valueToGet, VisitAppContext visitAppContext) { static String getFromLocale(String valueToGet, VisitAppContext visitAppContext) {
try { try {
return translations.where((element) => element.language == visitAppContext.language).first.data![valueToGet]!; return translations.where((element) => element.language == visitAppContext.language).first.data![valueToGet]!;

View File

@ -1,7 +1,7 @@
import 'package:manager_api/api.dart'; import 'package:manager_api/api.dart';
class ResponseSubDTO { class ResponseSubDTO {
List<TranslationDTO>? label; List<TranslationAndResourceDTO>? label;
bool? isGood; bool? isGood;
int? order; int? order;
@ -25,14 +25,14 @@ class ResponseSubDTO {
} }
class QuestionSubDTO { class QuestionSubDTO {
List<TranslationDTO>? label; List<TranslationAndResourceDTO>? label;
List<ResponseSubDTO>? responsesSubDTO; List<ResponseSubDTO>? responsesSubDTO;
int? chosen; int? chosen;
String? resourceId; String? resourceId;
String? source_; String? resourceUrl;
int? order; int? order;
QuestionSubDTO({this.label, this.responsesSubDTO, this.chosen, this.resourceId, this.source_, this.order}); QuestionSubDTO({this.label, this.responsesSubDTO, this.chosen, this.resourceId, this.resourceUrl, this.order});
List<QuestionSubDTO> fromJSON(List<QuestionDTO> questionsDTO) { List<QuestionSubDTO> fromJSON(List<QuestionDTO> questionsDTO) {
List<QuestionSubDTO> questionSubDTO = <QuestionSubDTO>[]; List<QuestionSubDTO> questionSubDTO = <QuestionSubDTO>[];
@ -42,8 +42,8 @@ class QuestionSubDTO {
chosen: null, chosen: null,
label: questionDTO.label, label: questionDTO.label,
responsesSubDTO: ResponseSubDTO().fromJSON(questionDTO.responses!), responsesSubDTO: ResponseSubDTO().fromJSON(questionDTO.responses!),
resourceId: questionDTO.resourceId, resourceId: questionDTO.imageBackgroundResourceId,
source_: questionDTO.source_, resourceUrl: questionDTO.imageBackgroundResourceUrl,
order: questionDTO.order, order: questionDTO.order,
)); ));
} }

View File

@ -7,7 +7,9 @@ import 'package:mymuseum_visitapp/Models/resourceModel.dart';
class VisitAppContext with ChangeNotifier{ class VisitAppContext with ChangeNotifier{
String? id = ""; String? id = "";
String? language = ""; String? language = "";
String? instanceId = "63514fd67ed8c735aaa4b8f1"; // Fort de Saint-Héribert instance id : 633ee379d9405f32f166f047 // 63514fd67ed8c735aaa4b8f1 Mymuseum test String? instanceId = "63514fd67ed8c735aaa4b8f2"; // 63514fd67ed8c735aaa4b8f2 MyInfoMate test instance -- Fort de Saint-Héribert Mymuseum instance id : 633ee379d9405f32f166f047 // 63514fd67ed8c735aaa4b8f1 Mymuseum test
List<ConfigurationDTO>? configurations; List<ConfigurationDTO>? configurations;
ConfigurationDTO? configuration; ConfigurationDTO? configuration;
List<String?>? sectionIds; // Use to valid QR code found List<String?>? sectionIds; // Use to valid QR code found

View File

@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_widget_from_html/flutter_widget_from_html.dart'; import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
import 'package:manager_api/api.dart'; import 'package:manager_api/api.dart';
import 'package:mymuseum_visitapp/Components/CustomAppBar.dart'; import 'package:mymuseum_visitapp/Components/CustomAppBar.dart';
import 'package:mymuseum_visitapp/Components/Loading.dart'; import 'package:mymuseum_visitapp/Components/loading_common.dart';
import 'package:mymuseum_visitapp/Components/SliderImages.dart'; import 'package:mymuseum_visitapp/Components/SliderImages.dart';
import 'package:mymuseum_visitapp/Helpers/DatabaseHelper.dart'; import 'package:mymuseum_visitapp/Helpers/DatabaseHelper.dart';
import 'package:mymuseum_visitapp/Helpers/translationHelper.dart'; import 'package:mymuseum_visitapp/Helpers/translationHelper.dart';
@ -115,7 +115,7 @@ class _ArticlePageState extends State<ArticlePage> {
); );
} }
} else { } else {
return const Loading(); return const LoadingCommon();
} }
} }
), ),
@ -124,7 +124,7 @@ class _ArticlePageState extends State<ArticlePage> {
builder: (context, AsyncSnapshot<dynamic> snapshot) { builder: (context, AsyncSnapshot<dynamic> snapshot) {
return Padding( return Padding(
padding: EdgeInsets.only(right: 0, top: 0), //size.height*0.1 padding: EdgeInsets.only(right: 0, top: 0), //size.height*0.1
child: audioResourceModel != null ? AudioPlayerFloatingContainer(audioBytes: audiobytes, isAuto: articleDTO!.isReadAudioAuto!) : null, child: audioResourceModel != null && audioResourceModel!.source != null ? AudioPlayerFloatingContainer(file: null, audioBytes: null, resourceURl: audioResourceModel!.source!, isAuto: articleDTO!.isReadAudioAuto!) : null,
); );
} }
), ),
@ -142,7 +142,7 @@ class _ArticlePageState extends State<ArticlePage> {
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
color: kBlue2, color: kMainColor2,
width: 0.5, width: 0.5,
), ),
color: Colors.white, color: Colors.white,
@ -153,7 +153,7 @@ class _ArticlePageState extends State<ArticlePage> {
child: SliderImagesWidget( child: SliderImagesWidget(
resources: resourcesModel, resources: resourcesModel,
height: size.height * 0.29, height: size.height * 0.29,
imagesDTO: articleDTO!.images!, contentsDTO: articleDTO!.contents!,
) )
) )
) )
@ -167,7 +167,7 @@ class _ArticlePageState extends State<ArticlePage> {
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
color: kBlue2, color: kMainColor2,
width: 0.5, width: 0.5,
), ),
color: Colors.white, color: Colors.white,
@ -178,7 +178,7 @@ class _ArticlePageState extends State<ArticlePage> {
child: SliderImagesWidget( child: SliderImagesWidget(
resources: resourcesModel, resources: resourcesModel,
height: size.height * 0.29, height: size.height * 0.29,
imagesDTO: articleDTO!.images!, contentsDTO: articleDTO!.contents!,
) )
) )
) )
@ -198,7 +198,7 @@ class _ArticlePageState extends State<ArticlePage> {
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
color: kBlue2, color: kMainColor2,
width: 0.5, width: 0.5,
), ),
color: Colors.white, color: Colors.white,
@ -231,7 +231,7 @@ class _ArticlePageState extends State<ArticlePage> {
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
color: kBlue2, color: kMainColor2,
width: 0.5, width: 0.5,
), ),
color: Colors.white, color: Colors.white,
@ -328,9 +328,12 @@ class _ArticlePageState extends State<ArticlePage> {
} }
else else
{ {
ResourceDTO? resourceDTO = await client.resourceApi!.resourceGetDetail(audioIdArticle.first.value!);
// ONLINE // ONLINE
ResourceModel? resourceAudioOnline = await ApiService.downloadAudio(client, audioIdArticle.first.value!); ResourceModel? resourceAudioOnline = await ApiService.downloadAudio(client, audioIdArticle.first.value!);
if(resourceAudioOnline != null) { if(resourceAudioOnline != null) {
resourceAudioOnline.source = resourceDTO!.url;
audioResourceModel = resourceAudioOnline; audioResourceModel = resourceAudioOnline;
Uint8List base64String = base64Decode(resourceAudioOnline.data!); Uint8List base64String = base64Decode(resourceAudioOnline.data!);
audiobytes = base64String; audiobytes = base64String;
@ -341,8 +344,8 @@ class _ArticlePageState extends State<ArticlePage> {
} }
} }
if(articleDTO!.images!.isNotEmpty && !isAudio) { if(articleDTO!.contents!.isNotEmpty && !isAudio) {
for (var image in articleDTO!.images!) { for (var image in articleDTO!.contents!) {
if(image.resourceId != null) { if(image.resourceId != null) {
if(isConfigOffline) if(isConfigOffline)
{ {
@ -360,7 +363,7 @@ class _ArticlePageState extends State<ArticlePage> {
// Not needed as it's in display logic // Not needed as it's in display logic
//ResourceModel? resourceImageOnline = await ApiService.downloadImage(client, image); //ResourceModel? resourceImageOnline = await ApiService.downloadImage(client, image);
//if(resourceImageOnline != null) { //if(resourceImageOnline != null) {
resourcesModel.add(ResourceModel(id: image.resourceId, source: image.source_, type: ResourceType.Image)); resourcesModel.add(ResourceModel(id: image.resourceId, source: image.resourceUrl, type: ResourceType.Image));
/*} else { /*} else {
print("EMPTY resourcesModel online - audio"); print("EMPTY resourcesModel online - audio");
}*/ }*/

View File

@ -1,19 +1,21 @@
import 'dart:io';
import 'dart:typed_data'; import 'dart:typed_data';
//import 'package:audioplayers/audioplayers.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:mymuseum_visitapp/Helpers/translationHelper.dart'; import 'package:mymuseum_visitapp/Models/visitContext.dart';
import 'package:mymuseum_visitapp/app_context.dart'; import 'package:mymuseum_visitapp/app_context.dart';
import 'package:mymuseum_visitapp/constants.dart'; import 'package:mymuseum_visitapp/constants.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:just_audio/just_audio.dart'; import 'package:just_audio/just_audio.dart';
import 'package:just_audio_cache/just_audio_cache.dart';
class AudioPlayerFloatingContainer extends StatefulWidget { class AudioPlayerFloatingContainer extends StatefulWidget {
const AudioPlayerFloatingContainer({Key? key, required this.audioBytes, required this.isAuto}) : super(key: key); const AudioPlayerFloatingContainer({Key? key, required this.file, required this.audioBytes, required this.resourceURl, required this.isAuto}) : super(key: key);
final Uint8List audioBytes; final File? file;
final Uint8List? audioBytes;
final String resourceURl;
final bool isAuto; final bool isAuto;
@override @override
@ -22,7 +24,7 @@ class AudioPlayerFloatingContainer extends StatefulWidget {
class _AudioPlayerFloatingContainerState extends State<AudioPlayerFloatingContainer> { class _AudioPlayerFloatingContainerState extends State<AudioPlayerFloatingContainer> {
AudioPlayer player = AudioPlayer(); AudioPlayer player = AudioPlayer();
late Uint8List audiobytes; Uint8List? audiobytes = null;
bool isplaying = false; bool isplaying = false;
bool audioplayed = false; bool audioplayed = false;
int currentpos = 0; int currentpos = 0;
@ -32,20 +34,27 @@ class _AudioPlayerFloatingContainerState extends State<AudioPlayerFloatingContai
@override @override
void initState() { void initState() {
//print("IN INITSTATE AUDDDIOOOO");
Future.delayed(Duration.zero, () async { Future.delayed(Duration.zero, () async {
if(widget.audioBytes != null) {
audiobytes = widget.audioBytes!;
}
if(widget.file != null) {
audiobytes = await fileToUint8List(widget.file!);
}
audiobytes = widget.audioBytes;
player.durationStream.listen((Duration? d) { //get the duration of audio player.durationStream.listen((Duration? d) { //get the duration of audio
maxduration = d!.inSeconds; if(d != null) {
durationAudio = d; maxduration = d.inSeconds;
print("YOULOUUU duration"); durationAudio = d;
print(d); }
}); });
//player.bufferedPositionStream //player.bufferedPositionStream
player.positionStream.listen((event) { player.positionStream.listen((event) {
if(event != null && durationAudio != null) { if(durationAudio != null) {
currentpos = event.inMilliseconds; //get the current position of playing audio currentpos = event.inMilliseconds; //get the current position of playing audio
@ -99,9 +108,17 @@ class _AudioPlayerFloatingContainerState extends State<AudioPlayerFloatingContai
}); });
});*/ });*/
if(audiobytes != null) {
print("GOT AUDIOBYYYTES - LOCALLY SOSO");
await player.setAudioSource(LoadedSource(audiobytes!));
} else {
print("GET SOUND BY URL");
await player.dynamicSet(url: widget.resourceURl);
}
if(widget.isAuto) { if(widget.isAuto) {
//player.play(BytesSource(audiobytes)); //player.play(BytesSource(audiobytes));
await player.setAudioSource(LoadedSource(audiobytes)); //
player.play(); player.play();
setState(() { setState(() {
isplaying = true; isplaying = true;
@ -119,18 +136,22 @@ class _AudioPlayerFloatingContainerState extends State<AudioPlayerFloatingContai
super.dispose(); super.dispose();
} }
Future<Uint8List> fileToUint8List(File file) async {
List<int> bytes = await file.readAsBytes();
return Uint8List.fromList(bytes);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final appContext = Provider.of<AppContext>(context); final appContext = Provider.of<AppContext>(context);
VisitAppContext visitAppContext = appContext.getContext();
return FloatingActionButton( return FloatingActionButton(
backgroundColor: kBlue1.withOpacity(0.7), backgroundColor: kMainColor1,
onPressed: () async { onPressed: () async {
print("TODO");
if(!isplaying && !audioplayed){ if(!isplaying && !audioplayed){
//player.play(BytesSource(audiobytes)); //player.play(BytesSource(audiobytes));
await player.setAudioSource(LoadedSource(audiobytes)); //await player.setUrl(widget.resourceURl);
player.play(); player.play();
setState(() { setState(() {
isplaying = true; isplaying = true;

View File

@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_widget_from_html/flutter_widget_from_html.dart'; import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
import 'package:manager_api/api.dart'; import 'package:manager_api/api.dart';
import 'package:mymuseum_visitapp/Components/LanguageSelection.dart'; import 'package:mymuseum_visitapp/Components/LanguageSelection.dart';
import 'package:mymuseum_visitapp/Components/Loading.dart'; import 'package:mymuseum_visitapp/Components/loading_common.dart';
import 'package:mymuseum_visitapp/Helpers/translationHelper.dart'; import 'package:mymuseum_visitapp/Helpers/translationHelper.dart';
import 'package:mymuseum_visitapp/Models/visitContext.dart'; import 'package:mymuseum_visitapp/Models/visitContext.dart';
import 'package:mymuseum_visitapp/Screens/Visit/visit.dart'; import 'package:mymuseum_visitapp/Screens/Visit/visit.dart';
@ -66,7 +66,7 @@ class _ConfigurationsListState extends State<ConfigurationsList> {
SnackBar( SnackBar(
content: Text(TranslationHelper.getFromLocale( content: Text(TranslationHelper.getFromLocale(
"languageNotSupported", appContext.getContext())), "languageNotSupported", appContext.getContext())),
backgroundColor: kBlue2), backgroundColor: kMainColor2),
); );
} else { } else {
// Update context // Update context
@ -88,7 +88,7 @@ class _ConfigurationsListState extends State<ConfigurationsList> {
SnackBar( SnackBar(
content: Text(TranslationHelper.getFromLocale( content: Text(TranslationHelper.getFromLocale(
"visitDownloadWarning", appContext.getContext())), "visitDownloadWarning", appContext.getContext())),
backgroundColor: kBlue2), backgroundColor: kMainColor2),
); );
} else { } else {
// Online mode // Online mode
@ -98,7 +98,7 @@ class _ConfigurationsListState extends State<ConfigurationsList> {
SnackBar( SnackBar(
content: Text(TranslationHelper.getFromLocale( content: Text(TranslationHelper.getFromLocale(
"languageNotSupported", appContext.getContext())), "languageNotSupported", appContext.getContext())),
backgroundColor: kBlue2), backgroundColor: kMainColor2),
); );
} else { } else {
visitAppContext.configuration = configurations[index]; visitAppContext.configuration = configurations[index];
@ -161,7 +161,7 @@ class _ConfigurationsListState extends State<ConfigurationsList> {
return Center( return Center(
child: child:
CircularProgressIndicator( CircularProgressIndicator(
color: kBlue1, color: kMainColor1,
value: loadingProgress value: loadingProgress
.expectedTotalBytes != .expectedTotalBytes !=
null null
@ -184,7 +184,7 @@ class _ConfigurationsListState extends State<ConfigurationsList> {
return Center( return Center(
child: SizedBox( child: SizedBox(
height: size.height * 0.15, height: size.height * 0.15,
child: const Loading())); child: const LoadingCommon()));
} }
}), }),
), ),
@ -220,7 +220,7 @@ class _ConfigurationsListState extends State<ConfigurationsList> {
height: 45, height: 45,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
color: kBlue1, color: kMainColor1,
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(20.0),
), ),
margin: const EdgeInsets.all(8), margin: const EdgeInsets.all(8),
@ -361,12 +361,12 @@ boxDecoration(ConfigurationDTO configuration, bool isSelected) {
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(20.0),
border: Border.all( border: Border.all(
color: kBlue0.withOpacity(0.35), color: kMainColor0.withOpacity(0.35),
width: 0.2, width: 0.2,
), ),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: kBlue0.withOpacity(0.35), color: kBackgroundGrey.withOpacity(0.35),
//spreadRadius: 0.15, //spreadRadius: 0.15,
blurRadius: 27, blurRadius: 27,
offset: const Offset(0, 15), // changes position of shadow offset: const Offset(0, 15), // changes position of shadow

View File

@ -6,7 +6,7 @@ import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:manager_api/api.dart'; import 'package:manager_api/api.dart';
import 'package:mymuseum_visitapp/Components/CustomAppBar.dart'; import 'package:mymuseum_visitapp/Components/CustomAppBar.dart';
import 'package:mymuseum_visitapp/Components/Loading.dart'; import 'package:mymuseum_visitapp/Components/loading_common.dart';
import 'package:mymuseum_visitapp/Helpers/DatabaseHelper.dart'; import 'package:mymuseum_visitapp/Helpers/DatabaseHelper.dart';
import 'package:mymuseum_visitapp/Helpers/modelsHelper.dart'; import 'package:mymuseum_visitapp/Helpers/modelsHelper.dart';
import 'package:mymuseum_visitapp/Helpers/networkCheck.dart'; import 'package:mymuseum_visitapp/Helpers/networkCheck.dart';
@ -78,7 +78,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
return Center( return Center(
child: Container( child: Container(
height: size.height * 0.15, height: size.height * 0.15,
child: Loading() child: LoadingCommon()
) )
); );
} }
@ -126,7 +126,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
if(!isOnline) { if(!isOnline) {
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(TranslationHelper.getFromLocale("noInternet", appContext.getContext())), backgroundColor: kBlue2), SnackBar(content: Text(TranslationHelper.getFromLocale("noInternet", appContext.getContext())), backgroundColor: kMainColor2),
); );
// GET ALL SECTIONIDS FOR ALL CONFIGURATION (OFFLINE) // GET ALL SECTIONIDS FOR ALL CONFIGURATION (OFFLINE)

View File

@ -1,4 +1,4 @@
import 'package:carousel_slider/carousel_slider.dart'; import 'package:mymuseum_visitapp/Components/Carousel/carousel_slider.dart' as cs;
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_widget_from_html/flutter_widget_from_html.dart'; import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
@ -23,7 +23,7 @@ class QuestionsListWidget extends StatefulWidget {
class _QuestionsListWidget extends State<QuestionsListWidget> { class _QuestionsListWidget extends State<QuestionsListWidget> {
List<QuestionSubDTO> _questionsSubDTO = <QuestionSubDTO>[]; List<QuestionSubDTO> _questionsSubDTO = <QuestionSubDTO>[];
CarouselController? sliderController; cs.CarouselController? sliderController;
int currentIndex = 1; int currentIndex = 1;
bool kIsWeb = false; bool kIsWeb = false;
@ -31,7 +31,7 @@ class _QuestionsListWidget extends State<QuestionsListWidget> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
sliderController = CarouselController(); sliderController = cs.CarouselController();
_questionsSubDTO = widget.questionsSubDTO!; _questionsSubDTO = widget.questionsSubDTO!;
} }
@ -69,10 +69,10 @@ class _QuestionsListWidget extends State<QuestionsListWidget> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
if(_questionsSubDTO.isNotEmpty) if(_questionsSubDTO.isNotEmpty)
CarouselSlider( cs.CarouselSlider(
carouselController: sliderController, carouselController: sliderController,
options: CarouselOptions( options: cs.CarouselOptions(
onPageChanged: (int index, CarouselPageChangedReason reason) { onPageChanged: (int index, cs.CarouselPageChangedReason reason) {
setState(() { setState(() {
currentIndex = index + 1; currentIndex = index + 1;
}); });
@ -95,11 +95,11 @@ class _QuestionsListWidget extends State<QuestionsListWidget> {
//color: Colors.orange, //kBackgroundLight //color: Colors.orange, //kBackgroundLight
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(20.0),
image: i.source_ != null ? DecorationImage( image: i.resourceUrl != null ? DecorationImage(
fit: BoxFit.cover, fit: BoxFit.cover,
opacity: 0.35, opacity: 0.35,
image: NetworkImage( image: NetworkImage(
i.source_!, i.resourceUrl!,
), ),
): null, ): null,
boxShadow: const [ boxShadow: const [
@ -143,7 +143,7 @@ class _QuestionsListWidget extends State<QuestionsListWidget> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(2.5), padding: const EdgeInsets.all(2.5),
child: HtmlWidget( child: HtmlWidget(
TranslationHelper.get(i.label, appContext.getContext() as VisitAppContext), TranslationHelper.getWithResource(i.label, appContext.getContext() as VisitAppContext),
//textAlign: TextAlign.center, //textAlign: TextAlign.center,
customStylesBuilder: (element) { customStylesBuilder: (element) {
return {'text-align': 'center'}; return {'text-align': 'center'};
@ -211,14 +211,14 @@ class _QuestionsListWidget extends State<QuestionsListWidget> {
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
child: HtmlWidget( child: HtmlWidget(
TranslationHelper.get(i.responsesSubDTO![index].label, appContext.getContext() as VisitAppContext), TranslationHelper.getWithResource(i.responsesSubDTO![index].label, appContext.getContext() as VisitAppContext),
//textAlign: TextAlign.center, //textAlign: TextAlign.center,
customStylesBuilder: (element) { customStylesBuilder: (element) {
return {'text-align': 'center'}; return {'text-align': 'center'};
}, },
textStyle: TextStyle(fontSize: kDescriptionSize, color: i.chosen == index ? Colors.white : Colors.black)), textStyle: TextStyle(fontSize: kDescriptionSize, color: i.chosen == index ? Colors.white : Colors.black)),
decoration: BoxDecoration( decoration: BoxDecoration(
color: !widget.isShowResponse ? i.chosen == index ? kTestSecondColor : kBackgroundLight : i.responsesSubDTO![index].isGood! ? kGreen : i.chosen == index ? kTextRed : kBackgroundLight, color: !widget.isShowResponse ? i.chosen == index ? kMainColor1 : kBackgroundLight : i.responsesSubDTO![index].isGood! ? kGreen : i.chosen == index ? kTextRed : kBackgroundLight,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
boxShadow: const [ boxShadow: const [

View File

@ -2,12 +2,13 @@ import 'dart:convert';
import 'dart:developer'; import 'dart:developer';
import 'dart:typed_data'; import 'dart:typed_data';
import 'package:carousel_slider/carousel_slider.dart'; import 'package:mymuseum_visitapp/Components/Carousel/carousel_slider.dart' as cs;
//import 'package:confetti/confetti.dart'; //import 'package:confetti/confetti.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:manager_api/api.dart'; import 'package:manager_api/api.dart';
import 'package:mymuseum_visitapp/Components/CustomAppBar.dart'; import 'package:mymuseum_visitapp/Components/CustomAppBar.dart';
import 'package:mymuseum_visitapp/Components/Loading.dart'; import 'package:mymuseum_visitapp/Components/Loading.dart';
import 'package:mymuseum_visitapp/Components/loading_common.dart';
import 'package:mymuseum_visitapp/Components/rounded_button.dart'; import 'package:mymuseum_visitapp/Components/rounded_button.dart';
import 'package:mymuseum_visitapp/Helpers/DatabaseHelper.dart'; import 'package:mymuseum_visitapp/Helpers/DatabaseHelper.dart';
import 'package:mymuseum_visitapp/Helpers/translationHelper.dart'; import 'package:mymuseum_visitapp/Helpers/translationHelper.dart';
@ -105,7 +106,7 @@ class _QuizzPageState extends State<QuizzPage> {
} }
} }
log("goodResponses =" + goodResponses.toString()); log("goodResponses =" + goodResponses.toString());
QuizzDTOBadLevel levelToShow = QuizzDTOBadLevel(); LevelDTO levelToShow = LevelDTO();
var test = goodResponses/quizzDTO!.questions!.length; var test = goodResponses/quizzDTO!.questions!.length;
if((0 == test || test < 0.25) && quizzDTO!.badLevel != null) { if((0 == test || test < 0.25) && quizzDTO!.badLevel != null) {
@ -139,7 +140,7 @@ class _QuizzPageState extends State<QuizzPage> {
kMainColor, kMainColor,
kSecondColor, kSecondColor,
kConfigurationColor, kConfigurationColor,
kTestSecondColor kMainColor1
//Colors.pink, //Colors.pink,
//Colors.orange, //Colors.orange,
//Colors.purple //Colors.purple
@ -151,8 +152,8 @@ class _QuizzPageState extends State<QuizzPage> {
if (orientation == Orientation.portrait) if (orientation == Orientation.portrait)
Column( Column(
children: [ children: [
if (!showResponses && levelToShow.source_ != null) if (!showResponses && levelToShow.label!.firstWhere((label) => label.language == visitAppContext!.language).resourceUrl != null) // TODO SUPPORT OTHER THAN IMAGES
resultImage(size, levelToShow, orientation), resultImage(visitAppContext!, size, levelToShow, orientation),
if(!showResponses) if(!showResponses)
// TEXT BOX WITH MAIN SCORE // TEXT BOX WITH MAIN SCORE
Text('$goodResponses/${quizzDTO!.questions!.length}', textAlign: TextAlign.center, style: TextStyle(fontSize: kIsWeb ? (showResponses ? 60 : 100) : 75, color: kBackgroundSecondGrey)), Text('$goodResponses/${quizzDTO!.questions!.length}', textAlign: TextAlign.center, style: TextStyle(fontSize: kIsWeb ? (showResponses ? 60 : 100) : 75, color: kBackgroundSecondGrey)),
@ -167,8 +168,8 @@ class _QuizzPageState extends State<QuizzPage> {
if(!showResponses) if(!showResponses)
// TEXT BOX WITH MAIN SCORE // TEXT BOX WITH MAIN SCORE
Text('$goodResponses/${quizzDTO!.questions!.length}', textAlign: TextAlign.center, style: TextStyle(fontSize: kIsWeb ? (showResponses ? 60 : 100) : 75, color: kBackgroundSecondGrey)), Text('$goodResponses/${quizzDTO!.questions!.length}', textAlign: TextAlign.center, style: TextStyle(fontSize: kIsWeb ? (showResponses ? 60 : 100) : 75, color: kBackgroundSecondGrey)),
if (!showResponses && levelToShow.source_ != null) if (!showResponses && levelToShow.label!.firstWhere((label) => label.language == visitAppContext!.language).resourceUrl != null)
resultImage(size, levelToShow, orientation), resultImage(visitAppContext!, size, levelToShow, orientation),
], ],
), ),
@ -216,7 +217,7 @@ class _QuizzPageState extends State<QuizzPage> {
); );
} }
} else { } else {
return const Loading(); return const LoadingCommon();
} }
} }
); );
@ -284,8 +285,8 @@ class _QuizzPageState extends State<QuizzPage> {
if(isConfigOffline) if(isConfigOffline)
{ {
// OFFLINE // OFFLINE
if(question.resourceId != null) { if(question.imageBackgroundResourceId != null) {
List<Map<String, dynamic>> ressourceQuizz = await DatabaseHelper.instance.queryWithColumnId(DatabaseTableType.resources, question.resourceId!); List<Map<String, dynamic>> ressourceQuizz = await DatabaseHelper.instance.queryWithColumnId(DatabaseTableType.resources, question.imageBackgroundResourceId!);
if(ressourceQuizz.isNotEmpty) { if(ressourceQuizz.isNotEmpty) {
resourcesModel.add(DatabaseHelper.instance.getResourceFromDB(ressourceQuizz.first)); resourcesModel.add(DatabaseHelper.instance.getResourceFromDB(ressourceQuizz.first));
} else { } else {
@ -296,8 +297,8 @@ class _QuizzPageState extends State<QuizzPage> {
else else
{ {
// ONLINE // ONLINE
if(question.resourceId != null) { if(question.imageBackgroundResourceId != null) {
resourcesModel.add(ResourceModel(id: question.resourceId, source: question.source_, type: ResourceType.Image)); resourcesModel.add(ResourceModel(id: question.imageBackgroundResourceId, source: question.imageBackgroundResourceUrl, type: ResourceType.Image));
} }
} }
} }
@ -317,7 +318,7 @@ class _QuizzPageState extends State<QuizzPage> {
} }
} }
resultImage(Size size, QuizzDTOBadLevel levelToShow, Orientation orientation) { resultImage(VisitAppContext visitAppContext, Size size, LevelDTO levelToShow, Orientation orientation) {
return Container( return Container(
//height: size.height * 0.2, //height: size.height * 0.2,
//width: size.width * 0.25, //width: size.width * 0.25,
@ -327,11 +328,11 @@ class _QuizzPageState extends State<QuizzPage> {
), ),
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
image: levelToShow.source_ != null ? DecorationImage( image: levelToShow.label!.where((label) => label.language == visitAppContext.language).isNotEmpty ? DecorationImage(
fit: BoxFit.contain, fit: BoxFit.contain,
opacity: 0.85, opacity: 0.85,
image: NetworkImage( image: NetworkImage(
levelToShow.source_!, levelToShow.label!.firstWhere((label) => label.language == visitAppContext.language).resourceUrl!,
), ),
): null, ): null,
borderRadius: const BorderRadius.all( Radius.circular(50.0)), borderRadius: const BorderRadius.all( Radius.circular(50.0)),
@ -346,7 +347,7 @@ class _QuizzPageState extends State<QuizzPage> {
color: const Color(0xff7c94b6), color: const Color(0xff7c94b6),
image: DecorationImage( image: DecorationImage(
image: NetworkImage( image: NetworkImage(
levelToShow.source_!, levelToShow.label!.firstWhere((label) => label.language == visitAppContext.language).resourceUrl!, // TODO REDUNDANCY here??
), ),
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
@ -360,7 +361,7 @@ class _QuizzPageState extends State<QuizzPage> {
); );
} }
resultText(Size size, QuizzDTOBadLevel levelToShow, AppContext appContext) { resultText(Size size, LevelDTO levelToShow, AppContext appContext) {
return Padding( return Padding(
padding: const EdgeInsets.only(bottom: 10), padding: const EdgeInsets.only(bottom: 10),
child: Container( child: Container(
@ -385,7 +386,7 @@ class _QuizzPageState extends State<QuizzPage> {
child: SingleChildScrollView( child: SingleChildScrollView(
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
child: Text(TranslationHelper.get(levelToShow.label, appContext.getContext() as VisitAppContext), textAlign: TextAlign.center, style: TextStyle(fontSize: kIsWeb ? kDescriptionSize : kDescriptionSize)), child: Text(TranslationHelper.getWithResource(levelToShow.label, appContext.getContext() as VisitAppContext), textAlign: TextAlign.center, style: TextStyle(fontSize: kIsWeb ? kDescriptionSize : kDescriptionSize)),
), ),
), ),
), ),

View File

@ -80,7 +80,7 @@ class _BeaconArticleFoundState extends State<BeaconArticleFound> {
} }
return Center( return Center(
child: CircularProgressIndicator( child: CircularProgressIndicator(
color: kBlue1, color: kMainColor1,
value: loadingProgress.expectedTotalBytes != null value: loadingProgress.expectedTotalBytes != null
? loadingProgress.cumulativeBytesLoaded / ? loadingProgress.cumulativeBytesLoaded /
loadingProgress.expectedTotalBytes! loadingProgress.expectedTotalBytes!

View File

@ -1,7 +1,7 @@
import 'package:diacritic/diacritic.dart'; import 'package:diacritic/diacritic.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:manager_api/api.dart'; import 'package:manager_api/api.dart';
import 'package:mymuseum_visitapp/Components/Loading.dart'; import 'package:mymuseum_visitapp/Components/loading_common.dart';
import 'package:mymuseum_visitapp/Components/SearchBox.dart'; import 'package:mymuseum_visitapp/Components/SearchBox.dart';
import 'package:mymuseum_visitapp/Components/SearchNumberBox.dart'; import 'package:mymuseum_visitapp/Components/SearchNumberBox.dart';
import 'package:mymuseum_visitapp/Helpers/DatabaseHelper.dart'; import 'package:mymuseum_visitapp/Helpers/DatabaseHelper.dart';
@ -139,7 +139,7 @@ class _BodyState extends State<Body> {
return Center( return Center(
child: Container( child: Container(
height: size.height * 0.15, height: size.height * 0.15,
child: Loading() child: LoadingCommon()
) )
); );
} }

View File

@ -3,7 +3,7 @@ import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_widget_from_html/flutter_widget_from_html.dart'; import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
import 'package:manager_api/api.dart'; import 'package:manager_api/api.dart';
import 'package:mymuseum_visitapp/Components/Loading.dart'; import 'package:mymuseum_visitapp/Components/loading_common.dart';
import 'package:mymuseum_visitapp/Helpers/DatabaseHelper.dart'; import 'package:mymuseum_visitapp/Helpers/DatabaseHelper.dart';
import 'package:mymuseum_visitapp/Helpers/translationHelper.dart'; import 'package:mymuseum_visitapp/Helpers/translationHelper.dart';
import 'package:mymuseum_visitapp/Models/articleRead.dart'; import 'package:mymuseum_visitapp/Models/articleRead.dart';
@ -55,14 +55,14 @@ class SectionCard extends StatelessWidget {
height: 136, height: 136,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(22), borderRadius: BorderRadius.circular(22),
color: itemIndex.isEven ? kBlue0 : kBlue1, color: itemIndex.isEven ? kMainColor0 : kMainColor1,
), ),
child: Container( child: Container(
margin: const EdgeInsets.only(right: 10), margin: const EdgeInsets.only(right: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
color: visitAppContext.readSections.any((element) => element.id == sectionDTO.id) ? kBackgroundGrey : Colors.white, color: visitAppContext.readSections.any((element) => element.id == sectionDTO.id) ? kBackgroundGrey : Colors.white,
border: Border.all( border: Border.all(
color: kBlue2, color: kMainColor2,
width: 0.2, width: 0.2,
), ),
borderRadius: BorderRadius.circular(22), borderRadius: BorderRadius.circular(22),
@ -102,7 +102,7 @@ class SectionCard extends StatelessWidget {
} }
return Center( return Center(
child: CircularProgressIndicator( child: CircularProgressIndicator(
color: kBlue1, color: kMainColor1,
value: loadingProgress.expectedTotalBytes != null value: loadingProgress.expectedTotalBytes != null
? loadingProgress.cumulativeBytesLoaded / ? loadingProgress.cumulativeBytesLoaded /
loadingProgress.expectedTotalBytes! loadingProgress.expectedTotalBytes!
@ -118,7 +118,7 @@ class SectionCard extends StatelessWidget {
return Center( return Center(
child: SizedBox( child: SizedBox(
height: size.height * 0.15, height: size.height * 0.15,
child: const Loading() child: const LoadingCommon()
) )
); );
} }
@ -155,7 +155,7 @@ class SectionCard extends StatelessWidget {
vertical: kDefaultPadding / 4, // 5 top and bottom vertical: kDefaultPadding / 4, // 5 top and bottom
), ),
decoration: const BoxDecoration( decoration: const BoxDecoration(
color: kBlue2, color: kMainColor2,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(22), bottomLeft: Radius.circular(22),
topRight: Radius.circular(22), topRight: Radius.circular(22),

View File

@ -502,7 +502,7 @@ class _VisitPageState extends State<VisitPage> with WidgetsBindingObserver {
} }
}, },
tooltip: 'Beacon', tooltip: 'Beacon',
backgroundColor: visitAppContext.isScanningBeacons ? kBlue1 : Colors.grey, backgroundColor: visitAppContext.isScanningBeacons ? kMainColor1 : Colors.grey,
child: const Icon(Icons.my_location), child: const Icon(Icons.my_location),
), ),
), ),

View File

@ -21,7 +21,7 @@ class ApiService {
if(configurations.isNotEmpty) { if(configurations.isNotEmpty) {
for(var configuration in configurations) { for(var configuration in configurations) {
if(configuration.imageId != null) { if(configuration.imageId != null) {
await downloadAndPushLocalImage(client, ImageDTO(source_: configuration.imageSource, resourceId: configuration.imageId)); await downloadAndPushLocalImage(client, ContentDTO(resourceUrl: configuration.imageSource, resourceId: configuration.imageId));
} }
} }
} }
@ -71,17 +71,17 @@ class ApiService {
} }
} }
static Future<bool> downloadAndPushLocalImage(Client client, ImageDTO imageDTO) async { static Future<bool> downloadAndPushLocalImage(Client client, ContentDTO contentDTO) async {
try { try {
// Test if already here or not.. // Test if already here or not..
List<Map<String, dynamic>> resourceTest = await DatabaseHelper.instance.queryWithColumnId(DatabaseTableType.resources, imageDTO.resourceId!); List<Map<String, dynamic>> resourceTest = await DatabaseHelper.instance.queryWithColumnId(DatabaseTableType.resources, contentDTO.resourceId!);
if(resourceTest.isNotEmpty) { if(resourceTest.isNotEmpty) {
return true; return true;
} else { } else {
bool isOnline = await hasNetwork(); bool isOnline = await hasNetwork();
if(isOnline) { if(isOnline) {
ResourceModel? resourceModel = await downloadImage(client, imageDTO); ResourceModel? resourceModel = await downloadImage(client, contentDTO);
if(resourceModel != null) { if(resourceModel != null) {
await DatabaseHelper.instance.insert(DatabaseTableType.resources, resourceModel.toMap()); await DatabaseHelper.instance.insert(DatabaseTableType.resources, resourceModel.toMap());
} }
@ -97,16 +97,16 @@ class ApiService {
} }
} }
static Future<ResourceModel?> downloadImage(Client client, ImageDTO imageDTO) async { static Future<ResourceModel?> downloadImage(Client client, ContentDTO contentDTO) async {
var source = imageDTO.source_; var source = contentDTO.resourceUrl;
//print("SOURCE getAndDownloadImage"); //print("SOURCE getAndDownloadImage");
if(imageDTO.source_ != null) { if(contentDTO.resourceUrl != null) {
if(imageDTO.source_!.contains("localhost:5000")){ if(contentDTO.resourceUrl!.contains("localhost:5000")){
print("Contains localhost:5000"); print("Contains localhost:5000");
source = imageDTO.source_!.replaceAll("http://localhost:5000", client.apiApi!.basePath); source = contentDTO.resourceUrl!.replaceAll("http://localhost:5000", client.apiApi!.basePath);
} }
} else { } else {
source = "https://api.mymuseum.be/api/Resource/"+imageDTO.resourceId!; // TODO UPDATE ROUTE source = "https://api.mymuseum.be/api/Resource/"+contentDTO.resourceId!; // TODO UPDATE ROUTE
} }
HttpClient client2 = HttpClient(); HttpClient client2 = HttpClient();
@ -117,7 +117,7 @@ class ApiService {
await for(dynamic d in response) { _downloadData.addAll(d); } await for(dynamic d in response) { _downloadData.addAll(d); }
//print("AFTER"); //print("AFTER");
final base64Str = base64.encode(_downloadData); final base64Str = base64.encode(_downloadData);
ResourceModel resourceModel = ResourceModel(id: imageDTO.resourceId, source: imageDTO.source_, data: base64Str, type: ResourceType.Image); ResourceModel resourceModel = ResourceModel(id: contentDTO.resourceId, source: contentDTO.resourceUrl, data: base64Str, type: ResourceType.Image);
return resourceModel; return resourceModel;
} }
@ -149,7 +149,7 @@ class ApiService {
} }
static Future<ResourceModel?> downloadAudio(Client client, String audioId) async { static Future<ResourceModel?> downloadAudio(Client client, String audioId) async {
var url = "https://api.mymuseum.be/api/Resource/"+audioId; // TO TEST TODO UPDATE ROUTE var url = "https://api.myinfomate.be/api/Resource/"+audioId; // TO TEST TODO UPDATE ROUTE
HttpClient client2 = HttpClient(); HttpClient client2 = HttpClient();
var _downloadData = <int>[]; var _downloadData = <int>[];
final HttpClientRequest request = await client2.getUrl(Uri.parse(url)); final HttpClientRequest request = await client2.getUrl(Uri.parse(url));
@ -181,7 +181,7 @@ class ApiService {
try { try {
bool isOnline = await hasNetwork(); bool isOnline = await hasNetwork();
if(isOnline) { if(isOnline) {
ExportConfigurationDTO? exportConfiguration = await client.configurationApi!.configurationExport(configurationId, language: language); ExportConfigurationDTO? exportConfiguration = await client.configurationApi!.configurationExport(configurationId, language);
return exportConfiguration; return exportConfiguration;
} else { } else {

View File

@ -56,7 +56,7 @@ class DownloadConfiguration {
var imageData = exportConfigurationDTO.resources!.where((element) => element.id == configuration.imageId); var imageData = exportConfigurationDTO.resources!.where((element) => element.id == configuration.imageId);
if(imageData.isNotEmpty) { if(imageData.isNotEmpty) {
ResourceModel resourceModel = ResourceModel(id: imageData.first.id, source: configuration.imageSource, data: imageData.first.data, type: imageData.first.type); ResourceModel resourceModel = ResourceModel(id: imageData.first.id, source: configuration.imageSource, /*data: imageData.first.data,*/ type: imageData.first.type);
try { try {
await DatabaseHelper.instance.insert(DatabaseTableType.resources, resourceModel.toMap()); await DatabaseHelper.instance.insert(DatabaseTableType.resources, resourceModel.toMap());
} catch (e) { } catch (e) {
@ -88,7 +88,8 @@ class DownloadConfiguration {
usedImageOrAudioIds.add(section.imageId!); usedImageOrAudioIds.add(section.imageId!);
var imageData = exportConfigurationDTO.resources!.where((element) => element.id == section.imageId); var imageData = exportConfigurationDTO.resources!.where((element) => element.id == section.imageId);
if(imageData.isNotEmpty) { if(imageData.isNotEmpty) {
ResourceModel resourceModel = ResourceModel(id: imageData.first.id, source: section.imageSource, data: imageData.first.data, type: imageData.first.type); // TODO get all resources from API + store it in download directory of the app
ResourceModel resourceModel = ResourceModel(id: imageData.first.id, source: section.imageSource, /*data: imageData.first.data,*/ type: imageData.first.type);
try { try {
await DatabaseHelper.instance.insert(DatabaseTableType.resources, resourceModel.toMap()); await DatabaseHelper.instance.insert(DatabaseTableType.resources, resourceModel.toMap());
} catch (e) { } catch (e) {
@ -101,11 +102,12 @@ class DownloadConfiguration {
ArticleDTO? articleDTO = ArticleDTO.fromJson(jsonDecode(section.data!)); ArticleDTO? articleDTO = ArticleDTO.fromJson(jsonDecode(section.data!));
if(articleDTO != null) { if(articleDTO != null) {
for(var image in articleDTO.images!) { for(var image in articleDTO.contents!) {
usedImageOrAudioIds.add(image.resourceId!); usedImageOrAudioIds.add(image.resourceId!);
var imageData = exportConfigurationDTO.resources!.where((element) => element.id == image.resourceId); var imageData = exportConfigurationDTO.resources!.where((element) => element.id == image.resourceId);
if(imageData.isNotEmpty) { if(imageData.isNotEmpty) {
ResourceModel resourceModel = ResourceModel(id: imageData.first.id, source: image.source_, data: imageData.first.data, type: imageData.first.type); // TODO get all resources from API + store it in download directory of the app
ResourceModel resourceModel = ResourceModel(id: imageData.first.id, source: image.resourceUrl, /*data: imageData.first.data,*/ type: imageData.first.type);
try { try {
await DatabaseHelper.instance.insert(DatabaseTableType.resources, resourceModel.toMap()); await DatabaseHelper.instance.insert(DatabaseTableType.resources, resourceModel.toMap());
} catch (e) { } catch (e) {
@ -146,7 +148,8 @@ class DownloadConfiguration {
Future<List<ResourceModel>> importAudio(VisitAppContext visitAppContext, ExportConfigurationDTO exportConfigurationDTO, String audioId, List<ResourceModel> audiosNotWorking) async { Future<List<ResourceModel>> importAudio(VisitAppContext visitAppContext, ExportConfigurationDTO exportConfigurationDTO, String audioId, List<ResourceModel> audiosNotWorking) async {
var audioData = exportConfigurationDTO.resources!.where((element) => element.id == audioId); var audioData = exportConfigurationDTO.resources!.where((element) => element.id == audioId);
if(audioData.isNotEmpty) { if(audioData.isNotEmpty) {
ResourceModel resourceModel = ResourceModel(id: audioData.first.id, source: "", data: audioData.first.data, type: audioData.first.type); // TODO get all resources from API + store it in download directory of the app
ResourceModel resourceModel = ResourceModel(id: audioData.first.id, source: "", /*data: audioData.first.data,*/ type: audioData.first.type);
try { try {
await DatabaseHelper.instance.insert(DatabaseTableType.resources, resourceModel.toMap()); await DatabaseHelper.instance.insert(DatabaseTableType.resources, resourceModel.toMap());
return audiosNotWorking; return audiosNotWorking;

View File

@ -5,7 +5,7 @@ info:
description: API Manager Service description: API Manager Service
version: Version Alpha version: Version Alpha
servers: servers:
- url: https://api.mymuseum.be - url: https://api.myinfomate.be
paths: paths:
/api/Configuration: /api/Configuration:
get: get:
@ -112,6 +112,39 @@ paths:
type: string type: string
security: security:
- bearer: [] - bearer: []
/api/Configuration/byPin:
get:
tags:
- Configuration
operationId: Configuration_GetConfigurationsByPinCode
parameters:
- name: pinCode
in: query
schema:
type: integer
format: int32
x-position: 1
responses:
'200':
description: ''
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ConfigurationDTO'
'404':
description: ''
content:
application/json:
schema:
type: string
'500':
description: ''
content:
application/json:
schema:
type: string
/api/Configuration/{id}: /api/Configuration/{id}:
get: get:
tags: tags:
@ -670,6 +703,37 @@ paths:
type: string type: string
security: security:
- bearer: [] - bearer: []
/api/Instance/byPin:
get:
tags:
- Instance
operationId: Instance_GetInstanceByPinCode
parameters:
- name: pinCode
in: query
schema:
type: integer
format: int32
x-position: 1
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/InstanceDTO'
'404':
description: ''
content:
application/json:
schema:
type: string
'500':
description: ''
content:
application/json:
schema:
type: string
/api/Resource: /api/Resource:
get: get:
tags: tags:
@ -1399,6 +1463,48 @@ paths:
$ref: '#/components/schemas/ArticleDTO' $ref: '#/components/schemas/ArticleDTO'
security: security:
- bearer: [] - 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: /api/User:
get: get:
tags: tags:
@ -1699,6 +1805,28 @@ components:
nullable: true nullable: true
items: items:
type: string type: string
loaderImageId:
type: string
nullable: true
loaderImageUrl:
type: string
nullable: true
weatherCity:
type: string
nullable: true
weatherUpdatedDate:
type: string
format: date-time
nullable: true
weatherResult:
type: string
nullable: true
isWeather:
type: boolean
isDate:
type: boolean
isHour:
type: boolean
TranslationDTO: TranslationDTO:
type: object type: object
additionalProperties: false additionalProperties: false
@ -1770,6 +1898,7 @@ components:
order: order:
type: integer type: integer
format: int32 format: int32
nullable: true
instanceId: instanceId:
type: string type: string
nullable: true nullable: true
@ -1799,6 +1928,9 @@ components:
4 = Menu 4 = Menu
5 = Quizz 5 = Quizz
6 = Article 6 = Article
7 = PDF
8 = Puzzle
9 = Agenda
x-enumNames: x-enumNames:
- Map - Map
- Slider - Slider
@ -1807,6 +1939,9 @@ components:
- Menu - Menu
- Quizz - Quizz
- Article - Article
- PDF
- Puzzle
- Agenda
enum: enum:
- 0 - 0
- 1 - 1
@ -1815,6 +1950,9 @@ components:
- 4 - 4
- 5 - 5
- 6 - 6
- 7
- 8
- 9
ResourceDTO: ResourceDTO:
type: object type: object
additionalProperties: false additionalProperties: false
@ -1827,7 +1965,7 @@ components:
label: label:
type: string type: string
nullable: true nullable: true
data: url:
type: string type: string
nullable: true nullable: true
dateCreation: dateCreation:
@ -1844,18 +1982,27 @@ components:
2 = ImageUrl 2 = ImageUrl
3 = VideoUrl 3 = VideoUrl
4 = Audio 4 = Audio
5 = PDF
6 = JSON
7 = JSONUrl
x-enumNames: x-enumNames:
- Image - Image
- Video - Video
- ImageUrl - ImageUrl
- VideoUrl - VideoUrl
- Audio - Audio
- PDF
- JSON
- JSONUrl
enum: enum:
- 0 - 0
- 1 - 1
- 2 - 2
- 3 - 3
- 4 - 4
- 5
- 6
- 7
DeviceDTO: DeviceDTO:
type: object type: object
additionalProperties: false additionalProperties: false
@ -1923,6 +2070,10 @@ components:
dateCreation: dateCreation:
type: string type: string
format: date-time format: date-time
pinCode:
type: integer
format: int32
nullable: true
InstanceDTO: InstanceDTO:
type: object type: object
additionalProperties: false additionalProperties: false
@ -1936,6 +2087,10 @@ components:
dateCreation: dateCreation:
type: string type: string
format: date-time format: date-time
pinCode:
type: integer
format: int32
nullable: true
MapDTO: MapDTO:
type: object type: object
additionalProperties: false additionalProperties: false
@ -1944,7 +2099,17 @@ components:
type: integer type: integer
format: int32 format: int32
mapType: mapType:
$ref: '#/components/schemas/MapTypeApp' nullable: true
oneOf:
- $ref: '#/components/schemas/MapTypeApp'
mapTypeMapbox:
nullable: true
oneOf:
- $ref: '#/components/schemas/MapTypeMapBox'
mapProvider:
nullable: true
oneOf:
- $ref: '#/components/schemas/MapProvider'
points: points:
type: array type: array
nullable: true nullable: true
@ -1956,6 +2121,11 @@ components:
iconSource: iconSource:
type: string type: string
nullable: true nullable: true
categories:
type: array
nullable: true
items:
$ref: '#/components/schemas/CategorieDTO'
MapTypeApp: MapTypeApp:
type: integer type: integer
description: |- description: |-
@ -1976,6 +2146,43 @@ components:
- 2 - 2
- 3 - 3
- 4 - 4
MapTypeMapBox:
type: integer
description: |-
0 = standard
1 = streets
2 = outdoors
3 = light
4 = dark
5 = satellite
6 = satellite_streets
x-enumNames:
- standard
- streets
- outdoors
- light
- dark
- satellite
- satellite_streets
enum:
- 0
- 1
- 2
- 3
- 4
- 5
- 6
MapProvider:
type: integer
description: |-
0 = Google
1 = MapBox
x-enumNames:
- Google
- MapBox
enum:
- 0
- 1
GeoPointDTO: GeoPointDTO:
type: object type: object
additionalProperties: false additionalProperties: false
@ -1983,6 +2190,7 @@ components:
id: id:
type: integer type: integer
format: int32 format: int32
nullable: true
title: title:
type: array type: array
nullable: true nullable: true
@ -1993,37 +2201,68 @@ components:
nullable: true nullable: true
items: items:
$ref: '#/components/schemas/TranslationDTO' $ref: '#/components/schemas/TranslationDTO'
images: contents:
type: array type: array
nullable: true nullable: true
items: items:
$ref: '#/components/schemas/ImageGeoPoint' $ref: '#/components/schemas/ContentGeoPoint'
categorie:
nullable: true
oneOf:
- $ref: '#/components/schemas/CategorieDTO'
latitude: latitude:
type: string type: string
nullable: true nullable: true
longitude: longitude:
type: string type: string
nullable: true nullable: true
ImageGeoPoint: ContentGeoPoint:
type: object type: object
additionalProperties: false additionalProperties: false
properties: properties:
imageResourceId: resourceId:
type: string type: string
nullable: true nullable: true
imageSource: resourceType:
$ref: '#/components/schemas/ResourceType'
resourceUrl:
type: string type: string
nullable: true nullable: true
resourceName:
type: string
nullable: true
CategorieDTO:
type: object
additionalProperties: false
properties:
label:
type: array
nullable: true
items:
$ref: '#/components/schemas/TranslationDTO'
icon:
type: string
nullable: true
iconResourceId:
type: string
nullable: true
iconUrl:
type: string
nullable: true
order:
type: integer
format: int32
nullable: true
SliderDTO: SliderDTO:
type: object type: object
additionalProperties: false additionalProperties: false
properties: properties:
images: contents:
type: array type: array
nullable: true nullable: true
items: items:
$ref: '#/components/schemas/ImageDTO' $ref: '#/components/schemas/ContentDTO'
ImageDTO: ContentDTO:
type: object type: object
additionalProperties: false additionalProperties: false
properties: properties:
@ -2040,12 +2279,14 @@ components:
resourceId: resourceId:
type: string type: string
nullable: true nullable: true
source: resourceUrl:
type: string type: string
nullable: true nullable: true
order: order:
type: integer type: integer
format: int32 format: int32
resourceType:
$ref: '#/components/schemas/ResourceType'
VideoDTO: VideoDTO:
type: object type: object
additionalProperties: false additionalProperties: false
@ -2110,21 +2351,45 @@ components:
type: array type: array
nullable: true nullable: true
items: items:
$ref: '#/components/schemas/TranslationDTO' $ref: '#/components/schemas/TranslationAndResourceDTO'
responses: responses:
type: array type: array
nullable: true nullable: true
items: items:
$ref: '#/components/schemas/ResponseDTO' $ref: '#/components/schemas/ResponseDTO'
resourceId: imageBackgroundResourceId:
type: string type: string
nullable: true nullable: true
source: imageBackgroundResourceType:
nullable: true
oneOf:
- $ref: '#/components/schemas/ResourceType'
imageBackgroundResourceUrl:
type: string type: string
nullable: true nullable: true
order: order:
type: integer type: integer
format: int32 format: int32
TranslationAndResourceDTO:
type: object
additionalProperties: false
properties:
language:
type: string
nullable: true
value:
type: string
nullable: true
resourceId:
type: string
nullable: true
resourceType:
nullable: true
oneOf:
- $ref: '#/components/schemas/ResourceType'
resourceUrl:
type: string
nullable: true
ResponseDTO: ResponseDTO:
type: object type: object
additionalProperties: false additionalProperties: false
@ -2133,7 +2398,7 @@ components:
type: array type: array
nullable: true nullable: true
items: items:
$ref: '#/components/schemas/TranslationDTO' $ref: '#/components/schemas/TranslationAndResourceDTO'
isGood: isGood:
type: boolean type: boolean
order: order:
@ -2147,13 +2412,7 @@ components:
type: array type: array
nullable: true nullable: true
items: items:
$ref: '#/components/schemas/TranslationDTO' $ref: '#/components/schemas/TranslationAndResourceDTO'
resourceId:
type: string
nullable: true
source:
type: string
nullable: true
ArticleDTO: ArticleDTO:
type: object type: object
additionalProperties: false additionalProperties: false
@ -2172,11 +2431,70 @@ components:
$ref: '#/components/schemas/TranslationDTO' $ref: '#/components/schemas/TranslationDTO'
isReadAudioAuto: isReadAudioAuto:
type: boolean type: boolean
images: contents:
type: array type: array
nullable: true nullable: true
items: items:
$ref: '#/components/schemas/ImageDTO' $ref: '#/components/schemas/ContentDTO'
PdfDTO:
type: object
additionalProperties: false
properties:
pdfs:
type: array
nullable: true
items:
$ref: '#/components/schemas/PDFFileDTO'
PDFFileDTO:
type: object
additionalProperties: false
properties:
pdfFilesAndTitles:
type: array
nullable: true
items:
$ref: '#/components/schemas/TranslationAndResourceDTO'
order:
type: integer
format: int32
nullable: true
PuzzleDTO:
type: object
additionalProperties: false
properties:
messageDebut:
type: array
nullable: true
items:
$ref: '#/components/schemas/TranslationAndResourceDTO'
messageFin:
type: array
nullable: true
items:
$ref: '#/components/schemas/TranslationAndResourceDTO'
image:
nullable: true
oneOf:
- $ref: '#/components/schemas/ContentDTO'
rows:
type: integer
format: int32
cols:
type: integer
format: int32
AgendaDTO:
type: object
additionalProperties: false
properties:
resourceIds:
type: array
nullable: true
items:
$ref: '#/components/schemas/TranslationDTO'
mapProvider:
nullable: true
oneOf:
- $ref: '#/components/schemas/MapProvider'
User: User:
type: object type: object
additionalProperties: false additionalProperties: false
@ -2246,6 +2564,10 @@ components:
instanceId: instanceId:
type: string type: string
nullable: true nullable: true
pinCode:
type: integer
format: int32
nullable: true
LoginDTO: LoginDTO:
type: object type: object
additionalProperties: false additionalProperties: false

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@ import 'Models/visitContext.dart';
class AppContext with ChangeNotifier { class AppContext with ChangeNotifier {
VisitAppContext _visitContext; VisitAppContext _visitContext;
Client clientAPI = Client("https://api.mymuseum.be"); // Replace by https://api.mymuseum.be //http://192.168.31.140:8089 Client clientAPI = Client("https://api.myinfomate.be"); // Replace by https://api.mymuseum.be //http://192.168.31.140:8089
AppContext(this._visitContext); AppContext(this._visitContext);

View File

@ -25,15 +25,14 @@ const kDefaultPadding = 20.0;
const kMainGrey = Color(0xFF424242); const kMainGrey = Color(0xFF424242);
const kSecondGrey = Color(0xFF555457); const kSecondGrey = Color(0xFF555457);
const kTestSecondColor = Color(0xFF2F4858);
const kSecondRed = Color(0xFF622727); const kSecondRed = Color(0xFF622727);
const kTextRed = Color(0xFFba0505); const kTextRed = Color(0xFFba0505);
const kBackgroundGrey = Color(0xFFb5b7b9); const kBackgroundGrey = Color(0xFFb5b7b9);
const kBackgroundSecondGrey = Color(0xFF5b5b63); const kBackgroundSecondGrey = Color(0xFF5b5b63);
const kBlue0 = Color(0xFF306bac); const kMainColor0 = Color(0xFFe52122); // const kBlue0 = Color(0xFF306bac);
const kBlue1 = Color(0xFF308aae); const kMainColor1 = Color(0xFFed7082); // const kBlue1 = Color(0xFF308aae);
const kBlue2 = Color(0xFF309cb0); const kMainColor2 = Color(0xFFed7082); // const kBlue2 = Color(0xFF309cb0);
const kBackgroundLight = Color(0xfff3f3f3); const kBackgroundLight = Color(0xfff3f3f3);

View File

@ -28,7 +28,7 @@ void main() async {
List<SectionRead> articleReadTest = List<SectionRead>.from(await DatabaseHelper.instance.getData(DatabaseTableType.articleRead)); List<SectionRead> articleReadTest = List<SectionRead>.from(await DatabaseHelper.instance.getData(DatabaseTableType.articleRead));
localContext.readSections = articleReadTest; localContext.readSections = articleReadTest;
} else { } else {
localContext = VisitAppContext(language: "FR", id: "UserId_Init", instanceId: "63514fd67ed8c735aaa4b8f1", isAdmin: false, isAllLanguages: false); // 633ee379d9405f32f166f047 Fort Saint-Héribert - MyMuseum instance 63514fd67ed8c735aaa4b8f1 localContext = VisitAppContext(language: "FR", id: "UserId_Init", instanceId: "63514fd67ed8c735aaa4b8f2", isAdmin: false, isAllLanguages: false); // 63514fd67ed8c735aaa4b8f2 MyInfoMate test instance -- 633ee379d9405f32f166f047 MyMuseum Fort Saint-Héribert - MyMuseum instance 63514fd67ed8c735aaa4b8f1
DatabaseHelper.instance.insert(DatabaseTableType.main, localContext.toMap()); DatabaseHelper.instance.insert(DatabaseTableType.main, localContext.toMap());
List<SectionRead> articleReadTest = List<SectionRead>.from(await DatabaseHelper.instance.getData(DatabaseTableType.articleRead)); List<SectionRead> articleReadTest = List<SectionRead>.from(await DatabaseHelper.instance.getData(DatabaseTableType.articleRead));
@ -86,7 +86,7 @@ class _MyAppState extends State<MyApp> {
create: (_) => AppContext(widget.visitAppContext), create: (_) => AppContext(widget.visitAppContext),
child: MaterialApp( child: MaterialApp(
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
title: 'Fort Saint Héribert', title: 'Musée de la fraise', //'Fort Saint Héribert'
initialRoute: widget.initialRoute, initialRoute: widget.initialRoute,
localizationsDelegates: const [ localizationsDelegates: const [
AppLocalizations.delegate, AppLocalizations.delegate,
@ -102,7 +102,7 @@ class _MyAppState extends State<MyApp> {
primarySwatch: Colors.blue, primarySwatch: Colors.blue,
scaffoldBackgroundColor: kBackgroundColor, scaffoldBackgroundColor: kBackgroundColor,
//fontFamily: "Vollkorn", //fontFamily: "Vollkorn",
textTheme: const TextTheme(bodyText1: TextStyle(color: kTestSecondColor)), textTheme: TextTheme(bodyLarge: TextStyle(color: widget.visitAppContext.configuration != null ? widget.visitAppContext.configuration!.primaryColor != null ? Color(int.parse(widget.visitAppContext.configuration!.primaryColor!.split('(0x')[1].split(')')[0], radix: 16)): kMainColor1 : kMainColor1)),
visualDensity: VisualDensity.adaptivePlatformDensity, visualDensity: VisualDensity.adaptivePlatformDensity,
), ),
routes: { routes: {

View File

@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.10)
project(runner LANGUAGES CXX) project(runner LANGUAGES CXX)
set(BINARY_NAME "mymuseum_visitapp") set(BINARY_NAME "mymuseum_visitapp")
set(APPLICATION_ID "be.unov.myvisit.mymuseum_visitapp") set(APPLICATION_ID "be.unov.myinfomate.mdlf")
cmake_policy(SET CMP0063 NEW) cmake_policy(SET CMP0063 NEW)

View File

@ -2,10 +2,14 @@
.travis.yml .travis.yml
README.md README.md
analysis_options.yaml analysis_options.yaml
doc/AgendaDTO.md
doc/ArticleDTO.md doc/ArticleDTO.md
doc/AuthenticationApi.md doc/AuthenticationApi.md
doc/CategorieDTO.md
doc/ConfigurationApi.md doc/ConfigurationApi.md
doc/ConfigurationDTO.md doc/ConfigurationDTO.md
doc/ContentDTO.md
doc/ContentGeoPoint.md
doc/DeviceApi.md doc/DeviceApi.md
doc/DeviceDTO.md doc/DeviceDTO.md
doc/DeviceDetailDTO.md doc/DeviceDetailDTO.md
@ -13,17 +17,25 @@ doc/DeviceDetailDTOAllOf.md
doc/ExportConfigurationDTO.md doc/ExportConfigurationDTO.md
doc/ExportConfigurationDTOAllOf.md doc/ExportConfigurationDTOAllOf.md
doc/GeoPointDTO.md doc/GeoPointDTO.md
doc/ImageDTO.md doc/GeoPointDTOCategorie.md
doc/ImageGeoPoint.md
doc/Instance.md doc/Instance.md
doc/InstanceApi.md doc/InstanceApi.md
doc/InstanceDTO.md doc/InstanceDTO.md
doc/LevelDTO.md doc/LevelDTO.md
doc/LoginDTO.md doc/LoginDTO.md
doc/MapDTO.md doc/MapDTO.md
doc/MapDTOMapProvider.md
doc/MapDTOMapType.md
doc/MapDTOMapTypeMapbox.md
doc/MapProvider.md
doc/MapTypeApp.md doc/MapTypeApp.md
doc/MapTypeMapBox.md
doc/MenuDTO.md doc/MenuDTO.md
doc/PDFFileDTO.md
doc/PdfDTO.md
doc/PlayerMessageDTO.md doc/PlayerMessageDTO.md
doc/PuzzleDTO.md
doc/PuzzleDTOImage.md
doc/QuestionDTO.md doc/QuestionDTO.md
doc/QuizzDTO.md doc/QuizzDTO.md
doc/QuizzDTOBadLevel.md doc/QuizzDTOBadLevel.md
@ -36,11 +48,13 @@ doc/SectionDTO.md
doc/SectionType.md doc/SectionType.md
doc/SliderDTO.md doc/SliderDTO.md
doc/TokenDTO.md doc/TokenDTO.md
doc/TranslationAndResourceDTO.md
doc/TranslationDTO.md doc/TranslationDTO.md
doc/User.md doc/User.md
doc/UserApi.md doc/UserApi.md
doc/UserDetailDTO.md doc/UserDetailDTO.md
doc/VideoDTO.md doc/VideoDTO.md
doc/WeatherDTO.md
doc/WebDTO.md doc/WebDTO.md
git_push.sh git_push.sh
lib/api.dart lib/api.dart
@ -59,24 +73,36 @@ lib/auth/authentication.dart
lib/auth/http_basic_auth.dart lib/auth/http_basic_auth.dart
lib/auth/http_bearer_auth.dart lib/auth/http_bearer_auth.dart
lib/auth/oauth.dart lib/auth/oauth.dart
lib/model/agenda_dto.dart
lib/model/article_dto.dart lib/model/article_dto.dart
lib/model/categorie_dto.dart
lib/model/configuration_dto.dart lib/model/configuration_dto.dart
lib/model/content_dto.dart
lib/model/content_geo_point.dart
lib/model/device_detail_dto.dart lib/model/device_detail_dto.dart
lib/model/device_detail_dto_all_of.dart lib/model/device_detail_dto_all_of.dart
lib/model/device_dto.dart lib/model/device_dto.dart
lib/model/export_configuration_dto.dart lib/model/export_configuration_dto.dart
lib/model/export_configuration_dto_all_of.dart lib/model/export_configuration_dto_all_of.dart
lib/model/geo_point_dto.dart lib/model/geo_point_dto.dart
lib/model/image_dto.dart lib/model/geo_point_dto_categorie.dart
lib/model/image_geo_point.dart
lib/model/instance.dart lib/model/instance.dart
lib/model/instance_dto.dart lib/model/instance_dto.dart
lib/model/level_dto.dart lib/model/level_dto.dart
lib/model/login_dto.dart lib/model/login_dto.dart
lib/model/map_dto.dart lib/model/map_dto.dart
lib/model/map_dto_map_provider.dart
lib/model/map_dto_map_type.dart
lib/model/map_dto_map_type_mapbox.dart
lib/model/map_provider.dart
lib/model/map_type_app.dart lib/model/map_type_app.dart
lib/model/map_type_map_box.dart
lib/model/menu_dto.dart lib/model/menu_dto.dart
lib/model/pdf_dto.dart
lib/model/pdf_file_dto.dart
lib/model/player_message_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/question_dto.dart
lib/model/quizz_dto.dart lib/model/quizz_dto.dart
lib/model/quizz_dto_bad_level.dart lib/model/quizz_dto_bad_level.dart
@ -87,9 +113,13 @@ lib/model/section_dto.dart
lib/model/section_type.dart lib/model/section_type.dart
lib/model/slider_dto.dart lib/model/slider_dto.dart
lib/model/token_dto.dart lib/model/token_dto.dart
lib/model/translation_and_resource_dto.dart
lib/model/translation_dto.dart lib/model/translation_dto.dart
lib/model/user.dart lib/model/user.dart
lib/model/user_detail_dto.dart lib/model/user_detail_dto.dart
lib/model/video_dto.dart lib/model/video_dto.dart
lib/model/weather_dto.dart
lib/model/web_dto.dart lib/model/web_dto.dart
pubspec.yaml pubspec.yaml
test/pdf_file_dto_test.dart
test/weather_dto_test.dart

View File

@ -60,7 +60,7 @@ try {
## Documentation for API Endpoints ## Documentation for API Endpoints
All URIs are relative to *https://api.mymuseum.be* All URIs are relative to *https://api.myinfomate.be*
Class | Method | HTTP request | Description Class | Method | HTTP request | Description
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
@ -70,6 +70,7 @@ Class | Method | HTTP request | Description
*ConfigurationApi* | [**configurationDelete**](doc\/ConfigurationApi.md#configurationdelete) | **DELETE** /api/Configuration/{id} | *ConfigurationApi* | [**configurationDelete**](doc\/ConfigurationApi.md#configurationdelete) | **DELETE** /api/Configuration/{id} |
*ConfigurationApi* | [**configurationExport**](doc\/ConfigurationApi.md#configurationexport) | **GET** /api/Configuration/{id}/export | *ConfigurationApi* | [**configurationExport**](doc\/ConfigurationApi.md#configurationexport) | **GET** /api/Configuration/{id}/export |
*ConfigurationApi* | [**configurationGet**](doc\/ConfigurationApi.md#configurationget) | **GET** /api/Configuration | *ConfigurationApi* | [**configurationGet**](doc\/ConfigurationApi.md#configurationget) | **GET** /api/Configuration |
*ConfigurationApi* | [**configurationGetConfigurationsByPinCode**](doc\/ConfigurationApi.md#configurationgetconfigurationsbypincode) | **GET** /api/Configuration/byPin |
*ConfigurationApi* | [**configurationGetDetail**](doc\/ConfigurationApi.md#configurationgetdetail) | **GET** /api/Configuration/{id} | *ConfigurationApi* | [**configurationGetDetail**](doc\/ConfigurationApi.md#configurationgetdetail) | **GET** /api/Configuration/{id} |
*ConfigurationApi* | [**configurationImport**](doc\/ConfigurationApi.md#configurationimport) | **POST** /api/Configuration/import | *ConfigurationApi* | [**configurationImport**](doc\/ConfigurationApi.md#configurationimport) | **POST** /api/Configuration/import |
*ConfigurationApi* | [**configurationUpdate**](doc\/ConfigurationApi.md#configurationupdate) | **PUT** /api/Configuration | *ConfigurationApi* | [**configurationUpdate**](doc\/ConfigurationApi.md#configurationupdate) | **PUT** /api/Configuration |
@ -83,6 +84,7 @@ Class | Method | HTTP request | Description
*InstanceApi* | [**instanceDeleteInstance**](doc\/InstanceApi.md#instancedeleteinstance) | **DELETE** /api/Instance/{id} | *InstanceApi* | [**instanceDeleteInstance**](doc\/InstanceApi.md#instancedeleteinstance) | **DELETE** /api/Instance/{id} |
*InstanceApi* | [**instanceGet**](doc\/InstanceApi.md#instanceget) | **GET** /api/Instance | *InstanceApi* | [**instanceGet**](doc\/InstanceApi.md#instanceget) | **GET** /api/Instance |
*InstanceApi* | [**instanceGetDetail**](doc\/InstanceApi.md#instancegetdetail) | **GET** /api/Instance/{id} | *InstanceApi* | [**instanceGetDetail**](doc\/InstanceApi.md#instancegetdetail) | **GET** /api/Instance/{id} |
*InstanceApi* | [**instanceGetInstanceByPinCode**](doc\/InstanceApi.md#instancegetinstancebypincode) | **GET** /api/Instance/byPin |
*InstanceApi* | [**instanceUpdateinstance**](doc\/InstanceApi.md#instanceupdateinstance) | **PUT** /api/Instance | *InstanceApi* | [**instanceUpdateinstance**](doc\/InstanceApi.md#instanceupdateinstance) | **PUT** /api/Instance |
*ResourceApi* | [**resourceCreate**](doc\/ResourceApi.md#resourcecreate) | **POST** /api/Resource | *ResourceApi* | [**resourceCreate**](doc\/ResourceApi.md#resourcecreate) | **POST** /api/Resource |
*ResourceApi* | [**resourceDelete**](doc\/ResourceApi.md#resourcedelete) | **DELETE** /api/Resource/{id} | *ResourceApi* | [**resourceDelete**](doc\/ResourceApi.md#resourcedelete) | **DELETE** /api/Resource/{id} |
@ -95,6 +97,7 @@ Class | Method | HTTP request | Description
*SectionApi* | [**sectionDelete**](doc\/SectionApi.md#sectiondelete) | **DELETE** /api/Section/{id} | *SectionApi* | [**sectionDelete**](doc\/SectionApi.md#sectiondelete) | **DELETE** /api/Section/{id} |
*SectionApi* | [**sectionDeleteAllForConfiguration**](doc\/SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} | *SectionApi* | [**sectionDeleteAllForConfiguration**](doc\/SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} |
*SectionApi* | [**sectionGet**](doc\/SectionApi.md#sectionget) | **GET** /api/Section | *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* | [**sectionGetAllBeaconsForInstance**](doc\/SectionApi.md#sectiongetallbeaconsforinstance) | **GET** /api/Section/beacons/{instanceId} |
*SectionApi* | [**sectionGetAllSectionSubSections**](doc\/SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections | *SectionApi* | [**sectionGetAllSectionSubSections**](doc\/SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections |
*SectionApi* | [**sectionGetArticleDTO**](doc\/SectionApi.md#sectiongetarticledto) | **GET** /api/Section/ArticleDTO | *SectionApi* | [**sectionGetArticleDTO**](doc\/SectionApi.md#sectiongetarticledto) | **GET** /api/Section/ArticleDTO |
@ -102,9 +105,12 @@ Class | Method | HTTP request | Description
*SectionApi* | [**sectionGetFromConfiguration**](doc\/SectionApi.md#sectiongetfromconfiguration) | **GET** /api/Section/configuration/{id} | *SectionApi* | [**sectionGetFromConfiguration**](doc\/SectionApi.md#sectiongetfromconfiguration) | **GET** /api/Section/configuration/{id} |
*SectionApi* | [**sectionGetMapDTO**](doc\/SectionApi.md#sectiongetmapdto) | **GET** /api/Section/MapDTO | *SectionApi* | [**sectionGetMapDTO**](doc\/SectionApi.md#sectiongetmapdto) | **GET** /api/Section/MapDTO |
*SectionApi* | [**sectionGetMenuDTO**](doc\/SectionApi.md#sectiongetmenudto) | **GET** /api/Section/MenuDTO | *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* | [**sectionGetQuizzDTO**](doc\/SectionApi.md#sectiongetquizzdto) | **GET** /api/Section/QuizzDTO |
*SectionApi* | [**sectionGetSliderDTO**](doc\/SectionApi.md#sectiongetsliderdto) | **GET** /api/Section/SliderDTO | *SectionApi* | [**sectionGetSliderDTO**](doc\/SectionApi.md#sectiongetsliderdto) | **GET** /api/Section/SliderDTO |
*SectionApi* | [**sectionGetVideoDTO**](doc\/SectionApi.md#sectiongetvideodto) | **GET** /api/Section/VideoDTO | *SectionApi* | [**sectionGetVideoDTO**](doc\/SectionApi.md#sectiongetvideodto) | **GET** /api/Section/VideoDTO |
*SectionApi* | [**sectionGetWeatherDTO**](doc\/SectionApi.md#sectiongetweatherdto) | **GET** /api/Section/WeatherDTO |
*SectionApi* | [**sectionGetWebDTO**](doc\/SectionApi.md#sectiongetwebdto) | **GET** /api/Section/WebDTO | *SectionApi* | [**sectionGetWebDTO**](doc\/SectionApi.md#sectiongetwebdto) | **GET** /api/Section/WebDTO |
*SectionApi* | [**sectionPlayerMessageDTO**](doc\/SectionApi.md#sectionplayermessagedto) | **GET** /api/Section/PlayerMessageDTO | *SectionApi* | [**sectionPlayerMessageDTO**](doc\/SectionApi.md#sectionplayermessagedto) | **GET** /api/Section/PlayerMessageDTO |
*SectionApi* | [**sectionUpdate**](doc\/SectionApi.md#sectionupdate) | **PUT** /api/Section | *SectionApi* | [**sectionUpdate**](doc\/SectionApi.md#sectionupdate) | **PUT** /api/Section |
@ -118,24 +124,36 @@ Class | Method | HTTP request | Description
## Documentation For Models ## Documentation For Models
- [AgendaDTO](doc\/AgendaDTO.md)
- [ArticleDTO](doc\/ArticleDTO.md) - [ArticleDTO](doc\/ArticleDTO.md)
- [CategorieDTO](doc\/CategorieDTO.md)
- [ConfigurationDTO](doc\/ConfigurationDTO.md) - [ConfigurationDTO](doc\/ConfigurationDTO.md)
- [ContentDTO](doc\/ContentDTO.md)
- [ContentGeoPoint](doc\/ContentGeoPoint.md)
- [DeviceDTO](doc\/DeviceDTO.md) - [DeviceDTO](doc\/DeviceDTO.md)
- [DeviceDetailDTO](doc\/DeviceDetailDTO.md) - [DeviceDetailDTO](doc\/DeviceDetailDTO.md)
- [DeviceDetailDTOAllOf](doc\/DeviceDetailDTOAllOf.md) - [DeviceDetailDTOAllOf](doc\/DeviceDetailDTOAllOf.md)
- [ExportConfigurationDTO](doc\/ExportConfigurationDTO.md) - [ExportConfigurationDTO](doc\/ExportConfigurationDTO.md)
- [ExportConfigurationDTOAllOf](doc\/ExportConfigurationDTOAllOf.md) - [ExportConfigurationDTOAllOf](doc\/ExportConfigurationDTOAllOf.md)
- [GeoPointDTO](doc\/GeoPointDTO.md) - [GeoPointDTO](doc\/GeoPointDTO.md)
- [ImageDTO](doc\/ImageDTO.md) - [GeoPointDTOCategorie](doc\/GeoPointDTOCategorie.md)
- [ImageGeoPoint](doc\/ImageGeoPoint.md)
- [Instance](doc\/Instance.md) - [Instance](doc\/Instance.md)
- [InstanceDTO](doc\/InstanceDTO.md) - [InstanceDTO](doc\/InstanceDTO.md)
- [LevelDTO](doc\/LevelDTO.md) - [LevelDTO](doc\/LevelDTO.md)
- [LoginDTO](doc\/LoginDTO.md) - [LoginDTO](doc\/LoginDTO.md)
- [MapDTO](doc\/MapDTO.md) - [MapDTO](doc\/MapDTO.md)
- [MapDTOMapProvider](doc\/MapDTOMapProvider.md)
- [MapDTOMapType](doc\/MapDTOMapType.md)
- [MapDTOMapTypeMapbox](doc\/MapDTOMapTypeMapbox.md)
- [MapProvider](doc\/MapProvider.md)
- [MapTypeApp](doc\/MapTypeApp.md) - [MapTypeApp](doc\/MapTypeApp.md)
- [MapTypeMapBox](doc\/MapTypeMapBox.md)
- [MenuDTO](doc\/MenuDTO.md) - [MenuDTO](doc\/MenuDTO.md)
- [PDFFileDTO](doc\/PDFFileDTO.md)
- [PdfDTO](doc\/PdfDTO.md)
- [PlayerMessageDTO](doc\/PlayerMessageDTO.md) - [PlayerMessageDTO](doc\/PlayerMessageDTO.md)
- [PuzzleDTO](doc\/PuzzleDTO.md)
- [PuzzleDTOImage](doc\/PuzzleDTOImage.md)
- [QuestionDTO](doc\/QuestionDTO.md) - [QuestionDTO](doc\/QuestionDTO.md)
- [QuizzDTO](doc\/QuizzDTO.md) - [QuizzDTO](doc\/QuizzDTO.md)
- [QuizzDTOBadLevel](doc\/QuizzDTOBadLevel.md) - [QuizzDTOBadLevel](doc\/QuizzDTOBadLevel.md)
@ -146,17 +164,20 @@ Class | Method | HTTP request | Description
- [SectionType](doc\/SectionType.md) - [SectionType](doc\/SectionType.md)
- [SliderDTO](doc\/SliderDTO.md) - [SliderDTO](doc\/SliderDTO.md)
- [TokenDTO](doc\/TokenDTO.md) - [TokenDTO](doc\/TokenDTO.md)
- [TranslationAndResourceDTO](doc\/TranslationAndResourceDTO.md)
- [TranslationDTO](doc\/TranslationDTO.md) - [TranslationDTO](doc\/TranslationDTO.md)
- [User](doc\/User.md) - [User](doc\/User.md)
- [UserDetailDTO](doc\/UserDetailDTO.md) - [UserDetailDTO](doc\/UserDetailDTO.md)
- [VideoDTO](doc\/VideoDTO.md) - [VideoDTO](doc\/VideoDTO.md)
- [WeatherDTO](doc\/WeatherDTO.md)
- [WebDTO](doc\/WebDTO.md) - [WebDTO](doc\/WebDTO.md)
## Documentation For Authorization ## Documentation For Authorization
## bearer Authentication schemes defined for the API:
### bearer
- **Type**: OAuth - **Type**: OAuth
- **Flow**: password - **Flow**: password

View File

@ -0,0 +1,16 @@
# manager_api.model.AgendaDTO
## Load the model package
```dart
import 'package:manager_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**resourceIds** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**mapProvider** | [**MapDTOMapProvider**](MapDTOMapProvider.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)

View File

@ -12,7 +12,7 @@ Name | Type | Description | Notes
**isContentTop** | **bool** | | [optional] **isContentTop** | **bool** | | [optional]
**audioIds** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []] **audioIds** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**isReadAudioAuto** | **bool** | | [optional] **isReadAudioAuto** | **bool** | | [optional]
**images** | [**List<ImageDTO>**](ImageDTO.md) | | [optional] [default to const []] **contents** | [**List<ContentDTO>**](ContentDTO.md) | | [optional] [default to const []]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -5,7 +5,7 @@
import 'package:manager_api/api.dart'; import 'package:manager_api/api.dart';
``` ```
All URIs are relative to *https://api.mymuseum.be* All URIs are relative to *https://api.myinfomate.be*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------

View File

@ -0,0 +1,20 @@
# manager_api.model.CategorieDTO
## Load the model package
```dart
import 'package:manager_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | | [optional]
**label** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**icon** | **String** | | [optional]
**iconResourceId** | **String** | | [optional]
**iconUrl** | **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)

View File

@ -5,7 +5,7 @@
import 'package:manager_api/api.dart'; import 'package:manager_api/api.dart';
``` ```
All URIs are relative to *https://api.mymuseum.be* All URIs are relative to *https://api.myinfomate.be*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
@ -13,6 +13,7 @@ Method | HTTP request | Description
[**configurationDelete**](ConfigurationApi.md#configurationdelete) | **DELETE** /api/Configuration/{id} | [**configurationDelete**](ConfigurationApi.md#configurationdelete) | **DELETE** /api/Configuration/{id} |
[**configurationExport**](ConfigurationApi.md#configurationexport) | **GET** /api/Configuration/{id}/export | [**configurationExport**](ConfigurationApi.md#configurationexport) | **GET** /api/Configuration/{id}/export |
[**configurationGet**](ConfigurationApi.md#configurationget) | **GET** /api/Configuration | [**configurationGet**](ConfigurationApi.md#configurationget) | **GET** /api/Configuration |
[**configurationGetConfigurationsByPinCode**](ConfigurationApi.md#configurationgetconfigurationsbypincode) | **GET** /api/Configuration/byPin |
[**configurationGetDetail**](ConfigurationApi.md#configurationgetdetail) | **GET** /api/Configuration/{id} | [**configurationGetDetail**](ConfigurationApi.md#configurationgetdetail) | **GET** /api/Configuration/{id} |
[**configurationImport**](ConfigurationApi.md#configurationimport) | **POST** /api/Configuration/import | [**configurationImport**](ConfigurationApi.md#configurationimport) | **POST** /api/Configuration/import |
[**configurationUpdate**](ConfigurationApi.md#configurationupdate) | **PUT** /api/Configuration | [**configurationUpdate**](ConfigurationApi.md#configurationupdate) | **PUT** /api/Configuration |
@ -192,6 +193,49 @@ 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) [[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)
# **configurationGetConfigurationsByPinCode**
> List<ConfigurationDTO> configurationGetConfigurationsByPinCode(pinCode)
### Example
```dart
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = ConfigurationApi();
final pinCode = 56; // int |
try {
final result = api_instance.configurationGetConfigurationsByPinCode(pinCode);
print(result);
} catch (e) {
print('Exception when calling ConfigurationApi->configurationGetConfigurationsByPinCode: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pinCode** | **int**| | [optional]
### Return type
[**List<ConfigurationDTO>**](ConfigurationDTO.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)
# **configurationGetDetail** # **configurationGetDetail**
> ConfigurationDTO configurationGetDetail(id) > ConfigurationDTO configurationGetDetail(id)

View File

@ -22,6 +22,17 @@ Name | Type | Description | Notes
**isOffline** | **bool** | | [optional] **isOffline** | **bool** | | [optional]
**instanceId** | **String** | | [optional] **instanceId** | **String** | | [optional]
**sectionIds** | **List<String>** | | [optional] [default to const []] **sectionIds** | **List<String>** | | [optional] [default to const []]
**loaderImageId** | **String** | | [optional]
**loaderImageUrl** | **String** | | [optional]
**weatherCity** | **String** | | [optional]
**weatherUpdatedDate** | [**DateTime**](DateTime.md) | | [optional]
**weatherResult** | **String** | | [optional]
**isWeather** | **bool** | | [optional]
**isDate** | **bool** | | [optional]
**isHour** | **bool** | | [optional]
**isSectionImageBackground** | **bool** | | [optional]
**roundedValue** | **int** | | [optional]
**screenPercentageSectionsMainPage** | **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) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,20 @@
# manager_api.model.ContentDTO
## Load the model package
```dart
import 'package:manager_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**title** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**description** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**resourceId** | **String** | | [optional]
**resourceUrl** | **String** | | [optional]
**order** | **int** | | [optional]
**resourceType** | [**ResourceType**](ResourceType.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)

View File

@ -0,0 +1,18 @@
# manager_api.model.ContentGeoPoint
## Load the model package
```dart
import 'package:manager_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**resourceId** | **String** | | [optional]
**resourceType** | [**ResourceType**](ResourceType.md) | | [optional]
**resourceUrl** | **String** | | [optional]
**resourceName** | **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)

View File

@ -5,7 +5,7 @@
import 'package:manager_api/api.dart'; import 'package:manager_api/api.dart';
``` ```
All URIs are relative to *https://api.mymuseum.be* All URIs are relative to *https://api.myinfomate.be*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------

View File

@ -22,6 +22,17 @@ Name | Type | Description | Notes
**isOffline** | **bool** | | [optional] **isOffline** | **bool** | | [optional]
**instanceId** | **String** | | [optional] **instanceId** | **String** | | [optional]
**sectionIds** | **List<String>** | | [optional] [default to const []] **sectionIds** | **List<String>** | | [optional] [default to const []]
**loaderImageId** | **String** | | [optional]
**loaderImageUrl** | **String** | | [optional]
**weatherCity** | **String** | | [optional]
**weatherUpdatedDate** | [**DateTime**](DateTime.md) | | [optional]
**weatherResult** | **String** | | [optional]
**isWeather** | **bool** | | [optional]
**isDate** | **bool** | | [optional]
**isHour** | **bool** | | [optional]
**isSectionImageBackground** | **bool** | | [optional]
**roundedValue** | **int** | | [optional]
**screenPercentageSectionsMainPage** | **int** | | [optional]
**sections** | [**List<SectionDTO>**](SectionDTO.md) | | [optional] [default to const []] **sections** | [**List<SectionDTO>**](SectionDTO.md) | | [optional] [default to const []]
**resources** | [**List<ResourceDTO>**](ResourceDTO.md) | | [optional] [default to const []] **resources** | [**List<ResourceDTO>**](ResourceDTO.md) | | [optional] [default to const []]

View File

@ -11,9 +11,18 @@ Name | Type | Description | Notes
**id** | **int** | | [optional] **id** | **int** | | [optional]
**title** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []] **title** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**description** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []] **description** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**images** | [**List<ImageGeoPoint>**](ImageGeoPoint.md) | | [optional] [default to const []] **contents** | [**List<ContentGeoPoint>**](ContentGeoPoint.md) | | [optional] [default to const []]
**categorie** | [**GeoPointDTOCategorie**](GeoPointDTOCategorie.md) | | [optional]
**categorieId** | **int** | | [optional]
**latitude** | **String** | | [optional] **latitude** | **String** | | [optional]
**longitude** | **String** | | [optional] **longitude** | **String** | | [optional]
**imageResourceId** | **String** | | [optional]
**imageUrl** | **String** | | [optional]
**schedules** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**prices** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**phone** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**email** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**site** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,20 @@
# manager_api.model.GeoPointDTOCategorie
## Load the model package
```dart
import 'package:manager_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | | [optional]
**label** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**icon** | **String** | | [optional]
**iconResourceId** | **String** | | [optional]
**iconUrl** | **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)

View File

@ -11,6 +11,7 @@ Name | Type | Description | Notes
**id** | **String** | | [optional] **id** | **String** | | [optional]
**name** | **String** | | [optional] **name** | **String** | | [optional]
**dateCreation** | [**DateTime**](DateTime.md) | | [optional] **dateCreation** | [**DateTime**](DateTime.md) | | [optional]
**pinCode** | **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) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -5,7 +5,7 @@
import 'package:manager_api/api.dart'; import 'package:manager_api/api.dart';
``` ```
All URIs are relative to *https://api.mymuseum.be* All URIs are relative to *https://api.myinfomate.be*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
@ -13,6 +13,7 @@ Method | HTTP request | Description
[**instanceDeleteInstance**](InstanceApi.md#instancedeleteinstance) | **DELETE** /api/Instance/{id} | [**instanceDeleteInstance**](InstanceApi.md#instancedeleteinstance) | **DELETE** /api/Instance/{id} |
[**instanceGet**](InstanceApi.md#instanceget) | **GET** /api/Instance | [**instanceGet**](InstanceApi.md#instanceget) | **GET** /api/Instance |
[**instanceGetDetail**](InstanceApi.md#instancegetdetail) | **GET** /api/Instance/{id} | [**instanceGetDetail**](InstanceApi.md#instancegetdetail) | **GET** /api/Instance/{id} |
[**instanceGetInstanceByPinCode**](InstanceApi.md#instancegetinstancebypincode) | **GET** /api/Instance/byPin |
[**instanceUpdateinstance**](InstanceApi.md#instanceupdateinstance) | **PUT** /api/Instance | [**instanceUpdateinstance**](InstanceApi.md#instanceupdateinstance) | **PUT** /api/Instance |
@ -184,6 +185,49 @@ 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) [[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)
# **instanceGetInstanceByPinCode**
> InstanceDTO instanceGetInstanceByPinCode(pinCode)
### Example
```dart
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = InstanceApi();
final pinCode = 56; // int |
try {
final result = api_instance.instanceGetInstanceByPinCode(pinCode);
print(result);
} catch (e) {
print('Exception when calling InstanceApi->instanceGetInstanceByPinCode: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pinCode** | **int**| | [optional]
### Return type
[**InstanceDTO**](InstanceDTO.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)
# **instanceUpdateinstance** # **instanceUpdateinstance**
> InstanceDTO instanceUpdateinstance(instance) > InstanceDTO instanceUpdateinstance(instance)

View File

@ -11,6 +11,7 @@ Name | Type | Description | Notes
**id** | **String** | | [optional] **id** | **String** | | [optional]
**name** | **String** | | [optional] **name** | **String** | | [optional]
**dateCreation** | [**DateTime**](DateTime.md) | | [optional] **dateCreation** | [**DateTime**](DateTime.md) | | [optional]
**pinCode** | **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) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -8,9 +8,7 @@ import 'package:manager_api/api.dart';
## Properties ## Properties
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**label** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []] **label** | [**List<TranslationAndResourceDTO>**](TranslationAndResourceDTO.md) | | [optional] [default to const []]
**resourceId** | **String** | | [optional]
**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) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -9,10 +9,15 @@ import 'package:manager_api/api.dart';
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**zoom** | **int** | | [optional] **zoom** | **int** | | [optional]
**mapType** | [**MapTypeApp**](MapTypeApp.md) | | [optional] **mapType** | [**MapDTOMapType**](MapDTOMapType.md) | | [optional]
**mapTypeMapbox** | [**MapDTOMapTypeMapbox**](MapDTOMapTypeMapbox.md) | | [optional]
**mapProvider** | [**MapDTOMapProvider**](MapDTOMapProvider.md) | | [optional]
**points** | [**List<GeoPointDTO>**](GeoPointDTO.md) | | [optional] [default to const []] **points** | [**List<GeoPointDTO>**](GeoPointDTO.md) | | [optional] [default to const []]
**iconResourceId** | **String** | | [optional] **iconResourceId** | **String** | | [optional]
**iconSource** | **String** | | [optional] **iconSource** | **String** | | [optional]
**categories** | [**List<CategorieDTO>**](CategorieDTO.md) | | [optional] [default to const []]
**latitude** | **String** | | [optional]
**longitude** | **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) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,14 @@
# manager_api.model.MapDTOMapProvider
## Load the model package
```dart
import 'package:manager_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,14 @@
# manager_api.model.MapDTOMapType
## Load the model package
```dart
import 'package:manager_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,14 @@
# manager_api.model.MapDTOMapTypeMapbox
## Load the model package
```dart
import 'package:manager_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,14 @@
# manager_api.model.MapProvider
## Load the model package
```dart
import 'package:manager_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,14 @@
# manager_api.model.MapTypeMapBox
## Load the model package
```dart
import 'package:manager_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,16 @@
# manager_api.model.PDFFileDTO
## Load the model package
```dart
import 'package:manager_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**pdfFilesAndTitles** | [**List<TranslationAndResourceDTO>**](TranslationAndResourceDTO.md) | | [optional] [default to const []]
**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)

15
manager_api/doc/PdfDTO.md Normal file
View File

@ -0,0 +1,15 @@
# manager_api.model.PdfDTO
## Load the model package
```dart
import 'package:manager_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**pdfs** | [**List<PDFFileDTO>**](PDFFileDTO.md) | | [optional] [default to const []]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,19 @@
# manager_api.model.PuzzleDTO
## Load the model package
```dart
import 'package:manager_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**messageDebut** | [**List<TranslationAndResourceDTO>**](TranslationAndResourceDTO.md) | | [optional] [default to const []]
**messageFin** | [**List<TranslationAndResourceDTO>**](TranslationAndResourceDTO.md) | | [optional] [default to const []]
**image** | [**PuzzleDTOImage**](PuzzleDTOImage.md) | | [optional]
**rows** | **int** | | [optional]
**cols** | **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)

View File

@ -0,0 +1,20 @@
# manager_api.model.PuzzleDTOImage
## Load the model package
```dart
import 'package:manager_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**title** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**description** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**resourceId** | **String** | | [optional]
**resourceUrl** | **String** | | [optional]
**order** | **int** | | [optional]
**resourceType** | [**ResourceType**](ResourceType.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)

View File

@ -8,10 +8,11 @@ import 'package:manager_api/api.dart';
## Properties ## Properties
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**label** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []] **label** | [**List<TranslationAndResourceDTO>**](TranslationAndResourceDTO.md) | | [optional] [default to const []]
**responses** | [**List<ResponseDTO>**](ResponseDTO.md) | | [optional] [default to const []] **responses** | [**List<ResponseDTO>**](ResponseDTO.md) | | [optional] [default to const []]
**resourceId** | **String** | | [optional] **imageBackgroundResourceId** | **String** | | [optional]
**source_** | **String** | | [optional] **imageBackgroundResourceType** | [**ResourceType**](ResourceType.md) | | [optional]
**imageBackgroundResourceUrl** | **String** | | [optional]
**order** | **int** | | [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) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -8,9 +8,7 @@ import 'package:manager_api/api.dart';
## Properties ## Properties
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**label** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []] **label** | [**List<TranslationAndResourceDTO>**](TranslationAndResourceDTO.md) | | [optional] [default to const []]
**resourceId** | **String** | | [optional]
**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) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Some files were not shown because too many files have changed in this diff Show More