Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25f59f3072 | ||
| 471190a153 | |||
| dd6d8b57ec | |||
| 0809004e15 | |||
| 093c840a57 | |||
| cf7fd02599 | |||
| 3765c1eacc | |||
| e898ac5496 | |||
| d290135ef9 | |||
| 358a035408 | |||
|
|
cf1eccc83e | ||
|
|
3955826456 | ||
|
|
0598e8bf46 | ||
|
|
ec2954fea9 | ||
|
|
29fd201c82 |
19
README.md
@ -14,3 +14,22 @@ A few resources to get you started if this is your first Flutter project:
|
|||||||
For help getting started with Flutter, view our
|
For help getting started with Flutter, view our
|
||||||
[online documentation](https://flutter.dev/docs), which offers tutorials,
|
[online documentation](https://flutter.dev/docs), which offers tutorials,
|
||||||
samples, guidance on mobile development, and a full API reference.
|
samples, guidance on mobile development, and a full API reference.
|
||||||
|
|
||||||
|
# Model generation via command line
|
||||||
|
|
||||||
|
java -cp openapi-generator-cli-5.1.0.jar org.openapitools.codegen.OpenAPIGenerator generate -i swagger.yaml --additional-properties pubName=managerapi -g dart --enable-post-process-file
|
||||||
|
|
||||||
|
=> Faudrait mettre à jour le projet avec les nouvelles versions plugins
|
||||||
|
|
||||||
|
# Publication sur docker
|
||||||
|
|
||||||
|
docker build -t flutter-web .
|
||||||
|
|
||||||
|
Pour tester en local :
|
||||||
|
docker run -d -p 8080:80 –name flutter-web flutter-web
|
||||||
|
|
||||||
|
Image tag:
|
||||||
|
docker image tag flutter-web registry.unov.be/mymuseum/manager:latest
|
||||||
|
|
||||||
|
Docker push:
|
||||||
|
docker image push registry.unov.be/mymuseum/manager:latest
|
||||||
|
|||||||
1
RELEASE/Version1_2/WEB/.last_build_id
Normal file
@ -0,0 +1 @@
|
|||||||
|
2cbf28f04b11760d77a4ab7a367289c4
|
||||||
1
RELEASE/Version1_2/WEB/assets/AssetManifest.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"assets/animations/MDLF_animation.flr":["assets/animations/MDLF_animation.flr"],"assets/files/session.json":["assets/files/session.json"],"packages/cupertino_icons/assets/CupertinoIcons.ttf":["packages/cupertino_icons/assets/CupertinoIcons.ttf"]}
|
||||||
1
RELEASE/Version1_2/WEB/assets/FontManifest.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
[{"family":"MaterialIcons","fonts":[{"asset":"fonts/MaterialIcons-Regular.otf"}]},{"family":"packages/cupertino_icons/CupertinoIcons","fonts":[{"asset":"packages/cupertino_icons/assets/CupertinoIcons.ttf"}]}]
|
||||||
15866
RELEASE/Version1_2/WEB/assets/NOTICES
Normal file
BIN
RELEASE/Version1_2/WEB/assets/fonts/MaterialIcons-Regular.otf
Normal file
BIN
RELEASE/Version1_2/WEB/favicon.png
Normal file
|
After Width: | Height: | Size: 917 B |
192
RELEASE/Version1_2/WEB/flutter_service_worker.js
Normal file
@ -0,0 +1,192 @@
|
|||||||
|
'use strict';
|
||||||
|
const MANIFEST = 'flutter-app-manifest';
|
||||||
|
const TEMP = 'flutter-temp-cache';
|
||||||
|
const CACHE_NAME = 'flutter-app-cache';
|
||||||
|
const RESOURCES = {
|
||||||
|
"assets/AssetManifest.json": "7ceda6dd13738309d0b4d4d2702b3010",
|
||||||
|
"assets/assets/animations/MDLF_animation.flr": "5151e91ce20a70dbc097f01a7ec97497",
|
||||||
|
"assets/assets/files/session.json": "d41d8cd98f00b204e9800998ecf8427e",
|
||||||
|
"assets/FontManifest.json": "dc3d03800ccca4601324923c0b1d6d57",
|
||||||
|
"assets/fonts/MaterialIcons-Regular.otf": "4e6447691c9509f7acdbf8a931a85ca1",
|
||||||
|
"assets/NOTICES": "907d5d6af179d7cb3714bbe817416d2d",
|
||||||
|
"assets/packages/cupertino_icons/assets/CupertinoIcons.ttf": "6d342eb68f170c97609e9da345464e5e",
|
||||||
|
"favicon.png": "5dcef449791fa27946b3d35ad8803796",
|
||||||
|
"icons/Icon-192.png": "ac9a721a12bbc803b44f645561ecb1e1",
|
||||||
|
"icons/Icon-512.png": "96e752610906ba2a93c65f8abe1645f1",
|
||||||
|
"index.html": "ef6d7910cf1be3a8b0788fb1b9120811",
|
||||||
|
"/": "ef6d7910cf1be3a8b0788fb1b9120811",
|
||||||
|
"main.dart.js": "493dd9b75833e3e7807dde24e63b3b4c",
|
||||||
|
"manifest.json": "f991a4c9a70f0e68a442d6a7ff3fc209",
|
||||||
|
"version.json": "efeb7954ff5b26a7b36c63eef4e9fe12"
|
||||||
|
};
|
||||||
|
|
||||||
|
// The application shell files that are downloaded before a service worker can
|
||||||
|
// start.
|
||||||
|
const CORE = [
|
||||||
|
"/",
|
||||||
|
"main.dart.js",
|
||||||
|
"index.html",
|
||||||
|
"assets/NOTICES",
|
||||||
|
"assets/AssetManifest.json",
|
||||||
|
"assets/FontManifest.json"];
|
||||||
|
// During install, the TEMP cache is populated with the application shell files.
|
||||||
|
self.addEventListener("install", (event) => {
|
||||||
|
self.skipWaiting();
|
||||||
|
return event.waitUntil(
|
||||||
|
caches.open(TEMP).then((cache) => {
|
||||||
|
return cache.addAll(
|
||||||
|
CORE.map((value) => new Request(value, {'cache': 'reload'})));
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
// During activate, the cache is populated with the temp files downloaded in
|
||||||
|
// install. If this service worker is upgrading from one with a saved
|
||||||
|
// MANIFEST, then use this to retain unchanged resource files.
|
||||||
|
self.addEventListener("activate", function(event) {
|
||||||
|
return event.waitUntil(async function() {
|
||||||
|
try {
|
||||||
|
var contentCache = await caches.open(CACHE_NAME);
|
||||||
|
var tempCache = await caches.open(TEMP);
|
||||||
|
var manifestCache = await caches.open(MANIFEST);
|
||||||
|
var manifest = await manifestCache.match('manifest');
|
||||||
|
// When there is no prior manifest, clear the entire cache.
|
||||||
|
if (!manifest) {
|
||||||
|
await caches.delete(CACHE_NAME);
|
||||||
|
contentCache = await caches.open(CACHE_NAME);
|
||||||
|
for (var request of await tempCache.keys()) {
|
||||||
|
var response = await tempCache.match(request);
|
||||||
|
await contentCache.put(request, response);
|
||||||
|
}
|
||||||
|
await caches.delete(TEMP);
|
||||||
|
// Save the manifest to make future upgrades efficient.
|
||||||
|
await manifestCache.put('manifest', new Response(JSON.stringify(RESOURCES)));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var oldManifest = await manifest.json();
|
||||||
|
var origin = self.location.origin;
|
||||||
|
for (var request of await contentCache.keys()) {
|
||||||
|
var key = request.url.substring(origin.length + 1);
|
||||||
|
if (key == "") {
|
||||||
|
key = "/";
|
||||||
|
}
|
||||||
|
// If a resource from the old manifest is not in the new cache, or if
|
||||||
|
// the MD5 sum has changed, delete it. Otherwise the resource is left
|
||||||
|
// in the cache and can be reused by the new service worker.
|
||||||
|
if (!RESOURCES[key] || RESOURCES[key] != oldManifest[key]) {
|
||||||
|
await contentCache.delete(request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Populate the cache with the app shell TEMP files, potentially overwriting
|
||||||
|
// cache files preserved above.
|
||||||
|
for (var request of await tempCache.keys()) {
|
||||||
|
var response = await tempCache.match(request);
|
||||||
|
await contentCache.put(request, response);
|
||||||
|
}
|
||||||
|
await caches.delete(TEMP);
|
||||||
|
// Save the manifest to make future upgrades efficient.
|
||||||
|
await manifestCache.put('manifest', new Response(JSON.stringify(RESOURCES)));
|
||||||
|
return;
|
||||||
|
} catch (err) {
|
||||||
|
// On an unhandled exception the state of the cache cannot be guaranteed.
|
||||||
|
console.error('Failed to upgrade service worker: ' + err);
|
||||||
|
await caches.delete(CACHE_NAME);
|
||||||
|
await caches.delete(TEMP);
|
||||||
|
await caches.delete(MANIFEST);
|
||||||
|
}
|
||||||
|
}());
|
||||||
|
});
|
||||||
|
|
||||||
|
// The fetch handler redirects requests for RESOURCE files to the service
|
||||||
|
// worker cache.
|
||||||
|
self.addEventListener("fetch", (event) => {
|
||||||
|
if (event.request.method !== 'GET') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var origin = self.location.origin;
|
||||||
|
var key = event.request.url.substring(origin.length + 1);
|
||||||
|
// Redirect URLs to the index.html
|
||||||
|
if (key.indexOf('?v=') != -1) {
|
||||||
|
key = key.split('?v=')[0];
|
||||||
|
}
|
||||||
|
if (event.request.url == origin || event.request.url.startsWith(origin + '/#') || key == '') {
|
||||||
|
key = '/';
|
||||||
|
}
|
||||||
|
// If the URL is not the RESOURCE list then return to signal that the
|
||||||
|
// browser should take over.
|
||||||
|
if (!RESOURCES[key]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// If the URL is the index.html, perform an online-first request.
|
||||||
|
if (key == '/') {
|
||||||
|
return onlineFirst(event);
|
||||||
|
}
|
||||||
|
event.respondWith(caches.open(CACHE_NAME)
|
||||||
|
.then((cache) => {
|
||||||
|
return cache.match(event.request).then((response) => {
|
||||||
|
// Either respond with the cached resource, or perform a fetch and
|
||||||
|
// lazily populate the cache.
|
||||||
|
return response || fetch(event.request).then((response) => {
|
||||||
|
cache.put(event.request, response.clone());
|
||||||
|
return response;
|
||||||
|
});
|
||||||
|
})
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
self.addEventListener('message', (event) => {
|
||||||
|
// SkipWaiting can be used to immediately activate a waiting service worker.
|
||||||
|
// This will also require a page refresh triggered by the main worker.
|
||||||
|
if (event.data === 'skipWaiting') {
|
||||||
|
self.skipWaiting();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (event.data === 'downloadOffline') {
|
||||||
|
downloadOffline();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Download offline will check the RESOURCES for all files not in the cache
|
||||||
|
// and populate them.
|
||||||
|
async function downloadOffline() {
|
||||||
|
var resources = [];
|
||||||
|
var contentCache = await caches.open(CACHE_NAME);
|
||||||
|
var currentContent = {};
|
||||||
|
for (var request of await contentCache.keys()) {
|
||||||
|
var key = request.url.substring(origin.length + 1);
|
||||||
|
if (key == "") {
|
||||||
|
key = "/";
|
||||||
|
}
|
||||||
|
currentContent[key] = true;
|
||||||
|
}
|
||||||
|
for (var resourceKey of Object.keys(RESOURCES)) {
|
||||||
|
if (!currentContent[resourceKey]) {
|
||||||
|
resources.push(resourceKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return contentCache.addAll(resources);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Attempt to download the resource online before falling back to
|
||||||
|
// the offline cache.
|
||||||
|
function onlineFirst(event) {
|
||||||
|
return event.respondWith(
|
||||||
|
fetch(event.request).then((response) => {
|
||||||
|
return caches.open(CACHE_NAME).then((cache) => {
|
||||||
|
cache.put(event.request, response.clone());
|
||||||
|
return response;
|
||||||
|
});
|
||||||
|
}).catch((error) => {
|
||||||
|
return caches.open(CACHE_NAME).then((cache) => {
|
||||||
|
return cache.match(event.request).then((response) => {
|
||||||
|
if (response != null) {
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
throw error;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
BIN
RELEASE/Version1_2/WEB/icons/Icon-192.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
RELEASE/Version1_2/WEB/icons/Icon-512.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
98
RELEASE/Version1_2/WEB/index.html
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<!--
|
||||||
|
If you are serving your web app in a path other than the root, change the
|
||||||
|
href value below to reflect the base path you are serving from.
|
||||||
|
|
||||||
|
The path provided below has to start and end with a slash "/" in order for
|
||||||
|
it to work correctly.
|
||||||
|
|
||||||
|
For more details:
|
||||||
|
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
|
||||||
|
-->
|
||||||
|
<base href="/">
|
||||||
|
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
|
||||||
|
<meta name="description" content="A new Flutter application.">
|
||||||
|
|
||||||
|
<!-- iOS meta tags & icons -->
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||||
|
<meta name="apple-mobile-web-app-title" content="manager_app">
|
||||||
|
<link rel="apple-touch-icon" href="icons/Icon-192.png">
|
||||||
|
|
||||||
|
<title>manager_app</title>
|
||||||
|
<link rel="manifest" href="manifest.json">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!-- This script installs service_worker.js to provide PWA functionality to
|
||||||
|
application. For more information, see:
|
||||||
|
https://developers.google.com/web/fundamentals/primers/service-workers -->
|
||||||
|
<script>
|
||||||
|
var serviceWorkerVersion = '3113084897';
|
||||||
|
var scriptLoaded = false;
|
||||||
|
function loadMainDartJs() {
|
||||||
|
if (scriptLoaded) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
scriptLoaded = true;
|
||||||
|
var scriptTag = document.createElement('script');
|
||||||
|
scriptTag.src = 'main.dart.js';
|
||||||
|
scriptTag.type = 'application/javascript';
|
||||||
|
document.body.append(scriptTag);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ('serviceWorker' in navigator) {
|
||||||
|
// Service workers are supported. Use them.
|
||||||
|
window.addEventListener('load', function () {
|
||||||
|
// Wait for registration to finish before dropping the <script> tag.
|
||||||
|
// Otherwise, the browser will load the script multiple times,
|
||||||
|
// potentially different versions.
|
||||||
|
var serviceWorkerUrl = 'flutter_service_worker.js?v=' + serviceWorkerVersion;
|
||||||
|
navigator.serviceWorker.register(serviceWorkerUrl)
|
||||||
|
.then((reg) => {
|
||||||
|
function waitForActivation(serviceWorker) {
|
||||||
|
serviceWorker.addEventListener('statechange', () => {
|
||||||
|
if (serviceWorker.state == 'activated') {
|
||||||
|
console.log('Installed new service worker.');
|
||||||
|
loadMainDartJs();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (!reg.active && (reg.installing || reg.waiting)) {
|
||||||
|
// No active web worker and we have installed or are installing
|
||||||
|
// one for the first time. Simply wait for it to activate.
|
||||||
|
waitForActivation(reg.installing ?? reg.waiting);
|
||||||
|
} else if (!reg.active.scriptURL.endsWith(serviceWorkerVersion)) {
|
||||||
|
// When the app updates the serviceWorkerVersion changes, so we
|
||||||
|
// need to ask the service worker to update.
|
||||||
|
console.log('New service worker available.');
|
||||||
|
reg.update();
|
||||||
|
waitForActivation(reg.installing);
|
||||||
|
} else {
|
||||||
|
// Existing service worker is still good.
|
||||||
|
console.log('Loading app from service worker.');
|
||||||
|
loadMainDartJs();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// If service worker doesn't succeed in a reasonable amount of time,
|
||||||
|
// fallback to plaint <script> tag.
|
||||||
|
setTimeout(() => {
|
||||||
|
if (!scriptLoaded) {
|
||||||
|
console.warn(
|
||||||
|
'Failed to load app from service worker. Falling back to plain <script> tag.',
|
||||||
|
);
|
||||||
|
loadMainDartJs();
|
||||||
|
}
|
||||||
|
}, 4000);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Service workers not supported. Just drop the <script> tag.
|
||||||
|
loadMainDartJs();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
98393
RELEASE/Version1_2/WEB/main.dart.js
Normal file
23
RELEASE/Version1_2/WEB/manifest.json
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"name": "manager_app",
|
||||||
|
"short_name": "manager_app",
|
||||||
|
"start_url": ".",
|
||||||
|
"display": "standalone",
|
||||||
|
"background_color": "#0175C2",
|
||||||
|
"theme_color": "#0175C2",
|
||||||
|
"description": "A new Flutter application.",
|
||||||
|
"orientation": "portrait-primary",
|
||||||
|
"prefer_related_applications": false,
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "icons/Icon-192.png",
|
||||||
|
"sizes": "192x192",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "icons/Icon-512.png",
|
||||||
|
"sizes": "512x512",
|
||||||
|
"type": "image/png"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
1
RELEASE/Version1_2/WEB/version.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"app_name":"manager_app","version":"1.0.0","build_number":"1"}
|
||||||
1
RELEASE/Version1_3/Changelog.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
Ajout du Module quizz
|
||||||
26
RELEASE/Version1_3/How to deploy.txt
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
- Create BAK folder !!
|
||||||
|
- FTP fichiers vers rpi (home/Manager_app)
|
||||||
|
- puis mv -v /home/ubuntu/Manager_app/* /var/www/html/manager/
|
||||||
|
- Changer nginx : etc/nginx/sites-enabled
|
||||||
|
- Changer le port du service vers le 5002
|
||||||
|
- Ajouter ou décommenter (check addresse ip):
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 8080;
|
||||||
|
listen [::]:8080;
|
||||||
|
|
||||||
|
server_name 192.168.31.96;
|
||||||
|
|
||||||
|
root /var/www/html/manager;
|
||||||
|
index index.html;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ =404;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
- Tester nginx : sudo nginx -t
|
||||||
|
- Reload nginx : sudo systemctl reload nginx
|
||||||
|
|
||||||
|
Connect manager via http://192.168.1.19:8089 => Si pas ça, peut aller changer dans le main.dart.js puis faire un CTRL MAJ R
|
||||||
1
RELEASE/Version1_3/WEB/.last_build_id
Normal file
@ -0,0 +1 @@
|
|||||||
|
2850532bac056cc3a4316af3c232a077
|
||||||
1
RELEASE/Version1_3/WEB/assets/AssetManifest.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"assets/animations/MDLF_animation.flr":["assets/animations/MDLF_animation.flr"],"assets/files/session.json":["assets/files/session.json"],"packages/cupertino_icons/assets/CupertinoIcons.ttf":["packages/cupertino_icons/assets/CupertinoIcons.ttf"]}
|
||||||
1
RELEASE/Version1_3/WEB/assets/FontManifest.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
[{"family":"MaterialIcons","fonts":[{"asset":"fonts/MaterialIcons-Regular.otf"}]},{"family":"packages/cupertino_icons/CupertinoIcons","fonts":[{"asset":"packages/cupertino_icons/assets/CupertinoIcons.ttf"}]}]
|
||||||
16755
RELEASE/Version1_3/WEB/assets/NOTICES
Normal file
BIN
RELEASE/Version1_3/WEB/assets/fonts/MaterialIcons-Regular.otf
Normal file
BIN
RELEASE/Version1_3/WEB/favicon.png
Normal file
|
After Width: | Height: | Size: 917 B |
219
RELEASE/Version1_3/WEB/flutter_service_worker.js
Normal file
@ -0,0 +1,219 @@
|
|||||||
|
'use strict';
|
||||||
|
const MANIFEST = 'flutter-app-manifest';
|
||||||
|
const TEMP = 'flutter-temp-cache';
|
||||||
|
const CACHE_NAME = 'flutter-app-cache';
|
||||||
|
const RESOURCES = {
|
||||||
|
"assets/AssetManifest.json": "7ceda6dd13738309d0b4d4d2702b3010",
|
||||||
|
"assets/assets/animations/MDLF_animation.flr": "5151e91ce20a70dbc097f01a7ec97497",
|
||||||
|
"assets/assets/files/session.json": "d41d8cd98f00b204e9800998ecf8427e",
|
||||||
|
"assets/FontManifest.json": "dc3d03800ccca4601324923c0b1d6d57",
|
||||||
|
"assets/fonts/MaterialIcons-Regular.otf": "4e6447691c9509f7acdbf8a931a85ca1",
|
||||||
|
"assets/NOTICES": "838205c3fa2fbd0319ce48d7c8347af6",
|
||||||
|
"assets/packages/cupertino_icons/assets/CupertinoIcons.ttf": "6d342eb68f170c97609e9da345464e5e",
|
||||||
|
"favicon.png": "5dcef449791fa27946b3d35ad8803796",
|
||||||
|
"icons/android-icon-144x144.png": "25849c1de85e1ac87dfde295a6c97dfe",
|
||||||
|
"icons/android-icon-192x192.png": "2f38b513d97a00ddf494059260c193b5",
|
||||||
|
"icons/android-icon-36x36.png": "5317b23569b5976037738ae5dec04859",
|
||||||
|
"icons/android-icon-48x48.png": "1f7a48a32ed8b3d4c1e6fa7734534fc7",
|
||||||
|
"icons/android-icon-72x72.png": "6db0636ec0c228480197e362f3f32fe5",
|
||||||
|
"icons/android-icon-96x96.png": "d925090c0a2f6b1a24078a8640fb18e4",
|
||||||
|
"icons/apple-icon-114x114.png": "ddd67f65d43fb30b64ebf7b3ff702427",
|
||||||
|
"icons/apple-icon-120x120.png": "b6bee39cb32e80068c5e1e87c600ffbc",
|
||||||
|
"icons/apple-icon-144x144.png": "25849c1de85e1ac87dfde295a6c97dfe",
|
||||||
|
"icons/apple-icon-152x152.png": "42b1ae2dedce452961803388468d6eae",
|
||||||
|
"icons/apple-icon-180x180.png": "17655db1c0eaff334ff6208d302a576a",
|
||||||
|
"icons/apple-icon-57x57.png": "ffd9c2b4dfe93b5874edbef7a3829495",
|
||||||
|
"icons/apple-icon-60x60.png": "5984c1c3aca2b357f604855446cf30f5",
|
||||||
|
"icons/apple-icon-72x72.png": "6db0636ec0c228480197e362f3f32fe5",
|
||||||
|
"icons/apple-icon-76x76.png": "45bb7aabc4d7211f0ee13c77e6300ec4",
|
||||||
|
"icons/apple-icon-precomposed.png": "9cd7f52d632b4bb32f3b701eed4ec663",
|
||||||
|
"icons/apple-icon.png": "9cd7f52d632b4bb32f3b701eed4ec663",
|
||||||
|
"icons/browserconfig.xml": "653d077300a12f09a69caeea7a8947f8",
|
||||||
|
"icons/favicon-16x16.png": "4fca1fd9f6c90305df787a99fe7abf62",
|
||||||
|
"icons/favicon-32x32.png": "e78cf52bb5861c5829d6f2b63e0f703e",
|
||||||
|
"icons/favicon-96x96.png": "91b367951bf21712259a3aa598456d29",
|
||||||
|
"icons/favicon.ico": "941f61fe5dd76ff538f9fd9456705d7a",
|
||||||
|
"icons/Icon-192.png": "ac9a721a12bbc803b44f645561ecb1e1",
|
||||||
|
"icons/Icon-512.png": "96e752610906ba2a93c65f8abe1645f1",
|
||||||
|
"icons/manifest.json": "b58fcfa7628c9205cb11a1b2c3e8f99a",
|
||||||
|
"icons/ms-icon-144x144.png": "7f185a22f8c85fb7ccd97cd7711214e5",
|
||||||
|
"icons/ms-icon-150x150.png": "5e33aababf68472e0bcc89c752e33fec",
|
||||||
|
"icons/ms-icon-310x310.png": "9eace62e32aec3853604ae2919eca0ea",
|
||||||
|
"icons/ms-icon-70x70.png": "6720855c40d6a5ba6cd4a384605fc270",
|
||||||
|
"index.html": "b934f3f00758439d39e79bff55598ca7",
|
||||||
|
"/": "b934f3f00758439d39e79bff55598ca7",
|
||||||
|
"main.dart.js": "d92d406acbbcdeb9b4675562b75a0cd3",
|
||||||
|
"manifest.json": "2ea69ab3cf494be775c9c65d32512a45",
|
||||||
|
"version.json": "c659aa18797537bf2ce076aa3126b86e"
|
||||||
|
};
|
||||||
|
|
||||||
|
// The application shell files that are downloaded before a service worker can
|
||||||
|
// start.
|
||||||
|
const CORE = [
|
||||||
|
"/",
|
||||||
|
"main.dart.js",
|
||||||
|
"index.html",
|
||||||
|
"assets/NOTICES",
|
||||||
|
"assets/AssetManifest.json",
|
||||||
|
"assets/FontManifest.json"];
|
||||||
|
// During install, the TEMP cache is populated with the application shell files.
|
||||||
|
self.addEventListener("install", (event) => {
|
||||||
|
self.skipWaiting();
|
||||||
|
return event.waitUntil(
|
||||||
|
caches.open(TEMP).then((cache) => {
|
||||||
|
return cache.addAll(
|
||||||
|
CORE.map((value) => new Request(value, {'cache': 'reload'})));
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
// During activate, the cache is populated with the temp files downloaded in
|
||||||
|
// install. If this service worker is upgrading from one with a saved
|
||||||
|
// MANIFEST, then use this to retain unchanged resource files.
|
||||||
|
self.addEventListener("activate", function(event) {
|
||||||
|
return event.waitUntil(async function() {
|
||||||
|
try {
|
||||||
|
var contentCache = await caches.open(CACHE_NAME);
|
||||||
|
var tempCache = await caches.open(TEMP);
|
||||||
|
var manifestCache = await caches.open(MANIFEST);
|
||||||
|
var manifest = await manifestCache.match('manifest');
|
||||||
|
// When there is no prior manifest, clear the entire cache.
|
||||||
|
if (!manifest) {
|
||||||
|
await caches.delete(CACHE_NAME);
|
||||||
|
contentCache = await caches.open(CACHE_NAME);
|
||||||
|
for (var request of await tempCache.keys()) {
|
||||||
|
var response = await tempCache.match(request);
|
||||||
|
await contentCache.put(request, response);
|
||||||
|
}
|
||||||
|
await caches.delete(TEMP);
|
||||||
|
// Save the manifest to make future upgrades efficient.
|
||||||
|
await manifestCache.put('manifest', new Response(JSON.stringify(RESOURCES)));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var oldManifest = await manifest.json();
|
||||||
|
var origin = self.location.origin;
|
||||||
|
for (var request of await contentCache.keys()) {
|
||||||
|
var key = request.url.substring(origin.length + 1);
|
||||||
|
if (key == "") {
|
||||||
|
key = "/";
|
||||||
|
}
|
||||||
|
// If a resource from the old manifest is not in the new cache, or if
|
||||||
|
// the MD5 sum has changed, delete it. Otherwise the resource is left
|
||||||
|
// in the cache and can be reused by the new service worker.
|
||||||
|
if (!RESOURCES[key] || RESOURCES[key] != oldManifest[key]) {
|
||||||
|
await contentCache.delete(request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Populate the cache with the app shell TEMP files, potentially overwriting
|
||||||
|
// cache files preserved above.
|
||||||
|
for (var request of await tempCache.keys()) {
|
||||||
|
var response = await tempCache.match(request);
|
||||||
|
await contentCache.put(request, response);
|
||||||
|
}
|
||||||
|
await caches.delete(TEMP);
|
||||||
|
// Save the manifest to make future upgrades efficient.
|
||||||
|
await manifestCache.put('manifest', new Response(JSON.stringify(RESOURCES)));
|
||||||
|
return;
|
||||||
|
} catch (err) {
|
||||||
|
// On an unhandled exception the state of the cache cannot be guaranteed.
|
||||||
|
console.error('Failed to upgrade service worker: ' + err);
|
||||||
|
await caches.delete(CACHE_NAME);
|
||||||
|
await caches.delete(TEMP);
|
||||||
|
await caches.delete(MANIFEST);
|
||||||
|
}
|
||||||
|
}());
|
||||||
|
});
|
||||||
|
|
||||||
|
// The fetch handler redirects requests for RESOURCE files to the service
|
||||||
|
// worker cache.
|
||||||
|
self.addEventListener("fetch", (event) => {
|
||||||
|
if (event.request.method !== 'GET') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var origin = self.location.origin;
|
||||||
|
var key = event.request.url.substring(origin.length + 1);
|
||||||
|
// Redirect URLs to the index.html
|
||||||
|
if (key.indexOf('?v=') != -1) {
|
||||||
|
key = key.split('?v=')[0];
|
||||||
|
}
|
||||||
|
if (event.request.url == origin || event.request.url.startsWith(origin + '/#') || key == '') {
|
||||||
|
key = '/';
|
||||||
|
}
|
||||||
|
// If the URL is not the RESOURCE list then return to signal that the
|
||||||
|
// browser should take over.
|
||||||
|
if (!RESOURCES[key]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// If the URL is the index.html, perform an online-first request.
|
||||||
|
if (key == '/') {
|
||||||
|
return onlineFirst(event);
|
||||||
|
}
|
||||||
|
event.respondWith(caches.open(CACHE_NAME)
|
||||||
|
.then((cache) => {
|
||||||
|
return cache.match(event.request).then((response) => {
|
||||||
|
// Either respond with the cached resource, or perform a fetch and
|
||||||
|
// lazily populate the cache.
|
||||||
|
return response || fetch(event.request).then((response) => {
|
||||||
|
cache.put(event.request, response.clone());
|
||||||
|
return response;
|
||||||
|
});
|
||||||
|
})
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
self.addEventListener('message', (event) => {
|
||||||
|
// SkipWaiting can be used to immediately activate a waiting service worker.
|
||||||
|
// This will also require a page refresh triggered by the main worker.
|
||||||
|
if (event.data === 'skipWaiting') {
|
||||||
|
self.skipWaiting();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (event.data === 'downloadOffline') {
|
||||||
|
downloadOffline();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Download offline will check the RESOURCES for all files not in the cache
|
||||||
|
// and populate them.
|
||||||
|
async function downloadOffline() {
|
||||||
|
var resources = [];
|
||||||
|
var contentCache = await caches.open(CACHE_NAME);
|
||||||
|
var currentContent = {};
|
||||||
|
for (var request of await contentCache.keys()) {
|
||||||
|
var key = request.url.substring(origin.length + 1);
|
||||||
|
if (key == "") {
|
||||||
|
key = "/";
|
||||||
|
}
|
||||||
|
currentContent[key] = true;
|
||||||
|
}
|
||||||
|
for (var resourceKey of Object.keys(RESOURCES)) {
|
||||||
|
if (!currentContent[resourceKey]) {
|
||||||
|
resources.push(resourceKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return contentCache.addAll(resources);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Attempt to download the resource online before falling back to
|
||||||
|
// the offline cache.
|
||||||
|
function onlineFirst(event) {
|
||||||
|
return event.respondWith(
|
||||||
|
fetch(event.request).then((response) => {
|
||||||
|
return caches.open(CACHE_NAME).then((cache) => {
|
||||||
|
cache.put(event.request, response.clone());
|
||||||
|
return response;
|
||||||
|
});
|
||||||
|
}).catch((error) => {
|
||||||
|
return caches.open(CACHE_NAME).then((cache) => {
|
||||||
|
return cache.match(event.request).then((response) => {
|
||||||
|
if (response != null) {
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
throw error;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
BIN
RELEASE/Version1_3/WEB/icons/Icon-192.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
RELEASE/Version1_3/WEB/icons/Icon-512.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
BIN
RELEASE/Version1_3/WEB/icons/android-icon-144x144.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
RELEASE/Version1_3/WEB/icons/android-icon-192x192.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
RELEASE/Version1_3/WEB/icons/android-icon-36x36.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
RELEASE/Version1_3/WEB/icons/android-icon-48x48.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
RELEASE/Version1_3/WEB/icons/android-icon-72x72.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
RELEASE/Version1_3/WEB/icons/android-icon-96x96.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
RELEASE/Version1_3/WEB/icons/apple-icon-114x114.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
RELEASE/Version1_3/WEB/icons/apple-icon-120x120.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
RELEASE/Version1_3/WEB/icons/apple-icon-144x144.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
RELEASE/Version1_3/WEB/icons/apple-icon-152x152.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
BIN
RELEASE/Version1_3/WEB/icons/apple-icon-180x180.png
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
RELEASE/Version1_3/WEB/icons/apple-icon-57x57.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
RELEASE/Version1_3/WEB/icons/apple-icon-60x60.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
RELEASE/Version1_3/WEB/icons/apple-icon-72x72.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
RELEASE/Version1_3/WEB/icons/apple-icon-76x76.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
RELEASE/Version1_3/WEB/icons/apple-icon-precomposed.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
RELEASE/Version1_3/WEB/icons/apple-icon.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
2
RELEASE/Version1_3/WEB/icons/browserconfig.xml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<browserconfig><msapplication><tile><square70x70logo src="/ms-icon-70x70.png"/><square150x150logo src="/ms-icon-150x150.png"/><square310x310logo src="/ms-icon-310x310.png"/><TileColor>#ffffff</TileColor></tile></msapplication></browserconfig>
|
||||||
BIN
RELEASE/Version1_3/WEB/icons/favicon-16x16.png
Normal file
|
After Width: | Height: | Size: 826 B |
BIN
RELEASE/Version1_3/WEB/icons/favicon-32x32.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
RELEASE/Version1_3/WEB/icons/favicon-96x96.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
RELEASE/Version1_3/WEB/icons/favicon.ico
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
41
RELEASE/Version1_3/WEB/icons/manifest.json
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"name": "App",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "\/android-icon-36x36.png",
|
||||||
|
"sizes": "36x36",
|
||||||
|
"type": "image\/png",
|
||||||
|
"density": "0.75"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "\/android-icon-48x48.png",
|
||||||
|
"sizes": "48x48",
|
||||||
|
"type": "image\/png",
|
||||||
|
"density": "1.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "\/android-icon-72x72.png",
|
||||||
|
"sizes": "72x72",
|
||||||
|
"type": "image\/png",
|
||||||
|
"density": "1.5"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "\/android-icon-96x96.png",
|
||||||
|
"sizes": "96x96",
|
||||||
|
"type": "image\/png",
|
||||||
|
"density": "2.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "\/android-icon-144x144.png",
|
||||||
|
"sizes": "144x144",
|
||||||
|
"type": "image\/png",
|
||||||
|
"density": "3.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "\/android-icon-192x192.png",
|
||||||
|
"sizes": "192x192",
|
||||||
|
"type": "image\/png",
|
||||||
|
"density": "4.0"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
BIN
RELEASE/Version1_3/WEB/icons/ms-icon-144x144.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
RELEASE/Version1_3/WEB/icons/ms-icon-150x150.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
RELEASE/Version1_3/WEB/icons/ms-icon-310x310.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
RELEASE/Version1_3/WEB/icons/ms-icon-70x70.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
115
RELEASE/Version1_3/WEB/index.html
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<!--
|
||||||
|
If you are serving your web app in a path other than the root, change the
|
||||||
|
href value below to reflect the base path you are serving from.
|
||||||
|
|
||||||
|
The path provided below has to start and end with a slash "/" in order for
|
||||||
|
it to work correctly.
|
||||||
|
|
||||||
|
For more details:
|
||||||
|
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
|
||||||
|
-->
|
||||||
|
<base href="/">
|
||||||
|
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
|
||||||
|
<meta name="description" content="A new Flutter application.">
|
||||||
|
|
||||||
|
<!-- iOS meta tags & icons -->
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||||
|
<meta name="apple-mobile-web-app-title" content="manager_app">
|
||||||
|
<link rel="apple-touch-icon" href="icons/Icon-192.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="57x57" href="icons/apple-icon-57x57.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="60x60" href="icons/apple-icon-60x60.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="72x72" href="icons/apple-icon-72x72.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="76x76" href="icons/apple-icon-76x76.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="114x114" href="icons/apple-icon-114x114.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="120x120" href="icons/apple-icon-120x120.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="144x144" href="icons/apple-icon-144x144.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="152x152" href="icons/apple-icon-152x152.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="180x180" href="icons/apple-icon-180x180.png">
|
||||||
|
<link rel="icon" type="image/png" sizes="192x192" href="icons/android-icon-192x192.png">
|
||||||
|
<link rel="icon" type="image/png" sizes="32x32" href="icons/favicon-32x32.png">
|
||||||
|
<link rel="icon" type="image/png" sizes="96x96" href="icons/favicon-96x96.png">
|
||||||
|
<link rel="icon" type="image/png" sizes="16x16" href="icons/favicon-16x16.png">
|
||||||
|
<link rel="manifest" href="/manifest.json">
|
||||||
|
<meta name="msapplication-TileColor" content="#ffffff">
|
||||||
|
<meta name="msapplication-TileImage" content="icons/ms-icon-144x144.png">
|
||||||
|
<meta name="theme-color" content="#ffffff">
|
||||||
|
|
||||||
|
<title>manager_app</title>
|
||||||
|
<link rel="manifest" href="manifest.json">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!-- This script installs service_worker.js to provide PWA functionality to
|
||||||
|
application. For more information, see:
|
||||||
|
https://developers.google.com/web/fundamentals/primers/service-workers -->
|
||||||
|
<script>
|
||||||
|
var serviceWorkerVersion = '3552968134';
|
||||||
|
var scriptLoaded = false;
|
||||||
|
function loadMainDartJs() {
|
||||||
|
if (scriptLoaded) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
scriptLoaded = true;
|
||||||
|
var scriptTag = document.createElement('script');
|
||||||
|
scriptTag.src = 'main.dart.js';
|
||||||
|
scriptTag.type = 'application/javascript';
|
||||||
|
document.body.append(scriptTag);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ('serviceWorker' in navigator) {
|
||||||
|
// Service workers are supported. Use them.
|
||||||
|
window.addEventListener('load', function () {
|
||||||
|
// Wait for registration to finish before dropping the <script> tag.
|
||||||
|
// Otherwise, the browser will load the script multiple times,
|
||||||
|
// potentially different versions.
|
||||||
|
var serviceWorkerUrl = 'flutter_service_worker.js?v=' + serviceWorkerVersion;
|
||||||
|
navigator.serviceWorker.register(serviceWorkerUrl)
|
||||||
|
.then((reg) => {
|
||||||
|
function waitForActivation(serviceWorker) {
|
||||||
|
serviceWorker.addEventListener('statechange', () => {
|
||||||
|
if (serviceWorker.state == 'activated') {
|
||||||
|
console.log('Installed new service worker.');
|
||||||
|
loadMainDartJs();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (!reg.active && (reg.installing || reg.waiting)) {
|
||||||
|
// No active web worker and we have installed or are installing
|
||||||
|
// one for the first time. Simply wait for it to activate.
|
||||||
|
waitForActivation(reg.installing ?? reg.waiting);
|
||||||
|
} else if (!reg.active.scriptURL.endsWith(serviceWorkerVersion)) {
|
||||||
|
// When the app updates the serviceWorkerVersion changes, so we
|
||||||
|
// need to ask the service worker to update.
|
||||||
|
console.log('New service worker available.');
|
||||||
|
reg.update();
|
||||||
|
waitForActivation(reg.installing);
|
||||||
|
} else {
|
||||||
|
// Existing service worker is still good.
|
||||||
|
console.log('Loading app from service worker.');
|
||||||
|
loadMainDartJs();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// If service worker doesn't succeed in a reasonable amount of time,
|
||||||
|
// fallback to plaint <script> tag.
|
||||||
|
setTimeout(() => {
|
||||||
|
if (!scriptLoaded) {
|
||||||
|
console.warn(
|
||||||
|
'Failed to load app from service worker. Falling back to plain <script> tag.',
|
||||||
|
);
|
||||||
|
loadMainDartJs();
|
||||||
|
}
|
||||||
|
}, 4000);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Service workers not supported. Just drop the <script> tag.
|
||||||
|
loadMainDartJs();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
101782
RELEASE/Version1_3/WEB/main.dart.js
Normal file
59
RELEASE/Version1_3/WEB/manifest.json
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
{
|
||||||
|
"name": "Manager app",
|
||||||
|
"short_name": "Manager_app",
|
||||||
|
"start_url": ".",
|
||||||
|
"display": "standalone",
|
||||||
|
"background_color": "#0175C2",
|
||||||
|
"theme_color": "#0175C2",
|
||||||
|
"description": "Manager application for MDLF",
|
||||||
|
"orientation": "portrait-primary",
|
||||||
|
"prefer_related_applications": false,
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "icons/android-icon-36x36.png",
|
||||||
|
"sizes": "36x36",
|
||||||
|
"type": "image/png",
|
||||||
|
"density": "0.75"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "icons/android-icon-48x48.png",
|
||||||
|
"sizes": "48x48",
|
||||||
|
"type": "image/png",
|
||||||
|
"density": "1.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "icons/android-icon-72x72.png",
|
||||||
|
"sizes": "72x72",
|
||||||
|
"type": "image/png",
|
||||||
|
"density": "1.5"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "icons/android-icon-96x96.png",
|
||||||
|
"sizes": "96x96",
|
||||||
|
"type": "image/png",
|
||||||
|
"density": "2.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "icons/android-icon-144x144.png",
|
||||||
|
"sizes": "144x144",
|
||||||
|
"type": "image/png",
|
||||||
|
"density": "3.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "icons/android-icon-192x192.png",
|
||||||
|
"sizes": "192x192",
|
||||||
|
"type": "image/png",
|
||||||
|
"density": "4.0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "icons/Icon-192.png",
|
||||||
|
"sizes": "192x192",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "icons/Icon-512.png",
|
||||||
|
"sizes": "512x512",
|
||||||
|
"type": "image/png"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
1
RELEASE/Version1_3/WEB/version.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"app_name":"manager_app","version":"1.0.0","build_number":"1","package_name":"manager_app"}
|
||||||
@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_colorpicker/flutter_colorpicker.dart';
|
import 'package:flutter_colorpicker/flutter_colorpicker.dart';
|
||||||
import 'package:manager_app/Components/rounded_button.dart';
|
import 'package:manager_app/Components/rounded_button.dart';
|
||||||
|
|
||||||
|
import '../constants.dart';
|
||||||
|
|
||||||
showColorPicker (Color currentColor, Function onSelect, BuildContext context) {
|
showColorPicker (Color currentColor, Function onSelect, BuildContext context) {
|
||||||
|
|
||||||
Color pickerColor = currentColor;
|
Color pickerColor = currentColor;
|
||||||
@ -39,7 +41,7 @@ showColorPicker (Color currentColor, Function onSelect, BuildContext context) {
|
|||||||
child: RoundedButton(
|
child: RoundedButton(
|
||||||
text: "Valider",
|
text: "Valider",
|
||||||
icon: Icons.check,
|
icon: Icons.check,
|
||||||
color: Colors.lightGreen,
|
color: kSuccess,
|
||||||
press: () {
|
press: () {
|
||||||
onSelect(pickerColor);
|
onSelect(pickerColor);
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
|
|||||||
@ -18,6 +18,9 @@ IconData getSectionIcon(elementType) {
|
|||||||
case SectionType.menu:
|
case SectionType.menu:
|
||||||
return Icons.apps_sharp;
|
return Icons.apps_sharp;
|
||||||
break;
|
break;
|
||||||
|
case SectionType.quizz:
|
||||||
|
return Icons.question_answer;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return Icons.menu;
|
return Icons.menu;
|
||||||
}
|
}
|
||||||
@ -84,7 +84,8 @@ class _ImageInputContainerState extends State<ImageInputContainer> {
|
|||||||
future: getResource(resourceIdToShow, appContext),
|
future: getResource(resourceIdToShow, appContext),
|
||||||
builder: (context, AsyncSnapshot<dynamic> snapshot) {
|
builder: (context, AsyncSnapshot<dynamic> snapshot) {
|
||||||
if (snapshot.connectionState == ConnectionState.done) {
|
if (snapshot.connectionState == ConnectionState.done) {
|
||||||
return Transform.scale(
|
if (snapshot.data != null) {
|
||||||
|
return Transform.scale(
|
||||||
scale: isSmall ? size.aspectRatio * 0.5: size.aspectRatio * 0.9,
|
scale: isSmall ? size.aspectRatio * 0.5: size.aspectRatio * 0.9,
|
||||||
child: AspectRatio(
|
child: AspectRatio(
|
||||||
aspectRatio: 4/4,
|
aspectRatio: 4/4,
|
||||||
@ -93,6 +94,10 @@ class _ImageInputContainerState extends State<ImageInputContainer> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
return Text("No data");
|
||||||
|
}
|
||||||
|
|
||||||
} else if (snapshot.connectionState == ConnectionState.none) {
|
} else if (snapshot.connectionState == ConnectionState.none) {
|
||||||
return Text("No data");
|
return Text("No data");
|
||||||
} else {
|
} else {
|
||||||
@ -137,9 +142,9 @@ class _ImageInputContainerState extends State<ImageInputContainer> {
|
|||||||
borderRadius: BorderRadius.circular(30.0),
|
borderRadius: BorderRadius.circular(30.0),
|
||||||
image: new DecorationImage(
|
image: new DecorationImage(
|
||||||
fit: widget.imageFit,
|
fit: widget.imageFit,
|
||||||
image: new NetworkImage(
|
image: resourceDTO.type != null ? new NetworkImage(
|
||||||
resourceDTO.type == ResourceType.image ? appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ resourceDTO.id : resourceDTO.data,
|
resourceDTO.type == ResourceType.image ? appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ resourceDTO.id : resourceDTO.data,
|
||||||
),
|
) : null,
|
||||||
),
|
),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
|
|||||||
@ -10,12 +10,17 @@ showNotification (Color backgroundColor, Color textColor, String text, BuildCont
|
|||||||
borderRadius: BorderRadius.circular(10.0),
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
),
|
),
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 8.0, // Inner padding for SnackBar content.
|
horizontal: 10.0, // Inner padding for SnackBar content.
|
||||||
),
|
),
|
||||||
content: Text(
|
content: Container(
|
||||||
text,
|
height: 32.5,
|
||||||
textAlign: TextAlign.center,
|
child: Center(
|
||||||
style: TextStyle(color: textColor),
|
child: Text(
|
||||||
|
text,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(color: textColor),
|
||||||
|
),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
||||||
|
|||||||
@ -7,6 +7,8 @@ class RoundedButton extends StatelessWidget {
|
|||||||
final IconData icon;
|
final IconData icon;
|
||||||
final Color color, textColor;
|
final Color color, textColor;
|
||||||
final double fontSize;
|
final double fontSize;
|
||||||
|
final int vertical;
|
||||||
|
final int horizontal;
|
||||||
|
|
||||||
const RoundedButton({
|
const RoundedButton({
|
||||||
Key key,
|
Key key,
|
||||||
@ -15,7 +17,9 @@ class RoundedButton extends StatelessWidget {
|
|||||||
this.icon,
|
this.icon,
|
||||||
this.color = kPrimaryColor,
|
this.color = kPrimaryColor,
|
||||||
this.textColor = kWhite,
|
this.textColor = kWhite,
|
||||||
this.fontSize
|
this.fontSize,
|
||||||
|
this.vertical,
|
||||||
|
this.horizontal
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -23,7 +27,7 @@ class RoundedButton extends StatelessWidget {
|
|||||||
//Size size = MediaQuery.of(context).size;
|
//Size size = MediaQuery.of(context).size;
|
||||||
return TextButton(
|
return TextButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
padding: MaterialStateProperty.resolveWith((states) => EdgeInsets.symmetric(vertical: 25, horizontal: icon == null ? 85 : 30)),
|
padding: MaterialStateProperty.resolveWith((states) => EdgeInsets.symmetric(vertical: this.vertical != null ? this.vertical : 25, horizontal: this.horizontal != null ? this.horizontal : (icon == null ? 85 : 30))),
|
||||||
backgroundColor: MaterialStateColor.resolveWith((states) => color),
|
backgroundColor: MaterialStateColor.resolveWith((states) => color),
|
||||||
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
|
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
|
||||||
RoundedRectangleBorder(
|
RoundedRectangleBorder(
|
||||||
|
|||||||
@ -80,7 +80,7 @@ class _UploadImageContainerState extends State<UploadImageContainer> with Single
|
|||||||
}
|
}
|
||||||
/*final file = OpenFilePicker()
|
/*final file = OpenFilePicker()
|
||||||
..filterSpecification = {
|
..filterSpecification = {
|
||||||
'Images (*.jpg; *.png)': '*.jpg;*.png',
|
'Images (*.jpg; *.jpeg;*.png)': '*.jpg;*.jpeg;*.png',
|
||||||
//'Video (*.mp4)': '*.mp4',
|
//'Video (*.mp4)': '*.mp4',
|
||||||
//'All Files': '*.*'
|
//'All Files': '*.*'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
import 'dart:developer';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:encrypt/encrypt.dart';
|
import 'package:encrypt/encrypt.dart';
|
||||||
|
import 'package:file_picker/file_picker.dart';
|
||||||
import 'package:manager_app/Components/message_notification.dart';
|
import 'package:manager_app/Components/message_notification.dart';
|
||||||
import 'package:manager_app/Models/session.dart';
|
import 'package:manager_app/Models/session.dart';
|
||||||
import 'package:manager_app/client.dart';
|
import 'package:manager_app/client.dart';
|
||||||
@ -47,13 +49,10 @@ class FileHelper {
|
|||||||
return file.writeAsString(jsonEncode(exportConfigurationDTO.toJson()));
|
return file.writeAsString(jsonEncode(exportConfigurationDTO.toJson()));
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> importConfiguration(String path, Client client, context) async {
|
Future<void> importConfiguration(FilePickerResult filePickerResult, String path, Client client, context) async {
|
||||||
// Gets the file
|
var fileTest = filePickerResult.files[0];
|
||||||
File file = File(path);
|
String fileContent = utf8.decode(fileTest.bytes);
|
||||||
|
ExportConfigurationDTO export = ExportConfigurationDTO.fromJson(jsonDecode(fileContent));
|
||||||
final contents = await file.readAsString();
|
|
||||||
|
|
||||||
ExportConfigurationDTO export = ExportConfigurationDTO.fromJson(jsonDecode(contents));
|
|
||||||
try {
|
try {
|
||||||
String test = await client.configurationApi.configurationImport(export);
|
String test = await client.configurationApi.configurationImport(export);
|
||||||
if (test.contains("successfully")) {
|
if (test.contains("successfully")) {
|
||||||
|
|||||||
48
lib/Models/Model.dart
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
|
import 'package:password_credential/credentials.dart';
|
||||||
|
import 'package:password_credential/entity/mediation.dart';
|
||||||
|
import 'package:password_credential/entity/password_credential.dart';
|
||||||
|
import 'package:password_credential/entity/result.dart';
|
||||||
|
|
||||||
|
class Model with ChangeNotifier {
|
||||||
|
final _credentials = Credentials();
|
||||||
|
|
||||||
|
bool hasCredentialFeature = false;
|
||||||
|
var idEdit = TextEditingController();
|
||||||
|
var passwordEdit = TextEditingController();
|
||||||
|
|
||||||
|
Model() {
|
||||||
|
Future(() async {
|
||||||
|
hasCredentialFeature = await _credentials.hasCredentialFeature;
|
||||||
|
notifyListeners();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<Result> store(Mediation mediation) async {
|
||||||
|
return await _credentials.store(idEdit.text, passwordEdit.text,
|
||||||
|
mediation: mediation);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<PasswordCredential> get(Mediation mediation) async {
|
||||||
|
var credential = await _credentials.get(mediation: mediation);
|
||||||
|
if (credential != null) {
|
||||||
|
idEdit.text = credential.id;
|
||||||
|
passwordEdit.text = credential.password;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
return credential;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> delete() async {
|
||||||
|
await _credentials.delete(idEdit.text);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> preventSilentAccess() async {
|
||||||
|
await _credentials.preventSilentAccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> openPlatformCredentialSettings() async {
|
||||||
|
await _credentials.openPlatformCredentialSettings();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -115,7 +115,7 @@ class _GeoPointImageListState extends State<GeoPointImageList> {
|
|||||||
size: 30.0,
|
size: 30.0,
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.lightGreen,
|
color: kSuccess,
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
borderRadius: BorderRadius.circular(20.0),
|
borderRadius: BorderRadius.circular(20.0),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
|
|||||||
@ -159,7 +159,7 @@ class _MapConfigState extends State<MapConfig> {
|
|||||||
size: 30.0,
|
size: 30.0,
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.lightGreen,
|
color: kSuccess,
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
borderRadius: BorderRadius.circular(20.0),
|
borderRadius: BorderRadius.circular(20.0),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
|
|||||||
@ -130,7 +130,7 @@ class _MenuConfigState extends State<MenuConfig> {
|
|||||||
size: 30.0,
|
size: 30.0,
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.lightGreen,
|
color: kSuccess,
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
borderRadius: BorderRadius.circular(20.0),
|
borderRadius: BorderRadius.circular(20.0),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
|
|||||||
@ -0,0 +1,201 @@
|
|||||||
|
import 'package:auto_size_text/auto_size_text.dart';
|
||||||
|
import 'package:manager_app/Components/image_input_container.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:manager_app/Components/message_notification.dart';
|
||||||
|
import 'package:manager_app/Components/rounded_button.dart';
|
||||||
|
import 'package:manager_app/Components/text_form_input_container.dart';
|
||||||
|
import 'package:manager_app/Models/managerContext.dart';
|
||||||
|
import 'package:manager_app/Screens/Configurations/Section/SubSection/Quizz/quizz_answer_list.dart';
|
||||||
|
import 'package:manager_app/app_context.dart';
|
||||||
|
import 'package:manager_app/constants.dart';
|
||||||
|
import 'package:managerapi/api.dart';
|
||||||
|
|
||||||
|
Future<QuestionDTO> showNewOrUpdateQuestionQuizz(QuestionDTO inputQuestionDTO, AppContext appContext, BuildContext context, String text) async {
|
||||||
|
QuestionDTO questionDTO = new QuestionDTO();
|
||||||
|
|
||||||
|
if (inputQuestionDTO != null) {
|
||||||
|
questionDTO = inputQuestionDTO;
|
||||||
|
} else {
|
||||||
|
questionDTO.label = <TranslationDTO>[];
|
||||||
|
|
||||||
|
ManagerAppContext managerAppContext = appContext.getContext();
|
||||||
|
managerAppContext.selectedConfiguration.languages.forEach((element) {
|
||||||
|
var translationMessageDTO = new TranslationDTO();
|
||||||
|
translationMessageDTO.language = element;
|
||||||
|
translationMessageDTO.value = "";
|
||||||
|
|
||||||
|
questionDTO.label.add(translationMessageDTO);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if(questionDTO.responses == null) {
|
||||||
|
questionDTO.responses = <ResponseDTO>[];
|
||||||
|
}
|
||||||
|
|
||||||
|
Size size = MediaQuery.of(context).size;
|
||||||
|
var result = await showDialog(
|
||||||
|
builder: (BuildContext dialogContext) => AlertDialog(
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(20.0))
|
||||||
|
),
|
||||||
|
content: Container(
|
||||||
|
width: size.width *0.5,
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(text, style: new TextStyle(fontSize: 25, fontWeight: FontWeight.w400)),
|
||||||
|
Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Center(
|
||||||
|
child: ImageInputContainer(
|
||||||
|
label: "Image :",
|
||||||
|
initialValue: questionDTO.resourceId,
|
||||||
|
color: kPrimaryColor,
|
||||||
|
onChanged: (ResourceDTO resource) {
|
||||||
|
var result = resource;
|
||||||
|
questionDTO.source_ = result.type == ResourceType.imageUrl ? result.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ result.id;
|
||||||
|
questionDTO.resourceId = result.id;
|
||||||
|
},
|
||||||
|
isSmall: true
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
//color: Colors.orangeAccent,
|
||||||
|
height: size.height * 0.15,
|
||||||
|
width: double.infinity,
|
||||||
|
child: ListView(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
children: getTranslations(dialogContext, appContext, questionDTO),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
height: size.height * 0.33,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: kWhite,
|
||||||
|
//color: Colors.green,
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
border: Border.all(width: 1.5, color: kSecond),
|
||||||
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: kSecond,
|
||||||
|
spreadRadius: 0.5,
|
||||||
|
blurRadius: 5,
|
||||||
|
offset: Offset(0, 1.5), // changes position of shadow
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: QuizzResponseList(
|
||||||
|
responses: questionDTO.responses,
|
||||||
|
onChanged: (List<ResponseDTO> responsesOutput) {
|
||||||
|
questionDTO.responses = responsesOutput;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: <Widget>[
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
Align(
|
||||||
|
alignment: AlignmentDirectional.bottomEnd,
|
||||||
|
child: Container(
|
||||||
|
width: 175,
|
||||||
|
height: 70,
|
||||||
|
child: RoundedButton(
|
||||||
|
text: "Annuler",
|
||||||
|
icon: Icons.undo,
|
||||||
|
color: kSecond,
|
||||||
|
press: () {
|
||||||
|
Navigator.pop(dialogContext);
|
||||||
|
},
|
||||||
|
fontSize: 20,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment: AlignmentDirectional.bottomEnd,
|
||||||
|
child: Container(
|
||||||
|
width: inputQuestionDTO != null ? 220: 150,
|
||||||
|
height: 70,
|
||||||
|
child: RoundedButton(
|
||||||
|
text: inputQuestionDTO != null ? "Sauvegarder" : "Créer",
|
||||||
|
icon: Icons.check,
|
||||||
|
color: kPrimaryColor,
|
||||||
|
textColor: kWhite,
|
||||||
|
press: () {
|
||||||
|
if(!questionDTO.label.any((label) => label.value == null || label.value.trim() == "")) {
|
||||||
|
Navigator.pop(dialogContext, questionDTO);
|
||||||
|
} else {
|
||||||
|
showNotification(kPrimaryColor, kWhite, "La traduction n'est pas complète", context, null);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fontSize: 20,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
), context: context
|
||||||
|
);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
getTranslations(BuildContext context, AppContext appContext, QuestionDTO questionDTO) {
|
||||||
|
List<Widget> translations = <Widget>[];
|
||||||
|
ManagerAppContext managerAppContext = appContext.getContext();
|
||||||
|
for(var language in managerAppContext.selectedConfiguration.languages) {
|
||||||
|
translations.add(
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: MediaQuery.of(context).size.width *0.05,
|
||||||
|
height: MediaQuery.of(context).size.height *0.2,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border(
|
||||||
|
right: BorderSide(width: 1.5, color: kSecond),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Center(child: AutoSizeText(language.toUpperCase()))
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 8.0),
|
||||||
|
child: Container(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
TextFormInputContainer(
|
||||||
|
label: "Question:",
|
||||||
|
color: kWhite,
|
||||||
|
isTitle: false,
|
||||||
|
initialValue: questionDTO.label.where((element) => element.language == language).first.value,
|
||||||
|
onChanged: (value) {
|
||||||
|
questionDTO.label.where((element) => element.language == language).first.value = value;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return translations;
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,178 @@
|
|||||||
|
import 'package:auto_size_text/auto_size_text.dart';
|
||||||
|
import 'package:manager_app/Components/image_input_container.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:manager_app/Components/message_notification.dart';
|
||||||
|
import 'package:manager_app/Components/rounded_button.dart';
|
||||||
|
import 'package:manager_app/Components/text_form_input_container.dart';
|
||||||
|
import 'package:manager_app/Models/managerContext.dart';
|
||||||
|
import 'package:manager_app/app_context.dart';
|
||||||
|
import 'package:manager_app/constants.dart';
|
||||||
|
import 'package:managerapi/api.dart';
|
||||||
|
|
||||||
|
Future<ResponseDTO> showNewOrUpdateResponseQuizz(ResponseDTO inputResponseDTO, AppContext appContext, BuildContext context, String text) async {
|
||||||
|
ResponseDTO responseDTO = new ResponseDTO();
|
||||||
|
|
||||||
|
if (inputResponseDTO != null) {
|
||||||
|
responseDTO = inputResponseDTO;
|
||||||
|
} else {
|
||||||
|
responseDTO.label = <TranslationDTO>[];
|
||||||
|
|
||||||
|
ManagerAppContext managerAppContext = appContext.getContext();
|
||||||
|
managerAppContext.selectedConfiguration.languages.forEach((element) {
|
||||||
|
var translationMessageDTO = new TranslationDTO();
|
||||||
|
translationMessageDTO.language = element;
|
||||||
|
translationMessageDTO.value = "";
|
||||||
|
|
||||||
|
responseDTO.label.add(translationMessageDTO);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Size size = MediaQuery.of(context).size;
|
||||||
|
var result = await showDialog(
|
||||||
|
builder: (BuildContext dialogContext) => AlertDialog(
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(20.0))
|
||||||
|
),
|
||||||
|
content: Container(
|
||||||
|
width: size.width *0.5,
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(text, style: new TextStyle(fontSize: 25, fontWeight: FontWeight.w400)),
|
||||||
|
Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
height: size.height * 0.25,
|
||||||
|
width: double.infinity,
|
||||||
|
child: ListView(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
children: getTranslations(dialogContext, appContext, responseDTO),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
/*Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Align(
|
||||||
|
alignment: AlignmentDirectional.centerStart,
|
||||||
|
child: Text("La réponse est valide:", style: TextStyle(fontSize: 25, fontWeight: FontWeight.w300))
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Checkbox(
|
||||||
|
value: responseDTO.isGood,
|
||||||
|
checkColor: Colors.white,
|
||||||
|
activeColor: kPrimaryColor,
|
||||||
|
onChanged: (bool value) {
|
||||||
|
responseDTO.isGood = !responseDTO.isGood;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),*/
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: <Widget>[
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
Align(
|
||||||
|
alignment: AlignmentDirectional.bottomEnd,
|
||||||
|
child: Container(
|
||||||
|
width: 175,
|
||||||
|
height: 70,
|
||||||
|
child: RoundedButton(
|
||||||
|
text: "Annuler",
|
||||||
|
icon: Icons.undo,
|
||||||
|
color: kSecond,
|
||||||
|
press: () {
|
||||||
|
Navigator.pop(dialogContext);
|
||||||
|
},
|
||||||
|
fontSize: 20,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment: AlignmentDirectional.bottomEnd,
|
||||||
|
child: Container(
|
||||||
|
width: inputResponseDTO != null ? 220: 150,
|
||||||
|
height: 70,
|
||||||
|
child: RoundedButton(
|
||||||
|
text: inputResponseDTO != null ? "Sauvegarder" : "Créer",
|
||||||
|
icon: Icons.check,
|
||||||
|
color: kPrimaryColor,
|
||||||
|
textColor: kWhite,
|
||||||
|
press: () {
|
||||||
|
if(!responseDTO.label.any((label) => label.value == null || label.value.trim() == "")) {
|
||||||
|
Navigator.pop(dialogContext, responseDTO);
|
||||||
|
} else {
|
||||||
|
showNotification(kPrimaryColor, kWhite, "La traduction n'est pas complète", context, null);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fontSize: 20,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
), context: context
|
||||||
|
);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
getTranslations(BuildContext context, AppContext appContext, ResponseDTO responseDTO) {
|
||||||
|
List<Widget> translations = <Widget>[];
|
||||||
|
ManagerAppContext managerAppContext = appContext.getContext();
|
||||||
|
for(var language in managerAppContext.selectedConfiguration.languages) {
|
||||||
|
translations.add(
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: MediaQuery.of(context).size.width *0.05,
|
||||||
|
height: MediaQuery.of(context).size.height *0.2,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border(
|
||||||
|
right: BorderSide(width: 1.5, color: kSecond),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Center(child: AutoSizeText(language.toUpperCase()))
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 8.0),
|
||||||
|
child: Container(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
TextFormInputContainer(
|
||||||
|
label: "Réponse:",
|
||||||
|
color: kWhite,
|
||||||
|
isTitle: true,
|
||||||
|
initialValue: responseDTO.label.where((element) => element.language == language).first.value,
|
||||||
|
onChanged: (value) {
|
||||||
|
responseDTO.label.where((element) => element.language == language).first.value = value;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return translations;
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,166 @@
|
|||||||
|
import 'package:auto_size_text/auto_size_text.dart';
|
||||||
|
import 'package:manager_app/Components/image_input_container.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:manager_app/Components/rounded_button.dart';
|
||||||
|
import 'package:manager_app/Components/text_form_input_container.dart';
|
||||||
|
import 'package:manager_app/Models/managerContext.dart';
|
||||||
|
import 'package:manager_app/app_context.dart';
|
||||||
|
import 'package:manager_app/constants.dart';
|
||||||
|
import 'package:managerapi/api.dart';
|
||||||
|
|
||||||
|
Future<LevelDTO> showNewOrUpdateScoreQuizz(LevelDTO inputLevelDTO, AppContext appContext, BuildContext context, String text) async {
|
||||||
|
LevelDTO levelDTO = new LevelDTO();
|
||||||
|
|
||||||
|
if (inputLevelDTO != null) {
|
||||||
|
levelDTO = inputLevelDTO;
|
||||||
|
} else {
|
||||||
|
levelDTO.label = <TranslationDTO>[];
|
||||||
|
|
||||||
|
ManagerAppContext managerAppContext = appContext.getContext();
|
||||||
|
managerAppContext.selectedConfiguration.languages.forEach((element) {
|
||||||
|
var translationMessageDTO = new TranslationDTO();
|
||||||
|
translationMessageDTO.language = element;
|
||||||
|
translationMessageDTO.value = "";
|
||||||
|
|
||||||
|
levelDTO.label.add(translationMessageDTO);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Size size = MediaQuery.of(context).size;
|
||||||
|
var result = await showDialog(
|
||||||
|
builder: (BuildContext dialogContext) => AlertDialog(
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(20.0))
|
||||||
|
),
|
||||||
|
content: Container(
|
||||||
|
width: size.width *0.5,
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(text, style: new TextStyle(fontSize: 25, fontWeight: FontWeight.w400)),
|
||||||
|
Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Center(
|
||||||
|
child: ImageInputContainer(
|
||||||
|
label: "Image :",
|
||||||
|
initialValue: levelDTO.resourceId,
|
||||||
|
color: kPrimaryColor,
|
||||||
|
onChanged: (ResourceDTO resource) {
|
||||||
|
var result = resource;
|
||||||
|
levelDTO.source_ = result.type == ResourceType.imageUrl ? result.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ result.id;
|
||||||
|
levelDTO.resourceId = result.id;
|
||||||
|
},
|
||||||
|
isSmall: true
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
height: size.height * 0.33,
|
||||||
|
width: double.infinity,
|
||||||
|
child: ListView(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
children: getTranslations(dialogContext, appContext, levelDTO),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: <Widget>[
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
Align(
|
||||||
|
alignment: AlignmentDirectional.bottomEnd,
|
||||||
|
child: Container(
|
||||||
|
width: 175,
|
||||||
|
height: 70,
|
||||||
|
child: RoundedButton(
|
||||||
|
text: "Annuler",
|
||||||
|
icon: Icons.undo,
|
||||||
|
color: kSecond,
|
||||||
|
press: () {
|
||||||
|
Navigator.pop(dialogContext);
|
||||||
|
},
|
||||||
|
fontSize: 20,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment: AlignmentDirectional.bottomEnd,
|
||||||
|
child: Container(
|
||||||
|
width: inputLevelDTO != null ? 220: 150,
|
||||||
|
height: 70,
|
||||||
|
child: RoundedButton(
|
||||||
|
text: inputLevelDTO != null ? "Sauvegarder" : "Créer",
|
||||||
|
icon: Icons.check,
|
||||||
|
color: kPrimaryColor,
|
||||||
|
textColor: kWhite,
|
||||||
|
press: () {
|
||||||
|
Navigator.pop(dialogContext, levelDTO);
|
||||||
|
},
|
||||||
|
fontSize: 20,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
), context: context
|
||||||
|
);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
getTranslations(BuildContext context, AppContext appContext, LevelDTO levelDTO) {
|
||||||
|
List<Widget> translations = <Widget>[];
|
||||||
|
ManagerAppContext managerAppContext = appContext.getContext();
|
||||||
|
for(var language in managerAppContext.selectedConfiguration.languages) {
|
||||||
|
translations.add(
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: MediaQuery.of(context).size.width *0.05,
|
||||||
|
height: MediaQuery.of(context).size.height *0.2,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border(
|
||||||
|
right: BorderSide(width: 1.5, color: kSecond),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Center(child: AutoSizeText(language.toUpperCase()))
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 8.0),
|
||||||
|
child: Container(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
TextFormInputContainer(
|
||||||
|
label: "Message:",
|
||||||
|
color: kWhite,
|
||||||
|
isTitle: false,
|
||||||
|
initialValue: levelDTO.label.where((element) => element.language == language).first.value,
|
||||||
|
onChanged: (value) {
|
||||||
|
levelDTO.label.where((element) => element.language == language).first.value = value;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return translations;
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,244 @@
|
|||||||
|
import 'package:auto_size_text/auto_size_text.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:manager_app/app_context.dart';
|
||||||
|
import 'package:manager_app/constants.dart';
|
||||||
|
import 'package:managerapi/api.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
import 'new_update_response_quizz.dart';
|
||||||
|
|
||||||
|
class QuizzResponseList extends StatefulWidget {
|
||||||
|
final List<ResponseDTO> responses;
|
||||||
|
final ValueChanged<List<ResponseDTO>> onChanged;
|
||||||
|
const QuizzResponseList({
|
||||||
|
Key key,
|
||||||
|
this.responses,
|
||||||
|
this.onChanged,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_QuizzResponseListState createState() => _QuizzResponseListState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _QuizzResponseListState extends State<QuizzResponseList> {
|
||||||
|
List<ResponseDTO> responsesMiddle;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
responsesMiddle = new List<ResponseDTO>.from(widget.responses);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _onReorder(int oldIndex, int newIndex) {
|
||||||
|
setState(
|
||||||
|
() {
|
||||||
|
if (newIndex > oldIndex) {
|
||||||
|
newIndex -= 1;
|
||||||
|
}
|
||||||
|
final ResponseDTO item = responsesMiddle.removeAt(oldIndex);
|
||||||
|
responsesMiddle.insert(newIndex, item);
|
||||||
|
|
||||||
|
var i = 0;
|
||||||
|
responsesMiddle.forEach((response) {
|
||||||
|
response.order = i;
|
||||||
|
i++;
|
||||||
|
});
|
||||||
|
widget.onChanged(responsesMiddle);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final appContext = Provider.of<AppContext>(context);
|
||||||
|
Size size = MediaQuery.of(context).size;
|
||||||
|
|
||||||
|
return Stack(
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 15.0, right: 15.0, bottom: 15.0, top: 32.5),
|
||||||
|
child: ReorderableListView.builder(
|
||||||
|
shrinkWrap: true,
|
||||||
|
padding: const EdgeInsets.only(right: 125),
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return Container(
|
||||||
|
key: ValueKey(index),
|
||||||
|
decoration: boxDecoration(),
|
||||||
|
padding: const EdgeInsets.all(2),
|
||||||
|
margin: EdgeInsets.symmetric(vertical: 3, horizontal: 3),
|
||||||
|
child: getElement(index, responsesMiddle[index], size, appContext),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
itemCount: responsesMiddle.length,
|
||||||
|
onReorder: _onReorder
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
top: 10,
|
||||||
|
left: 10,
|
||||||
|
child: Text(
|
||||||
|
"Réponses",
|
||||||
|
style: TextStyle(fontSize: 15, fontWeight: FontWeight.w500),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if(responsesMiddle.length < 4)
|
||||||
|
Positioned(
|
||||||
|
bottom: 10,
|
||||||
|
right: 10,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () async {
|
||||||
|
var result = await showNewOrUpdateResponseQuizz(null, appContext, context, "Réponse");
|
||||||
|
if (result != null)
|
||||||
|
{
|
||||||
|
setState(() {
|
||||||
|
result.order = responsesMiddle.length;
|
||||||
|
result.isGood = false;
|
||||||
|
responsesMiddle.add(result);
|
||||||
|
widget.onChanged(responsesMiddle);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
height: MediaQuery.of(context).size.width * 0.04,
|
||||||
|
width: MediaQuery.of(context).size.width * 0.04,
|
||||||
|
child: Icon(
|
||||||
|
Icons.add,
|
||||||
|
color: kTextLightColor,
|
||||||
|
size: 30.0,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: kSuccess,
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
borderRadius: BorderRadius.circular(20.0),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: kSecond,
|
||||||
|
spreadRadius: 0.5,
|
||||||
|
blurRadius: 5,
|
||||||
|
offset: Offset(0, 1.5), // changes position of shadow
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
getElement(int index, ResponseDTO response, Size size, AppContext appContext) {
|
||||||
|
return Stack(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: size.width *0.8,
|
||||||
|
height: 50,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Center(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(2.0),
|
||||||
|
child: AutoSizeText(
|
||||||
|
response.label == null ? "" : response.label[0].value,
|
||||||
|
style: new TextStyle(fontSize: 15),
|
||||||
|
maxLines: 2,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
right: 35,
|
||||||
|
bottom: 3,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Tooltip(
|
||||||
|
message: "Si coché, la réponse est valide",
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Checkbox(
|
||||||
|
value: response.isGood,
|
||||||
|
checkColor: Colors.white,
|
||||||
|
activeColor: kPrimaryColor,
|
||||||
|
onChanged: (bool value) {
|
||||||
|
setState(() {
|
||||||
|
response.isGood = !response.isGood;
|
||||||
|
widget.onChanged(responsesMiddle);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Tooltip(
|
||||||
|
message: "Modifier",
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () async {
|
||||||
|
var result = await showNewOrUpdateResponseQuizz(
|
||||||
|
response,
|
||||||
|
appContext,
|
||||||
|
context,
|
||||||
|
"Modifier la réponse"
|
||||||
|
);
|
||||||
|
|
||||||
|
if (result != null) {
|
||||||
|
setState(() {
|
||||||
|
responsesMiddle[response.order] = result;
|
||||||
|
widget.onChanged(responsesMiddle);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Icon(
|
||||||
|
Icons.edit,
|
||||||
|
color: kPrimaryColor,
|
||||||
|
size: 25.0,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Tooltip(
|
||||||
|
message: "Supprimer",
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
responsesMiddle.removeAt(response.order);
|
||||||
|
widget.onChanged(responsesMiddle);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Icon(
|
||||||
|
Icons.delete,
|
||||||
|
color: kPrimaryColor,
|
||||||
|
size: 25.0,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
boxDecoration() {
|
||||||
|
return BoxDecoration(
|
||||||
|
color: kBackgroundColor,
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
border: Border.all(width: 1.5, color: kSecond),
|
||||||
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: kSecond,
|
||||||
|
spreadRadius: 0.5,
|
||||||
|
blurRadius: 5,
|
||||||
|
offset: Offset(0, 1.5), // changes position of shadow
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -0,0 +1,380 @@
|
|||||||
|
import 'package:auto_size_text/auto_size_text.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:manager_app/Components/rounded_button.dart';
|
||||||
|
import 'package:manager_app/app_context.dart';
|
||||||
|
import 'package:manager_app/constants.dart';
|
||||||
|
import 'package:managerapi/api.dart';
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
import 'new_update_question_quizz.dart';
|
||||||
|
import 'new_update_score_quizz.dart';
|
||||||
|
|
||||||
|
class QuizzConfig extends StatefulWidget {
|
||||||
|
final String color;
|
||||||
|
final String label;
|
||||||
|
final String initialValue;
|
||||||
|
final ValueChanged<String> onChanged;
|
||||||
|
const QuizzConfig({
|
||||||
|
Key key,
|
||||||
|
this.color,
|
||||||
|
this.label,
|
||||||
|
this.initialValue,
|
||||||
|
this.onChanged,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_QuizzConfigState createState() => _QuizzConfigState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _QuizzConfigState extends State<QuizzConfig> {
|
||||||
|
QuizzDTO quizzDTO;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
quizzDTO = QuizzDTO.fromJson(json.decode(widget.initialValue));
|
||||||
|
List<QuestionDTO> test = new List<QuestionDTO>.from(quizzDTO.questions);
|
||||||
|
quizzDTO.questions = test;
|
||||||
|
quizzDTO.questions.sort((a, b) => a.order.compareTo(b.order));
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final appContext = Provider.of<AppContext>(context);
|
||||||
|
Size size = MediaQuery.of(context).size;
|
||||||
|
|
||||||
|
void _onReorder(int oldIndex, int newIndex) {
|
||||||
|
setState(
|
||||||
|
() {
|
||||||
|
if (newIndex > oldIndex) {
|
||||||
|
newIndex -= 1;
|
||||||
|
}
|
||||||
|
final QuestionDTO item = quizzDTO.questions.removeAt(oldIndex);
|
||||||
|
quizzDTO.questions.insert(newIndex, item);
|
||||||
|
|
||||||
|
var i = 0;
|
||||||
|
quizzDTO.questions.forEach((question) {
|
||||||
|
question.order = i;
|
||||||
|
i++;
|
||||||
|
});
|
||||||
|
|
||||||
|
widget.onChanged(jsonEncode(quizzDTO).toString());
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
height: size.height * 0.1,
|
||||||
|
width: double.infinity,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
// Bad
|
||||||
|
Container(
|
||||||
|
height: 50,
|
||||||
|
child: RoundedButton(
|
||||||
|
text: "Mauvais score",
|
||||||
|
color: kPrimaryColor,
|
||||||
|
textColor: kWhite,
|
||||||
|
icon: Icons.message,
|
||||||
|
press: () async {
|
||||||
|
var result = await showNewOrUpdateScoreQuizz(quizzDTO.badLevel, appContext, context, "Message pour un mauvais score");
|
||||||
|
if (result != null)
|
||||||
|
{
|
||||||
|
setState(() {
|
||||||
|
print("BAAAD");
|
||||||
|
quizzDTO.badLevel = result;
|
||||||
|
print(quizzDTO.badLevel);
|
||||||
|
widget.onChanged(jsonEncode(quizzDTO).toString());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fontSize: 20,
|
||||||
|
horizontal: 10,
|
||||||
|
vertical: 10
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// Medium
|
||||||
|
Container(
|
||||||
|
height: 50,
|
||||||
|
child: RoundedButton(
|
||||||
|
text: "Moyen score",
|
||||||
|
color: kPrimaryColor,
|
||||||
|
textColor: kWhite,
|
||||||
|
icon: Icons.message,
|
||||||
|
press: () async {
|
||||||
|
var result = await showNewOrUpdateScoreQuizz(quizzDTO.mediumLevel, appContext, context, "Message pour un moyen score");
|
||||||
|
if (result != null)
|
||||||
|
{
|
||||||
|
setState(() {
|
||||||
|
quizzDTO.mediumLevel = result;
|
||||||
|
widget.onChanged(jsonEncode(quizzDTO).toString());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fontSize: 20,
|
||||||
|
horizontal: 10,
|
||||||
|
vertical: 10
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// Good
|
||||||
|
Container(
|
||||||
|
height: 50,
|
||||||
|
child: RoundedButton(
|
||||||
|
text: "Bon score",
|
||||||
|
color: kPrimaryColor,
|
||||||
|
textColor: kWhite,
|
||||||
|
icon: Icons.message,
|
||||||
|
press: () async {
|
||||||
|
var result = await showNewOrUpdateScoreQuizz(quizzDTO.goodLevel, appContext, context, "Message pour un bon score");
|
||||||
|
if (result != null)
|
||||||
|
{
|
||||||
|
setState(() {
|
||||||
|
quizzDTO.goodLevel = result;
|
||||||
|
widget.onChanged(jsonEncode(quizzDTO).toString());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fontSize: 20,
|
||||||
|
horizontal: 10,
|
||||||
|
vertical: 10
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// Great
|
||||||
|
Container(
|
||||||
|
height: 50,
|
||||||
|
child: RoundedButton(
|
||||||
|
text: "Excellent score",
|
||||||
|
color: kPrimaryColor,
|
||||||
|
textColor: kWhite,
|
||||||
|
icon: Icons.message,
|
||||||
|
press: () async {
|
||||||
|
var result = await showNewOrUpdateScoreQuizz(quizzDTO.greatLevel, appContext, context, "Message pour un excellent score");
|
||||||
|
if (result != null)
|
||||||
|
{
|
||||||
|
setState(() {
|
||||||
|
quizzDTO.greatLevel = result;
|
||||||
|
widget.onChanged(jsonEncode(quizzDTO).toString());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fontSize: 20,
|
||||||
|
horizontal: 10,
|
||||||
|
vertical: 10
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(25),
|
||||||
|
border: Border.all(width: 1.5, color: kSecond)
|
||||||
|
),
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 40, left: 10, right: 10, bottom: 10),
|
||||||
|
child: Container(
|
||||||
|
height: quizzDTO.questions.length == 0 ? 75 : null,
|
||||||
|
child: ReorderableListView.builder(
|
||||||
|
shrinkWrap: true,
|
||||||
|
padding: const EdgeInsets.only(right: 125),
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return Container(
|
||||||
|
key: ValueKey(index),
|
||||||
|
decoration: boxDecoration(),
|
||||||
|
padding: const EdgeInsets.all(2),
|
||||||
|
margin: EdgeInsets.symmetric(vertical: 3, horizontal: 3),
|
||||||
|
child: getElement(index, quizzDTO.questions[index], size, appContext),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
itemCount: quizzDTO.questions.length,
|
||||||
|
onReorder: _onReorder
|
||||||
|
),
|
||||||
|
)
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
top: 10,
|
||||||
|
left: 10,
|
||||||
|
child: Text(
|
||||||
|
"Questions",
|
||||||
|
style: TextStyle(fontSize: 15, fontWeight: FontWeight.w500),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
bottom: 10,
|
||||||
|
right: 10,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () async {
|
||||||
|
print("new question");
|
||||||
|
QuestionDTO result = await showNewOrUpdateQuestionQuizz(null, appContext, context, "Question");
|
||||||
|
if (result != null)
|
||||||
|
{
|
||||||
|
setState(() {
|
||||||
|
result.order = quizzDTO.questions.length;
|
||||||
|
quizzDTO.questions.add(result);
|
||||||
|
widget.onChanged(jsonEncode(quizzDTO).toString());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
height: MediaQuery.of(context).size.width * 0.04,
|
||||||
|
width: MediaQuery.of(context).size.width * 0.04,
|
||||||
|
child: Icon(
|
||||||
|
Icons.add,
|
||||||
|
color: kTextLightColor,
|
||||||
|
size: 30.0,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: kSuccess,
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
borderRadius: BorderRadius.circular(20.0),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: kSecond,
|
||||||
|
spreadRadius: 0.5,
|
||||||
|
blurRadius: 5,
|
||||||
|
offset: Offset(0, 1.5), // changes position of shadow
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
getElement(int index, QuestionDTO question, Size size, AppContext appContext) {
|
||||||
|
return Stack(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: size.width *0.8,
|
||||||
|
height: 75,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
if(question.source_ != null) Container(
|
||||||
|
height: 60,
|
||||||
|
width: 60,
|
||||||
|
decoration: imageBoxDecoration(question, appContext),
|
||||||
|
margin: EdgeInsets.symmetric(horizontal: 10),
|
||||||
|
),
|
||||||
|
Center(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(2.0),
|
||||||
|
child: AutoSizeText(
|
||||||
|
question.label == null ? "" : question.label[0].value,
|
||||||
|
style: new TextStyle(fontSize: 15),
|
||||||
|
maxLines: 2,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
right: 35,
|
||||||
|
bottom: 18,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Tooltip(
|
||||||
|
message: "Modifier",
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () async {
|
||||||
|
var result = await showNewOrUpdateQuestionQuizz(
|
||||||
|
question,
|
||||||
|
appContext,
|
||||||
|
context,
|
||||||
|
"Modifier la question"
|
||||||
|
);
|
||||||
|
|
||||||
|
if (result != null) {
|
||||||
|
setState(() {
|
||||||
|
quizzDTO.questions[question.order] = result;
|
||||||
|
widget.onChanged(jsonEncode(quizzDTO).toString());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Icon(
|
||||||
|
Icons.edit,
|
||||||
|
color: kPrimaryColor,
|
||||||
|
size: 25.0,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Tooltip(
|
||||||
|
message: "Supprimer",
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
quizzDTO.questions.removeAt(question.order);
|
||||||
|
widget.onChanged(jsonEncode(quizzDTO).toString());
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Icon(
|
||||||
|
Icons.delete,
|
||||||
|
color: kPrimaryColor,
|
||||||
|
size: 25.0,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
boxDecoration() {
|
||||||
|
return BoxDecoration(
|
||||||
|
color: kBackgroundColor,
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
border: Border.all(width: 1.5, color: kSecond),
|
||||||
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: kSecond,
|
||||||
|
spreadRadius: 0.5,
|
||||||
|
blurRadius: 5,
|
||||||
|
offset: Offset(0, 1.5), // changes position of shadow
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
imageBoxDecoration(QuestionDTO questionDTO, appContext) {
|
||||||
|
return BoxDecoration(
|
||||||
|
color: kBackgroundColor,
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
border: Border.all(width: 1.5, color: kSecond),
|
||||||
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
|
image: questionDTO.source_ != null ? new DecorationImage(
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
image: new NetworkImage(
|
||||||
|
questionDTO.source_,
|
||||||
|
),
|
||||||
|
) : null,
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -117,7 +117,7 @@ class _SliderConfigState extends State<SliderConfig> {
|
|||||||
size: 30.0,
|
size: 30.0,
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.lightGreen,
|
color: kSuccess,
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
borderRadius: BorderRadius.circular(20.0),
|
borderRadius: BorderRadius.circular(20.0),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import 'package:intl/intl.dart';
|
|||||||
|
|
||||||
import 'SubSection/Map/map_config.dart';
|
import 'SubSection/Map/map_config.dart';
|
||||||
import 'SubSection/Menu/menu_config.dart';
|
import 'SubSection/Menu/menu_config.dart';
|
||||||
|
import 'SubSection/Quizz/quizz_config.dart';
|
||||||
import 'SubSection/Slider/slider_config.dart';
|
import 'SubSection/Slider/slider_config.dart';
|
||||||
|
|
||||||
class SectionDetailScreen extends StatefulWidget {
|
class SectionDetailScreen extends StatefulWidget {
|
||||||
@ -67,17 +68,18 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
|
|||||||
|
|
||||||
Widget bodySection(SectionDTO sectionDTO, Size size, AppContext appContext, BuildContext context) {
|
Widget bodySection(SectionDTO sectionDTO, Size size, AppContext appContext, BuildContext context) {
|
||||||
return Column(
|
return Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
//mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
//height: size.height *0.13,
|
//color: Colors.orangeAccent,
|
||||||
|
height: 75,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Align(
|
Align(
|
||||||
alignment: AlignmentDirectional.bottomStart,
|
alignment: AlignmentDirectional.bottomStart,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(10.0),
|
padding: const EdgeInsets.all(3.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
@ -104,7 +106,7 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(10.0),
|
padding: const EdgeInsets.all(5.0),
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: AlignmentDirectional.centerEnd,
|
alignment: AlignmentDirectional.centerEnd,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
@ -127,8 +129,9 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
|
|||||||
),
|
),
|
||||||
), // TITLE
|
), // TITLE
|
||||||
Container(
|
Container(
|
||||||
|
//color: Colors.blue,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(10.0),
|
padding: const EdgeInsets.all(5.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
@ -201,19 +204,20 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
|
|||||||
),
|
),
|
||||||
),// FIELDS SECTION
|
),// FIELDS SECTION
|
||||||
Container(
|
Container(
|
||||||
height: size.height * 0.305,
|
|
||||||
//width: size.width * 0.8,
|
//width: size.width * 0.8,
|
||||||
|
height: size.height * 0.45,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(10.0),
|
padding: const EdgeInsets.all(10.0),
|
||||||
child: sectionDTO != null ? getSpecificData(sectionDTO, appContext) : null,
|
child: sectionDTO != null ? getSpecificData(sectionDTO, appContext) : null,
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
|
//color: Colors.lightGreen,
|
||||||
borderRadius: BorderRadius.circular(30),
|
borderRadius: BorderRadius.circular(30),
|
||||||
border: Border.all(width: 1.5, color: kSecond)
|
border: Border.all(width: 1.5, color: kSecond)
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: size.height*0.1,
|
height: size.height*0.05,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
@ -257,7 +261,7 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
|
|||||||
child: RoundedButton(
|
child: RoundedButton(
|
||||||
text: "Sauvegarder",
|
text: "Sauvegarder",
|
||||||
icon: Icons.done,
|
icon: Icons.done,
|
||||||
color: Colors.lightGreen,
|
color: kSuccess,
|
||||||
textColor: Colors.white,
|
textColor: Colors.white,
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
press: () {
|
press: () {
|
||||||
@ -342,6 +346,15 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
|
|||||||
sectionDTO.data = data;
|
sectionDTO.data = data;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
case SectionType.quizz:
|
||||||
|
return QuizzConfig(
|
||||||
|
initialValue: sectionDTO.data,
|
||||||
|
onChanged: (String data) {
|
||||||
|
print("Received info in parent - quizz");
|
||||||
|
print(data);
|
||||||
|
sectionDTO.data = data;
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
|
import 'dart:developer';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/painting.dart';
|
import 'package:flutter/painting.dart';
|
||||||
import 'package:manager_app/Components/color_picker_input_container.dart';
|
import 'package:manager_app/Components/color_picker_input_container.dart';
|
||||||
@ -19,6 +21,8 @@ import 'package:manager_app/constants.dart';
|
|||||||
import 'package:managerapi/api.dart';
|
import 'package:managerapi/api.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
import 'dart:html' as html;
|
||||||
|
|
||||||
|
|
||||||
class ConfigurationDetailScreen extends StatefulWidget {
|
class ConfigurationDetailScreen extends StatefulWidget {
|
||||||
final String id;
|
final String id;
|
||||||
@ -82,9 +86,19 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
|
|||||||
// Export config
|
// Export config
|
||||||
Client clientAPI = appContext.getContext().clientAPI;
|
Client clientAPI = appContext.getContext().clientAPI;
|
||||||
ExportConfigurationDTO export = await clientAPI.configurationApi.configurationExport(configurationDTO.id);
|
ExportConfigurationDTO export = await clientAPI.configurationApi.configurationExport(configurationDTO.id);
|
||||||
File test = await FileHelper().storeConfiguration(export);
|
|
||||||
showNotification(Colors.green, kWhite, "L'export de la configuration a réussi, le document se trouve là : " + test.path, context, 3000);
|
if (kIsWeb) {
|
||||||
|
html.AnchorElement anchorElement = new html.AnchorElement();
|
||||||
|
var uri = (Uri.parse(appContext.getContext().clientAPI.resourceApi.apiClient.basePath+'/api/Configuration/${configurationDTO.id}/export'));
|
||||||
|
anchorElement.href = uri.toString();
|
||||||
|
anchorElement.download = '${configurationDTO.label}.json';
|
||||||
|
anchorElement.click();
|
||||||
|
} else {
|
||||||
|
File test = await FileHelper().storeConfiguration(export);
|
||||||
|
showNotification(Colors.green, kWhite, "L'export de la configuration a réussi, le document se trouve là : " + test.path, context, 3000);
|
||||||
|
}
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
|
log(e);
|
||||||
showNotification(kPrimaryColor, kWhite, "L'export de la configuration a échoué", context, null);
|
showNotification(kPrimaryColor, kWhite, "L'export de la configuration a échoué", context, null);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -257,7 +271,7 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
|
|||||||
child: RoundedButton(
|
child: RoundedButton(
|
||||||
text: "Supprimer",
|
text: "Supprimer",
|
||||||
icon: Icons.delete,
|
icon: Icons.delete,
|
||||||
color: Colors.red,
|
color: kPrimaryColor,
|
||||||
textColor: Colors.white,
|
textColor: Colors.white,
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
press: () {
|
press: () {
|
||||||
@ -270,7 +284,7 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
|
|||||||
child: RoundedButton(
|
child: RoundedButton(
|
||||||
text: "Sauvegarder",
|
text: "Sauvegarder",
|
||||||
icon: Icons.done,
|
icon: Icons.done,
|
||||||
color: Colors.lightGreen,
|
color: kSuccess,
|
||||||
textColor: Colors.white,
|
textColor: Colors.white,
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
press: () {
|
press: () {
|
||||||
@ -349,7 +363,7 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
|
|||||||
|
|
||||||
boxDecoration(dynamic element) {
|
boxDecoration(dynamic element) {
|
||||||
return BoxDecoration(
|
return BoxDecoration(
|
||||||
color: element.id == null ? Colors.lightGreen : kTextLightColor,
|
color: element.id == null ? kSuccess : kTextLightColor,
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
borderRadius: BorderRadius.circular(25.0),
|
borderRadius: BorderRadius.circular(25.0),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
|
|||||||
@ -144,7 +144,7 @@ Future<List<ConfigurationDTO>> getConfigurations(dynamic appContext) async {
|
|||||||
|
|
||||||
boxDecoration(ConfigurationDTO configurationDTO) {
|
boxDecoration(ConfigurationDTO configurationDTO) {
|
||||||
return BoxDecoration(
|
return BoxDecoration(
|
||||||
color: configurationDTO.id == null ? Colors.lightGreen : kTextLightColor,
|
color: configurationDTO.id == null ? kSuccess : kTextLightColor,
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
borderRadius: BorderRadius.circular(25.0),
|
borderRadius: BorderRadius.circular(25.0),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
//import 'package:filepicker_windows/filepicker_windows.dart';
|
//import 'package:filepicker_windows/filepicker_windows.dart';
|
||||||
|
import 'package:file_picker/file_picker.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:manager_app/Components/message_notification.dart';
|
import 'package:manager_app/Components/message_notification.dart';
|
||||||
import 'package:manager_app/Components/rounded_button.dart';
|
import 'package:manager_app/Components/rounded_button.dart';
|
||||||
@ -40,9 +41,12 @@ void showNewConfiguration(AppContext appContext, ValueChanged<bool> isImport, Bu
|
|||||||
),
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
String result = filePicker();
|
FilePickerResult result = await FilePicker.platform.pickFiles();
|
||||||
|
|
||||||
|
//String result = filePicker();
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
await FileHelper().importConfiguration(result, appContext.getContext().clientAPI, mainContext);
|
|
||||||
|
await FileHelper().importConfiguration(result, null, appContext.getContext().clientAPI, mainContext);
|
||||||
isImport(true);
|
isImport(true);
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -109,7 +109,7 @@ class _SectionReorderListState extends State<SectionReorderList> {
|
|||||||
size: 30.0,
|
size: 30.0,
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.lightGreen,
|
color: kSuccess,
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
borderRadius: BorderRadius.circular(20.0),
|
borderRadius: BorderRadius.circular(20.0),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
|
|||||||
@ -91,7 +91,7 @@ class _ResourceBodyGridState extends State<ResourceBodyGrid> {
|
|||||||
height: size.height *0.08,
|
height: size.height *0.08,
|
||||||
width: size.height *0.08,
|
width: size.height *0.08,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.lightGreen,
|
color: kSuccess,
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
borderRadius: BorderRadius.circular(25.0),
|
borderRadius: BorderRadius.circular(25.0),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
@ -211,7 +211,7 @@ class _ResourceBodyGridState extends State<ResourceBodyGrid> {
|
|||||||
|
|
||||||
boxDecoration(dynamic resourceDetailDTO, appContext) {
|
boxDecoration(dynamic resourceDetailDTO, appContext) {
|
||||||
return BoxDecoration(
|
return BoxDecoration(
|
||||||
color: resourceDetailDTO.id == null ? Colors.lightGreen : kBackgroundColor,
|
color: resourceDetailDTO.id == null ? kSuccess : kBackgroundColor,
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
borderRadius: BorderRadius.circular(30.0),
|
borderRadius: BorderRadius.circular(30.0),
|
||||||
image: resourceDetailDTO.id != null && resourceDetailDTO.type != ResourceType.videoUrl ? new DecorationImage(
|
image: resourceDetailDTO.id != null && resourceDetailDTO.type != ResourceType.videoUrl ? new DecorationImage(
|
||||||
|
|||||||
@ -14,6 +14,9 @@ import 'package:manager_app/constants.dart';
|
|||||||
import 'package:managerapi/api.dart';
|
import 'package:managerapi/api.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:flutter/foundation.dart' show kIsWeb;
|
import 'package:flutter/foundation.dart' show kIsWeb;
|
||||||
|
import 'package:password_credential/credentials.dart';
|
||||||
|
import 'package:password_credential/entity/password_credential.dart';
|
||||||
|
import 'package:password_credential/entity/result.dart';
|
||||||
|
|
||||||
class LoginScreen extends StatefulWidget {
|
class LoginScreen extends StatefulWidget {
|
||||||
final Session session;
|
final Session session;
|
||||||
@ -25,8 +28,8 @@ class LoginScreen extends StatefulWidget {
|
|||||||
|
|
||||||
class _LoginScreenState extends State<LoginScreen> {
|
class _LoginScreenState extends State<LoginScreen> {
|
||||||
String email; // DEV "test@email.be"
|
String email; // DEV "test@email.be"
|
||||||
String password ; // DEV = "kljqsdkljqsd"
|
String password; // DEV = "kljqsdkljqsd"
|
||||||
String host ; // DEV = "http://192.168.31.96"
|
String host; // DEV = "http://192.168.31.96"
|
||||||
Client clientAPI;
|
Client clientAPI;
|
||||||
bool isLoading = false;
|
bool isLoading = false;
|
||||||
bool isRememberMe = false;
|
bool isRememberMe = false;
|
||||||
@ -34,9 +37,9 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
void authenticateTRY(dynamic appContext) async {
|
void authenticateTRY(dynamic appContext) async {
|
||||||
print("try auth.. ");
|
print("try auth.. ");
|
||||||
|
|
||||||
this.host = "http://localhost:5000";
|
/*this.host = "http://localhost:5000";
|
||||||
this.email = "fs";
|
this.email = "test@email.be";
|
||||||
this.password = "fs";
|
this.password = "kljqsdkljqsd";*/
|
||||||
|
|
||||||
clientAPI = Client(this.host);
|
clientAPI = Client(this.host);
|
||||||
|
|
||||||
@ -60,7 +63,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
FileHelper().writeSession(updatedSession);
|
FileHelper().writeSession(updatedSession);
|
||||||
}
|
}
|
||||||
|
|
||||||
showNotification(Colors.lightGreen, kWhite, 'Connexion réussie', context, null);
|
showNotification(kSuccess, kWhite, 'Connexion réussie', context, null);
|
||||||
|
|
||||||
ManagerAppContext managerAppContext = appContext.getContext();
|
ManagerAppContext managerAppContext = appContext.getContext();
|
||||||
// Set the appContext
|
// Set the appContext
|
||||||
@ -113,9 +116,9 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
this.isRememberMe = widget.session.rememberMe;
|
this.isRememberMe = widget.session.rememberMe;
|
||||||
this.host = widget.session.host;
|
this.host = "http://192.168.1.19:8089"; //widget.session.host;
|
||||||
this.email = widget.session.email;
|
this.email = "test@email.be"; //widget.session.email;
|
||||||
this.password = widget.session.password;
|
this.password = "kljqsdkljqsd"; //widget.session.password;
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,15 +179,17 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Checkbox(
|
Container(
|
||||||
checkColor: kTextLightColor,
|
child: Checkbox(
|
||||||
activeColor: kPrimaryColor,
|
checkColor: kTextLightColor,
|
||||||
value: this.isRememberMe,
|
activeColor: kPrimaryColor,
|
||||||
onChanged: (bool value) {
|
value: this.isRememberMe,
|
||||||
setState(() {
|
onChanged: (bool value) {
|
||||||
this.isRememberMe = value;
|
setState(() {
|
||||||
});
|
this.isRememberMe = value;
|
||||||
},
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Text("Se souvenir de moi", style: TextStyle(fontSize: 15, fontWeight: FontWeight.w500),),
|
Text("Se souvenir de moi", style: TextStyle(fontSize: 15, fontWeight: FontWeight.w500),),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -13,7 +13,7 @@ const kWhite = Color(0xFFFFFFFF);
|
|||||||
const kBlack = Color(0xFF000000);
|
const kBlack = Color(0xFF000000);
|
||||||
const kSuccess = Color(0xFF8bc34a);
|
const kSuccess = Color(0xFF8bc34a);
|
||||||
|
|
||||||
const List<String> section_types = ["Map", "Slider", "Video", "Web", "Menu"];
|
const List<String> section_types = ["Map", "Slider", "Video", "Web", "Menu", "Quizz"];
|
||||||
const List<String> map_types = ["none", "normal", "satellite", "terrain", "hybrid"];
|
const List<String> map_types = ["none", "normal", "satellite", "terrain", "hybrid"];
|
||||||
const List<String> languages = ["FR", "NL", "EN", "DE"];
|
const List<String> languages = ["FR", "NL", "EN", "DE"];
|
||||||
const List<String> resource_types = ["image", "image url", "video url"]; // "video",
|
const List<String> resource_types = ["image", "image url", "video url"]; // "video",
|
||||||
|
|||||||
@ -49,7 +49,7 @@ class _MyAppState extends State<MyApp> {
|
|||||||
child: MaterialApp(
|
child: MaterialApp(
|
||||||
scrollBehavior: MyCustomScrollBehavior(),
|
scrollBehavior: MyCustomScrollBehavior(),
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
title: 'Manager App Demo',
|
title: 'Manager App',
|
||||||
initialRoute: widget.initialRoute,
|
initialRoute: widget.initialRoute,
|
||||||
/*supportedLocales: [
|
/*supportedLocales: [
|
||||||
const Locale('en', 'US'),
|
const Locale('en', 'US'),
|
||||||
@ -85,4 +85,3 @@ class MyCustomScrollBehavior extends MaterialScrollBehavior {
|
|||||||
PointerDeviceKind.mouse,
|
PointerDeviceKind.mouse,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
.gitignore
|
.gitignore
|
||||||
.travis.yml
|
.travis.yml
|
||||||
README.md
|
README.md
|
||||||
|
doc/ArticleDTO.md
|
||||||
doc/AuthenticationApi.md
|
doc/AuthenticationApi.md
|
||||||
doc/ConfigurationApi.md
|
doc/ConfigurationApi.md
|
||||||
doc/ConfigurationDTO.md
|
doc/ConfigurationDTO.md
|
||||||
@ -13,14 +14,18 @@ doc/ExportConfigurationDTOAllOf.md
|
|||||||
doc/GeoPointDTO.md
|
doc/GeoPointDTO.md
|
||||||
doc/ImageDTO.md
|
doc/ImageDTO.md
|
||||||
doc/ImageGeoPoint.md
|
doc/ImageGeoPoint.md
|
||||||
|
doc/LevelDTO.md
|
||||||
doc/LoginDTO.md
|
doc/LoginDTO.md
|
||||||
doc/MapDTO.md
|
doc/MapDTO.md
|
||||||
doc/MapTypeApp.md
|
doc/MapTypeApp.md
|
||||||
doc/MenuDTO.md
|
doc/MenuDTO.md
|
||||||
doc/PlayerMessageDTO.md
|
doc/PlayerMessageDTO.md
|
||||||
|
doc/QuestionDTO.md
|
||||||
|
doc/QuizzDTO.md
|
||||||
doc/ResourceApi.md
|
doc/ResourceApi.md
|
||||||
doc/ResourceDTO.md
|
doc/ResourceDTO.md
|
||||||
doc/ResourceType.md
|
doc/ResourceType.md
|
||||||
|
doc/ResponseDTO.md
|
||||||
doc/SectionApi.md
|
doc/SectionApi.md
|
||||||
doc/SectionDTO.md
|
doc/SectionDTO.md
|
||||||
doc/SectionType.md
|
doc/SectionType.md
|
||||||
@ -48,6 +53,7 @@ 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/article_dto.dart
|
||||||
lib/model/configuration_dto.dart
|
lib/model/configuration_dto.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
|
||||||
@ -57,13 +63,17 @@ 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/image_dto.dart
|
||||||
lib/model/image_geo_point.dart
|
lib/model/image_geo_point.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_type_app.dart
|
lib/model/map_type_app.dart
|
||||||
lib/model/menu_dto.dart
|
lib/model/menu_dto.dart
|
||||||
lib/model/player_message_dto.dart
|
lib/model/player_message_dto.dart
|
||||||
|
lib/model/question_dto.dart
|
||||||
|
lib/model/quizz_dto.dart
|
||||||
lib/model/resource_dto.dart
|
lib/model/resource_dto.dart
|
||||||
lib/model/resource_type.dart
|
lib/model/resource_type.dart
|
||||||
|
lib/model/response_dto.dart
|
||||||
lib/model/section_dto.dart
|
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
|
||||||
@ -74,5 +84,4 @@ lib/model/user_detail_dto.dart
|
|||||||
lib/model/video_dto.dart
|
lib/model/video_dto.dart
|
||||||
lib/model/web_dto.dart
|
lib/model/web_dto.dart
|
||||||
pubspec.yaml
|
pubspec.yaml
|
||||||
test/export_configuration_dto_all_of_test.dart
|
test/article_dto_test.dart
|
||||||
test/export_configuration_dto_test.dart
|
|
||||||
|
|||||||
@ -60,7 +60,7 @@ try {
|
|||||||
|
|
||||||
## Documentation for API Endpoints
|
## Documentation for API Endpoints
|
||||||
|
|
||||||
All URIs are relative to *http://192.168.31.96*
|
All URIs are relative to *http://localhost:5000*
|
||||||
|
|
||||||
Class | Method | HTTP request | Description
|
Class | Method | HTTP request | Description
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
@ -91,10 +91,12 @@ Class | Method | HTTP request | Description
|
|||||||
*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* | [**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* | [**sectionGetDetail**](doc\/SectionApi.md#sectiongetdetail) | **GET** /api/Section/{id} |
|
*SectionApi* | [**sectionGetDetail**](doc\/SectionApi.md#sectiongetdetail) | **GET** /api/Section/{id} |
|
||||||
*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* | [**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* | [**sectionGetWebDTO**](doc\/SectionApi.md#sectiongetwebdto) | **GET** /api/Section/WebDTO |
|
*SectionApi* | [**sectionGetWebDTO**](doc\/SectionApi.md#sectiongetwebdto) | **GET** /api/Section/WebDTO |
|
||||||
@ -110,6 +112,7 @@ Class | Method | HTTP request | Description
|
|||||||
|
|
||||||
## Documentation For Models
|
## Documentation For Models
|
||||||
|
|
||||||
|
- [ArticleDTO](doc\/ArticleDTO.md)
|
||||||
- [ConfigurationDTO](doc\/ConfigurationDTO.md)
|
- [ConfigurationDTO](doc\/ConfigurationDTO.md)
|
||||||
- [DeviceDTO](doc\/DeviceDTO.md)
|
- [DeviceDTO](doc\/DeviceDTO.md)
|
||||||
- [DeviceDetailDTO](doc\/DeviceDetailDTO.md)
|
- [DeviceDetailDTO](doc\/DeviceDetailDTO.md)
|
||||||
@ -119,13 +122,17 @@ Class | Method | HTTP request | Description
|
|||||||
- [GeoPointDTO](doc\/GeoPointDTO.md)
|
- [GeoPointDTO](doc\/GeoPointDTO.md)
|
||||||
- [ImageDTO](doc\/ImageDTO.md)
|
- [ImageDTO](doc\/ImageDTO.md)
|
||||||
- [ImageGeoPoint](doc\/ImageGeoPoint.md)
|
- [ImageGeoPoint](doc\/ImageGeoPoint.md)
|
||||||
|
- [LevelDTO](doc\/LevelDTO.md)
|
||||||
- [LoginDTO](doc\/LoginDTO.md)
|
- [LoginDTO](doc\/LoginDTO.md)
|
||||||
- [MapDTO](doc\/MapDTO.md)
|
- [MapDTO](doc\/MapDTO.md)
|
||||||
- [MapTypeApp](doc\/MapTypeApp.md)
|
- [MapTypeApp](doc\/MapTypeApp.md)
|
||||||
- [MenuDTO](doc\/MenuDTO.md)
|
- [MenuDTO](doc\/MenuDTO.md)
|
||||||
- [PlayerMessageDTO](doc\/PlayerMessageDTO.md)
|
- [PlayerMessageDTO](doc\/PlayerMessageDTO.md)
|
||||||
|
- [QuestionDTO](doc\/QuestionDTO.md)
|
||||||
|
- [QuizzDTO](doc\/QuizzDTO.md)
|
||||||
- [ResourceDTO](doc\/ResourceDTO.md)
|
- [ResourceDTO](doc\/ResourceDTO.md)
|
||||||
- [ResourceType](doc\/ResourceType.md)
|
- [ResourceType](doc\/ResourceType.md)
|
||||||
|
- [ResponseDTO](doc\/ResponseDTO.md)
|
||||||
- [SectionDTO](doc\/SectionDTO.md)
|
- [SectionDTO](doc\/SectionDTO.md)
|
||||||
- [SectionType](doc\/SectionType.md)
|
- [SectionType](doc\/SectionType.md)
|
||||||
- [SliderDTO](doc\/SliderDTO.md)
|
- [SliderDTO](doc\/SliderDTO.md)
|
||||||
|
|||||||
22
manager_api/doc/ArticleDTO.md
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# managerapi.model.ArticleDTO
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```dart
|
||||||
|
import 'package:managerapi/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 []]
|
||||||
|
**content** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
|
||||||
|
**qrCode** | **String** | | [optional]
|
||||||
|
**isContentTop** | **bool** | | [optional]
|
||||||
|
**audioId** | **String** | | [optional]
|
||||||
|
**isReadAudioAuto** | **bool** | | [optional]
|
||||||
|
**images** | [**List<ImageDTO>**](ImageDTO.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)
|
||||||
|
|
||||||
|
|
||||||
@ -5,7 +5,7 @@
|
|||||||
import 'package:managerapi/api.dart';
|
import 'package:managerapi/api.dart';
|
||||||
```
|
```
|
||||||
|
|
||||||
All URIs are relative to *http://192.168.31.96*
|
All URIs are relative to *http://localhost:5000*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
import 'package:managerapi/api.dart';
|
import 'package:managerapi/api.dart';
|
||||||
```
|
```
|
||||||
|
|
||||||
All URIs are relative to *http://192.168.31.96*
|
All URIs are relative to *http://localhost:5000*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
|
|||||||
@ -14,6 +14,8 @@ Name | Type | Description | Notes
|
|||||||
**secondaryColor** | **String** | | [optional]
|
**secondaryColor** | **String** | | [optional]
|
||||||
**languages** | **List<String>** | | [optional] [default to const []]
|
**languages** | **List<String>** | | [optional] [default to const []]
|
||||||
**dateCreation** | [**DateTime**](DateTime.md) | | [optional]
|
**dateCreation** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
|
**isMobile** | **bool** | | [optional]
|
||||||
|
**isOffline** | **bool** | | [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)
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
import 'package:managerapi/api.dart';
|
import 'package:managerapi/api.dart';
|
||||||
```
|
```
|
||||||
|
|
||||||
All URIs are relative to *http://192.168.31.96*
|
All URIs are relative to *http://localhost:5000*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
|
|||||||
@ -14,6 +14,8 @@ Name | Type | Description | Notes
|
|||||||
**secondaryColor** | **String** | | [optional]
|
**secondaryColor** | **String** | | [optional]
|
||||||
**languages** | **List<String>** | | [optional] [default to const []]
|
**languages** | **List<String>** | | [optional] [default to const []]
|
||||||
**dateCreation** | [**DateTime**](DateTime.md) | | [optional]
|
**dateCreation** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
|
**isMobile** | **bool** | | [optional]
|
||||||
|
**isOffline** | **bool** | | [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 []]
|
||||||
|
|
||||||
|
|||||||
17
manager_api/doc/LevelDTO.md
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# managerapi.model.LevelDTO
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```dart
|
||||||
|
import 'package:managerapi/api.dart';
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**label** | [**List<TranslationDTO>**](TranslationDTO.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)
|
||||||
|
|
||||||
|
|
||||||
19
manager_api/doc/QuestionDTO.md
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# managerapi.model.QuestionDTO
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```dart
|
||||||
|
import 'package:managerapi/api.dart';
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**label** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
|
||||||
|
**responses** | [**List<ResponseDTO>**](ResponseDTO.md) | | [optional] [default to const []]
|
||||||
|
**resourceId** | **String** | | [optional]
|
||||||
|
**source_** | **String** | | [optional]
|
||||||
|
**order** | **int** | | [optional]
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
||||||
19
manager_api/doc/QuizzDTO.md
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# managerapi.model.QuizzDTO
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```dart
|
||||||
|
import 'package:managerapi/api.dart';
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**questions** | [**List<QuestionDTO>**](QuestionDTO.md) | | [optional] [default to const []]
|
||||||
|
**badLevel** | [**OneOfLevelDTO**](OneOfLevelDTO.md) | | [optional]
|
||||||
|
**mediumLevel** | [**OneOfLevelDTO**](OneOfLevelDTO.md) | | [optional]
|
||||||
|
**goodLevel** | [**OneOfLevelDTO**](OneOfLevelDTO.md) | | [optional]
|
||||||
|
**greatLevel** | [**OneOfLevelDTO**](OneOfLevelDTO.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)
|
||||||
|
|
||||||
|
|
||||||
@ -5,7 +5,7 @@
|
|||||||
import 'package:managerapi/api.dart';
|
import 'package:managerapi/api.dart';
|
||||||
```
|
```
|
||||||
|
|
||||||
All URIs are relative to *http://192.168.31.96*
|
All URIs are relative to *http://localhost:5000*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
|
|||||||