Compare commits

..

No commits in common. "master" and "Test-web" have entirely different histories.

152 changed files with 126 additions and 238358 deletions

View File

@ -14,22 +14,3 @@ A few resources to get you started if this is your first Flutter project:
For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
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

View File

@ -1 +0,0 @@
2cbf28f04b11760d77a4ab7a367289c4

View File

@ -1 +0,0 @@
{"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"]}

View File

@ -1 +0,0 @@
[{"family":"MaterialIcons","fonts":[{"asset":"fonts/MaterialIcons-Regular.otf"}]},{"family":"packages/cupertino_icons/CupertinoIcons","fonts":[{"asset":"packages/cupertino_icons/assets/CupertinoIcons.ttf"}]}]

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 917 B

View File

@ -1,192 +0,0 @@
'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;
});
});
})
);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

View File

@ -1,98 +0,0 @@
<!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>

File diff suppressed because one or more lines are too long

View File

@ -1,23 +0,0 @@
{
"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"
}
]
}

View File

@ -1 +0,0 @@
{"app_name":"manager_app","version":"1.0.0","build_number":"1"}

View File

@ -1 +0,0 @@
Ajout du Module quizz

View File

@ -1,26 +0,0 @@
- 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

View File

@ -1 +0,0 @@
2850532bac056cc3a4316af3c232a077

View File

@ -1 +0,0 @@
{"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"]}

View File

@ -1 +0,0 @@
[{"family":"MaterialIcons","fonts":[{"asset":"fonts/MaterialIcons-Regular.otf"}]},{"family":"packages/cupertino_icons/CupertinoIcons","fonts":[{"asset":"packages/cupertino_icons/assets/CupertinoIcons.ttf"}]}]

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 917 B

View File

@ -1,219 +0,0 @@
'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;
});
});
})
);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

View File

@ -1,2 +0,0 @@
<?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>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 826 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -1,41 +0,0 @@
{
"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"
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -1,115 +0,0 @@
<!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>

File diff suppressed because one or more lines are too long

View File

@ -1,59 +0,0 @@
{
"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"
}
]
}

View File

@ -1 +0,0 @@
{"app_name":"manager_app","version":"1.0.0","build_number":"1","package_name":"manager_app"}

View File

@ -2,8 +2,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_colorpicker/flutter_colorpicker.dart';
import 'package:manager_app/Components/rounded_button.dart';
import '../constants.dart';
showColorPicker (Color currentColor, Function onSelect, BuildContext context) {
Color pickerColor = currentColor;
@ -41,7 +39,7 @@ showColorPicker (Color currentColor, Function onSelect, BuildContext context) {
child: RoundedButton(
text: "Valider",
icon: Icons.check,
color: kSuccess,
color: Colors.lightGreen,
press: () {
onSelect(pickerColor);
Navigator.of(context).pop();

View File

@ -18,9 +18,6 @@ IconData getSectionIcon(elementType) {
case SectionType.menu:
return Icons.apps_sharp;
break;
case SectionType.quizz:
return Icons.question_answer;
break;
}
return Icons.menu;
}

View File

@ -84,8 +84,7 @@ class _ImageInputContainerState extends State<ImageInputContainer> {
future: getResource(resourceIdToShow, appContext),
builder: (context, AsyncSnapshot<dynamic> snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
if (snapshot.data != null) {
return Transform.scale(
return Transform.scale(
scale: isSmall ? size.aspectRatio * 0.5: size.aspectRatio * 0.9,
child: AspectRatio(
aspectRatio: 4/4,
@ -94,10 +93,6 @@ class _ImageInputContainerState extends State<ImageInputContainer> {
),
),
);
} else {
return Text("No data");
}
} else if (snapshot.connectionState == ConnectionState.none) {
return Text("No data");
} else {
@ -142,9 +137,9 @@ class _ImageInputContainerState extends State<ImageInputContainer> {
borderRadius: BorderRadius.circular(30.0),
image: new DecorationImage(
fit: widget.imageFit,
image: resourceDTO.type != null ? new NetworkImage(
image: new NetworkImage(
resourceDTO.type == ResourceType.image ? appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ resourceDTO.id : resourceDTO.data,
) : null,
),
),
boxShadow: [
BoxShadow(

View File

@ -10,17 +10,12 @@ showNotification (Color backgroundColor, Color textColor, String text, BuildCont
borderRadius: BorderRadius.circular(10.0),
),
padding: const EdgeInsets.symmetric(
horizontal: 10.0, // Inner padding for SnackBar content.
horizontal: 8.0, // Inner padding for SnackBar content.
),
content: Container(
height: 32.5,
child: Center(
child: Text(
text,
textAlign: TextAlign.center,
style: TextStyle(color: textColor),
),
),
content: Text(
text,
textAlign: TextAlign.center,
style: TextStyle(color: textColor),
)
);
ScaffoldMessenger.of(context).showSnackBar(snackBar);

View File

@ -7,8 +7,6 @@ class RoundedButton extends StatelessWidget {
final IconData icon;
final Color color, textColor;
final double fontSize;
final int vertical;
final int horizontal;
const RoundedButton({
Key key,
@ -17,9 +15,7 @@ class RoundedButton extends StatelessWidget {
this.icon,
this.color = kPrimaryColor,
this.textColor = kWhite,
this.fontSize,
this.vertical,
this.horizontal
this.fontSize
}) : super(key: key);
@override
@ -27,7 +23,7 @@ class RoundedButton extends StatelessWidget {
//Size size = MediaQuery.of(context).size;
return TextButton(
style: ButtonStyle(
padding: MaterialStateProperty.resolveWith((states) => EdgeInsets.symmetric(vertical: this.vertical != null ? this.vertical : 25, horizontal: this.horizontal != null ? this.horizontal : (icon == null ? 85 : 30))),
padding: MaterialStateProperty.resolveWith((states) => EdgeInsets.symmetric(vertical: 25, horizontal: icon == null ? 85 : 30)),
backgroundColor: MaterialStateColor.resolveWith((states) => color),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(

View File

@ -80,7 +80,7 @@ class _UploadImageContainerState extends State<UploadImageContainer> with Single
}
/*final file = OpenFilePicker()
..filterSpecification = {
'Images (*.jpg; *.jpeg;*.png)': '*.jpg;*.jpeg;*.png',
'Images (*.jpg; *.png)': '*.jpg;*.png',
//'Video (*.mp4)': '*.mp4',
//'All Files': '*.*'
}

View File

@ -1,9 +1,7 @@
import 'dart:convert';
import 'dart:developer';
import 'dart:io';
import 'package:encrypt/encrypt.dart';
import 'package:file_picker/file_picker.dart';
import 'package:manager_app/Components/message_notification.dart';
import 'package:manager_app/Models/session.dart';
import 'package:manager_app/client.dart';
@ -49,10 +47,13 @@ class FileHelper {
return file.writeAsString(jsonEncode(exportConfigurationDTO.toJson()));
}
Future<void> importConfiguration(FilePickerResult filePickerResult, String path, Client client, context) async {
var fileTest = filePickerResult.files[0];
String fileContent = utf8.decode(fileTest.bytes);
ExportConfigurationDTO export = ExportConfigurationDTO.fromJson(jsonDecode(fileContent));
Future<void> importConfiguration(String path, Client client, context) async {
// Gets the file
File file = File(path);
final contents = await file.readAsString();
ExportConfigurationDTO export = ExportConfigurationDTO.fromJson(jsonDecode(contents));
try {
String test = await client.configurationApi.configurationImport(export);
if (test.contains("successfully")) {

View File

@ -1,48 +0,0 @@
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();
}
}

View File

@ -115,7 +115,7 @@ class _GeoPointImageListState extends State<GeoPointImageList> {
size: 30.0,
),
decoration: BoxDecoration(
color: kSuccess,
color: Colors.lightGreen,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(20.0),
boxShadow: [

View File

@ -159,7 +159,7 @@ class _MapConfigState extends State<MapConfig> {
size: 30.0,
),
decoration: BoxDecoration(
color: kSuccess,
color: Colors.lightGreen,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(20.0),
boxShadow: [

View File

@ -130,7 +130,7 @@ class _MenuConfigState extends State<MenuConfig> {
size: 30.0,
),
decoration: BoxDecoration(
color: kSuccess,
color: Colors.lightGreen,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(20.0),
boxShadow: [

View File

@ -1,201 +0,0 @@
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;
}

View File

@ -1,178 +0,0 @@
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;
}

View File

@ -1,166 +0,0 @@
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;
}

View File

@ -1,244 +0,0 @@
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
),
],
);
}

View File

@ -1,380 +0,0 @@
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,
);
}

View File

@ -117,7 +117,7 @@ class _SliderConfigState extends State<SliderConfig> {
size: 30.0,
),
decoration: BoxDecoration(
color: kSuccess,
color: Colors.lightGreen,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(20.0),
boxShadow: [

View File

@ -18,7 +18,6 @@ import 'package:intl/intl.dart';
import 'SubSection/Map/map_config.dart';
import 'SubSection/Menu/menu_config.dart';
import 'SubSection/Quizz/quizz_config.dart';
import 'SubSection/Slider/slider_config.dart';
class SectionDetailScreen extends StatefulWidget {
@ -68,18 +67,17 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
Widget bodySection(SectionDTO sectionDTO, Size size, AppContext appContext, BuildContext context) {
return Column(
//mainAxisAlignment: MainAxisAlignment.spaceAround,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Container(
//color: Colors.orangeAccent,
height: 75,
//height: size.height *0.13,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Align(
alignment: AlignmentDirectional.bottomStart,
child: Padding(
padding: const EdgeInsets.all(3.0),
padding: const EdgeInsets.all(10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -106,7 +104,7 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
)
),
Padding(
padding: const EdgeInsets.all(5.0),
padding: const EdgeInsets.all(10.0),
child: Align(
alignment: AlignmentDirectional.centerEnd,
child: InkWell(
@ -129,9 +127,8 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
),
), // TITLE
Container(
//color: Colors.blue,
child: Padding(
padding: const EdgeInsets.all(5.0),
padding: const EdgeInsets.all(10.0),
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
@ -204,20 +201,19 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
),
),// FIELDS SECTION
Container(
height: size.height * 0.305,
//width: size.width * 0.8,
height: size.height * 0.45,
child: Padding(
padding: const EdgeInsets.all(10.0),
child: sectionDTO != null ? getSpecificData(sectionDTO, appContext) : null,
),
decoration: BoxDecoration(
//color: Colors.lightGreen,
borderRadius: BorderRadius.circular(30),
border: Border.all(width: 1.5, color: kSecond)
),
),
SizedBox(
height: size.height*0.05,
height: size.height*0.1,
)
],
);
@ -261,7 +257,7 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
child: RoundedButton(
text: "Sauvegarder",
icon: Icons.done,
color: kSuccess,
color: Colors.lightGreen,
textColor: Colors.white,
fontSize: 15,
press: () {
@ -346,15 +342,6 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
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;
},
);
}
}
}

View File

@ -1,8 +1,6 @@
import 'dart:developer';
import 'dart:io';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';
import 'package:manager_app/Components/color_picker_input_container.dart';
@ -21,8 +19,6 @@ import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart';
import 'package:provider/provider.dart';
import 'package:intl/intl.dart';
import 'dart:html' as html;
class ConfigurationDetailScreen extends StatefulWidget {
final String id;
@ -86,19 +82,9 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
// Export config
Client clientAPI = appContext.getContext().clientAPI;
ExportConfigurationDTO export = await clientAPI.configurationApi.configurationExport(configurationDTO.id);
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);
}
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) {
log(e);
showNotification(kPrimaryColor, kWhite, "L'export de la configuration a échoué", context, null);
}
},
@ -271,7 +257,7 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
child: RoundedButton(
text: "Supprimer",
icon: Icons.delete,
color: kPrimaryColor,
color: Colors.red,
textColor: Colors.white,
fontSize: 15,
press: () {
@ -284,7 +270,7 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
child: RoundedButton(
text: "Sauvegarder",
icon: Icons.done,
color: kSuccess,
color: Colors.lightGreen,
textColor: Colors.white,
fontSize: 15,
press: () {
@ -363,7 +349,7 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
boxDecoration(dynamic element) {
return BoxDecoration(
color: element.id == null ? kSuccess : kTextLightColor,
color: element.id == null ? Colors.lightGreen : kTextLightColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(25.0),
boxShadow: [

View File

@ -144,7 +144,7 @@ Future<List<ConfigurationDTO>> getConfigurations(dynamic appContext) async {
boxDecoration(ConfigurationDTO configurationDTO) {
return BoxDecoration(
color: configurationDTO.id == null ? kSuccess : kTextLightColor,
color: configurationDTO.id == null ? Colors.lightGreen : kTextLightColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(25.0),
boxShadow: [

View File

@ -1,5 +1,4 @@
//import 'package:filepicker_windows/filepicker_windows.dart';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
import 'package:manager_app/Components/message_notification.dart';
import 'package:manager_app/Components/rounded_button.dart';
@ -41,12 +40,9 @@ void showNewConfiguration(AppContext appContext, ValueChanged<bool> isImport, Bu
),
InkWell(
onTap: () async {
FilePickerResult result = await FilePicker.platform.pickFiles();
//String result = filePicker();
String result = filePicker();
if (result != null) {
await FileHelper().importConfiguration(result, null, appContext.getContext().clientAPI, mainContext);
await FileHelper().importConfiguration(result, appContext.getContext().clientAPI, mainContext);
isImport(true);
Navigator.of(context).pop();
}

View File

@ -109,7 +109,7 @@ class _SectionReorderListState extends State<SectionReorderList> {
size: 30.0,
),
decoration: BoxDecoration(
color: kSuccess,
color: Colors.lightGreen,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(20.0),
boxShadow: [

View File

@ -91,7 +91,7 @@ class _ResourceBodyGridState extends State<ResourceBodyGrid> {
height: size.height *0.08,
width: size.height *0.08,
decoration: BoxDecoration(
color: kSuccess,
color: Colors.lightGreen,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(25.0),
boxShadow: [
@ -211,7 +211,7 @@ class _ResourceBodyGridState extends State<ResourceBodyGrid> {
boxDecoration(dynamic resourceDetailDTO, appContext) {
return BoxDecoration(
color: resourceDetailDTO.id == null ? kSuccess : kBackgroundColor,
color: resourceDetailDTO.id == null ? Colors.lightGreen : kBackgroundColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(30.0),
image: resourceDetailDTO.id != null && resourceDetailDTO.type != ResourceType.videoUrl ? new DecorationImage(

View File

@ -14,9 +14,6 @@ import 'package:manager_app/constants.dart';
import 'package:managerapi/api.dart';
import 'package:provider/provider.dart';
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 {
final Session session;
@ -28,8 +25,8 @@ class LoginScreen extends StatefulWidget {
class _LoginScreenState extends State<LoginScreen> {
String email; // DEV "test@email.be"
String password; // DEV = "kljqsdkljqsd"
String host; // DEV = "http://192.168.31.96"
String password ; // DEV = "kljqsdkljqsd"
String host ; // DEV = "http://192.168.31.96"
Client clientAPI;
bool isLoading = false;
bool isRememberMe = false;
@ -37,9 +34,9 @@ class _LoginScreenState extends State<LoginScreen> {
void authenticateTRY(dynamic appContext) async {
print("try auth.. ");
/*this.host = "http://localhost:5000";
this.email = "test@email.be";
this.password = "kljqsdkljqsd";*/
this.host = "http://localhost:5000";
this.email = "fs";
this.password = "fs";
clientAPI = Client(this.host);
@ -63,7 +60,7 @@ class _LoginScreenState extends State<LoginScreen> {
FileHelper().writeSession(updatedSession);
}
showNotification(kSuccess, kWhite, 'Connexion réussie', context, null);
showNotification(Colors.lightGreen, kWhite, 'Connexion réussie', context, null);
ManagerAppContext managerAppContext = appContext.getContext();
// Set the appContext
@ -116,9 +113,9 @@ class _LoginScreenState extends State<LoginScreen> {
@override
void initState() {
this.isRememberMe = widget.session.rememberMe;
this.host = "http://192.168.1.19:8089"; //widget.session.host;
this.email = "test@email.be"; //widget.session.email;
this.password = "kljqsdkljqsd"; //widget.session.password;
this.host = widget.session.host;
this.email = widget.session.email;
this.password = widget.session.password;
super.initState();
}
@ -179,17 +176,15 @@ class _LoginScreenState extends State<LoginScreen> {
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
child: Checkbox(
checkColor: kTextLightColor,
activeColor: kPrimaryColor,
value: this.isRememberMe,
onChanged: (bool value) {
setState(() {
this.isRememberMe = value;
});
},
),
Checkbox(
checkColor: kTextLightColor,
activeColor: kPrimaryColor,
value: this.isRememberMe,
onChanged: (bool value) {
setState(() {
this.isRememberMe = value;
});
},
),
Text("Se souvenir de moi", style: TextStyle(fontSize: 15, fontWeight: FontWeight.w500),),
],

View File

@ -13,7 +13,7 @@ const kWhite = Color(0xFFFFFFFF);
const kBlack = Color(0xFF000000);
const kSuccess = Color(0xFF8bc34a);
const List<String> section_types = ["Map", "Slider", "Video", "Web", "Menu", "Quizz"];
const List<String> section_types = ["Map", "Slider", "Video", "Web", "Menu"];
const List<String> map_types = ["none", "normal", "satellite", "terrain", "hybrid"];
const List<String> languages = ["FR", "NL", "EN", "DE"];
const List<String> resource_types = ["image", "image url", "video url"]; // "video",

View File

@ -49,7 +49,7 @@ class _MyAppState extends State<MyApp> {
child: MaterialApp(
scrollBehavior: MyCustomScrollBehavior(),
debugShowCheckedModeBanner: false,
title: 'Manager App',
title: 'Manager App Demo',
initialRoute: widget.initialRoute,
/*supportedLocales: [
const Locale('en', 'US'),
@ -85,3 +85,4 @@ class MyCustomScrollBehavior extends MaterialScrollBehavior {
PointerDeviceKind.mouse,
};
}

View File

@ -1,7 +1,6 @@
.gitignore
.travis.yml
README.md
doc/ArticleDTO.md
doc/AuthenticationApi.md
doc/ConfigurationApi.md
doc/ConfigurationDTO.md
@ -14,18 +13,14 @@ doc/ExportConfigurationDTOAllOf.md
doc/GeoPointDTO.md
doc/ImageDTO.md
doc/ImageGeoPoint.md
doc/LevelDTO.md
doc/LoginDTO.md
doc/MapDTO.md
doc/MapTypeApp.md
doc/MenuDTO.md
doc/PlayerMessageDTO.md
doc/QuestionDTO.md
doc/QuizzDTO.md
doc/ResourceApi.md
doc/ResourceDTO.md
doc/ResourceType.md
doc/ResponseDTO.md
doc/SectionApi.md
doc/SectionDTO.md
doc/SectionType.md
@ -53,7 +48,6 @@ lib/auth/authentication.dart
lib/auth/http_basic_auth.dart
lib/auth/http_bearer_auth.dart
lib/auth/oauth.dart
lib/model/article_dto.dart
lib/model/configuration_dto.dart
lib/model/device_detail_dto.dart
lib/model/device_detail_dto_all_of.dart
@ -63,17 +57,13 @@ lib/model/export_configuration_dto_all_of.dart
lib/model/geo_point_dto.dart
lib/model/image_dto.dart
lib/model/image_geo_point.dart
lib/model/level_dto.dart
lib/model/login_dto.dart
lib/model/map_dto.dart
lib/model/map_type_app.dart
lib/model/menu_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_type.dart
lib/model/response_dto.dart
lib/model/section_dto.dart
lib/model/section_type.dart
lib/model/slider_dto.dart
@ -84,4 +74,5 @@ lib/model/user_detail_dto.dart
lib/model/video_dto.dart
lib/model/web_dto.dart
pubspec.yaml
test/article_dto_test.dart
test/export_configuration_dto_all_of_test.dart
test/export_configuration_dto_test.dart

View File

@ -60,7 +60,7 @@ try {
## Documentation for API Endpoints
All URIs are relative to *http://localhost:5000*
All URIs are relative to *http://192.168.31.96*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
@ -91,12 +91,10 @@ Class | Method | HTTP request | Description
*SectionApi* | [**sectionDeleteAllForConfiguration**](doc\/SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} |
*SectionApi* | [**sectionGet**](doc\/SectionApi.md#sectionget) | **GET** /api/Section |
*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* | [**sectionGetFromConfiguration**](doc\/SectionApi.md#sectiongetfromconfiguration) | **GET** /api/Section/configuration/{id} |
*SectionApi* | [**sectionGetMapDTO**](doc\/SectionApi.md#sectiongetmapdto) | **GET** /api/Section/MapDTO |
*SectionApi* | [**sectionGetMenuDTO**](doc\/SectionApi.md#sectiongetmenudto) | **GET** /api/Section/MenuDTO |
*SectionApi* | [**sectionGetQuizzDTO**](doc\/SectionApi.md#sectiongetquizzdto) | **GET** /api/Section/QuizzDTO |
*SectionApi* | [**sectionGetSliderDTO**](doc\/SectionApi.md#sectiongetsliderdto) | **GET** /api/Section/SliderDTO |
*SectionApi* | [**sectionGetVideoDTO**](doc\/SectionApi.md#sectiongetvideodto) | **GET** /api/Section/VideoDTO |
*SectionApi* | [**sectionGetWebDTO**](doc\/SectionApi.md#sectiongetwebdto) | **GET** /api/Section/WebDTO |
@ -112,7 +110,6 @@ Class | Method | HTTP request | Description
## Documentation For Models
- [ArticleDTO](doc\/ArticleDTO.md)
- [ConfigurationDTO](doc\/ConfigurationDTO.md)
- [DeviceDTO](doc\/DeviceDTO.md)
- [DeviceDetailDTO](doc\/DeviceDetailDTO.md)
@ -122,17 +119,13 @@ Class | Method | HTTP request | Description
- [GeoPointDTO](doc\/GeoPointDTO.md)
- [ImageDTO](doc\/ImageDTO.md)
- [ImageGeoPoint](doc\/ImageGeoPoint.md)
- [LevelDTO](doc\/LevelDTO.md)
- [LoginDTO](doc\/LoginDTO.md)
- [MapDTO](doc\/MapDTO.md)
- [MapTypeApp](doc\/MapTypeApp.md)
- [MenuDTO](doc\/MenuDTO.md)
- [PlayerMessageDTO](doc\/PlayerMessageDTO.md)
- [QuestionDTO](doc\/QuestionDTO.md)
- [QuizzDTO](doc\/QuizzDTO.md)
- [ResourceDTO](doc\/ResourceDTO.md)
- [ResourceType](doc\/ResourceType.md)
- [ResponseDTO](doc\/ResponseDTO.md)
- [SectionDTO](doc\/SectionDTO.md)
- [SectionType](doc\/SectionType.md)
- [SliderDTO](doc\/SliderDTO.md)

View File

@ -1,22 +0,0 @@
# 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)

View File

@ -5,7 +5,7 @@
import 'package:managerapi/api.dart';
```
All URIs are relative to *http://localhost:5000*
All URIs are relative to *http://192.168.31.96*
Method | HTTP request | Description
------------- | ------------- | -------------

View File

@ -5,7 +5,7 @@
import 'package:managerapi/api.dart';
```
All URIs are relative to *http://localhost:5000*
All URIs are relative to *http://192.168.31.96*
Method | HTTP request | Description
------------- | ------------- | -------------

View File

@ -14,8 +14,6 @@ Name | Type | Description | Notes
**secondaryColor** | **String** | | [optional]
**languages** | **List<String>** | | [optional] [default to const []]
**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)

View File

@ -5,7 +5,7 @@
import 'package:managerapi/api.dart';
```
All URIs are relative to *http://localhost:5000*
All URIs are relative to *http://192.168.31.96*
Method | HTTP request | Description
------------- | ------------- | -------------

View File

@ -14,8 +14,6 @@ Name | Type | Description | Notes
**secondaryColor** | **String** | | [optional]
**languages** | **List<String>** | | [optional] [default to const []]
**dateCreation** | [**DateTime**](DateTime.md) | | [optional]
**isMobile** | **bool** | | [optional]
**isOffline** | **bool** | | [optional]
**sections** | [**List<SectionDTO>**](SectionDTO.md) | | [optional] [default to const []]
**resources** | [**List<ResourceDTO>**](ResourceDTO.md) | | [optional] [default to const []]

View File

@ -1,17 +0,0 @@
# 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)

View File

@ -1,19 +0,0 @@
# 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)

View File

@ -1,19 +0,0 @@
# 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)

View File

@ -5,7 +5,7 @@
import 'package:managerapi/api.dart';
```
All URIs are relative to *http://localhost:5000*
All URIs are relative to *http://192.168.31.96*
Method | HTTP request | Description
------------- | ------------- | -------------

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